- Timestamp:
- 11/09/10 16:02:49 (14 years ago)
- Location:
- trunk/libIGCM
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/AA_create_ts
r377 r380 481 481 Length=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" ) ;; 482 482 *) 483 IGCM_debug_Exit "create_ts " ${config_UserChoices_PeriodLength} " invalid PeriodLength : choose in 1Y, *M, *D."483 IGCM_debug_Exit "create_ts " ${config_UserChoices_PeriodLength} " invalid PeriodLength : choose in *Y, *M, *D." 484 484 IGCM_debug_Verif_Exit_Post ;; 485 485 esac … … 536 536 Length=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" ) ;; 537 537 *) 538 IGCM_debug_Exit "create_ts " ${config_UserChoices_PeriodLength} " invalid PeriodLength : choose in 1Y, *M, *D."538 IGCM_debug_Exit "create_ts " ${config_UserChoices_PeriodLength} " invalid PeriodLength : choose in *Y, *M, *D." 539 539 IGCM_debug_Verif_Exit_Post ;; 540 540 esac -
trunk/libIGCM/AA_job
r373 r380 285 285 #D- Will stop here if something is wrong 286 286 # --------------------------------------------------------------------== 287 #IGCM_config_Check 287 IGCM_config_Check 288 289 # ------------------------------------------------------------------ 290 #D- Test if all was right before entering the period loop 291 # ------------------------------------------------------------------ 292 IGCM_debug_Verif_Exit 288 293 289 294 #D--------------------------------------------------------------------== … … 487 492 #D- 488 493 # ------------------------------------------------------------------ 494 #D- Configure asynchronous post-treatment (Level 0) when necessary (rebuild) 495 #D- Configure classic post-treatment (Level 1) when necessary (TimeSeries/Seasonal) 496 # ------------------------------------------------------------------ 497 IGCM_post_Configure 498 499 #D- 500 # ------------------------------------------------------------------ 489 501 #D- Launch remote rebuild or/and post-treatment process if necessary 490 502 # ------------------------------------------------------------------ 491 IGCM_post_ Configure503 IGCM_post_Submit 492 504 493 505 #D- … … 497 509 #D- Write in run.card user, system and elapse time 498 510 #D- Check that everything went well ! No ? then we stop. 499 #D- Determine next computed period 511 #D- Determine next computed period 500 512 # ------------------------------------------------------------------ 501 513 IGCM_config_PeriodEnd -
trunk/libIGCM/AA_rebuild_fromArchive
r373 r380 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 = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; $RebuildFromArchive ; $config_UserChoices_JobName ; $R_SAVE34 #-Q- sx8brodie # @ environment = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; $RebuildFromArchive 35 35 #-Q- sx8brodie # @ queue 36 36 #-Q- aix6 #!/bin/ksh … … 48 48 #-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) 49 49 #-Q- aix6 # @ notification = error 50 #-Q- aix6 # @ environment = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; $RebuildFromArchive ; $config_UserChoices_JobName ; $R_SAVE50 #-Q- aix6 # @ environment = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; $RebuildFromArchive 51 51 #-Q- aix6 # @ queue 52 52 #-Q- sx8mercure #!/bin/ksh … … 153 153 LastPeriodForRebuild=${PeriodDateBegin:=18901201} 154 154 155 #D- Name of the job to work in a standalone mode (needed for mask patch)156 #D- Default : value from config.card if any157 config_UserChoices_JobName=${config_UserChoices_JobName:=name_of_the_job}158 159 #D- Directory where output data are stored (needed in standalone mode for mask patch)160 #D- Default : value from AA_job if any161 R_SAVE=${R_SAVE:=/path/to/your/ARCHIVE/FILES}162 163 155 #D- Flag to determine atlas job's output directory 164 156 #D- Default : value from libIGCM_post.ksh if any -
trunk/libIGCM/AA_rebuild_fromWorkdir
r373 r380 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 = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; $RebuildFromArchive ; $config_UserChoices_JobName ; $R_SAVE34 #-Q- sx8brodie # @ environment = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; $RebuildFromArchive 35 35 #-Q- sx8brodie # @ queue 36 36 #-Q- aix6 #!/bin/ksh … … 49 49 #-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) 50 50 #-Q- aix6 # @ notification = error 51 #-Q- aix6 # @ environment = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; $RebuildFromArchive ; $config_UserChoices_JobName ; $R_SAVE51 #-Q- aix6 # @ environment = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; $RebuildFromArchive 52 52 #-Q- aix6 # @ queue 53 53 #-Q- sx8mercure #!/bin/ksh … … 154 154 LastPeriodForRebuild=${PeriodDateBegin:=18901201} 155 155 156 #D- Name of the job to work in a standalone mode (needed for mask patch)157 #D- Default : value from config.card if any158 config_UserChoices_JobName=${config_UserChoices_JobName:=name_of_the_job}159 160 #D- Directory where output data are stored (needed in standalone mode for mask patch)161 #D- Default : value from AA_job if any162 R_SAVE=${R_SAVE:=/path/to/your/ARCHIVE/FILES}163 164 156 #D- Flag to determine atlas job's output directory 165 157 #D- Default : value from libIGCM_post.ksh if any -
trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh
r373 r380 109 109 eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1 110 110 # 111 typeset i112 111 i=2 113 112 # … … 159 158 if [ ! $( eval echo \${${compname}_${flag_post}_TimeSeriesVars${Dimension}} ) = ${NULL_STR} ] ; then 160 159 if [ $( eval echo \${${compname}_${flag_post}_ChunckJob${Dimension}} ) = NONE ] ; then 161 IGCM_debug_Print 3 "${Dimension} time series activated for ${flag_post} according to ${card}"160 IGCM_debug_Print 3 "${Dimension} time series activated for ${flag_post}" 162 161 eval TimeSeries${Dimension}=true 163 162 fi … … 169 168 chunck_size=$( eval echo \${${compname}_${flag_post}_ChunckJob${Dimension}} ) 170 169 if [ ! ${chunck_size} = NONE ] && [ ! ${chunck_size} = OFF ] ; then 171 IGCM_debug_Print 3 "${Dimension} time series activated with chunck for ${flag_post} according to ${card}"170 IGCM_debug_Print 3 "${Dimension} time series activated with chunck for ${flag_post}" 172 171 eval TimeSeriesChunck${Dimension}=true 173 172 eval set +A CHUNCK${Dimension}_COMP \${CHUNCK${Dimension}_COMP[*]} ${comp} … … 266 265 if [ X${FileName0} != X${NULL_STR} ] ; then 267 266 eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1 268 typeset i269 267 (( i=0 )) 270 268 until [ $i -ge $NbFiles ]; do … … 369 367 eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1 370 368 371 typeset i372 369 (( i=0 )) 373 370 until [ $i -ge $NbFiles ]; do … … 433 430 eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1 434 431 435 typeset i436 432 (( i=0 )) 437 433 until [ $i -ge $NbFiles ]; do … … 459 455 eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1 460 456 461 typeset i462 457 (( i=0 )) 463 458 until [ $i -ge $NbFiles ]; do … … 529 524 eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1 530 525 531 typeset i532 526 (( i=0 )) 533 527 until [ $i -ge $NbFiles ]; do … … 613 607 eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1 614 608 615 typeset i616 609 (( i=1 )) 617 610 until [ $i -gt $NbFiles ]; do … … 666 659 eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1 667 660 668 typeset i669 661 (( i=1 )) 670 662 until [ $i -gt $NbFiles ]; do … … 828 820 eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1 829 821 830 typeset i831 822 (( i=0 )) 832 823 until [ $i -ge $NbFiles ]; do … … 893 884 eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1 894 885 895 typeset i896 886 (( i=0 )) 897 887 until [ $i -ge $NbFiles ]; do … … 931 921 echo "IGCM_debug_Print 1 \"IGCM_FlushRebuild\" " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh 932 922 echo "echo " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh 923 echo "export R_SAVE=${R_SAVE} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh 924 echo "export config_UserChoices_JobName=${config_UserChoices_JobName} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh 933 925 fi 934 926 fi … … 1027 1019 eval NbFiles=\${#${ListTextName}[@]} > /dev/null 2>&1 1028 1020 1029 typeset i1030 1021 (( i=0 )) 1031 1022 until [ $i -eq $NbFiles ]; do -
trunk/libIGCM/libIGCM_config/libIGCM_config.ksh
r373 r380 269 269 IGCM_debug_Print 1 "Number of years for PeriodLength : ${PeriodLengthInYears}" 270 270 PeriodLengthInDays=0 271 typeset i272 271 i=0 273 272 until [ $i -ge $PeriodLengthInYears ] ; do … … 280 279 IGCM_debug_Print 1 "Number of months for PeriodLength : ${PeriodLengthInMonths}" 281 280 PeriodLengthInDays=0 282 typeset i283 281 i=0 284 282 until [ $i -ge $PeriodLengthInMonths ] ; do … … 300 298 301 299 IGCM_debug_PopStack "IGCM_config_Analyse_PeriodLength" 302 300 } 301 302 #=================================== 303 function IGCM_config_Check 304 { 305 IGCM_debug_PushStack "IGCM_config_Check" 306 307 # If one of the following modulo is not zero : 308 # we will issue an error then explain and exit in 309 # AA_job IGCM_debug_Verif_Exit call before binary submission 310 311 echo 312 IGCM_debug_Print 1 "IGCM_config_Check :" 313 echo 314 315 if ( [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] || [ ! X${config_Post_RebuildFrequency} = XNONE ] ) ; then 316 AsynchronousRebuild=true 317 IGCM_debug_Print 1 "Asynchronous rebuild has been activated." 318 echo 319 # modulo (RebuildFrequency and PeriodLength/TimeSeriesFrequency/SeasonalFrequency) must be zero 320 IGCM_post_CheckModuloFrequency config_Post_RebuildFrequency config_UserChoices_PeriodLength 321 IGCM_post_CheckModuloFrequency config_Post_TimeSeriesFrequency config_Post_RebuildFrequency 322 IGCM_post_CheckModuloFrequency config_Post_SeasonalFrequency config_Post_RebuildFrequency 323 else 324 AsynchronousRebuild=false 325 IGCM_debug_Print 1 "Asynchronous rebuild has not been activated" 326 IGCM_debug_Print 1 "Proceed with standard post-treatment pathway" 327 echo 328 #modulo (TimeSeriesFrequency/SeasonalFrequency and PeriodLenght) must be zero 329 IGCM_post_CheckModuloFrequency config_Post_TimeSeriesFrequency config_UserChoices_PeriodLength 330 IGCM_post_CheckModuloFrequency config_Post_SeasonalFrequency config_UserChoices_PeriodLength 331 fi 332 333 IGCM_debug_PopStack "IGCM_config_Check" 303 334 } 304 335 … … 435 466 if [ ${DRYRUN} -le 0 ] ; then 436 467 if ( IGCM_sys_TestFileArchive ${R_OUT_KSH}/${PREFIX}_${Exe_Output} ) ; then 437 IGCM_debug_Exit "IGCM_config_PeriodStart" " RErunan old job."468 IGCM_debug_Exit "IGCM_config_PeriodStart" "You are currently RErunning an old job." 438 469 IGCM_debug_Print 1 "Because of readonly permissions, you can't RErun a job when saved files" 439 470 IGCM_debug_Print 1 " are still in the ARCHIVE directory. You must deleted those files, or " 440 IGCM_debug_Print 1 " the whole ${R_SAVE} tree." 471 IGCM_debug_Print 1 " the whole ${R_SAVE} tree. See clean_month.job in ${libIGCM} directory." 472 IGCM_debug_Print 1 " This exit has been initiated because at least ${R_OUT_KSH}/${PREFIX}_${Exe_Output} exists." 441 473 IGCM_debug_Verif_Exit 442 474 fi … … 476 508 #==================================# 477 509 478 typeset i479 480 481 run_Log_LastExeSize=""482 for comp in ${config_ListOfComponents[*]} ; do483 484 485 done486 487 IGCM_card_DefineArrayFromOption ${SUBMIT_DIR}/run.card Log LastExeSize488 489 510 if [ ${DRYRUN} -le 1 ] ; then 511 (( i=0 )) 512 if ( ${FirstInitialize} ) ; then 513 run_Log_LastExeSize="" 514 for comp in ${config_ListOfComponents[*]} ; do 515 run_Log_LastExeSize[$i]=0 516 (( i=i+1 )) 517 done 518 else 519 IGCM_card_DefineArrayFromOption ${SUBMIT_DIR}/run.card Log LastExeSize 520 fi 521 fi 490 522 #==================================# 491 523 # And Build ExeDate # … … 532 564 (( i=i+1 )) 533 565 534 if [ ${ExeSize} -ne ${LastCompExeSize} ] ; then 535 if ( ${FirstInitialize} ) ; then 536 IGCM_debug_Print 1 "Put first ${ExeNameIn} in ${R_OUT_EXE} !" 537 else 538 IGCM_debug_Print 1 "${ExeNameIn} has changed in ${R_EXE} !" 539 eval FileToBeDeleted[${#FileToBeDeleted[@]}]=${ExeNameOut} 566 if [ ${DRYRUN} -le 1 ] ; then 567 if [ ${ExeSize} -ne ${LastCompExeSize} ] ; then 568 if ( ${FirstInitialize} ) ; then 569 IGCM_debug_Print 1 "Put first ${ExeNameIn} in ${R_OUT_EXE} !" 570 else 571 IGCM_debug_Print 1 "${ExeNameIn} has changed in ${R_EXE} !" 572 eval FileToBeDeleted[${#FileToBeDeleted[@]}]=${ExeNameOut} 573 fi 574 eval IGCM_sys_Put_Out ${ExeNameOut} ${R_OUT_EXE}/${PREFIX}_${ExeNameIn} rw 540 575 fi 541 eval IGCM_sys_Put_Out ${ExeNameOut} ${R_OUT_EXE}/${PREFIX}_${ExeNameIn} rw542 576 fi 543 577 done 544 578 545 579 if [ ${DRYRUN} -le 1 ] ; then 546 typeset ExeCpuLog547 580 tail -1500 ${Exe_Output} > ${Exe_Output}_tail.txt 548 581 ExeCpuLog=$( gawk -f ${libIGCM}/libIGCM_sys/IGCM_add_out.awk ${Exe_Output}_tail.txt ) … … 688 721 689 722 if [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ; then 690 691 723 #==========================# 692 724 # End of entire simulation # … … 704 736 IGCM_sys_Tree ${R_SAVE} 705 737 fi 706 707 738 else 708 709 739 #=================# 710 740 # Submit next job # … … 719 749 # SUBMIT NEXT JOB from SUBMIT_DIR and come back in RUN_DIR 720 750 IGCM_sys_Cd ${SUBMIT_DIR} 751 # Keep only the 5 latest ${Script_Output_Prefix}_${config_UserChoices_JobName} 752 ScriptTot=$( ls ${Script_Output_Prefix}_${config_UserChoices_JobName}.?????? > /dev/null 2>&1 | wc -l ) 753 [ ${ScriptTot} -gt 5 ] && rm -f $( ls ${Script_Output_Prefix}_${config_UserChoices_JobName}.?????? | head -$(( ${ScriptTot} - 5 )) ) 754 # Submit next job and come back 721 755 IGCM_sys_Qsub ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} 722 756 IGCM_sys_Cd - -
trunk/libIGCM/libIGCM_post/libIGCM_post.ksh
r373 r380 22 22 IGCM_debug_Print 1 "IGCM_post_Configure :" 23 23 echo 24 25 typeset NbDays PeriodEndJul PostEndJul PeriodPost 24 # 25 # Initialize 26 # 27 POST=false 26 28 RebuildFrequency=false 27 28 if ( [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] && [ ! X${config_Post_RebuildFrequency} = XNONE ] ) ; then29 30 IGCM_debug_Print 1 "Asynchronous rebuild has been activated."31 echo32 33 case ${config_Post_RebuildFrequency} in34 *y|*Y)35 PeriodYear=$( echo ${config_Post_RebuildFrequency} | sed -e "s/[yY]//" )36 case ${config_UserChoices_PeriodLength} in37 *Y|*y)38 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[yY]//" )39 if [ ${PeriodPost} -le ${PeriodYear} ] ; then40 if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} )) % ${PeriodYear} ) -eq 0 ] ; then41 RebuildFrequency=true42 NbRebuildDir=$( expr ${PeriodYear} / ${PeriodPost} )43 fi44 else45 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"46 IGCM_debug_Print 3 "RebuildFrequency frequency : ${config_Post_RebuildFrequency}"47 fi ;;48 *M|*m)49 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[mM]//" )50 if [ ${PeriodPost} -le $(( ${PeriodYear} * 12 )) ] ; then51 if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} )) % $(( ${PeriodYear} * 12 )) ) -eq 0 ] ; then52 RebuildFrequency=true53 NbRebuildDir=$( expr $(( 12 * ${PeriodYear} )) / ${PeriodPost} )54 fi55 else56 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"57 IGCM_debug_Print 3 "RebuildFrequency frequency : ${config_Post_RebuildFrequency}"58 fi ;;59 *D|*d)60 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" )61 NbDays=$( IGCM_date_DaysInYear ${year} )62 if [ ${config_UserChoices_CalendarType} = 360d ] || [ ${config_UserChoices_CalendarType} = noleap ] ; then63 if [ ${PeriodPost} -le $(( ${PeriodYear} * ${NbDays} )) ] ; then64 if [ $( expr ${CumulPeriod} % $( expr \( ${NbDays} \* ${PeriodYear} \/ ${PeriodPost} \) ) ) -eq 0 ] ; then65 RebuildFrequency=true66 NbRebuildDir=$( expr $(( ${NbDays} * ${PeriodYear} )) / ${PeriodPost} )67 fi68 else69 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"70 IGCM_debug_Print 3 "RebuildFrequency frequency : ${config_Post_RebuildFrequency}"71 fi72 else73 # if [ ${PeriodYear} -eq 1 ] ; then74 # PeriodEndJul=$( IGCM_date_ConvertGregorianDateToJulian ${PeriodDateEnd} )75 # PostEndJul=${year}${NbDays}76 # #echo "PeriodYear=${PeriodYear} NbDays=${NbDays}"77 # #echo "PeriodEndJul=${PeriodEndJul} PostEndJul=${PostEndJul}"78 # if [ ${PostEndJul} -eq ${PeriodEndJul} ] ; then79 # RebuildFrequency=true80 # NbRebuildDir=$( expr ${NbDays} / ${PeriodPost} )81 # fi82 # else83 IGCM_debug_Print 3 "For RebuildFrequency with leap calendar:"84 IGCM_debug_Print 3 "We have a daily PeriodLength frequency and RebuildFrequency=${PeriodYear}Y."85 IGCM_debug_Print 3 "No post-treatment. Case not properly handle at this moment."86 # fi87 fi;;88 esac ;;89 *M|*m)90 PeriodMonth=$( echo ${config_Post_RebuildFrequency} | sed -e "s/[mM]//" )91 case ${config_UserChoices_PeriodLength} in92 *Y|*y)93 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"94 IGCM_debug_Print 3 "RebuildFrequency frequency ${config_Post_RebuildFrequency}" ;;95 *M|*m)96 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[mM]//" )97 if [ ${PeriodPost} -le ${PeriodMonth} ] ; then98 if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} )) % ${PeriodMonth} ) -eq 0 ] ; then99 RebuildFrequency=true100 NbRebuildDir=$( expr ${PeriodMonth} / ${PeriodPost} )101 fi102 else103 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"104 IGCM_debug_Print 3 "RebuildFrequency frequency : ${config_Post_RebuildFrequency}"105 fi ;;106 *D|*d)107 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"108 IGCM_debug_Print 3 "RebuildFrequency frequency : ${config_Post_RebuildFrequency}" ;;109 esac110 ;;111 *D|*d)112 PeriodDay=$( echo ${config_Post_RebuildFrequency} | sed -e "s/[dD]//" )113 case ${config_UserChoices_PeriodLength} in114 *Y|*y)115 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"116 IGCM_debug_Print 3 "RebuildFrequency frequency ${config_Post_RebuildFrequency}" ;;117 *M|*m)118 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"119 IGCM_debug_Print 3 "RebuildFrequency frequency ${config_Post_RebuildFrequency}" ;;120 *D|*d)121 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" )122 if [ ${PeriodPost} -le ${PeriodDay} ] ; then123 if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} )) % ${PeriodDay} ) -eq 0 ] ; then124 RebuildFrequency=true125 NbRebuildDir=$( expr ${PeriodDay} / ${PeriodPost} )126 fi127 else128 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with"129 IGCM_debug_Print 3 "RebuildFrequency frequency : ${config_Post_RebuildFrequency}"130 fi ;;131 132 esac133 ;;134 NONE|none)135 ;;136 *)137 IGCM_debug_Print 3 "KeyWord not allowed for RebuildFrequency in config.card"138 ;;139 esac140 else141 #142 IGCM_debug_Print 1 "Asynchronous rebuild has not been activated"143 IGCM_debug_Print 1 "Proceed with standard post-treatment pathway"144 echo145 #146 fi147 148 IGCM_debug_Print 1 "RebuildFrequency flag value : ${RebuildFrequency}"149 IGCM_post_Initialize150 151 IGCM_debug_PopStack "IGCM_post_Configure"152 }153 154 function IGCM_post_Initialize155 {156 IGCM_debug_PushStack "IGCM_post_Initialize"157 158 # Debug Print :159 echo160 IGCM_debug_Print 1 "IGCM_post_Initialize :"161 echo162 163 typeset NbDays PeriodEndJul PostEndJul164 #165 # Initialize166 #167 POST=false168 29 TimeSeriesFrequency=false 169 30 SeasonalFrequency=false … … 171 32 # ONLY IF SOMETHING NEEDS TO BE DONE (EATHER TIME SERIES OR SEASONAL) COMPUTE THE MODULOS 172 33 # 34 if [ X${AsynchronousRebuild} = Xtrue ] ; then 35 list_post="RebuildFrequency" 36 fi 37 # 173 38 if ( [ X${TimeSeries} = Xtrue ] || [ X${TimeSeries2D} = Xtrue ] || [ X${TimeSeries3D} = Xtrue ] ) ; then 174 list_post= TimeSeriesFrequency39 list_post="${list_post} TimeSeriesFrequency" 175 40 fi 176 41 # … … 178 43 list_post="${list_post} SeasonalFrequency" 179 44 fi 180 # 181 # READ TIME SERIES OR SEASONAL FREQUENCY 45 46 # Overrule special cases 47 if ( [ ! X${config_Post_TimeSeriesFrequency} = X${NULL_STR} ] && \ 48 [ ! X${config_Post_TimeSeriesFrequency} = XNONE ] && \ 49 [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ) ; then 50 TimeSeriesFrequency=true 51 POST=true 52 fi 53 # 54 if ( [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] && \ 55 [ ! X${config_Post_RebuildFrequency} = XNONE ] && \ 56 [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ) ; then 57 RebuildFrequency=true 58 POST=true 59 fi 60 61 # READ REBUILD OR TIME SERIES OR SEASONAL FREQUENCY 182 62 # AND TURN ON THE SUBMISSION FLAG WHEN MODULO IS ZERO 183 #184 63 for post_freq in ${list_post} ; do 185 #186 64 # Extract frequency from previously defined variable 187 #188 65 config_Post_post_freq=$( eval echo \${config_Post_${post_freq}} ) 189 #190 66 # Offset for Seasonal Average starting period 191 #192 67 if [ ${post_freq} = SeasonalFrequency ] ; then 193 68 if ( [ X${config_Post_SeasonalFrequencyOffset} = X${NULL_STR} ] || [ X${config_Post_SeasonalFrequencyOffset} = XNONE ] || [ X${config_Post_SeasonalFrequencyOffset} = X ] ) ; then … … 199 74 PeriodOffset=0 200 75 fi 201 # 202 if ( [ X${config_Post_post_freq} = X${NULL_STR} ] || [ X${config_Post_post_freq} = XNONE ] ) ; then 203 # 204 continue 205 # 206 fi 207 # 208 case ${config_Post_post_freq} in 209 *y|*Y) 210 PeriodYear=$( echo ${config_Post_post_freq} | sed -e "s/[yY]//" ) 211 # 212 case ${config_UserChoices_PeriodLength} in 213 *Y|*y) 214 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[yY]//" ) 215 if [ ${PeriodPost} -le ${PeriodYear} ] ; then 216 if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) % ${PeriodYear} ) -eq 0 ] ; then 217 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && eval ${post_freq}=true 218 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && POST=true 219 fi 220 else 221 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 222 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 223 fi ;; 224 *M|*m) 225 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[mM]//" ) 226 if [ ${PeriodPost} -le $(( ${PeriodYear} * 12 )) ] ; then 227 if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} * 12 )) % $(( ${PeriodYear} * 12 )) ) -eq 0 ] ; then 228 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} * 12 )) -ne 0 ] && eval ${post_freq}=true 229 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} * 12 )) -ne 0 ] && POST=true 230 fi 231 else 232 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 233 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 234 fi ;; 235 *D|*d) 236 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" ) 237 NbDays=$( IGCM_date_DaysInYear ${year} ) 238 if [ ${config_UserChoices_CalendarType} = 360d ] | [ ${config_UserChoices_CalendarType} = noleap ] ; then 239 if [ ${PeriodPost} -le $(( ${PeriodYear} * ${NbDays} )) ] ; then 240 if [ $( expr $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodPost} ) )) % \ 241 $(( ${NbDays} * ${PeriodYear} / ${PeriodPost} )) ) -eq 0 ] ; then 242 [ $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodPost} ) )) -ne 0 ] && eval ${post_freq}=true 243 [ $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodPost} ) )) -ne 0 ] POST=true 244 fi 245 else 246 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 247 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 248 fi 249 else 250 # if [ ${PeriodYear} -eq 1 ] ; then 251 # PeriodEndJul=$( IGCM_date_ConvertGregorianDateToJulian ${PeriodDateEnd} ) 252 # PostEndJul=${year}${NbDays} 253 # #echo "PeriodYear=${PeriodYear} NbDays=${NbDays}" 254 # #echo PeriodEndJul=${PeriodEndJul} PostEndJul=${PostEndJul}" 255 # if [ ${PostEndJul} -le ${PeriodEndJul} ] ; then 256 # eval ${post_freq}=true 257 # POST=true 258 # fi 259 # else 260 IGCM_debug_Print 3 "For ${post_freq} with leap calendar, for ${comp} and ${file_in} :" 261 IGCM_debug_Print 3 "We have a daily PeriodLength frequency and RebuildFrequency=${PeriodYear}Y." 262 IGCM_debug_Print 3 "No post-treatment. Case not properly handle at this moment." 263 # fi 264 fi;; 265 esac ;; 266 *M|*m) 267 PeriodMonth=$( echo ${config_Post_post_freq} | sed -e "s/[mM]//" ) 268 case ${config_UserChoices_PeriodLength} in 269 *Y|*y) 270 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 271 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 272 *M|*m) 273 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[mM]//" ) 274 if [ ${PeriodPost} -le ${PeriodMonth} ] ; then 275 if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) % ${PeriodMonth} ) -eq 0 ] ; then 276 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && eval ${post_freq}=true 277 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && POST=true 278 fi 279 else 280 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 281 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 282 fi;; 283 *D|*d) 284 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 285 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 286 esac ;; 287 *D|*d) 288 PeriodDay=$( echo ${config_Post_post_freq} | sed -e "s/[dD]//" ) 289 case ${config_UserChoices_PeriodLength} in 290 *Y|*y) 291 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 292 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 293 *M|*m) 294 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 295 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 296 *D|*d) 297 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" ) 298 if [ ${PeriodPost} -le ${PeriodDay} ] ; then 299 if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) % ${PeriodDay} ) -eq 0 ] ; then 300 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && eval ${post_freq}=true 301 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && POST=true 302 fi 303 else 304 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 305 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 306 fi;; 307 esac ;; 308 NONE|none) 309 ;; 310 *) 311 IGCM_debug_Print 3 "KeyWord not allowed for ${post_freq} in config.card" 312 ;; 313 esac 76 # Compute Modulo between frequencys (/!\second argument will be multiplied by CumuPeriod/!\) 77 # RebuildFrequency needs additionnal information 78 if [ ${post_freq} = RebuildFrequency ] ; then 79 IGCM_post_ModuloRuntimeFrequency config_Post_post_freq config_UserChoices_PeriodLength NbRebuildDir 80 else 81 IGCM_post_ModuloRuntimeFrequency config_Post_post_freq config_UserChoices_PeriodLength 82 fi 83 # 84 IGCM_debug_Print 1 "${post_freq} flag value : ${RebuildFrequency}" 314 85 done 315 86 # 316 if ( [ ! X${config_Post_TimeSeriesFrequency} = X${NULL_STR} ] && \ 317 [ ! X${config_Post_TimeSeriesFrequency} = XNONE ] && \ 318 [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ) ; then 319 TimeSeriesFrequency=true 320 POST=true 321 fi 322 323 if ( [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] && \ 324 [ ! X${config_Post_RebuildFrequency} = XNONE ] && \ 325 [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ) ; then 326 RebuildFrequency=true 327 POST=true 328 fi 329 330 # 87 echo 331 88 IGCM_debug_Print 1 "POST-TREATEMENT flag value : ${POST}" 332 89 # 333 IGCM_post_Submit 334 335 IGCM_debug_PopStack "IGCM_post_Initialize" 90 IGCM_debug_PopStack "IGCM_post_Configure" 336 91 } 337 92 … … 365 120 366 121 typeset listVarEnv 367 listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,POST_DIR,MASTER,RebuildFrequency,DateBegin,PeriodDateEnd,StandAlone,CompletedFlag,TsTask,CompToRead,FlagToRead,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_SBG ,config_UserChoices_JobName,R_SAVE"122 listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,POST_DIR,MASTER,RebuildFrequency,DateBegin,PeriodDateEnd,StandAlone,CompletedFlag,TsTask,CompToRead,FlagToRead,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_SBG" 368 123 # 369 124 jLoop=${#ListDimension[*]} … … 405 160 echo "export RESOL_SRF=${RESOL_SRF} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh 406 161 echo "export RESOL_SBG=${RESOL_SBG} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh 407 echo "export config_UserChoices_JobName=${config_UserChoices_JobName} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh408 echo "export R_SAVE=${R_SAVE} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh409 162 echo "export listVarEnv=${listVarEnv} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh 410 163 echo "IGCM_sys_MkdirWork ${POST_DIR} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh … … 435 188 export RESOL_SRF=${RESOL_SRF} 436 189 export RESOL_SBG=${RESOL_SBG} 437 export config_UserChoices_JobName=${config_UserChoices_JobName}438 export R_SAVE=${R_SAVE}439 190 export listVarEnv=${listVarEnv} 440 191 . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh … … 502 253 echo "export RESOL_SRF=${RESOL_SRF} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh 503 254 echo "export RESOL_SBG=${RESOL_SBG} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh 504 echo "export config_UserChoices_JobName=${config_UserChoices_JobName} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh505 echo "export R_SAVE=${R_SAVE} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh506 255 echo "export listVarEnv=${listVarEnv} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh 507 256 echo "IGCM_sys_MkdirWork ${POST_DIR} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh … … 534 283 export RESOL_SRF=${RESOL_SRF} 535 284 export RESOL_SBG=${RESOL_SBG} 536 export config_UserChoices_JobName=${config_UserChoices_JobName}537 export R_SAVE=${R_SAVE}538 285 export listVarEnv=${listVarEnv} 539 286 . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh … … 563 310 # 564 311 typeset listVarEnv 565 listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,POST_DIR,MASTER,RebuildFrequency,DateBegin,PeriodDateEnd,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_SBG ,config_UserChoices_JobName,R_SAVE"312 listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,POST_DIR,MASTER,RebuildFrequency,DateBegin,PeriodDateEnd,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_SBG" 566 313 567 314 if [ ${RebuildFrequency} = true ] && [ ${DRYRUN} -le 1 ] ; then … … 584 331 echo "export RESOL_SRF=${RESOL_SRF} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh 585 332 echo "export RESOL_SBG=${RESOL_SBG} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh 586 echo "export config_UserChoices_JobName=${config_UserChoices_JobName} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh587 echo "export R_SAVE=${R_SAVE} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh588 333 echo "export listVarEnv=${listVarEnv} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh 589 334 echo "IGCM_sys_MkdirWork ${POST_DIR} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh … … 611 356 export RESOL_SRF=${RESOL_SRF} 612 357 export RESOL_SBG=${RESOL_SBG} 613 export config_UserChoices_JobName=${config_UserChoices_JobName}614 export R_SAVE=${R_SAVE}615 358 export listVarEnv=${listVarEnv} 616 359 . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh … … 648 391 # 649 392 typeset listVarEnv 650 listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,POST_DIR,MASTER,RebuildFromArchive,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_SBG ,config_UserChoices_JobName,R_SAVE"393 listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,POST_DIR,MASTER,RebuildFromArchive,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_SBG" 651 394 IGCM_sys_RshPost <<-EOF 652 395 export DEBUG_debug=${DEBUG_debug} … … 670 413 export RESOL_SRF=${RESOL_SRF} 671 414 export RESOL_SBG=${RESOL_SBG} 672 export config_UserChoices_JobName=${config_UserChoices_JobName}673 export R_SAVE=${R_SAVE}674 415 export listVarEnv=${listVarEnv} 675 416 . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh … … 685 426 # 686 427 typeset listVarEnv 687 listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,POST_DIR,MASTER,RebuildFromArchive,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_SBG ,config_UserChoices_JobName,R_SAVE"428 listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,POST_DIR,MASTER,RebuildFromArchive,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_SBG" 688 429 IGCM_sys_RshPost <<-EOF 689 430 export DEBUG_debug=${DEBUG_debug} … … 707 448 export RESOL_SRF=${RESOL_SRF} 708 449 export RESOL_SBG=${RESOL_SBG} 709 export config_UserChoices_JobName=${config_UserChoices_JobName}710 export R_SAVE=${R_SAVE}711 450 export listVarEnv=${listVarEnv} 712 451 . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh … … 721 460 IGCM_debug_PopStack "IGCM_post_Submit" 722 461 } 462 463 #=================================== 464 function IGCM_post_CheckModuloFrequency 465 { 466 IGCM_debug_PushStack "IGCM_post_CheckModuloFrequency" $* 467 468 set -vx 469 470 # Used by IGCM_config_Check 471 # from 2 libIGCM compatible frequency (*Y, *M, *D, *y, *m, *d) 472 # Issue an exit instruction IGCM_debug_Exit if there modulo is not zero 473 # Input parameter are the name of the variable, not the frequency value itself 474 # example 475 # IGCM_post_ModuloFrequency config_Post_RebuildFrequency config_UserChoices_PeriodLength 476 477 typeset MasterName SlaveName MasterFrequency SlaveFrequency PeriodMasterYear PeriodMasterMonth PeriodMasterDay PeriodSlaveYear PeriodSlaveMonth PeriodSlaveDay 478 479 # Get the name of the variable 480 MasterName=$1 481 SlaveName=$2 482 # Get the value the above name points to 483 MasterFrequency=$( eval echo \${${1}} ) 484 SlaveFrequency=$( eval echo \${${2}} ) 485 486 echo 487 IGCM_debug_Print 1 "IGCM_post_CheckModuloFrequency : Master=${MasterFrequency} Slave=${SlaveFrequency}" 488 echo 489 490 case ${MasterFrequency} in 491 *y|*Y) 492 PeriodMasterYear=$( echo ${MasterFrequency} | sed -e "s/[yY]//" ) 493 case ${SlaveFrequency} in 494 *Y|*y) 495 PeriodSlaveYear=$( echo ${SlaveFrequency} | sed -e "s/[yY]//" ) 496 if ( [ ${PeriodSlaveYear} -gt ${PeriodMasterYear} ] || \ 497 [ $(( ${PeriodMasterYear} % ${PeriodSlaveYear} )) -ne 0 ] ); then 498 IGCM_debug_Print 3 "${SlaveName} frequency ${SlaveFrequency} not compatbile with" 499 IGCM_debug_Print 3 "${MasterName} frequency : ${MasterFrequency}" 500 IGCM_debug_Exit "Check your frequency" 501 fi ;; 502 *M|*m) 503 PeriodSlaveMonth=$( echo ${SlaveFrequency} | sed -e "s/[mM]//" ) 504 if ( [ ${PeriodSlaveMonth} -gt $(( ${PeriodMasterYear} * 12 )) ] || \ 505 [ $(( ( ${PeriodMasterYear} * 12 ) % ${PeriodSlaveMonth} )) -ne 0 ] ) ; then 506 IGCM_debug_Print 3 "${SlaveName} frequency ${SlaveFrequency} not compatbile with" 507 IGCM_debug_Print 3 "${MasterName} frequency : ${MasterFrequency}" 508 IGCM_debug_Exit "Check your frequency" 509 fi ;; 510 *D|*d) 511 PeriodSlaveDay=$( echo ${SlaveFrequency} | sed -e "s/[dD]//" ) 512 NbDays=$( IGCM_date_DaysInYear ${year} ) 513 if [ ${config_UserChoices_CalendarType} = 360d ] || [ ${config_UserChoices_CalendarType} = noleap ] ; then 514 if ( [ ${PeriodSlaveDay} -gt $(( ${PeriodMasterYear} * ${NbDays} )) ] || \ 515 [ $(( ( ${PeriodMasterYear} * ${NbDays} ) % ${PeriodSlaveDay} )) -ne 0 ] ; ) then 516 IGCM_debug_Print 3 "${SlaveName} frequency ${SlaveFrequency} not compatbile with" 517 IGCM_debug_Print 3 "${MasterName} frequency : ${MasterFrequency}" 518 IGCM_debug_Exit "Check your frequency" 519 fi 520 else 521 IGCM_debug_Print 3 "For ${MasterName} with leap calendar:" 522 IGCM_debug_Print 3 "We have a daily ${SlaveName} frequency and ${MasterName}=${MasterFrequency}" 523 IGCM_debug_Print 3 "No post-treatment. Case not properly handle at this moment." 524 IGCM_debug_Exit "Check your frequency" 525 fi ;; 526 esac ;; 527 *M|*m) 528 PeriodMasterMonth=$( echo ${MasterFrequency} | sed -e "s/[mM]//" ) 529 case ${SlaveFrequency} in 530 *Y|*y) 531 PeriodSlaveYear=$( echo ${SlaveFrequency} | sed -e "s/[yY]//" ) 532 if ( [ ${PeriodMasterMonth} -gt $(( ${PeriodSlaveYear} * 12 )) ] || \ 533 [ $(( ${PeriodMasterMonth} % ( ${PeriodSlaveYear} * 12 ) )) -ne 0 ] ) ; then 534 IGCM_debug_Print 3 "${SlaveName} frequency ${SlaveFrequency} not compatbile with" 535 IGCM_debug_Print 3 "${MasterName} frequency : ${MasterFrequency}" 536 IGCM_debug_Exit "Check your frequency" 537 fi ;; 538 *M|*m) 539 PeriodSlaveMonth=$( echo ${SlaveFrequency} | sed -e "s/[mM]//" ) 540 if ( [ ${PeriodSlaveMonth} -gt ${PeriodMasterMonth} ] || \ 541 [ $(( ${PeriodMasterMonth} % ${PeriodSlaveMonth} )) -ne 0 ] ) ; then 542 IGCM_debug_Print 3 "${SlaveName} frequency ${SlaveFrequency} not compatbile with" 543 IGCM_debug_Print 3 "${MasterName} frequency : ${MasterFrequency}" 544 IGCM_debug_Exit "Check your frequency" 545 fi ;; 546 *D|*d) 547 IGCM_debug_Print 3 "${SlaveName} frequency ${SlaveFrequency} not compatbile with" 548 IGCM_debug_Print 3 "${MasterName} frequency : ${MasterFrequency}" 549 IGCM_debug_Exit "Check your frequency" ;; 550 esac ;; 551 *D|*d) 552 PeriodMasterDay=$( echo ${MasterFrequency} | sed -e "s/[dD]//" ) 553 case ${SlaveFrequency} in 554 *Y|*y) 555 IGCM_debug_Print 3 "${SlaveName} frequency ${SlaveFrequency} not compatbile with" 556 IGCM_debug_Print 3 "${MasterName} frequency ${MasterFrequency}" 557 IGCM_debug_Exit "Check your frequency" ;; 558 *M|*m) 559 IGCM_debug_Print 3 "${SlaveName} frequency ${SlaveFrequency} not compatbile with" 560 IGCM_debug_Print 3 "${MasterName} frequency ${MasterFrequency}" 561 IGCM_debug_Exit "Check your frequency" ;; 562 *D|*d) 563 PeriodSlaveDay=$( echo ${SlaveFrequency} | sed -e "s/[dD]//" ) 564 if ( [ ${PeriodSlaveDay} -gt ${PeriodMasterDay} ] || \ 565 [ $(( ${PeriodMasterDay} % ${PeriodSlaveDay} )) -ne 0 ] ) ; then 566 IGCM_debug_Print 3 "${SlaveName} frequency ${SlaveFrequency} not compatbile with" 567 IGCM_debug_Print 3 "${MasterName} frequency : ${MasterFrequency}" 568 IGCM_debug_Exit "Check your frequency" 569 fi ;; 570 esac ;; 571 NONE|none) 572 ;; 573 *) 574 IGCM_debug_Print 3 "KeyWord ${MasterFrequency} not allowed for ${MasterName} in config.card" 575 IGCM_debug_Exit "Check your ${MasterName} in config.card" ;; 576 esac 577 578 IGCM_debug_PopStack "IGCM_post_CheckModuloFrequency" 579 } 580 581 #=================================== 582 function IGCM_post_ModuloRuntimeFrequency 583 { 584 IGCM_debug_PushStack "IGCM_post_ModuloRuntimeFrequency" $* 585 586 set -vx 587 588 # Used by IGCM_post_Configure 589 # - from libIGCM (config_UserChoices_PeriodLength frequency * CumulPeriod) and 590 # - post-processing compatible frequency (*Y, *M, *D, *y, *m, *d) 591 # --> turn on post-processing submission when their modulo is zero 592 # Input parameter are the name of the variable, not the frequency value itself 593 # example 594 # IGCM_post_ModuloRuntimeFrequency config_Post_SeasonalFrequency config_UserChoices_PeriodLength 595 596 typeset MasterName SlaveName MasterFrequency SlaveFrequency PeriodMasterYear PeriodMasterMonth PeriodMasterDay PeriodSlaveYear PeriodSlaveMonth PeriodSlaveDay 597 598 # Get the name of the variable 599 MasterName=$1 600 SlaveName=$2 601 602 # Get the value the above name points to 603 eval MasterFrequency=\${${1}} 604 eval SlaveFrequency=\${${2}} 605 606 echo 607 IGCM_debug_Print 1 "IGCM_post_ModuloRuntimeFrequency : Master=${MasterFrequency} Slave=${SlaveFrequency} CumulPeriod=${CumulPeriod}" 608 echo 609 610 case ${MasterFrequency} in 611 *y|*Y) 612 PeriodMasterYear=$( echo ${MasterFrequency} | sed -e "s/[yY]//" ) 613 case ${SlaveFrequency} in 614 *Y|*y) 615 PeriodSlaveYear=$( echo ${SlaveFrequency} | sed -e "s/[yY]//" ) 616 if [ $(( ( ${CumulPeriod} * ${PeriodSlaveYear} - ${PeriodOffset} ) % ${PeriodMasterYear} )) -eq 0 ] ; then 617 if [ $(( ${CumulPeriod} * ${PeriodSlaveYear} - ${PeriodOffset} )) -ne 0 ] ; then 618 eval ${post_freq}=true ; POST=true 619 [ X${3} = XNbRebuildDir ] && NbRebuildDir=$(( ${PeriodMasterYear} / ${PeriodSlaveYear} )) 620 fi 621 fi;; 622 *M|*m) 623 PeriodSlaveMonth=$( echo ${SlaveFrequency} | sed -e "s/[mM]//" ) 624 if [ $(( ( ${CumulPeriod} * ${PeriodSlaveMonth} - ${PeriodOffset} * 12 ) % ( ${PeriodMasterYear} * 12 ) )) -eq 0 ] ; then 625 if [ $(( ${CumulPeriod} * ${PeriodSlaveMonth} - ${PeriodOffset} * 12 )) -ne 0 ] ; then 626 eval ${post_freq}=true ; POST=true 627 [ X${3} = XNbRebuildDir ] && NbRebuildDir=$(( ( 12 * ${PeriodMasterYear} ) / ${PeriodSlaveMonth} )) 628 fi 629 fi;; 630 *D|*d) 631 PeriodSlaveDay=$( echo ${SlaveFrequency} | sed -e "s/[dD]//" ) 632 NbDays=$( IGCM_date_DaysInYear ${year} ) 633 if [ $(( ( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodSlaveDay} ) ) % ( ${NbDays} * ${PeriodMasterYear} / ${PeriodSlaveDay} ) )) -eq 0 ] ; then 634 if [ $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodSlaveDay} ) )) -ne 0 ] ; then 635 eval ${post_freq}=true ; POST=true 636 [ X${3} = XNbRebuildDir ] && NbRebuildDir=$(( ( ${NbDays} * ${PeriodMasterYear} ) / ${PeriodSlaveDay} )) 637 fi 638 fi;; 639 esac ;; 640 *M|*m) 641 PeriodMasterMonth=$( echo ${MasterFrequency} | sed -e "s/[mM]//" ) 642 case ${SlaveFrequency} in 643 *Y|*y) 644 PeriodSlaveYear=$( echo ${SlaveFrequency} | sed -e "s/[yY]//" ) 645 if [ $(( ( ${CumulPeriod} * ${PeriodSlaveYear} * 12 - ${PeriodOffset} ) % ( ${PeriodMasterMonth} ) )) -eq 0 ] ; then 646 if [ $(( ${CumulPeriod} * ${PeriodSlaveYear} * 12 - ${PeriodOffset} )) -ne 0 ] ; then 647 eval ${post_freq}=true ; POST=true 648 [ X${3} = XNbRebuildDir ] && NbRebuildDir=$(( ${PeriodMasterMonth} / ( 12 * ${PeriodSlaveYear} ) )) 649 fi 650 fi;; 651 *M|*m) 652 PeriodSlaveMonth=$( echo ${SlaveFrequency} | sed -e "s/[mM]//" ) 653 if [ $(( ( ${CumulPeriod} * ${PeriodSlaveMonth} - ${PeriodOffset} ) % ${PeriodMasterMonth} )) -eq 0 ] ; then 654 if [ $(( ${CumulPeriod} * ${PeriodSlaveMonth} - ${PeriodOffset} )) -ne 0 ] ; then 655 eval ${post_freq}=true ; POST=true 656 [ X${3} = XNbRebuildDir ] && NbRebuildDir=$(( ${PeriodMasterMonth} / ${PeriodSlaveMonth} )) 657 fi 658 fi;; 659 *D|*d) 660 IGCM_debug_Print 3 "PeriodLength frequency ${SlaveFrequency} not compatbile with" 661 IGCM_debug_Print 3 "${flag_post} frequency : ${MasterFrequency} " ;; 662 esac ;; 663 *D|*d) 664 PeriodMasterDay=$( echo ${MasterFrequency} | sed -e "s/[dD]//" ) 665 case ${SlaveFrequency} in 666 *Y|*y) 667 IGCM_debug_Print 3 "PeriodLength frequency ${SlaveFrequency} not compatbile with" 668 IGCM_debug_Print 3 "${flag_post} frequency : ${MasterFrequency} " ;; 669 *M|*m) 670 IGCM_debug_Print 3 "PeriodLength frequency ${SlaveFrequency} not compatbile with" 671 IGCM_debug_Print 3 "${flag_post} frequency : ${MasterFrequency} " ;; 672 *D|*d) 673 PeriodSlaveDay=$( echo ${SlaveFrequency} | sed -e "s/[dD]//" ) 674 if [ $(( ( ${CumulPeriod} * ${PeriodSlaveDay} - ${PeriodOffset} ) % ${PeriodMasterDay} )) -eq 0 ] ; then 675 if [ $(( ${CumulPeriod} * ${PeriodSlaveDay} - ${PeriodOffset} )) -ne 0 ] ; then 676 eval ${post_freq}=true ; POST=true 677 [ X${3} = XNbRebuildDir ] && NbRebuildDir=$(( ${PeriodMasterDay} / ${PeriodSlaveDay} )) 678 fi 679 fi;; 680 esac ;; 681 NONE|none) 682 ;; 683 *) 684 IGCM_debug_Print 3 "KeyWord not allowed for ${post_freq} in config.card" 685 ;; 686 esac 687 688 IGCM_debug_PopStack "IGCM_post_ModuloRuntimeFrequency" 689 } -
trunk/libIGCM/libIGCM_sys/libIGCM_sys.ksh
r373 r380 49 49 . ${libIGCM}/libIGCM_sys/libIGCM_sys_ulam.ksh;; 50 50 51 mercure)52 echo "sys source mercure frontend TX7 IA-64 lib."53 . ${libIGCM}/libIGCM_sys/libIGCM_sys_mercureTX.ksh;;54 55 51 mercure0?) 56 52 echo "sys source mercure frontend X-64 lib." … … 77 73 . ${libIGCM}/libIGCM_sys/libIGCM_sys_cesium.ksh;; 78 74 79 claude|nougaro|ghio|grebil|robin)80 echo "sys source LMD lib."81 . ${libIGCM}/libIGCM_sys/libIGCM_sys_claude.ksh;;82 83 calculo)84 echo "sys source calculo lib."85 . ${libIGCM}/libIGCM_sys/libIGCM_sys_calculo.ksh;;86 87 75 obelix*) 88 76 echo "sys source obelix lib."
Note: See TracChangeset
for help on using the changeset viewer.