Changeset 48 for trunk/detectbarotropicmode.sh
- Timestamp:
- 03/16/14 20:38:39 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/detectbarotropicmode.sh
r47 r48 16 16 # ======== 17 17 # 18 # .. code-bl cok:: bash18 # .. code-block:: bash 19 19 # 20 20 # detectbarotropicmode.sh -l list -r resolution -exp experience -g grid \ … … 31 31 # in the box [-50,30] [295,335]: 32 32 # 33 # .. code-block 33 # .. code-block:: bash 34 34 # 35 35 # detectbarotropicmode.sh -l ${GEOMAG_OD}/list_G42 -r ORCA025 -exp G42 -g gridT \ … … 60 60 command=detectbarotropicmode.sh 61 61 # 62 usage=" 63 # 64 set +u65 while [ ! -z "${1}"]62 usage="Usage : ${command} -l list -r orcares -exp drakkar_exp -g grid -latmin latmin -latmax latmax -longmin longmin -longmax longmax" 63 # 64 set -u 65 while [ ${#} -gt 0 ] 66 66 do 67 case ${1} in68 -l)69 list=${2}70 shift71 ;;72 -r)73 orcares=${2}74 shift75 ;;76 -exp)77 drakkar_exp=${2}78 shift79 ;;80 -g)81 grid=${2}82 shift83 ;;84 -latmin)85 latmin=${2}86 shift87 ;;88 -latmax)89 latmax=${2}90 shift91 ;;92 -longmin)93 longmin=${2}94 shift95 ;;96 -longmax)97 longmax=${2}98 shift99 ;;100 *)101 # other choice102 echo "eee : unknown option ${1}"103 echo "${usage}"104 ;;105 esac106 # next flag107 shift67 case ${1} in 68 -l) 69 list=${2} 70 shift 71 ;; 72 -r) 73 orcares=${2} 74 shift 75 ;; 76 -exp) 77 drakkar_exp=${2} 78 shift 79 ;; 80 -g) 81 grid=${2} 82 shift 83 ;; 84 -latmin) 85 latmin=${2} 86 shift 87 ;; 88 -latmax) 89 latmax=${2} 90 shift 91 ;; 92 -longmin) 93 longmin=${2} 94 shift 95 ;; 96 -longmax) 97 longmax=${2} 98 shift 99 ;; 100 *) 101 # other choice 102 echo "eee : unknown option ${1}" 103 echo "${usage}" 104 ;; 105 esac 106 # next flag 107 shift 108 108 done 109 #110 set -u111 109 # 112 110 # check GEOMAG environement 113 111 if [ ! -d ${GEOMAG_LOG} ] 114 112 then 115 echo " eee : \${GEOMAG_LOG} not found"116 exit 1113 echo " eee : \${GEOMAG_LOG} not found" 114 exit 1 117 115 fi 118 116 # ++ blindage en tout genre 119 117 # 120 118 case ${grid} in 121 gridT)122 echo "iii : grid=${orcares}"123 ;;124 *)125 echo "eee : pb \${grid} = ${grid}"126 exit 1127 ;;119 gridT) 120 echo "iii : grid=${orcares}" 121 ;; 122 *) 123 echo "eee : pb \${grid} = ${grid}" 124 exit 1 125 ;; 128 126 esac 129 127 # 130 128 case ${orcares} in 131 ORCA025)132 echo "iii : orcares=${orcares}"133 ;;134 *)135 echo "eee : pb \${orcares} = ${orcares}"136 exit 1137 ;;129 ORCA025) 130 echo "iii : orcares=${orcares}" 131 ;; 132 *) 133 echo "eee : pb \${orcares} = ${orcares}" 134 exit 1 135 ;; 138 136 esac 139 137 # 140 138 case ${drakkar_exp} in 141 G42)142 echo "iii : drakkar_exp=${drakkar_exp}"143 ;;144 *)145 echo "eee : pb \${drakkar_exp} = ${drakkar_exp}"146 exit 1147 ;;139 G42) 140 echo "iii : drakkar_exp=${drakkar_exp}" 141 ;; 142 *) 143 echo "eee : pb \${drakkar_exp} = ${drakkar_exp}" 144 exit 1 145 ;; 148 146 esac 149 147 # 150 148 # ++ conversion of latitude and longitude in x and y indexes 151 149 case ${orcares} in 152 ORCA025)153 xmin=529154 xmax=689155 ymin=266156 ymax=372157 echo "iii : forcage xmin xmax ymin ymax : ${xmin} ${xmax} ${ymin} ${ymax}"158 ;;159 *)160 echo "eee : pb conversion lat,long to x,y"161 exit 1162 ;;150 ORCA025) 151 xmin=529 152 xmax=689 153 ymin=266 154 ymax=372 155 echo "iii : forcage xmin xmax ymin ymax : ${xmin} ${xmax} ${ymin} ${ymax}" 156 ;; 157 *) 158 echo "eee : pb conversion lat,long to x,y" 159 exit 1 160 ;; 163 161 esac 164 162 # … … 167 165 for file in `cat ${list}` 168 166 do 169 echo "iii : extraction from ${file}" # ++ voir seulement si debug demandé170 filessh=${GEOMAG_OD}/`basename ${file} .nc`_ssh.nc171 rm -f ${filessh} 2> /dev/null172 ncks --dimension x,${xmin},${xmax} --dimension y,${ymin},${ymax} -v sossheig,nav_lon,nav_lat \173 174 status_ncks=${?}175 if [ ${status_ncks} -ne 0 ]176 then177 echo "eee : pb with ncks ${file}"178 exit 1179 else180 list_ssh="${list_ssh} ${filessh}"181 fi167 echo "iii : extraction from ${file}" # ++ voir seulement si debug demandé 168 filessh=${GEOMAG_OD}/`basename ${file} .nc`_ssh.nc 169 rm -f ${filessh} 2> /dev/null 170 ncks --dimension x,${xmin},${xmax} --dimension y,${ymin},${ymax} -v sossheig,nav_lon,nav_lat \ 171 ${file} ${filessh} 172 status_ncks=${?} 173 if [ ${status_ncks} -ne 0 ] 174 then 175 echo "eee : pb with ncks ${file}" 176 exit 1 177 else 178 list_ssh="${list_ssh} ${filessh}" 179 fi 182 180 done 183 181 line=`head -n 1 ${list}` … … 195 193 if [ ${status_ncrcat} -ne 0 ] 196 194 then 197 echo "eee : pb with ncrcat"198 exit 1195 echo "eee : pb with ncrcat" 196 exit 1 199 197 else 200 echo "iii : result in ${filetot}"198 echo "iii : result in ${filetot}" 201 199 fi 202 200 #
Note: See TracChangeset
for help on using the changeset viewer.