Changeset 457 for trunk/libIGCM/libIGCM_config
- Timestamp:
- 04/13/11 10:32:33 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_config/libIGCM_config.ksh
r455 r457 19 19 # Debug Print : 20 20 echo 21 IGCM_debug_Print 1 "IGCM_config_Initialize :" 22 echo 21 IGCM_debug_Print 1 "IGCM_config_Initialize" 23 22 24 23 if [ ! -r ${SUBMIT_DIR}/run.card ]; then … … 65 64 IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card UserChoices ${option} 66 65 done 67 66 echo 68 67 IGCM_debug_Print 1 "DefineArrayFromOption : config_UserChoices" 69 68 # Name Space of this experience … … 93 92 IGCM_debug_Print 1 "DefineArrayFromSection : ListOfComponents" 94 93 IGCM_debug_Print 3 ${config_ListOfComponents[*]} 95 echo96 94 97 95 NbComponents=${#config_ListOfComponents[*]} … … 105 103 #================================== 106 104 # Define Outputs Name 107 IGCM_debug_Print 1"Define Script_Output_Prefix and Exe_Output"105 IGCM_debug_Print 2 "Define Script_Output_Prefix and Exe_Output" 108 106 eval Script_Output_Prefix=${config_UserChoices_Script_Output_Prefix:='Script_Output'} 109 107 IGCM_debug_Print 3 "Script_Output_Prefix = ${Script_Output_Prefix}" … … 160 158 # and PeriodNb through config.card 161 159 R_INIT=${config_UserChoices_R_INIT:=${R_IN}/INIT} 162 echo 163 IGCM_debug_Print 1 "(Re)Define R_INIT, R_BC and PeriodNb" 160 IGCM_debug_Print 2 "(Re)Define R_INIT, R_BC and PeriodNb" 164 161 IGCM_debug_Print 3 "R_INIT=${R_INIT}" 165 162 R_BC=${config_UserChoices_R_BC:=${R_IN}/BC} … … 188 185 IGCM_sys_MkdirArchive ${R_SAVE} 189 186 else 187 IGCM_sys_TestDirArchive ${R_SAVE} 188 [ $? != 0 ] && IGCM_debug_Exit "IGCM_sys_TestDirArchive" 190 189 #Test state of run in run.card 191 190 IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration PeriodState 191 192 192 if ( [ ${run_Configuration_PeriodState} != "Start" ] && [ ${run_Configuration_PeriodState} != "Running" ] && [ ${run_Configuration_PeriodState} != "OnQueue" ] && [ ${run_Configuration_PeriodState} != "Continue" ] ) ; then 193 193 echo 194 IGCM_debug_Print 1 "!! !! IGCM_config_Initialize Error PeriodState : " ${run_Configuration_PeriodState} "!!!!!!!!!!"195 echo196 IGCM_debug_Exit "IGCM_config_Initialize Error PeriodState : " ${run_Configuration_PeriodState}194 IGCM_debug_Print 1 "!! Error in run.card with PeriodState : " ${run_Configuration_PeriodState} "!!" 195 IGCM_debug_Print 1 "Try running ${libIGCM}/clean_month.job to fix this" 196 IGCM_debug_Exit 197 197 IGCM_debug_Verif_Exit 198 198 fi 199 199 fi 200 IGCM_sys_TestDirArchive ${R_SAVE}201 [ $? != 0 ] && IGCM_debug_Exit "IGCM_sys_TestDirArchive"202 200 203 201 #================================== … … 278 276 *Y|*y) 279 277 PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | sed -e 's/[yY]//' ) 280 IGCM_debug_Print 1"Number of years for PeriodLength : ${PeriodLengthInYears}"278 IGCM_debug_Print 2 "Number of years for PeriodLength : ${PeriodLengthInYears}" 281 279 PeriodLengthInDays=0 282 280 i=0 … … 288 286 *M|*m) 289 287 PeriodLengthInMonths=$( echo ${config_UserChoices_PeriodLength} | sed -e 's/[mM]//' ) 290 IGCM_debug_Print 1"Number of months for PeriodLength : ${PeriodLengthInMonths}"288 IGCM_debug_Print 2 "Number of months for PeriodLength : ${PeriodLengthInMonths}" 291 289 PeriodLengthInDays=0 292 290 i=0 … … 321 319 322 320 echo 323 IGCM_debug_Print 1 "IGCM_config_Check :"321 IGCM_debug_Print 1 "IGCM_config_Check" 324 322 echo 325 323 … … 331 329 echo 332 330 # modulo (RebuildFrequency and PeriodLength/TimeSeriesFrequency/SeasonalFrequency) must be zero 333 IGCM_debug_Print 1 "C oherence between RebuildFrequency and PeriodLength:"331 IGCM_debug_Print 1 "Check coherence between RebuildFrequency and PeriodLength" 334 332 IGCM_post_CheckModuloFrequency config_Post_RebuildFrequency config_UserChoices_PeriodLength 335 IGCM_debug_Print 1 "C oherence between TimeSeriesFrequency and RebuildFrequency:"333 IGCM_debug_Print 1 "Check coherence between TimeSeriesFrequency and RebuildFrequency" 336 334 IGCM_post_CheckModuloFrequency config_Post_TimeSeriesFrequency config_Post_RebuildFrequency 337 IGCM_debug_Print 1 "C oherence between SeasonalFrequency and RebuildFrequency:"335 IGCM_debug_Print 1 "Check coherence between SeasonalFrequency and RebuildFrequency" 338 336 IGCM_post_CheckModuloFrequency config_Post_SeasonalFrequency config_Post_RebuildFrequency 339 337 else … … 343 341 echo 344 342 #modulo (TimeSeriesFrequency/SeasonalFrequency and PeriodLenght) must be zero 345 IGCM_debug_Print 1 "C oherence between TimeSeriesFrequency and PeriodLength:"343 IGCM_debug_Print 1 "Check coherence between TimeSeriesFrequency and PeriodLength" 346 344 IGCM_post_CheckModuloFrequency config_Post_TimeSeriesFrequency config_UserChoices_PeriodLength 347 IGCM_debug_Print 1 "C oherence between SeasonalFrequency and PeriodLength:"345 IGCM_debug_Print 1 "Check coherence between SeasonalFrequency and PeriodLength" 348 346 IGCM_post_CheckModuloFrequency config_Post_SeasonalFrequency config_UserChoices_PeriodLength 349 347 fi … … 354 352 until [ $i -ge $NbJob ]; do 355 353 value=${CHUNCK2D_SIZE[${i}]} 356 IGCM_debug_Print 1 "C oherence between All Chunck2D frequency and TimeSeriesFrequency:"354 IGCM_debug_Print 1 "Check coherence between All Chunck2D frequency and TimeSeriesFrequency" 357 355 IGCM_post_CheckModuloFrequency value config_Post_TimeSeriesFrequency 358 356 case ${value} in 359 357 *Y|*y) ;; 360 *) IGCM_debug_Print 3"All ChunckJob2D frequency must be expressed in year *Y|*y in comp.card"358 *) IGCM_debug_Print 1 "All ChunckJob2D frequency must be expressed in year *Y|*y in comp.card" 361 359 IGCM_debug_Exit "This will stop the job" ;; 362 360 esac … … 369 367 until [ $i -ge $NbJob ]; do 370 368 value=${CHUNCK3D_SIZE[${i}]} 371 IGCM_debug_Print 1 "C oherence between All Chunck3D frequency and TimeSeriesFrequency:"369 IGCM_debug_Print 1 "Check coherence between All Chunck3D frequency and TimeSeriesFrequency" 372 370 IGCM_post_CheckModuloFrequency value config_Post_TimeSeriesFrequency 373 371 case ${value} in 374 372 *Y|*y) ;; 375 *) IGCM_debug_Print 3"All ChunckJob3D frequency must be expressed in year *Y|*y in comp.card"373 *) IGCM_debug_Print 1 "All ChunckJob3D frequency must be expressed in year *Y|*y in comp.card" 376 374 IGCM_debug_Exit "This will stop the job" ;; 377 375 esac … … 388 386 389 387 echo 390 IGCM_debug_Print 1 "IGCM_config_PeriodStart :"388 IGCM_debug_Print 1 "IGCM_config_PeriodStart" 391 389 echo 392 390 … … 426 424 if ( [ ${run_Configuration_PeriodState} != "Running" ] && [ ${run_Configuration_PeriodState} != "OnQueue" ] && [ ${run_Configuration_PeriodState} != "Continue" ] ) ; then 427 425 echo 428 IGCM_debug_Print 1 "!!!!!! IGCM_config_PeriodStart Error PeriodState : " ${run_Configuration_PeriodState} "!!!!!!!!!!" 429 echo 430 IGCM_debug_Exit "IGCM_config_PeriodStart Error PeriodState : " ${run_Configuration_PeriodState} 426 IGCM_debug_Print 1 "!! Error in run.card with PeriodState : " ${run_Configuration_PeriodState} "!!" 427 IGCM_debug_Print 1 "Try running ${libIGCM}/clean_month.job to fix this" 428 echo 429 IGCM_debug_Exit 431 430 IGCM_debug_Verif_Exit 432 431 fi … … 454 453 #eval ls -l ${SUBMIT_DIR}/${Last_Script_Output_Name} 455 454 #eval IGCM_sys_Put_Out ${SUBMIT_DIR}/${Last_Script_Output_Name} ${R_OUT_KSH}/${Last_Script_Output_Name} > /dev/null 2>&1 456 IGCM_debug_Print 1"Try to save previous ksh job output"455 IGCM_debug_Print 2 "Try to save previous ksh job output" 457 456 IGCM_sys_Cd ${SUBMIT_DIR}/ 458 457 IGCM_sys_Put_Out ${Last_Script_Output_Name} ${R_OUT_KSH}/${Last_Script_Output_Name}.$$ rw … … 483 482 # Debug Print : 484 483 IGCM_debug_Print 1 "IGCM_config_PeriodStart : Before Execution" 485 IGCM_debug_Print 3"Year of simulation : ${year}"486 IGCM_debug_Print 3"Month of simulation : ${month}"487 IGCM_debug_Print 3"PeriodLengthInDays : ${PeriodLengthInDays}"488 IGCM_debug_Print 3"PeriodDateBegin : ${PeriodDateBegin}"489 IGCM_debug_Print 3"PeriodDateEnd : ${PeriodDateEnd}"490 IGCM_debug_Print 3"SimulationLengthInDays : ${SimulationLengthInDays}"491 IGCM_debug_Print 3"ExperienceLengthInDays : ${ExperienceLengthInDays}"484 IGCM_debug_Print 1 "Year of simulation : ${year}" 485 IGCM_debug_Print 1 "Month of simulation : ${month}" 486 IGCM_debug_Print 1 "PeriodLengthInDays : ${PeriodLengthInDays}" 487 IGCM_debug_Print 1 "PeriodDateBegin : ${PeriodDateBegin}" 488 IGCM_debug_Print 1 "PeriodDateEnd : ${PeriodDateEnd}" 489 IGCM_debug_Print 1 "SimulationLengthInDays : ${SimulationLengthInDays}" 490 IGCM_debug_Print 1 "ExperienceLengthInDays : ${ExperienceLengthInDays}" 492 491 493 492 #================================================================# … … 518 517 else 519 518 if ( IGCM_sys_TestFileArchive ${R_OUT_KSH}/${PREFIX}_${Exe_Output} ) ; then 520 IGCM_debug_Print 1 "IGCM_config_PeriodStart" "RErun an old job. DEBUG ofDEV mode."519 IGCM_debug_Print 1 "IGCM_config_PeriodStart" "RErun an old job. Allowed in DEBUG or DEV mode." 521 520 fi 522 521 fi … … 531 530 532 531 echo 533 IGCM_debug_Print 1 "IGCM_config_PeriodEnd :"532 IGCM_debug_Print 1 "IGCM_config_PeriodEnd" 534 533 echo 535 534 … … 539 538 IGCM_sys_Put_Out ${Exe_Output} ${R_OUT_KSH}/${PREFIX}_${Exe_Output} 540 539 eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${Exe_Output}" 541 542 540 IGCM_sys_Put_Out ${SUBMIT_DIR}/run.card ${R_OUT_KSH}/run.card rw 543 544 typeset LS_comp LS_bin ExeDate ExeCpuLog ExeSize NextExeSize LastCompExeSize 541 542 IGCM_debug_Print 1 "Check components binary : size and creation date" 543 544 typeset LS_comp LS_bin ExeDate ExeCpuLog NextExeSize LastCompExeSize 545 545 typeset comp i 546 546 typeset ExeNameIn ExeNameOut … … 550 550 #==================================# 551 551 552 if [ ${DRYRUN} -le 1 ] ; then 553 (( i=0 )) 554 if ( ${FirstInitialize} ) ; then 555 run_Log_LastExeSize="" 556 for comp in ${config_ListOfComponents[*]} ; do 557 run_Log_LastExeSize[$i]=0 558 (( i=i+1 )) 559 done 560 else 561 IGCM_card_DefineArrayFromOption ${SUBMIT_DIR}/run.card Log LastExeSize 562 fi 552 (( i=0 )) 553 if ( ${FirstInitialize} ) ; then 554 run_Log_LastExeSize="" 555 for comp in ${config_ListOfComponents[*]} ; do 556 run_Log_LastExeSize[$i]=0 557 (( i=i+1 )) 558 done 559 else 560 IGCM_card_DefineArrayFromOption ${SUBMIT_DIR}/run.card Log LastExeSize 563 561 fi 564 562 #==================================# … … 575 573 for comp in ${config_ListOfComponents[*]} ; do 576 574 577 IGCM_debug_Print 1${comp}575 IGCM_debug_Print 3 ${comp} 578 576 579 577 eval ExeNameIn=\${config_Executable_${comp}[0]} … … 606 604 (( i=i+1 )) 607 605 608 if [ ${DRYRUN} -le 1 ] ; then 609 if [ ${ExeSize} -ne ${LastCompExeSize} ] ; then 610 if ( ${FirstInitialize} ) ; then 611 IGCM_debug_Print 1 "Put first ${ExeNameIn} in ${R_OUT_EXE} !" 612 else 613 IGCM_debug_Print 1 "${ExeNameIn} has changed in ${R_EXE} !" 614 eval FileToBeDeleted[${#FileToBeDeleted[@]}]=${ExeNameOut} 615 fi 616 eval IGCM_sys_Put_Out ${ExeNameOut} ${R_OUT_EXE}/${PREFIX}_${ExeNameIn} rw 606 if [ ${ExeSize} -ne ${LastCompExeSize} ] ; then 607 if ( ${FirstInitialize} ) ; then 608 IGCM_debug_Print 1 "Save first ${ExeNameIn} in ${R_OUT_EXE} !" 609 else 610 IGCM_debug_Print 1 "${ExeNameIn} has changed in ${R_EXE} !" 611 IGCM_debug_Print 1 "Save latest ${ExeNameIn} in ${R_OUT_EXE} !" 612 eval FileToBeDeleted[${#FileToBeDeleted[@]}]=${ExeNameOut} 617 613 fi 614 eval IGCM_sys_Put_Out ${ExeNameOut} ${R_OUT_EXE}/${PREFIX}_${ExeNameIn} rw 618 615 fi 619 616 done 617 618 NextExeSize=${NextExeSize}" )" 619 IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Log LastExeSize "${NextExeSize}" 620 620 621 621 if [ ${DRYRUN} -le 1 ] ; then … … 632 632 fi 633 633 634 NextExeSize=${NextExeSize}" )"635 IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Log LastExeSize "${NextExeSize}"636 637 634 # All was right ? no ? then we stop. 638 635 IGCM_debug_Verif_Exit 639 636 640 637 # If all was OK, we can delete all files not necessary for next Job 638 echo 641 639 IGCM_debug_Print 1 "Files that will be deleted before next period-run : " 642 640 … … 652 650 653 651 # To use this function, one must copy libIGCM.card from ${libIGCM} directory 654 # and put it in ${SUBMIT_DIR} directory. A ter modifications of ${SUBMIT_DIR}/libIGCM.card,652 # and put it in ${SUBMIT_DIR} directory. After modifications of ${SUBMIT_DIR}/libIGCM.card, 655 653 # variables define inside [UserChanges] will be modified for next Period of libIGCM main loop. 656 654 if [ -f ${SUBMIT_DIR}/libIGCM.card ] ; then … … 676 674 case ${option} in 677 675 config_UserChoices_DateEnd) 678 IGCM_debug_PrintVariables 3config_UserChoices_DateEnd676 IGCM_debug_PrintVariables 1 config_UserChoices_DateEnd 679 677 DateEnd=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} ) 680 678 … … 688 686 ;; 689 687 config_UserChoices_PeriodLength) 688 IGCM_debug_Print 1 "Change config_UserChoices_PeriodLength=${config_UserChoices_PeriodLength}" 690 689 ;; 691 690 PeriodNb) 692 IGCM_debug_Print 3"Loop in main Job with ${PeriodNb} period(s)"691 IGCM_debug_Print 1 "Loop in main Job with ${PeriodNb} period(s)" 693 692 ;; 694 693 config_Post_RebuildFrequency) 695 IGCM_debug_Print 3"Change config_Post_RebuildFrequency=${config_Post_RebuildFrequency} : IGCM_post_Configure"694 IGCM_debug_Print 1 "Change config_Post_RebuildFrequency=${config_Post_RebuildFrequency} : IGCM_post_Configure" 696 695 IGCM_post_Configure 697 696 ;; 698 697 config_Post_TimeSeriesFrequency) 699 IGCM_debug_Print 3"Change config_Post_TimeSeriesFrequency = ${config_Post_TimeSeriesFrequency} : IGCM_post_Initialize"698 IGCM_debug_Print 1 "Change config_Post_TimeSeriesFrequency = ${config_Post_TimeSeriesFrequency} : IGCM_post_Initialize" 700 699 IGCM_post_Configure 701 700 ;; 702 701 config_Post_SeasonalFrequency) 703 IGCM_debug_Print 3"Change config_Post_SeasonalFrequency = ${config_Post_SeasonalFrequency} : IGCM_post_Initialize"702 IGCM_debug_Print 1 "Change config_Post_SeasonalFrequency = ${config_Post_SeasonalFrequency} : IGCM_post_Initialize" 704 703 IGCM_post_Configure 705 704 ;; … … 726 725 echo 727 726 IGCM_debug_Print 1 "IGCM_config_PeriodEnd : Preparing Next Execution" 728 IGCM_debug_Print 3"PeriodDateBegin : ${PeriodDateBegin}"729 IGCM_debug_Print 3"PeriodDateEnd : ${PeriodDateEnd}"730 IGCM_debug_Print 3"PeriodLengthInDays : ${PeriodLengthInDays}"727 IGCM_debug_Print 1 "PeriodDateBegin : ${PeriodDateBegin}" 728 IGCM_debug_Print 1 "PeriodDateEnd : ${PeriodDateEnd}" 729 IGCM_debug_Print 1 "PeriodLengthInDays : ${PeriodLengthInDays}" 731 730 732 731 PeriodDateBegin=$( IGCM_date_ConvertFormatToHuman ${PeriodDateBegin} ) … … 764 763 765 764 echo 766 IGCM_debug_Print 1 "IGCM_config_Finalize :"765 IGCM_debug_Print 1 "IGCM_config_Finalize" 767 766 echo 768 767
Note: See TracChangeset
for help on using the changeset viewer.