#! /bin/sh # #+ # # NAME # ==== # # getmodelout.sh - get model data output file in ${GEOMAG_ID} # # # SYNOPSIS # ======== # # :: # # $ getmodelout.sh -r orcares -exp drakkar_exp -g grid -yearmin yyyy -yearmax yyyy -o list # # DESCRIPTION # =========== # # get model data output file in ${GEOMAG_ID} # # EXAMPLES # ======== # # # To get DRAKKAR G42 experiment output on grid T points beteween year 9 and 10: # :: # # $ getmodelout.sh -r ORCA025 -exp G42 -g gridT -yearmin 9 -yearmax 10 -o ${GEOMAG_OD}/list_G42 # # EVOLUTIONS # ========== # # $Id$ # - reee522 2007-11-26T11:21:37Z rhodes (IRIX64) # # * creation #- # command=getmodelout.sh # usage=" Usage : ${command} -r orcares -exp drakkar_exp -g grid -o list" # while [ ! -z "${1}" ] # ++ pb bash do case ${1} in -r) orcares=${2} shift ;; -exp) drakkar_exp=${2} shift ;; -g) grid=${2} shift ;; -yearmin) yearmin=${2} shift ;; -yearmax) yearmax=${2} shift ;; -o) list=${2} shift ;; *) # other choice echo "${usage}" ;; esac shift # next flag done # set -u # # check GEOMAG environement if [ ! -d ${GEOMAG_LOG} ] then echo " eee : \${GEOMAG_LOG} not found" exit 1 fi # if [ -f ${list} ] then echo "eee : ${list} exist" exit 1 fi # ++ blindage en tout genre # case ${orcares} in ORCA025) dirref=/u/rech/cli/rcli002/ # sur l'idris ;; *) echo "eee : pb \${orcares} = ${orcares}" ;; esac # listfull=${GEOMAG_LOG}/lisfull${$} # iyear=${yearmin} while [ ${iyear} -le ${yearmax} ] do cyear=`printf "%4.4d" ${iyear}` ls ${dirref}/${orcares}/${orcares}-${drakkar_exp}-S/${cyear}/${orcares}-${drakkar_exp}_y${cyear}m??d??_${grid}.nc >> ${listfull} # ++ calcul taille cf myls dans faq es dods # iyear=$(( ${iyear} + 1 )) ++ pas ok sur rhodes # iyear=$(expr ${iyear} + 1 ) ++ pas ok sur rhodes iyear=`expr ${iyear} + 1 ` done # # print total size of model files # ++ pb syntaxe unitsop="1024**2" # Mo #ls -l `cat ${listfull}` | \ #awk 'NF>4 {print $5, $9}' | \ #awk 'sum=$1/'$unitsop'+sum {printf("%08.3f '$units' -- %s\n",$1/'$unitsop', $2)} # # put files in ${GEOMAG_ID} # ++ ln cp ou scp # ++ -f ou test si deja existant for file in `cat ${listfull}` do ln -sf ${file} ${GEOMAG_ID} echo ${GEOMAG_ID}/`basename ${file}` >> ${list} done # # end exit 0