- Timestamp:
- 04/30/12 13:06:37 (12 years ago)
- Location:
- trunk/src
- Files:
-
- 1 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/cresamsu.pro
r539 r543 17 17 ; 18 18 ; but: faire des fichiers "grilles" pour analyse statistique avec 19 ; 19 20 ; interpolation spatiale et temporelle 21 ; 22 ; 23 ; .. only:: man 24 ; 25 ; Figure is visible on PDF and HTML documents only. 26 ; 27 ; .. only:: html or latex 28 ; 29 ; .. graphviz:: 30 ; 31 ; digraph cresamsu { 32 ; amsu_t2 [shape=ellipse, 33 ; fontname=Courier, 34 ; label="${PROJECT_ID}/yyyy/mm/numch_yyyymmdd_geomin_geomax.dat"]; 35 ; amsu_t5 [shape=ellipse, 36 ; fontname=Courier, 37 ; label="${PROJECT_OD}/AMSU/numch_temprtrtemprhrhdeg_yyyymmdd_yyyymmdd_geomin_geomax.nc"]; 38 ; cresamsu [shape=box, 39 ; fontname=Courier, 40 ; color=blue, 41 ; URL="http://forge.ipsl.jussieu.fr/varamma/browser/trunk/src/cresamsu.pro", 42 ; label="${PROJECT}/src/cresamsua.pro"]; 43 ; 44 ; {amsu_t2} -> {cresamsua} -> {amsu_t5}; 45 ; } 20 46 ; 21 47 ; EXAMPLES … … 24 50 ; :: 25 51 ; 26 ; numch ='a5'27 ; yyyyb =2006L28 ; yyyye =2006L29 ; mmb =830 ; mme =831 ; ddb =132 ; dde =333 ; lonmin =-25.34 ; lonmax =25.35 ; latmin =-5.36 ; latmax =20.37 ; temp ='m'38 ; rtemp =0.539 ; rhdeg =1.52 ; numch = 'a5' 53 ; yyyyb = 2006L 54 ; yyyye = 2006L 55 ; mmb = 8 56 ; mme = 8 57 ; ddb = 1 58 ; dde = 3 59 ; lonmin = -25. 60 ; lonmax = 25. 61 ; latmin = -5. 62 ; latmax = 20. 63 ; temp = 'm' 64 ; rtemp = 0.5 65 ; rhdeg = 1. 40 66 ; cresamsu, numch, yyyyb, mmb, ddb $ 41 ; , yyyye, mme, dde $ 42 ; , lonmin, lonmax, latmin, latmax,temp,rtemp,rhdeg 67 ; , yyyye, mme, dde $ 68 ; , lonmin, lonmax, latmin, latmax $ 69 ; , temp, rtemp, rhdeg 43 70 ; 44 71 ; SEE ALSO 45 72 ; ======== 46 73 ; 47 ; :ref:`traite_amsuab.sh` 48 ; 49 ; :func:`file_amsu_t2_to_mem` 74 ; Previous step :ref:`extract_amsu.pro` (:ref:`traite_amsuab.sh`) 75 ; 76 ; :ref:`cresamsu.sh` 77 ; 78 ; Use :func:`file_amsu_t2_to_mem` 79 ; :func:`idl_amsu_netcdf` 50 80 ; 51 81 ; TODO 52 82 ; ==== 53 ;54 ; add temp,rtemp,rhdeg in example55 83 ; 56 84 ; fix pb with fov_int2 and fov_int3 … … 83 111 ; $URL$ 84 112 ; 113 ; - fplod 20120430 114 ; 115 ; * add digraph 116 ; 85 117 ; - lelod 20120410 86 118 ; … … 133 165 ;- 134 166 135 pro cresamsu, numch, yyyyb, mmb, ddb, yyyye,mme,dde,lonmin,lonmax,latmin,latmax,temp,rtemp,rhdeg 136 137 ; les parametres de l'interpolation 167 pro cresamsu $ 168 , numch $ 169 , yyyyb $ 170 , mmb $ 171 , ddb $ 172 , yyyye $ 173 , mme $ 174 , dde $ 175 , lonmin $ 176 , lonmax $ 177 , latmin $ 178 , latmax $ 179 , temp $ 180 , rtemp $ 181 , rhdeg 138 182 139 183 ; grille de sortie en long / lat 140 184 ; recoit en entree les jours de l'annee jdeb et jfin correspondant au debut et la fin du mois 141 ;=============================================================================================142 185 143 186 compile_opt idl2, strictarrsubs … … 391 434 ENDIF ELSE BEGIN 392 435 print, 'www : no files at all' 436 goto, realend 393 437 ENDELSE 394 438 395 IF key_performance EQ 1 THEN BEGIN 396 PRINT, 'ppp : durée totale cresamsu', SYSTIME(1)-time1, format='(a, 1x, F12.6)' 397 ENDIF 398 399 print,'fin cresamsu' 439 realend: 440 IF key_performance EQ 1 THEN BEGIN 441 PRINT, 'ppp : durée totale cresamsu', SYSTIME(1)-time1, format='(a, 1x, F12.6)' 442 ENDIF 443 444 print,'fin cresamsu' 400 445 401 446 end -
trunk/src/cresamsu.sh
r541 r543 2 2 #+ 3 3 # 4 # .. program:: traite_amsuab.sh5 # 6 # .. _ traite_amsuab.sh:7 # 8 # =========== =====9 # traite_amsuab.sh10 # =========== =====4 # .. program:: cresamsu.sh 5 # 6 # .. _cresamsu.sh: 7 # 8 # =========== 9 # cresamsu.sh 10 # =========== 11 11 # 12 12 # SYNOPSIS … … 15 15 # :: 16 16 # 17 # $ traite_amsuab.sh -b yyyymmdd -e yyyymmdd -lonmin lonmin -lonmax lonmax -latmin latmin -latmax latmax -numch numch17 # $ cresamsu.sh -b yyyymmdd -e yyyymmdd -lonmin lonmin -lonmax lonmax -latmin latmin -latmax latmax -numch numch -temp temp -rtemp rtemp -rhdeg rhdeg 18 18 # 19 19 # DESCRIPTION … … 29 29 # .. option:: -latmax <latmax> 30 30 # .. option:: -numch <channel> 31 # 32 # ``traite_amsuab.sh`` read :file:`${PROJECT_ID}/AMSU/AMSU*/*/*.L1C`` 33 # and :file:`${PROJECT}/SRC/dataref_amsu/COR*.dat` 34 # 35 # Some IDL programs are launched here using ${IDL_CMD} command 31 # .. option:: -temp <temp> 32 # .. option:: -rtemp <rtemp> 33 # .. option:: -rhdeg <rhdeg> 34 # 35 # ``cresamsu.sh`` read 36 # :file:`${PROJECT_ID}/AMSU/{yyyy}/{mm}/{numch}_{yyyymmdd}_{geomin}_{geomax}_nadir.dat` 37 # for each yyyymmdd between datemin and datemax (:option:`-b` and :option:`-e`). 38 # 39 # ``cresamsu.sh`` write 40 # :file:`${PROJECT_ID}/AMSU/{numch}{temp}rt{rtemp}rh{rhdeg}_{yyyymmdd}_{yyyymmdd}_{geomin}_{geomax}_03150e4150n.nc` 41 # 42 # :ref:`cresamsu` is launched here using ${IDL_CMD} command 36 43 # (see :ref:`varamma_profile.sh` to know how to set this environnement variable). 37 44 # … … 39 46 # 40 47 # Log file is written on 41 # :file:`${PROJECT_LOG}/ traite_amsuab.log.{YYYYMMDDTHHMMSSZ}`48 # :file:`${PROJECT_LOG}/cresamsu.log.{YYYYMMDDTHHMMSSZ}` 42 49 # 43 50 # .. only:: man … … 49 56 # .. graphviz:: 50 57 # 51 # digraph traite_amsuab { 52 # 53 # amsu_t1 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/AMSU/AMSU*/L1C/yyyy/yyyy_mm_dd/*.L1C"]; 54 # amsu_a_cor_land [shape=diamond,fontname=Courier,label="${PROJECT}/src/dataref_amsu/CORR_LAND_AMSUA5_DataFromJune2010_40deg.DAT"]; 55 # amsu_a_cor_sea [shape=diamond,fontname=Courier,label="${PROJECT}/src/dataref_amsu/CORR_SEA_AMSUA5_DataFromJune2010_40deg.DA"]; 58 # digraph cresamsu { 59 # 56 60 # amsu_t2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/yyyy/mm/amsua_amsub_yyyymmdd_geomin_geomax.dat"]; 57 61 # amsu_t3 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/yyyy/mm/amsua_amsub_yyyymmdd_geomin_geomax_nadir.dat"]; 58 # amsu_t4 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/yyyy/mm/amsua_amsub_yyyymmdd_geomin_geomax_nadir.nc"]; 59 # mask [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/MASK/ETOPO1_Ice_g_gmt4.nc"]; 60 # 61 # log [shape=ellipse,fontname=Courier,label="${PROJECT_LOG}/traite_amsuab.log{YYYYMMDDTHHMMSSZ}"]; 62 # 63 # traite_amsuab [shape=box, 62 # 63 # log [shape=ellipse,fontname=Courier,label="${PROJECT_LOG}/cresamsu.log{YYYYMMDDTHHMMSSZ}"]; 64 # 65 # cresamsu [shape=box, 64 66 # fontname=Courier, 65 67 # color=blue, 66 # URL="http://forge.ipsl.jussieu.fr/varamma/browser/trunk/src/ traite_amsuab.sh",67 # label="${PROJECT}/src/ traite_amsuab.sh"];68 # 69 # {amsu_t 1 amsu_a_cor_land amsu_a_cor_sea mask} -> {traite_amsuab} -> {log amsu_t2 amsu_t3 amsu_t4}68 # URL="http://forge.ipsl.jussieu.fr/varamma/browser/trunk/src/cresamsu.sh", 69 # label="${PROJECT}/src/cresamsu.sh"]; 70 # 71 # {amsu_t2} -> {cresamsu} -> {log amsu_t5} 70 72 # 71 73 # } … … 74 76 # ======== 75 77 # 76 # You already used :ref:`get_amsu.sh` to get AMSU data including channel a5 77 # during [20060801, 20060802[ and you want to produce NetCDF files:: 78 # 79 # traite_amsuab.sh -b 20060801 -e 20060802 -lonmin -25 -lonmax 25 -latmin -5 -latmax 20 -numch a5 78 # You already used :ref:`traite_amsuab.sh` to process AMSU channel a5 data 79 # during [20060801, 20060802[ and you want to run cressman filter and produce 80 # NetCDF files:: 81 # 82 # cresamsu.sh -b 20060801 -e 20060802 -lonmin -25 -lonmax 25 -latmin -5 -latmax 20 -numch a5 -temp 'm' -rtemp 1. -rhdeg .5 80 83 # 81 84 # And look at log file with :: 82 85 # 83 # tlogd.sh traite_amsuab84 # 85 # A more realistic example: 86 # 87 # traite_amsuab.sh -b 20060101 -e 20060630 -lonmin -32 -lonmax 32 -latmin -2 -latmax 4286 # tlogd.sh cresamsu 87 # 88 # A more realistic example:: 89 # 90 # cresamsu.sh -b 20060101 -e 20060630 -lonmin -32 -lonmax 32 -latmin -2 -latmax 42 -temp 'm' -rtemp 1. -rhdeg .5 88 91 # 89 92 # and of course on files in ${PROJECT_ID}. 90 #91 # If you want to work on channel b5 of AMSU::92 #93 # traite_amsuab.sh -b 20060813 -e 20060814 -lonmin -25 -lonmax 25 -latmin -5 -latmax 20 -numch b594 93 # 95 94 # SEE ALSO 96 95 # ======== 97 96 # 98 # IDL_99 #100 # .. _IDL: http://www.ittvis.com/ProductServices/IDL.aspx101 #102 97 # :ref:`varamma_profile.sh` 103 98 # :ref:`project_init.pro` 104 99 # 105 # :ref:`run_ traite_amsuab.sh` to submit job106 # 107 # Previous step : :ref:` get_amsu.sh`100 # :ref:`run_cresamsu.sh` to submit job 101 # 102 # Previous step : :ref:`traite_amsuab.sh` 108 103 # 109 104 # Use : 110 # :ref:`extract_amsua.pro` 111 # :ref:`amsu2ncdf.pro` 112 # :func:`search_amsufiles` 113 # 105 # :ref:`cresamsu.pro` 114 106 # :ref:`geolocation_to_string_sh.sh` 115 107 # … … 119 111 # ==== 120 112 # 121 # usage of profile on parameter true only 122 # 123 # get all procedure in profiler report (pb of sequence between 124 # compile statements and call to profiler ?) 125 # 126 # se bloque sur 127 # /homedata/pinsard/varamma_d/AMSU/AMSUBN17/L1C/2006/2006_08_01/NSS.AMBX.NM.D06213.S1029.E1224.B2132223.WI.L1C 128 # avec use_amsua 0 129 # 130 # why need .compile ?! 113 # get rid of "Program caused arithmetic error: Floating illegal operand" 131 114 # 132 115 # build/complete catalog … … 139 122 # 140 123 # test if demo mode idl (or force cancel if demo) 141 #142 # what about143 # lire_amsuab_new.pro:if (ambfile eq '/bdd/AMSU-1C/AMSUBN15/L1C/2006/2006_03_14/NSS.AMBX.NK.D06073.S1701.E1846.B4072728.GC.L1C') then goto,labett ;exception fichier erronne144 # lire_amsuab_new.pro:if (ambfile eq '/bdd/AMSU-1C/AMSUBN15/L1C/2004/2004_06_25/NSS.AMBX.NK.D04177.S1824.E1950.B3180102.WI.L1C') then goto,labett ;exception fichier erronne145 124 # 146 125 # EVOLUTIONS … … 151 130 # $URL$ 152 131 # 153 # - fplod 201204 20132 # - fplod 20120430 154 133 # 155 # * add some compile to complete profiler report 156 # * add a realistic example from laurence 157 # 158 # - fplod 20120419 159 # 160 # * add test on files_list 161 # * new technique to validate yyyymmdd 162 # because :: 163 # yyyymmddb=200601010 164 # ${date_cmd} -d "${yyyymmddb}" 165 # Sun Oct 10 00:00:00 CET 20060 166 # 167 # alors qu'on avait pu supposer que cela renvoie "date invalid" (année sur 5 digits !) 168 # 169 # - fplod 20120417 170 # 171 # * add some Profiler usage thanks to 172 # http://www.idlcoyote.com/code_tips/whyslow.html 173 # 174 # - pinsard 20120416 175 # 176 # * update min max yyyymmdd 177 # 178 # - pinsard 20120323 179 # 180 # * replace creation of :file:`${PROJECT_ID}/list_file` by a call to 181 # :func:`search_amsufiles` 182 # * transform the IDL snippet to a function to be abble to use ``CASE`` 183 # 184 # - pinsard 20120106 185 # 186 # * update header (no more use_amsu, correction files under src/dataref_amsu) 187 # * remplace VARAMMA by PROJECT 188 # * test if at least one file to be read 189 # * ajout pour connaitre la durée du traitement de chaque jour 190 # * add ref to :ref:`run_traite_amsuab.sh` 191 # 192 # - pinsard 2011-08-22T14:32:21Z loholt1.ipsl.polytechnique.fr (Linux) 193 # 194 # * usage of ${IDL_CMD} instead of idl to allow run on idl 6.4 (/opt/idl-6.4/idl/bin/idl on climserv) 195 # 196 # - fplod 20110818T154338Z cratos (Linux) 197 # 198 # * test on cratos after copying files from climserv 199 # 200 # as get_amsu.sh do not yet work on cratos copies have been done using 201 # this kind of sequence 202 # :: 203 # 204 # cratos$ mkdir -p ${PROJECT_ID}/AMSU/AMSUBN17/L1C/2006/ 205 # loholt1$ scp -r /bdd/AMSU-1C/AMSUBN17/L1C/2006/2006_08_01 fplod@cerbere.locean-ipsl.upmc.fr:/usr/work/incas/fplod/varamma_d/AMSU/AMSUBN17/L1C/2006/ 206 # 207 # - pinsard 2011-08-18T10:23:42Z loholt1.ipsl.polytechnique.fr (Linux) 208 # 209 # * reach end with amsu-b only on loholt1 210 # 211 # - pinsard 2011-08-18T07:37:43Z loholt1.ipsl.polytechnique.fr (Linux) 212 # 213 # * use geolocation_to_string_sh to build geobox 214 # 215 # - pinsard 2011-08-10T15:36:50Z loholt1.ipsl.polytechnique.fr (Linux) 216 # 217 # * update amsu2ncdf call 218 # 219 # - fplod 20110810T081339Z aedon.locean-ipsl.upmc.fr (Darwin) 220 # 221 # * correct_nadir_LE06 has been replaced by correct_nadir_amsu. 222 # * correction of graph 223 # 224 # - lelod/fplod 20110809 225 # 226 # * new idl tools : need a list of file and new parameters 227 # 228 # - fplod 20110531T085708Z cratos.locean-ipsl.upmc.fr (Linux) 229 # 230 # * remove "_" in parameter variables 231 # 232 # - pinsard 2011-05-30T14:32:02Z loholt1.ipsl.polytechnique.fr (Linux) 233 # 234 # * produce daily files 235 # * complete graphic 236 # 237 # - pinsard 2011-05-26T10:57:48Z loholt1.ipsl.polytechnique.fr 238 # 239 # * add lonmin,lonmax,latmin,latmax parameters 240 # * create a temporary file for idl command 241 # * amsu2ncdf should work now on one day 242 # 243 # - pinsard 2011-05-26T10:37:42Z loholt1.ipsl.polytechnique.fr 244 # 245 # * correct_nadir_LE06 work now on one day 246 # * add mask in doc 247 # 248 # - pinsard 2011-05-25T13:16:37Z loholt1.ipsl.polytechnique.fr (Linux) 249 # 250 # * get rid of yr and jm 251 # 252 # - fplod 20110511T102251Z cratos.locean-ipsl.upmc.fr (Linux) 253 # 254 # * add -a parameter to handle use_amsua and use_amsub parameters of IDL 255 # program 256 # 257 # - pinsard 2011-05-05T07:11:18Z loholt1.ipsl.polytechnique.fr (Linux) 258 # 259 # * consolidation 260 # nb : tricky string to integer pb. see http://www.mail-archive.com/bug-bash@gnu.org/msg06358.html 261 # 262 # - fplod 20110426T090939Z aedon.locean-ipsl.upmc.fr (Darwin) 263 # 264 # * usage of PROJECT* 265 # 266 # - fplod 20100608T143812Z aedon.locean-ipsl.upmc.fr (Darwin) 267 # 268 # * minimal header 134 # * creation 135 # 269 136 #- 270 137 system=$(uname) … … 294 161 command=$(basename ${0}) 295 162 log_date=$(date -u +"%Y%m%dT%H%M%SZ") 296 # 297 usage=" Usage : ${command} [-f] -b yyyymmdd -e yyyymmdd -lonmin lonmin -lonmax lonmax -latmin latmin -latmax latmax -numch numch" 163 # get current time at the beginning of the process 164 timebd="$(date +%s)" 165 # 166 usage=" Usage : ${command} [-f] -b yyyymmdd -e yyyymmdd -lonmin lonmin -lonmax lonmax -latmin latmin -latmax latmax -numch numch -temp temp -rtemp rtemp -rhdeg rhdeg" 298 167 # 299 168 hostname=$(hostname) … … 307 176 yyyymmddb=20060420 308 177 yyyymmdde=20060420 309 numch='a5' 310 jdeb=1 311 jfin=10 312 netcdf_build=0 313 # 314 minargcount=4 178 # 179 minargcount=18 315 180 if [ ${#} -lt ${minargcount} ] 316 181 then 317 echo "${command} : eee : not enought arguments "182 echo "${command} : eee : not enought arguments (${#} vs ${minargcount})" 318 183 echo "${usage}" 319 184 exit 1 … … 354 219 shift 355 220 ;; 221 -temp) 222 temp=${2} 223 shift 224 ;; 225 -rtemp) 226 rtemp=${2} 227 shift 228 ;; 229 -rhdeg) 230 rhdeg=${2} 231 shift 232 ;; 356 233 -f) 357 234 force=1 … … 390 267 exit 1 391 268 fi 269 unset d 392 270 # 393 271 d=$((${yyyymmddb} - ${yyyymmdde_max})) … … 397 275 exit 1 398 276 fi 277 unset d 399 278 # 400 279 ${date_cmd} -d "${yyyymmdde}" > /dev/null … … 413 292 exit 1 414 293 fi 294 unset d 415 295 # 416 296 if [[ "${yyyymmdde}" < "${yyyymmddb}" ]] … … 433 313 echo "${command} : eee : tool ${IDL_CMD} not found" 434 314 echo "${command} : eee : check varamma_profile.sh sequence" 435 exit 1436 fi437 unset status438 unset tool439 #440 #441 tool=ncrcat442 type ${tool} 1> /dev/null 2>&1443 status=${?}444 if [ ${status} -ne 0 ]445 then446 echo "${command} : eee : tool ${tool} not found"447 315 exit 1 448 316 fi … … 474 342 echo "latmax=${latmax}" 1>> ${log} 475 343 echo "numch=${numch}" 1>> ${log} 344 echo "temp=${temp}" 1>> ${log} 345 echo "rtemp=${rtemp}" 1>> ${log} 346 echo "rhdeg=${rhdeg}" 1>> ${log} 476 347 echo "" 1>> ${log} 477 348 # 478 # build geomax from parameters 479 geomin=$(geolocation_to_string_sh.sh -lon ${lonmin} -lat ${latmin}) 480 status=${?} 481 if [ ${status} -ne 0 ] 482 then 483 echo "${command} : eee : pb geomin with geolocation_to_string_sh.sh" 1>> ${log} 484 exit 1 485 fi 486 geomax=$(geolocation_to_string_sh.sh -lon ${lonmax} -lat ${latmax}) 487 status=${?} 488 if [ ${status} -ne 0 ] 489 then 490 echo "${command} : eee : pb geomax with geolocation_to_string_sh.sh" 1>> ${log} 491 exit 1 492 fi 493 # 494 # loop over all dates 495 # set current and end date 496 current=$(${date_cmd} -u -d "${yyyymmddb}" +%s | awk '{printf "%10.10d",$1}') 497 end=$(${date_cmd} -u -d "${yyyymmdde}" +%s | awk '{printf "%10.10d",$1}') 498 delta=86400 499 while [[ "${current}" < "${end}" ]] 500 do 501 # get current time at the beginning of the process for one day 502 timebd="$(date +%s)" 503 echo "${command} : iii : looking for files of $(${date_cmd} -u -d "1970-01-01 ${current} sec" +%Y%m%dT%H%M)" 1>> ${log} 504 yyyymmdd=$(${date_cmd} -u -d "1970-01-01 ${current} sec" +%Y%m%d) 505 yyyy=$(${date_cmd} -u -d "1970-01-01 ${current} sec" +%Y) 506 mm=$(${date_cmd} -u -d "1970-01-01 ${current} sec" +%m) 507 dd=$(${date_cmd} -u -d "1970-01-01 ${current} sec" +%d) 508 hh=$(${date_cmd} -u -d "1970-01-01 ${current} sec" +%H) 509 mn=$(${date_cmd} -u -d "1970-01-01 ${current} sec" +%M) 510 # 511 prefix=$(printf "%1c" ${numch} | tr [:lower:] [:upper:]) 512 513 cat >> ${PROJECT}/src/traite_amsu_${$}.pro << EOF 514 function traite_amsu_${$} 349 datesec=$(${date_cmd} -u -d "${yyyymmddb}" +%s | awk '{printf "%10.10d",$1}') 350 yyyyb=$(${date_cmd} -u -d "1970-01-01 ${datesec} sec" +%Y) 351 mmb=$(${date_cmd} -u -d "1970-01-01 ${datesec} sec" +%m) 352 ddb=$(${date_cmd} -u -d "1970-01-01 ${datesec} sec" +%d) 353 unset datesec 354 unset yyyymmddb 355 # 356 datesec=$(${date_cmd} -u -d "${yyyymmdde}" +%s | awk '{printf "%10.10d",$1}') 357 yyyye=$(${date_cmd} -u -d "1970-01-01 ${datesec} sec" +%Y) 358 mme=$(${date_cmd} -u -d "1970-01-01 ${datesec} sec" +%m) 359 dde=$(${date_cmd} -u -d "1970-01-01 ${datesec} sec" +%d) 360 unset datesec 361 unset yyyymmdde 362 # 363 cat >> ${PROJECT}/src/cresamsu_${$}.pro << EOF 364 function cresamsu_${$} 515 365 ; 516 366 compile_opt idl2, strictarrsubs … … 521 371 result = -1 522 372 ; 523 result = search_amsufiles('${numch}', ${yyyy},${mm}, ${dd}) 524 result_type=size(result,/type) 525 IF (result_type EQ 3) THEN BEGIN 526 IF (result EQ -1) THEN BEGIN 527 print, 'eee : pb search_amsufiles' 528 return, result 529 ENDIF 530 ENDIF ELSE BEGIN 531 files_list = result 532 ENDELSE 373 cresamsu, '${numch}', ${yyyyb}, ${mmb}, ${ddb} $ 374 , ${yyyye}, ${mme}, ${dde} $ 375 , ${lonmin}, ${lonmax}, ${latmin}, ${latmax} $ 376 , '${temp}' , ${rtemp} , ${rhdeg} 377 result = 0 533 378 ; 534 result = file_bathy_to_mem(${lonmin}, ${lonmax}, ${latmin}, ${latmax})535 IF (result EQ -1) THEN BEGIN536 print, 'eee : pb file_bathy_to_mem'537 return, result538 ENDIF539 ;540 ; uncomment the following lines to test with the last file of the list541 ; files_list_new_array = strarr(1)542 ; files_list_new_array[0] = files_list[N_ELEMENTS(files_list) - 1]543 ; files_list = files_list_new_array544 ;545 ; uncomment the following lines to test with the two last files of the list546 ; files_list_new_array = strarr(2)547 ; files_list_new_array[0] = files_list[N_ELEMENTS(files_list) - 2]548 ; files_list_new_array[1] = files_list[N_ELEMENTS(files_list) - 1]549 ; files_list = files_list_new_array550 ;551 ; uncomment the following lines to test with the first file of the list552 ; files_list_new_array = strarr(1)553 ; files_list_new_array[0] = files_list[1]554 ; files_list = files_list_new_array555 ;556 CASE size(files_list,/DIMENSION) OF557 0L : BEGIN558 print, 'www : no file found'559 END560 ELSE: BEGIN561 print, 'iii : nb de fichiers', size(files_list,/DIMENSION)562 resol=1563 extract_amsua, '${numch}', files_list, ${yyyy}, ${mm}, ${dd}, resol, ${lonmin}, ${lonmax}, ${latmin}, ${latmax}564 END565 ENDCASE566 EOF567 if [ ${netcdf_build} -eq 1 ]568 then569 cat >> ${PROJECT}/src/traite_amsu_${$}.pro << EOF570 amsu2ncdf, ${use_amsua}, ${yyyy},${mm},${dd}, ${lonmin}, ${lonmax}, ${latmin}, ${latmax}571 EOF572 fi573 cat >> ${PROJECT}/src/traite_amsu_${$}.pro << EOF574 379 return, result 575 380 end 576 381 EOF 577 ${IDL_CMD} << EOF >> ${log} 2>&1 382 unset numch 383 unset yyyyb 384 unset mmb 385 unset ddb 386 unset yyyye 387 unset mme 388 unset dde 389 unset lonmin 390 unset lonmax 391 unset latmin 392 unset latmax 393 unset temp 394 unset rtemp 395 unset rhdeg 396 # 397 ${IDL_CMD} << EOF >> ${log} 2>&1 578 398 key_performance = 0 579 399 ; totally shut down all profiling 580 profiler, /CLEAR,/SYSTEM & profiler,/CLEAR,/RESET400 profiler, /CLEAR, /SYSTEM & profiler, /CLEAR, /RESET 581 401 ; add system procedure 582 402 Profiler, /SYSTEM 583 403 ; compile users procedures to be scan by Profiler 584 .compile interpol_correc 585 .compile extract_amsua 586 .compile read_amsua1c 587 .compile define_amsua_header_struct 588 .compile define_amsua_struct 589 .compile pixelsize 590 .compile mem_to_file_amsu_t2 404 .compile cresamsu 405 .compile idl_amsu_netcdf 591 406 .compile geolocation_to_string_idl 592 .compile file_ bathy_to_mem407 .compile file_amsu_t2_to_mem 593 408 ; add users procedures 594 409 Profiler 595 result = traite_amsu_${$}()410 result = cresamsu_${$}() 596 411 print, 'ppp : profiler report begin' 597 412 Profiler, /REPORT 598 413 print, 'ppp : profiler report end' 599 414 EOF 600 status=${?} 601 if [ ${status} -ne 0 ] 602 then 603 echo "${command} : eee: ${IDL_CMD} failed : ${status}" >> ${log} 2>&1 604 cat ${PROJECT}/src/traite_amsu_${$}.pro >> ${log} 2>&1 605 exit 1 606 fi 607 rm ${PROJECT}/src/traite_amsu_${$}.pro 608 unset status 609 if [ ${netcdf_build} -eq 1 ] 610 then 611 # concatenate yyyymmdd-hhmnss NetCDF files 612 list=${PROJECT_ID}/AMSU/${yyyy}/${mm}/${prefix}${yyyy}${mm}${dd}_??????_${geomin}_${geomax}_nadir.nc 613 fileout=${PROJECT_ID}/AMSU/${yyyy}/${mm}/${prefix}${yyyy}${mm}${dd}_${geomin}_${geomax}_nadir.nc 614 ncrcat -O ${list} ${fileout} >> ${log} 2>&1 615 status=${?} 616 if [ ${status} -ne 0 ] 617 then 618 echo "${command} : eee : pb with ncrcat" 1>> ${log} 619 for file in ${list} 620 do 621 ncdump -h ${file} >> ${log} 2>&1 622 done 623 exit 1 624 else 625 echo "${command} : iii : adding ${fileout}" >> ${log} 2>&1 626 fi 627 fi 628 unset dd 629 # get current time at the end of the process for one day 630 timeed="$(date +%s)" 631 elapsed_seconds="$(( ${timeed} - ${timebd} ))" 632 echo "${command} : iii : Elapsed time for this day (s) : ${elapsed_seconds}" >> ${log} 2>&1 633 unset timebd 634 unset timeed 635 # next time step 636 current=$((${current} + ${delta})) 637 done 638 # 639 unset yyyy 640 unset mm 415 status=${?} 416 if [ ${status} -ne 0 ] 417 then 418 echo "${command} : eee: ${IDL_CMD} failed : ${status}" >> ${log} 2>&1 419 cat ${PROJECT}/src/cresamsu_${$}.pro >> ${log} 2>&1 420 exit 1 421 fi 422 rm ${PROJECT}/src/cresamsu_${$}.pro 423 unset status 424 # get current time at the end of the process 425 timeed="$(date +%s)" 426 elapsed_seconds="$(( ${timeed} - ${timebd} ))" 427 echo "${command} : iii : Elapsed time (s) : ${elapsed_seconds}" >> ${log} 2>&1 428 unset timebd 429 unset timeed 430 unset elapsed_seconds 431 # 432 unset yyyymmddb_min 433 unset yyyymmdde_max 434 unset force 435 unset debug 641 436 # 642 437 unset command … … 648 443 # 649 444 # end 650 #++set445 set 651 446 exit -
trunk/src/run_cresamsu.sh
r541 r543 2 2 #+ 3 3 # 4 # .. program:: run_ traite_amsuab.sh5 # 6 # .. _run_ traite_amsuab.sh:7 # 8 # =============== =====9 # run_ traite_amsuab.sh10 # =============== =====4 # .. program:: run_cresamsu.sh 5 # 6 # .. _run_cresamsu.sh: 7 # 8 # =============== 9 # run_cresamsu.sh 10 # =============== 11 11 # 12 12 # SYNOPSIS … … 15 15 # :: 16 16 # 17 # $ run_traite_amsuab.sh -b yyyymmdd -e yyyymmdd -lonmin lonmin -lonmax lonmax -latmin latmin -latmax latmax -numch numch17 # run_cresamsu.sh -b yyyymmdd -e yyyymmdd -lonmin lonmin -lonmax lonmax -latmin latmin -latmax latmax -numch numch -temp temp -rtemp rtemp -rhdeg rhdeg 18 18 # 19 19 # DESCRIPTION … … 27 27 # .. option:: -latmax <latmax> 28 28 # .. option:: -numch <channel> 29 # 30 # lancement de :ref:`traite_amsuab.sh` en batch 31 # 32 # Job stderr is in the working directory :file:`run_traite_amsuab.e{xxxxx}`, stdout is in :file:`run_traite_amsuab.o{xxxxx}` 33 # 34 # Log file of :ref:`traite_amsuab.sh` is written on 35 # :file:`${PROJECT_LOG}/traite_amsuab.log.{YYYYMMDDTHHMMSSZ}` 29 # .. option:: -temp <temp> 30 # .. option:: -rtemp <rtemp> 31 # .. option:: -rhdeg <rhdeg> 32 # 33 # lancement de :ref:`cresamsu.sh` en batch 34 # 35 # Job stderr is in the working directory :file:`run_cresamsu.e{xxxxx}`, stdout is in :file:`run_cresamsu.o{xxxxx}` 36 # 37 # Log file of :ref:`cresamsu.sh` is written on 38 # :file:`${PROJECT_LOG}/cresamsu.log.{YYYYMMDDTHHMMSSZ}` 36 39 # 37 40 # SEE ALSO … … 39 42 # 40 43 # :ref:`varamma_profile.sh` 41 # :ref:` traite_amsuab.sh`44 # :ref:`cresamsu.sh` 42 45 # 43 46 # http://climserv.ipsl.polytechnique.fr/fr/utilisation-du-cluster-climserv/le-cluster-de-calcul-2.html … … 48 51 # To submit with qsub:: 49 52 # 50 # run_ traite_amsuab.sh -b 20060813 -e 20060814 -lonmin -25 -lonmax 25 -latmin -5 -latmax 20 -numch a553 # run_cresamsu.sh -b 20060813 -e 20060814 -lonmin -25 -lonmax 25 -latmin -5 -latmax 20 -numch a5 -temp 'm' -rtemp 1. -rhdeg .5 51 54 # 52 55 # The job id will be written on the screen. … … 56 59 # qstat {jobid} 57 60 # 58 # When the job is done, look at log file of traite_amsuab.sh::59 # 60 # tlogd.sh traite_amsuab61 # When the job is done, look at log file of cresamsu.sh:: 62 # 63 # tlogd.sh cresamsu 61 64 # 62 65 # TODO 63 66 # ==== 64 67 # 65 # destruction de ${PROJECT_LOG}/job_run_ traite_amsuab.sh : quand ? pas ici car le job68 # destruction de ${PROJECT_LOG}/job_run_cresamsu.sh : quand ? pas ici car le job 66 69 # en question n'est pas fini 67 70 # … … 69 72 # qu'un mechant 10:00:00 en dur 70 73 # 71 # check param or fusion with traite_amsuab.sh74 # check param or fusion with cresamsu.sh 72 75 # 73 76 # introduire methode comme dans run_modmarin pour batch cratos (pas de PBS !) … … 80 83 # $URL$ 81 84 # 82 # - fplod 20120420 83 # 84 # * add logdate in job filename to avoid confusion between jobs 85 # * add job content in log 86 # 87 # - fplod 20120416 88 # 89 # * job...sh in ${PROJECT_LOG}/ instead of current directory 90 # 91 # - fplod 20120223 92 # 93 # * add rest title ! 94 # * lancement sur le cluster de climserv avec plus de temps que l'heure de 95 # base en interacif sur loholt ou que les 6h de base (sans l'option 96 # -l walltime) :: 97 # 98 # qsub -l walltime=10:00:00 traite_amsu.sh 99 # 100 # - fplod 20120106 101 # 102 # * creation car traite_amsuab.sh trop long en interactif sur climserv loholt1 103 # 85 # - fplod 20120430 86 # 87 # * creation 104 88 # 105 89 #- … … 132 116 log_date=$(date -u +"%Y%m%dT%H%M%SZ") 133 117 # 134 usage=" Usage : ${command} [-f] -b yyyymmdd -e yyyymmdd -lonmin lonmin -lonmax lonmax -latmin latmin -latmax latmax -numch numch "118 usage=" Usage : ${command} [-f] -b yyyymmdd -e yyyymmdd -lonmin lonmin -lonmax lonmax -latmin latmin -latmax latmax -numch numch -temp temp -rtemp rtemp -rhdeg rhdeg" 135 119 # 136 120 hostname=$(hostname) … … 167 151 -numch) 168 152 numch=${2} 153 shift 154 ;; 155 -temp) 156 temp=${2} 157 shift 158 ;; 159 -rtemp) 160 rtemp=${2} 161 shift 162 ;; 163 -rhdeg) 164 rhdeg=${2} 169 165 shift 170 166 ;; … … 205 201 echo "latmax=${latmax}" 1>> ${log} 206 202 echo "numch=${numch}" 1>> ${log} 203 echo "temp=${temp}" 1>> ${log} 204 echo "rtemp=${rtemp}" 1>> ${log} 205 echo "rhdeg=${rhdeg}" 1>> ${log} 207 206 echo "" 1>> ${log} 208 207 … … 221 220 # 222 221 . ${PROJECT}/src/varamma_profile.sh -d ${PROJECT}/ -i ${PROJECT_ID} -o ${PROJECT_OD} -t ${PROJECT_LOG} -s ${SAXO_DIR} -idl_cmd ${IDL_CMD} 223 time traite_amsuab.sh -b ${yyyymmddb} -e ${yyyymmdde} -lonmin ${lonmin} -lonmax ${lonmax} -latmin ${latmin} -latmax ${latmax} -numch ${numch}222 time cresamsu.sh -b ${yyyymmddb} -e ${yyyymmdde} -lonmin ${lonmin} -lonmax ${lonmax} -latmin ${latmin} -latmax ${latmax} -numch ${numch} -temp ${temp} -rtemp ${rtemp} -rhdeg ${rhdeg} 224 223 EOF 225 224 #
Note: See TracChangeset
for help on using the changeset viewer.