Changeset 1322
- Timestamp:
- 03/01/11 09:48:22 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/AA_stomate_flux_correction
- Property svn:keywords set to Date Author Revision
r1310 r1322 32 32 #-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) 33 33 #-Q- sx8brodie # @ notification = error 34 #-Q- sx8brodie # @ environment = $CURRENT_LOOP ; $imin ; $imax 34 35 #-Q- sx8brodie # @ queue 35 36 #-Q- aix6 #!/bin/ksh … … 47 48 #-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) 48 49 #-Q- aix6 # @ notification = error 50 #-Q- aix6 # @ environment = $CURRENT_LOOP ; $imin ; $imax 49 51 #-Q- aix6 # @ queue 50 52 #-Q- ulam #!/bin/ksh … … 62 64 #-Q- ulam # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) 63 65 #-Q- ulam # @ notification = error 66 #-Q- ulam # @ environment = $CURRENT_LOOP ; $imin ; $imax 64 67 #-Q- ulam # @ queue 65 68 #-Q- sx8mercure #!/bin/ksh 69 #-Q- sx9mercure ######################### 70 #-Q- sx9mercure ## CESIUM FOR SX9 CEA ## 71 #-Q- sx9mercure ######################### 72 #-Q- sx9mercure #MSUB -r SBGcorr # Nom du job 73 #-Q- sx9mercure #MSUB -N 1 # Reservation du noeud 74 #-Q- sx9mercure #MSUB -n 1 # Reservation du processus 75 #-Q- sx9mercure #MSUB -T 86400 # Limite de temps elapsed du job 76 #-Q- sx9mercure #MSUB -E "-j o" 77 #-Q- sx9mercure #MSUB -E "-S /bin/ksh" 66 78 #-Q- sx8mercure ###################### 67 79 #-Q- sx8mercure ## SX8MERCURE CEA ## … … 108 120 109 121 #************************************************************** 110 # Author: Sebastien Denvil111 # Contact: Sebastien.Denvil__at__ipsl.jussieu.fr112 # $Revision:: 414$ Revision of last commit113 # $Author:: sdipsl$ Author of last commit114 # $Date:: 2011-01-31 10:38:05 +0100 (lun. 31 janv. 201#$ Date of last commit122 # Author: Martial Mancip 123 # Contact: Martial.Mancip__at__ipsl.jussieu.fr 124 # $Revision:: $ Revision of last commit 125 # $Author:: $ Author of last commit 126 # $Date:: $ Date of last commit 115 127 # IPSL (2006) 116 128 # This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC … … 118 130 #************************************************************** 119 131 120 #set -eu 121 #set -vx 132 133 #************************************************************** 134 # usage : 135 # 136 # This script is only used for correction of stomate_ipcc_history files created 137 # with orchidee_1_9_5 version of ORCHIDEE model checkouted before 01/0 138 # Version of ORCHIDEE/src_stomate/stomate_lpj.f90 before CVS 1.26 had a bug 139 # that give a wrong Land Cover Change (fLuc) variable and a wrong nbp balance variable. 140 # This file will correct all those IPCC CMIP5 history files in a simulation. 141 # You must read 'Documentation' paragraph below to parameter the chain of jobs for 142 # specific schedulers. 143 # This script must only be used in a libIGCM directory 144 # (but submit from a CONFIG directory). 145 # Default parameters in this job are given for mercure CCRT X64 frontend. 146 # 147 #************************************************************** 148 149 150 122 151 123 152 date … … 148 177 #D- Experience type : DEB(ug), DEV(elopment), RUN (default) 149 178 JobType=RUN 179 180 181 ### Documentation : 182 ## 1) To start again this script in StandAlone mode 183 ## (because it fails with a problem with the system or a timeout, for example), 184 ## you must check the initialisation of three variables after the "Start loop" line : 185 ## CURRENT_LOOP=${CURRENT_LOOP:=1} give the iteration to begin the main loop 186 ## imin=${imin:=0} give the corresponding min index in the list of stomate_history files 187 ## imax=${imax:=${NbFilesLOOP}} give the corresponding max index in the list of stomate_history files 188 ## nb: the main loop is parametered by UNIX_MAX_LIMIT (in system library) value. 189 ## imax is a factor of NbFilesLOOP = UNIX_MAX_LIMIT / 2 value 190 ## imin is the previous imax (see previous output of the script if exist) 191 ## 2) This script will re-submit itself automaticly after calculate the next values of those three variables. 192 193 ## To prevent timeout because of a large number of files (long simulation) and maximum elapse time 194 ## in the PBS queue, you must give the correct value of next line LOOP_MAX variable. 195 ## It gives the maximum of iterations of the MAIN LOOP during the elapse time required in the PBS. 196 LOOP_MAX=15 197 # 198 ## For example: if UNIX_MAX_LIMIT=360 and the number of stomate_history for a run if 3800, 199 ## the number of files that has to be demigrated if 7600 (stomate_history + stomate_ipcc_history). 200 ## The NBRE_TOUR (see previous output) calculate is 22. 201 ## If the elasped time required is 24H (86400s) and each 10 years (120x2 = 240 files) take one hour, 202 ## you must give LOOP_MAX= 240 * 24 / 360 = 16 max. 203 ## To prevent system slow, the default value is 15. 204 150 205 151 206 ######################################################################## … … 231 286 echo "NbFilesLOOP = ${NbFilesLOOP} " 232 287 233 CURRENT_LOOP=1 234 # THIS LOOP GIVES PARAMETERS FOR THE DATE'S LOOP ie : DATE_COURANTE, DATE_FIN. 235 # WE HAVE 3 LEVELS 236 # - LEVEL 1 : JUST ONE LOOP TO COMPLETE 237 # - LEVEL 2 : WE ARE IN THE "DEEP" LOOP 238 # - LEVEL 3 : WE ARE IN THE LAST LOOP 239 240 imin=0 241 imax=${NbFilesLOOP} 288 ######################################################################## 289 # 290 # START THE MAIN LOOP 291 # 292 ######################################################################## 293 294 # PARAMETERS OF THE LOOP : 295 # Cumultate CURRENT LOOP number over submitions 296 CURRENT_LOOP=${CURRENT_LOOP:=1} 297 # min index for list of local files 298 imin=${imin:=0} 299 # max index for list of local files 300 imax=${imax:=${NbFilesLOOP}} 301 302 # DEPEND OF THE ELAPSED TIME RESERVED FOR LOOP_MAX ITERATIONS 303 LOOP_MAX=${LOOP_MAX:=NBRE_TOUR} 304 305 IGCM_debug_Verif_Exit_Post 306 307 # MAIN LOOP 308 # LOCAL CURRENT LOOP number less than LOOP_MAX 309 CURRENT_LOOP0=1 242 310 while [ ${CURRENT_LOOP} -le ${NBRE_TOUR} ] ; do 311 312 echo "###############################################################" 313 echo "LOOP : " ${CURRENT_LOOP} 314 echo "imin/imax : " $imin " / " $imax 243 315 244 316 unset liste_file … … 253 325 254 326 liste_file[${#liste_file[*]}]=${file} 255 liste_file[${#liste_file[*]}]=${file_ipcc}256 327 liste_file_local[${#liste_file_local[*]}]=$( basename ${file} ) 257 328 RET=$? 258 329 if [ ${RET} -gt 0 ] ; then 259 echo "erreur basename "330 echo "erreur basename liste_file_local " ${file} 260 331 echo "file = " ${file} 261 332 exit 1 262 333 fi 263 liste_file_local[${#liste_file_local[*]}]=$( basename ${file_ipcc} ) 264 RET=$? 265 if [ ${RET} -gt 0 ] ; then 266 echo "erreur basename" 267 echo "file = " ${file_ipcc} 268 exit 2 269 fi 334 liste_file[${#liste_file[*]}]=${file_ipcc} 335 270 336 liste_file_ipcc[${#liste_file_ipcc[*]}]=${file_ipcc} 271 337 liste_file_ipcc_local[${#liste_file_ipcc_local[*]}]=$( basename ${file_ipcc} ) 272 338 RET=$? 273 339 if [ ${RET} -gt 0 ] ; then 274 echo "erreur basename "340 echo "erreur basename liste_file_ipcc_local " ${file_ipcc} 275 341 echo "file = " ${file_ipcc} 276 342 exit 3 … … 334 400 (( imin = imax )) 335 401 (( CURRENT_LOOP = CURRENT_LOOP + 1 )) 402 (( CURRENT_LOOP0 = CURRENT_LOOP0 + 1 )) 336 403 if [ ${CURRENT_LOOP} -lt ${NBRE_TOUR} ] ; then 337 404 (( imax = imax + ${NbFilesLOOP} )) 338 405 else 339 if [ ${NBRE_FILE_TOT}%${UNIX_MAX_LIMIT} -eq 0 ] ; then 340 (( imax = imax + ${NbFilesLOOP} )) 341 else 406 if [ ${CURRENT_LOOP} -eq ${NBRE_TOUR} ] ; then 342 407 echo "Dernier tour : " 343 echo "reste = " $(( NBRE_FILE_TOT % UNIX_MAX_LIMIT )) 344 echo "imax = " ${imax} 345 echo "reste / 2 = " $(( ( NBRE_FILE_TOT % UNIX_MAX_LIMIT / 2 ) )) 346 (( imax = imax + ( NBRE_FILE_TOT % UNIX_MAX_LIMIT / 2 ) )) 347 echo "imax NEW = " ${imax} 348 echo "Nombre de stomate_history : " ${CountLISTE_FILE_SBG} 408 if [ ${NBRE_FILE_TOT}%${UNIX_MAX_LIMIT} -eq 0 ] ; then 409 echo "imin NEW = " ${imax} 410 (( imax = imax + ${NbFilesLOOP} )) 411 echo "imax NEW = " ${imax} 412 else 413 echo "imin NEW = " ${imax} 414 (( imax = imax + ( NBRE_FILE_TOT % UNIX_MAX_LIMIT ) / 2 )) 415 echo "imax NEW = " ${imax} 416 fi 349 417 fi 350 418 fi 351 done # while [ ${CURRENT_LOOP} -le ${NBRE_TOUR} ] do 419 if ( [ ${CURRENT_LOOP} -le ${NBRE_TOUR} ] && \ 420 [ ${CURRENT_LOOP0} -gt ${LOOP_MAX} ] ) ; then 421 export CURRENT_LOOP 422 export imin 423 export imax 424 IGCM_sys_Cd ${SUBMIT_DIR} 425 Script_Post_Output=SBGcorr.${imin}.${imax} 426 listVarEnv="CURRENT_LOOP,imin,imax" 427 echo "Submit next job." 428 IGCM_sys_QsubPost stomate_flux_correction 429 break ; 430 fi 431 done # while [ ${CURRENT_LOOP} -le ${LOOP_MAX} ] do 352 432 # FINISH 353 433 … … 360 440 361 441 # Clean RUN_DIR_PATH (necessary for cesium) 442 IGCM_sys_Cd ${SUBMIT_DIR} 362 443 IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH} 363 444
Note: See TracChangeset
for help on using the changeset viewer.