Changeset 33 for trunk/detectbarotopemode.sh
- Timestamp:
- 11/26/07 12:39:53 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/detectbarotopemode.sh
r32 r33 2 2 # 3 3 # module : 4 # build file for detection of bar atrope mode4 # build file for detection of barotrope mode 5 5 # 6 6 # usage : 7 # $ ./detectbaratropemode.sh ++ 7 # $ detectbarotropemode.sh -l list 8 # 9 # example : 10 # $ detectbarotropemode.sh -l ${GEOMAG_OD}/list_G42 8 11 # 9 12 # update : 10 13 # $Id$ 11 14 # pas fini ++ 15 # reee522 2007-11-26T11:33:42Z rhodes (IRIX64) 16 # externalization of copy of data file in getmodelout.sh 17 # reee522 2007-11-26T10:55:44Z rhodes (IRIX64) 18 # add ncks, ncrcat and some informations inspired by 19 # http://dods.ipsl.jussieu.fr/projets_ES/misc/myls 12 20 # fplod 2007-11-23T17:02:56Z aedon.locean-ipsl.upmc.fr (Darwin) 13 21 # creation 14 22 # 23 command=detectbarotopemode.sh 24 # 15 25 # ++ simulation parametres 16 26 yearmin=8 17 27 yearmax=10 28 latmin=-50 29 latmax=-30 30 longmin=295 31 longmax=335 18 32 grid=gridT 33 orcares=ORCA025 19 34 DRAKKAR_EXP=G42 20 35 # 36 usage=" Usage : ${command} -f list" 37 # 38 while [ ! -z "${1}" ] # ++ pb bash 39 do 40 case ${1} in 41 -l) 42 list=${2} 43 shift 44 ;; 45 46 *) # other choice 47 echo "${usage}" 48 ;; 49 esac 50 shift # next flag 51 done 52 # 53 set -u 54 # 55 # check GEOMAG environement 56 if [ ! -d ${GEOMAG_LOG} ] 57 then 58 echo " eee : \${GEOMAG_LOG} not found" 59 exit 1 60 fi 21 61 # ++ blindage en tout genre 22 62 # 23 63 # 24 #++list=/tmp/${LOGNAME}/listfiles${$} 25 list=./listfiles${$} 64 # ++ conversion of latitude and longitude in x and y indexes 65 case in ${orcares} in 66 ORCA025) 67 xmin=10 68 xmax=30 69 ymin=10 70 ymax=40 71 ; 72 *) 73 echo "eee : pb conversion lat,long to x,y" 74 exit 1 75 ;; 76 esac 26 77 # 27 # pour info liste des fichiers à prendre en compte 28 iyear=${yearmin} 29 while [ ${iyear} -lt ${yearmax} ] 30 do 31 cyear=`printf "%4.4d" ${iyear}` 32 ls /u/rech/cli/rcli002/ORCA025/ORCA025-${DRAKKAR_EXP}-S/${cyear}/ORCA025-${DRAKKAR_EXP}_y${cyear}m??d??_${grid}.nc >> ${list} 33 34 # ++ calcul taille cf myls dans faq es dods 35 # iyear=$(( ${iyear} + 1 )) ++ pas ok sur rhodes 36 # iyear=$(expr ${iyear} + 1 ) ++ pas ok sur rhodes 37 iyear=`expr ${iyear} + 1 ` 78 # extract ssh and create a new set of files 79 list_ssh="" 80 for file in `cat ${list}` 81 do 82 fileb=`basename ${file}` 83 filessh=`basename ${file} .nc`_ssh.nc 84 rm -f ${GEOMAG_OD}/${filessh} 2> /dev/null 85 ncks --dimension x,${xmin},${xmax} --dimension y,${ymin},${ymax} \ 86 -v sossheig \ 87 ${GEOMAG_ID}/${fileb} ${GEOMAG_OD}/${filessh} 88 status_ncks=${?} 89 if [ ${status_ncks} -ne 0 ] 90 then 91 echo "eee : pb with ncks ${file}" 92 exit 1 93 else 94 list_ssh="${list_ssh} ${file_ssh}" 95 fi 38 96 done 39 97 # 40 # put files in ${GEOMAG_ID} 41 # ++ ln cp ou scp 42 # ++ -f ou test si deja existant 43 for file in `cat ${list}` 44 do 45 ln -sf ${file} ${GEOMAG_ID} 46 done 47 # 48 # 49 # extract ssh and create a new set of files 50 for file in `cat ${list}` 51 do 52 filessh=`basename ${file} .nc`_ssh.nc 53 # ++ test si exist deja 54 ncks -v sossheig ${GEOMAG_ID}/${file} ${GEOMAG_OD}/${filessh} #++ lat long et sortie x, y, t 55 #++ test status 56 ls -l ${GEOMAG_ID}/${file} ${GEOMAG_OD}/${filessh} 57 read a 58 done 59 # 98 datemin=19980101#++ 99 datemax=19991231#++ 60 100 # concatenation ++ 61 # ++ ncrcat 62 101 varlist=`cat ${list_ssh}` 102 filetot=ssh_zone_${datemin}_${datemax}_${orcares}_${DRAKKAR_EXP}.nc 103 ncrcat ${varlist} ${filetot} 104 status_ncrcat=${?} 105 if [ ${status_ncrcat} -ne 0 ] 106 then 107 echo "eee : pb with ncrcat" 108 exit 1 109 fi 63 110 # 64 111 # menage 65 112 rm ${list} 113 rm ${list_ssh} 66 114 # 67 115 # end
Note: See TracChangeset
for help on using the changeset viewer.