Changeset 44
- Timestamp:
- 04/13/10 15:26:07 (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/adm/extract_rst.sh
r43 r44 171 171 system=$(uname) 172 172 case "${system}" in 173 AIX|IRIX64)174 echo " www : no specific posix checking"175 ;;176 *)177 set -o posix178 ;;173 AIX|IRIX64) 174 echo " www : no specific posix checking" 175 ;; 176 *) 177 set -o posix 178 ;; 179 179 esac 180 180 # … … 189 189 if [ ${#} -lt ${minargcount} ] 190 190 then 191 echo "eee : not enought arguments"192 echo "${usage}"193 exit 1191 echo "eee : not enought arguments" 192 echo "${usage}" 193 exit 1 194 194 fi 195 195 # … … 199 199 while [ ! -z "${1}" ] 200 200 do 201 case ${1} in202 -i)203 filein=${2}204 shift205 ;;206 -o)207 fileout=${2}208 shift209 ;;210 -l)211 language=${2}212 shift213 ;;214 -h)215 echo "${usage}"216 exit 1217 ;;218 *)219 echo "eee : unknown option ${1}"220 echo "${usage}"221 exit 1222 ;;223 esac224 shift # next flag225 201 case ${1} in 202 -i) 203 filein=${2} 204 shift 205 ;; 206 -o) 207 fileout=${2} 208 shift 209 ;; 210 -l) 211 language=${2} 212 shift 213 ;; 214 -h) 215 echo "${usage}" 216 exit 1 217 ;; 218 *) 219 echo "eee : unknown option ${1}" 220 echo "${usage}" 221 exit 1 222 ;; 223 esac 224 shift # next flag 225 done 226 226 # 227 227 set -u … … 230 230 # 231 231 case "${language}" in 232 fortran)233 awkblockstart="^C\+$"234 awkblockend="^C-$"235 sedblockstart="^C+$"236 sedblockend="^C-$"237 comment="^C"238 ;;239 F90)240 awkblockstart="^!\+$"241 awkblockend="^!-$"242 sedblockstart="^!+$"243 sedblockend="^!-$"244 comment="^!"245 ;;246 IDL)247 awkblockstart="^;\+$"248 awkblockend="^;-$"249 sedblockstart="^;+$"250 sedblockend="^;-$"251 comment="^;"252 ;;253 xml)254 awkblockstart="^<!--rst$"255 awkblockend="-->$"256 sedblockstart="^<!--rst$"257 sedblockend="-->$"258 comment=""259 ;;260 sh)261 # iii : awk '/^\#\+/,/^\#\-/' $file262 awkblockstart="^\#\+$"263 awkblockend="^\#\-$"264 sedblockstart="^#+"265 sedblockend="^#-"266 comment="^#"267 ;;268 dot|php)269 awkblockstart="^\/\*rst$"270 awkblockend="*\/"271 sedblockstart="^\/\*rst$"272 sedblockend="^\*\/"273 comment=""274 ;;275 matlab)276 awkblockstart="^%\+$"277 awkblockend="^%-$"278 sedblockstart="^%+$"279 sedblockend="^%-$"280 comment="^%"281 ;;282 *)283 echo "eee : ${language} not implemented"284 exit 1285 ;;232 fortran) 233 awkblockstart="^C\+$" 234 awkblockend="^C-$" 235 sedblockstart="^C+$" 236 sedblockend="^C-$" 237 comment="^C" 238 ;; 239 F90) 240 awkblockstart="^!\+$" 241 awkblockend="^!-$" 242 sedblockstart="^!+$" 243 sedblockend="^!-$" 244 comment="^!" 245 ;; 246 IDL) 247 awkblockstart="^;\+$" 248 awkblockend="^;-$" 249 sedblockstart="^;+$" 250 sedblockend="^;-$" 251 comment="^;" 252 ;; 253 xml) 254 awkblockstart="^<!--rst$" 255 awkblockend="-->$" 256 sedblockstart="^<!--rst$" 257 sedblockend="-->$" 258 comment="" 259 ;; 260 sh) 261 # iii : awk '/^\#\+/,/^\#\-/' $file 262 awkblockstart="^\#\+$" 263 awkblockend="^\#\-$" 264 sedblockstart="^#+" 265 sedblockend="^#-" 266 comment="^#" 267 ;; 268 dot|php) 269 awkblockstart="^\/\*rst$" 270 awkblockend="*\/" 271 sedblockstart="^\/\*rst$" 272 sedblockend="^\*\/" 273 comment="" 274 ;; 275 matlab) 276 awkblockstart="^%\+$" 277 awkblockend="^%-$" 278 sedblockstart="^%+$" 279 sedblockend="^%-$" 280 comment="^%" 281 ;; 282 *) 283 echo "eee : ${language} not implemented" 284 exit 1 285 ;; 286 286 esac 287 287 # … … 295 295 if [ ! -s /tmp/${$}_1 ] 296 296 then 297 rm /tmp/${$}_0 /tmp/${$}_1298 echo "iii : no rst comments in ${filein}"299 exit 1297 rm /tmp/${$}_0 /tmp/${$}_1 298 echo "iii : no rst comments in ${filein}" 299 exit 1 300 300 fi 301 301 # … … 307 307 if [ "${comment}" != "" ] 308 308 then 309 sedcmd="sed -e \"s/${comment}//\" /tmp/${$}_2 > /tmp/${$}_3"310 eval ${sedcmd}311 # suppress first blank312 cp /tmp/${$}_3 /tmp/${$}_2313 sed -e "s/^ //" /tmp/${$}_2 > /tmp/${$}_3314 cp /tmp/${$}_3 ${fileout}309 sedcmd="sed -e \"s/${comment}//\" /tmp/${$}_2 > /tmp/${$}_3" 310 eval ${sedcmd} 311 # suppress first blank 312 cp /tmp/${$}_3 /tmp/${$}_2 313 sed -e "s/^ //" /tmp/${$}_2 > /tmp/${$}_3 314 cp /tmp/${$}_3 ${fileout} 315 315 else 316 cp /tmp/${$}_2 ${fileout}316 cp /tmp/${$}_2 ${fileout} 317 317 fi 318 318 # -
trunk/detectbarotropicmode.sh
r42 r44 61 61 while [ ! -z "${1}" ] # ++ pb bash 62 62 do 63 case ${1} in64 -l)65 list=${2}66 shift67 ;;68 -r)69 orcares=${2}70 shift71 ;;72 -exp)73 drakkar_exp=${2}74 shift75 ;;76 -g)77 grid=${2}78 shift79 ;;80 -latmin)81 latmin=${2}82 shift83 ;;84 -latmax)85 latmax=${2}86 shift87 ;;88 -longmin)89 longmin=${2}90 shift91 ;;92 -longmax)93 longmax=${2}94 shift95 ;;96 *) # other choice97 echo "eee : unknown option ${1}"98 echo "${usage}"99 ;;100 esac101 shift # next flag63 case ${1} in 64 -l) 65 list=${2} 66 shift 67 ;; 68 -r) 69 orcares=${2} 70 shift 71 ;; 72 -exp) 73 drakkar_exp=${2} 74 shift 75 ;; 76 -g) 77 grid=${2} 78 shift 79 ;; 80 -latmin) 81 latmin=${2} 82 shift 83 ;; 84 -latmax) 85 latmax=${2} 86 shift 87 ;; 88 -longmin) 89 longmin=${2} 90 shift 91 ;; 92 -longmax) 93 longmax=${2} 94 shift 95 ;; 96 *) # other choice 97 echo "eee : unknown option ${1}" 98 echo "${usage}" 99 ;; 100 esac 101 shift # next flag 102 102 done 103 103 # … … 107 107 if [ ! -d ${GEOMAG_LOG} ] 108 108 then 109 echo " eee : \${GEOMAG_LOG} not found"110 exit 1109 echo " eee : \${GEOMAG_LOG} not found" 110 exit 1 111 111 fi 112 112 # ++ blindage en tout genre 113 113 # 114 114 case ${grid} in 115 gridT)116 echo "iii : grid=${orcares}"117 ;;118 *)119 echo "eee : pb \${grid} = ${grid}"120 exit 1121 ;;115 gridT) 116 echo "iii : grid=${orcares}" 117 ;; 118 *) 119 echo "eee : pb \${grid} = ${grid}" 120 exit 1 121 ;; 122 122 esac 123 123 # 124 124 case ${orcares} in 125 ORCA025)126 echo "iii : orcares=${orcares}"127 ;;128 *)129 echo "eee : pb \${orcares} = ${orcares}"130 exit 1131 ;;125 ORCA025) 126 echo "iii : orcares=${orcares}" 127 ;; 128 *) 129 echo "eee : pb \${orcares} = ${orcares}" 130 exit 1 131 ;; 132 132 esac 133 133 # 134 134 case ${drakkar_exp} in 135 G42)136 echo "iii : drakkar_exp=${drakkar_exp}"137 ;;138 *)139 echo "eee : pb \${drakkar_exp} = ${drakkar_exp}"140 exit 1141 ;;135 G42) 136 echo "iii : drakkar_exp=${drakkar_exp}" 137 ;; 138 *) 139 echo "eee : pb \${drakkar_exp} = ${drakkar_exp}" 140 exit 1 141 ;; 142 142 esac 143 143 # 144 144 # ++ conversion of latitude and longitude in x and y indexes 145 145 case ${orcares} in 146 ORCA025)147 xmin=529148 xmax=689149 ymin=266150 ymax=372151 echo "iii : forcage xmin xmax ymin ymax : ${xmin} ${xmax} ${ymin} ${ymax}"152 ;;153 *)154 echo "eee : pb conversion lat,long to x,y"155 exit 1156 ;;146 ORCA025) 147 xmin=529 148 xmax=689 149 ymin=266 150 ymax=372 151 echo "iii : forcage xmin xmax ymin ymax : ${xmin} ${xmax} ${ymin} ${ymax}" 152 ;; 153 *) 154 echo "eee : pb conversion lat,long to x,y" 155 exit 1 156 ;; 157 157 esac 158 158 # … … 161 161 for file in `cat ${list}` 162 162 do 163 echo "iii : extraction from ${file}" # ++ voir seulement si debug demandé164 filessh=${GEOMAG_OD}/`basename ${file} .nc`_ssh.nc165 rm -f ${filessh} 2> /dev/null166 ncks --dimension x,${xmin},${xmax} --dimension y,${ymin},${ymax} -v sossheig,nav_lon,nav_lat \167 ${file} ${filessh}168 status_ncks=${?}169 if [ ${status_ncks} -ne 0 ]170 then171 echo "eee : pb with ncks ${file}"172 exit 1173 else174 list_ssh="${list_ssh} ${filessh}"175 fi163 echo "iii : extraction from ${file}" # ++ voir seulement si debug demandé 164 filessh=${GEOMAG_OD}/`basename ${file} .nc`_ssh.nc 165 rm -f ${filessh} 2> /dev/null 166 ncks --dimension x,${xmin},${xmax} --dimension y,${ymin},${ymax} -v sossheig,nav_lon,nav_lat \ 167 ${file} ${filessh} 168 status_ncks=${?} 169 if [ ${status_ncks} -ne 0 ] 170 then 171 echo "eee : pb with ncks ${file}" 172 exit 1 173 else 174 list_ssh="${list_ssh} ${filessh}" 175 fi 176 176 done 177 177 line=`head -n 1 ${list}` -
trunk/geomag_profile.sh
r42 r44 96 96 while [ ! -z "${1}" ] # ++ pb bash 97 97 do 98 case ${1} in 99 -d) # directory for application choosen by user (see svn checkout command used) 100 directory=${2} 101 shift 102 ;; 103 -i) # directory for inputs choosen by user 104 indir=${2} 105 shift 106 ;; 107 -o) # directory for outputs choosen by user 108 outdir=${2} 109 shift 110 ;; 111 -t) # directory for temporary outputs choosen by user 112 tempdir=${2} 113 shift 114 ;; 115 116 *) # other choice 117 echo "eee : unknown option ${1}" 118 echo "${usage}" 119 # nb : no exit because this file should be launched by login process 120 ;; 121 esac 122 shift # next flag 98 case ${1} in 99 -d) # directory for application choosen by user (see svn checkout command used) 100 directory=${2} 101 shift 102 ;; 103 -i) # directory for inputs choosen by user 104 indir=${2} 105 shift 106 ;; 107 -o) # directory for outputs choosen by user 108 outdir=${2} 109 shift 110 ;; 111 -t) # directory for temporary outputs choosen by user 112 tempdir=${2} 113 shift 114 ;; 115 *) # other choice 116 echo "eee : unknown option ${1}" 117 echo "${usage}" 118 # nb : no exit because this file should be launched by login process 119 ;; 120 esac 121 shift # next flag 123 122 done 124 123 unset usage … … 129 128 if [ ! -d ${directory} ] 130 129 then 131 echo " eee : ${directory} not found"132 # nb : no exit because this file should be launched by login process130 echo " eee : ${directory} not found" 131 # nb : no exit because this file should be launched by login process 133 132 fi 134 133 # … … 136 135 if [ ! -x ${directory} ] 137 136 then 138 echo " eee : ${directory} not reachable"139 # nb : no exit because this file should be launched by login process137 echo " eee : ${directory} not reachable" 138 # nb : no exit because this file should be launched by login process 140 139 fi 141 140 # … … 143 142 system=$(uname) 144 143 case "${system}" in 145 IRIX64)146 echo " www : no specific posix checking"147 ;;148 *)149 set -o posix150 ;;144 IRIX64) 145 echo " www : no specific posix checking" 146 ;; 147 *) 148 set -o posix 149 ;; 151 150 esac 152 151 unset system … … 189 188 if [ ! -d ${GEOMAG_LOG} ] 190 189 then 191 mkdir -p ${GEOMAG_LOG}192 echo "${command} : iii : creation of \${GEOMAG_LOG}"190 mkdir -p ${GEOMAG_LOG} 191 echo "${command} : iii : creation of \${GEOMAG_LOG}" 193 192 fi 194 193 # check for permission on GEOMAG_LOG 195 194 if [ ! -x ${GEOMAG_LOG} ] 196 195 then 197 echo " eee : ${GEOMAG_LOG} not reachable"198 # nb : no exit because this file should be launched by login process196 echo " eee : ${GEOMAG_LOG} not reachable" 197 # nb : no exit because this file should be launched by login process 199 198 fi 200 199 # … … 202 201 if [ ! -w ${GEOMAG_LOG} ] 203 202 then 204 echo " eee : ${GEOMAG_LOG} not writable"205 # nb : no exit because this file shouldreachable be launched by login process203 echo " eee : ${GEOMAG_LOG} not writable" 204 # nb : no exit because this file shouldreachable be launched by login process 206 205 fi 207 206 # … … 215 214 if [ ! -d ${GEOMAG_ID} ] 216 215 then 217 mkdir -p ${GEOMAG_ID}218 echo "${command} : iii : creation of \${GEOMAG_ID}"216 mkdir -p ${GEOMAG_ID} 217 echo "${command} : iii : creation of \${GEOMAG_ID}" 219 218 fi 220 219 # check for permission on GEOMAG_ID 221 220 if [ ! -x ${GEOMAG_ID} ] 222 221 then 223 echo " eee : ${GEOMAG_ID} not reachable"224 # nb : no exit because this file should be launched by login process222 echo " eee : ${GEOMAG_ID} not reachable" 223 # nb : no exit because this file should be launched by login process 225 224 fi 226 225 # … … 230 229 if [ ! -d ${GEOMAG_OD} ] 231 230 then 232 mkdir -p ${GEOMAG_OD}233 echo "${command} : iii : creation of \${GEOMAG_OD}"231 mkdir -p ${GEOMAG_OD} 232 echo "${command} : iii : creation of \${GEOMAG_OD}" 234 233 fi 235 234 # check for permission on GEOMAG_OD 236 235 if [ ! -x ${GEOMAG_OD} ] 237 236 then 238 echo " eee : ${GEOMAG_OD} not reachable"239 # nb : no exit because this file should be launched by login process237 echo " eee : ${GEOMAG_OD} not reachable" 238 # nb : no exit because this file should be launched by login process 240 239 fi 241 240 if [ ! -w ${GEOMAG_OD} ] 242 241 then 243 echo " eee : ${GEOMAG_OD} not writable"244 # nb : no exit because this file should be launched by login process242 echo " eee : ${GEOMAG_OD} not writable" 243 # nb : no exit because this file should be launched by login process 245 244 fi 246 245 # -
trunk/getmodelout.sh
r42 r44 49 49 while [ ! -z "${1}" ] # ++ pb bash 50 50 do 51 case ${1} in52 -r)53 orcares=${2}54 shift55 ;;56 -exp)57 drakkar_exp=${2}58 shift59 ;;60 -g)61 grid=${2}62 shift63 ;;64 -yearmin)65 yearmin=${2}66 shift67 ;;68 -yearmax)69 yearmax=${2}70 shift71 ;;72 -o)73 list=${2}74 shift75 ;;76 *) # other choice77 echo "eee : unknown option ${1}"78 echo "${usage}"79 ;;80 esac81 shift # next flag51 case ${1} in 52 -r) 53 orcares=${2} 54 shift 55 ;; 56 -exp) 57 drakkar_exp=${2} 58 shift 59 ;; 60 -g) 61 grid=${2} 62 shift 63 ;; 64 -yearmin) 65 yearmin=${2} 66 shift 67 ;; 68 -yearmax) 69 yearmax=${2} 70 shift 71 ;; 72 -o) 73 list=${2} 74 shift 75 ;; 76 *) # other choice 77 echo "eee : unknown option ${1}" 78 echo "${usage}" 79 ;; 80 esac 81 shift # next flag 82 82 done 83 83 unset usage … … 88 88 if [ ! -d ${GEOMAG_LOG} ] 89 89 then 90 echo " eee : \${GEOMAG_LOG} not found"91 exit 190 echo " eee : \${GEOMAG_LOG} not found" 91 exit 1 92 92 fi 93 93 # 94 94 if [ -f ${list} ] 95 95 then 96 echo "eee : ${list} exist"97 exit 196 echo "eee : ${list} exist" 97 exit 1 98 98 fi 99 99 # ++ blindage en tout genre 100 100 # 101 101 case ${orcares} in 102 ORCA025)103 dirref=/u/rech/cli/rcli002/ # sur l'idris104 ;;105 *)106 echo "eee : pb \${orcares} = ${orcares}"107 ;;102 ORCA025) 103 dirref=/u/rech/cli/rcli002/ # sur l'idris 104 ;; 105 *) 106 echo "eee : pb \${orcares} = ${orcares}" 107 ;; 108 108 esac 109 109 # … … 113 113 while [ ${iyear} -le ${yearmax} ] 114 114 do 115 cyear=`printf "%4.4d" ${iyear}`116 ls ${dirref}/${orcares}/${orcares}-${drakkar_exp}-S/${cyear}/${orcares}-${drakkar_exp}_y${cyear}m??d??_${grid}.nc >> ${listfull}117 unset cyear118 # ++ calcul taille cf myls dans faq es dods119 # iyear=$(( ${iyear} + 1 )) ++ pas ok sur rhodes120 # iyear=$(expr ${iyear} + 1 ) ++ pas ok sur rhodes121 iyear=`expr ${iyear} + 1 `115 cyear=`printf "%4.4d" ${iyear}` 116 ls ${dirref}/${orcares}/${orcares}-${drakkar_exp}-S/${cyear}/${orcares}-${drakkar_exp}_y${cyear}m??d??_${grid}.nc >> ${listfull} 117 unset cyear 118 # ++ calcul taille cf myls dans faq es dods 119 # iyear=$(( ${iyear} + 1 )) ++ pas ok sur rhodes 120 # iyear=$(expr ${iyear} + 1 ) ++ pas ok sur rhodes 121 iyear=`expr ${iyear} + 1 ` 122 122 done 123 123 unset iyear … … 138 138 for file in `cat ${listfull}` 139 139 do 140 ln -sf ${file} ${GEOMAG_ID}141 echo ${GEOMAG_ID}/`basename ${file}` >> ${list}140 ln -sf ${file} ${GEOMAG_ID} 141 echo ${GEOMAG_ID}/`basename ${file}` >> ${list} 142 142 done 143 143 unset listfull -
trunk/step2_diff.sh
r42 r44 42 42 system=$(uname) 43 43 case "${system}" in 44 AIX|IRIX64)45 echo " www : no specific posix checking"46 ;;47 *)48 set -o posix49 ;;44 AIX|IRIX64) 45 echo " www : no specific posix checking" 46 ;; 47 *) 48 set -o posix 49 ;; 50 50 esac 51 51 unset system … … 57 57 while [ ! -z "${1}" ] # ++ pb bash 58 58 do 59 case ${1} in60 -y) # year61 year=${2}62 shift63 ;;64 *) # other choice65 echo "eee : unknown option ${1}"66 echo "${usage}"67 exit 168 ;;69 esac70 shift # next flag59 case ${1} in 60 -y) # year 61 year=${2} 62 shift 63 ;; 64 *) # other choice 65 echo "eee : unknown option ${1}" 66 echo "${usage}" 67 exit 1 68 ;; 69 esac 70 shift # next flag 71 71 done 72 72 unset usage
Note: See TracChangeset
for help on using the changeset viewer.