Changeset 35
- Timestamp:
- 11/26/07 16:20:37 (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/detectbarotropicmode.sh
r34 r35 1 #!/bin/sh -x1 #!/bin/sh 2 2 # 3 3 # module : 4 # build file for detection of barotrope mode 5 # 6 # usage : 7 # $ detectbarotropemode.sh -l list 4 # build file for detection of barotropic mode 8 5 # 9 6 # example : 10 # $ detectbarotropemode.sh -l ${GEOMAG_OD}/list_G42 7 # $ detectbarotropicmode.sh -l ${GEOMAG_OD}/list_G42 -r ORCA025 -exp G42 -g gridT \ 8 # -latmin -50 -latmax -30 -longmin 295 -longmax 335 11 9 # 12 10 # update : … … 20 18 # fplod 2007-11-23T17:02:56Z aedon.locean-ipsl.upmc.fr (Darwin) 21 19 # creation 22 #23 command=detectbarotopemode.sh24 20 # 25 # ++ simulation parametres 26 yearmin=8 27 yearmax=10 28 latmin=-50 29 latmax=-30 30 longmin=295 31 longmax=335 32 grid=gridT 33 orcares=ORCA025 34 DRAKKAR_EXP=G42 21 command=detectbarotropicmode.sh 35 22 # 36 usage=" Usage : ${command} - f list"23 usage=" Usage : ${command} -l list -r orcares -exp drakkar_exp -g grid -latmin latmin -latmax latmax -longmin longmin -longmax longmax" 37 24 # 38 25 while [ ! -z "${1}" ] # ++ pb bash … … 43 30 shift 44 31 ;; 45 32 -r) 33 orcares=${2} 34 shift 35 ;; 36 -exp) 37 drakkar_exp=${2} 38 shift 39 ;; 40 -g) 41 grid=${2} 42 shift 43 ;; 44 -latmin) 45 latmin=${2} 46 shift 47 ;; 48 -latmax) 49 latmax=${2} 50 shift 51 ;; 52 -longmin) 53 longmin=${2} 54 shift 55 ;; 56 -longmax) 57 longmax=${2} 58 shift 59 ;; 46 60 *) # other choice 47 61 echo "${usage}" … … 61 75 # ++ blindage en tout genre 62 76 # 63 # 77 case ${grid} in 78 gridT) 79 echo "iii : grid=${orcares}" 80 ;; 81 *) 82 echo "eee : pb \${grid} = ${grid}" 83 exit 1 84 ;; 85 esac 86 # 87 case ${orcares} in 88 ORCA025) 89 echo "iii : orcares=${orcares}" 90 ;; 91 *) 92 echo "eee : pb \${orcares} = ${orcares}" 93 exit 1 94 ;; 95 esac 96 # 97 case ${drakkar_exp} in 98 G42) 99 echo "iii : drakkar_exp=${drakkar_exp}" 100 ;; 101 *) 102 echo "eee : pb \${drakkar_exp} = ${drakkar_exp}" 103 exit 1 104 ;; 105 esac 106 # 64 107 # ++ conversion of latitude and longitude in x and y indexes 65 case in${orcares} in108 case ${orcares} in 66 109 ORCA025) 67 xmin=10 68 xmax=30 69 ymin=10 70 ymax=40 71 ; 110 xmin=529 111 xmax=689 112 ymin=266 113 ymax=372 114 echo "iii : forcage xmin xmax ymin ymax : ${xmin} ${xmax} ${ymin} ${ymax}" 115 ;; 72 116 *) 73 117 echo "eee : pb conversion lat,long to x,y" … … 80 124 for file in `cat ${list}` 81 125 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} 126 echo "iii : extraction from ${file}" # ++ voir seulement si debug demandé 127 filessh=${GEOMAG_OD}/`basename ${file} .nc`_ssh.nc 128 rm -f ${filessh} 2> /dev/null 129 ncks --dimension x,${xmin},${xmax} --dimension y,${ymin},${ymax} -v sossheig,nav_lon,nav_lat \ 130 ${file} ${filessh} 88 131 status_ncks=${?} 89 132 if [ ${status_ncks} -ne 0 ] … … 92 135 exit 1 93 136 else 94 list_ssh="${list_ssh} ${file _ssh}"137 list_ssh="${list_ssh} ${filessh}" 95 138 fi 96 139 done 140 line=`head -n 1 ${list}` 141 bfile=`basename ${line}` 142 datemin=`echo ${bfile} | awk -F "_" '{print $2}'` 143 line=`tail -n 1 ${list}` 144 bfile=`basename ${line}` 145 datemax=`echo ${bfile} | awk -F "_" '{print $2}'` 97 146 # 98 datemin=19980101#++ 99 datemax=19991231#++ 100 # concatenation ++ 101 varlist=`cat ${list_ssh}` 102 filetot=ssh_zone_${datemin}_${datemax}_${orcares}_${DRAKKAR_EXP}.nc 103 ncrcat ${varlist} ${filetot} 147 # concatenation 148 filetot=${GEOMAG_OD}/${orcares}-${drakkar_exp}_${datemin}_${datemax}_${grid}_ssh.nc 149 rm -f ${filetot} 2> /dev/null 150 ncrcat ${list_ssh} ${filetot} 104 151 status_ncrcat=${?} 105 152 if [ ${status_ncrcat} -ne 0 ] … … 107 154 echo "eee : pb with ncrcat" 108 155 exit 1 156 else 157 echo "iii : result in ${filetot}" 109 158 fi 110 # 111 # menage 112 rm ${list} 159 # 160 # ++ global attributes 161 # ++ convention 162 # ++ nedtcf output or ascii 163 # clean 113 164 rm ${list_ssh} 114 165 # 115 166 # end 116 exit 1167 exit 0 -
trunk/getmodelout.sh
r33 r35 1 #!/bin/sh -x1 #!/bin/sh 2 2 # 3 3 # module : … … 5 5 # 6 6 # usage : 7 # $ getmodelout.sh - o list ++7 # $ getmodelout.sh -r orcares -exp drakkar_exp -g grid -yearmin yyyy -yearmax yyyy -o list 8 8 # 9 9 # example : 10 # $ getmodelout.sh - o ${GEOMAG_OD}/list_G4210 # $ getmodelout.sh -r ORCA025 -exp G42 -g gridT -yearmin 9 -yearmax 10 -o ${GEOMAG_OD}/list_G42 11 11 # 12 12 # update : … … 18 18 command=getmodelout.sh 19 19 # 20 # ++ simulation parametres 21 yearmin=8 22 yearmax=10 23 grid=gridT 24 orcares=ORCA025 25 DRAKKAR_EXP=G42 26 # 27 usage=" Usage : ${command} -o list" 20 usage=" Usage : ${command} -r orcares -exp drakkar_exp -g grid -o list" 28 21 # 29 22 while [ ! -z "${1}" ] # ++ pb bash 30 23 do 31 24 case ${1} in 25 -r) 26 orcares=${2} 27 shift 28 ;; 29 -exp) 30 drakkar_exp=${2} 31 shift 32 ;; 33 -g) 34 grid=${2} 35 shift 36 ;; 37 -yearmin) 38 yearmin=${2} 39 shift 40 ;; 41 -yearmax) 42 yearmax=${2} 43 shift 44 ;; 32 45 -o) 33 46 list=${2} … … 49 62 exit 1 50 63 fi 64 # 65 if [ -f ${list} ] 66 then 67 echo "eee : ${list} exist" 68 exit 1 69 fi 51 70 # ++ blindage en tout genre 52 71 # 72 case ${orcares} in 73 ORCA025) 74 dirref=/u/rech/cli/rcli002/ # sur l'idris 75 ;; 76 *) 77 echo "eee : pb \${orcares} = ${orcares}" 78 ;; 79 esac 80 # 81 listfull=${GEOMAG_LOG}/lisfull${$} 82 # 53 83 iyear=${yearmin} 54 while [ ${iyear} -l t${yearmax} ]84 while [ ${iyear} -le ${yearmax} ] 55 85 do 56 86 cyear=`printf "%4.4d" ${iyear}` 57 ls /u/rech/cli/rcli002/${orcares}/${orcares}-${DRAKKAR_EXP}-S/${cyear}/${orcares}-${DRAKKAR_EXP}_y${cyear}m??d??_${grid}.nc >> ${list}87 ls ${dirref}/${orcares}/${orcares}-${drakkar_exp}-S/${cyear}/${orcares}-${drakkar_exp}_y${cyear}m??d??_${grid}.nc >> ${listfull} 58 88 # ++ calcul taille cf myls dans faq es dods 59 60 89 # iyear=$(( ${iyear} + 1 )) ++ pas ok sur rhodes 61 90 # iyear=$(expr ${iyear} + 1 ) ++ pas ok sur rhodes … … 65 94 # print total size of model files 66 95 # ++ pb syntaxe unitsop="1024**2" # Mo 67 #ls -l `cat ${list }` | \96 #ls -l `cat ${listfull}` | \ 68 97 #awk 'NF>4 {print $5, $9}' | \ 69 98 #awk 'sum=$1/'$unitsop'+sum {printf("%08.3f '$units' -- %s\n",$1/'$unitsop', $2)} … … 72 101 # ++ ln cp ou scp 73 102 # ++ -f ou test si deja existant 74 for file in `cat ${list }`103 for file in `cat ${listfull}` 75 104 do 76 105 ln -sf ${file} ${GEOMAG_ID} 106 echo ${GEOMAG_ID}/`basename ${file}` >> ${list} 77 107 done 78 108 #
Note: See TracChangeset
for help on using the changeset viewer.