Changeset 785 for trunk/libIGCM/AA_job


Ignore:
Timestamp:
02/04/13 16:39:38 (11 years ago)
Author:
labetoulle
Message:

Cosmetics :

  • Convert tabs into space for better lisibility with different editors.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/AA_job

    r781 r785  
    291291while ( ${PeriodContinue} ) ; do 
    292292 
    293     echo 
    294     echo "Starting iteration ${Period} / ${PeriodNb}" 
    295  
    296     #D- 
    297     # ------------------------------------------------------------------ 
    298     #D- COMPUTE AND DEFINE DATE STUFF. 
    299     # ------------------------------------------------------------------ 
    300     IGCM_config_PeriodStart 
    301     #D- => ${PeriodDateBegin} 
    302     #D- => ${PeriodDateEnd} 
    303     #D- => ${CumulPeriod} 
    304     #D- => ${DatesPeriod}=${PeriodDateBegin}_${PeriodDateEnd} 
    305     #D- => ${PeriodLength} => JOURS=31 , 28, 29, 30 ; MOIS=0 ; ANS=0 
    306     #D- => update run.card value 
    307      
    308     #D- 
    309     # ------------------------------------------------------------------ 
    310     #D- BEGIN COMPUTATION ONLY IF NEEDED 
    311     # ------------------------------------------------------------------ 
    312     if [ ${SimulationLengthInDays} -gt ${ExperienceLengthInDays} ] ; then 
    313         IGCM_debug_Print 1 "break because '${SimulationLengthInDays} -gt ${ExperienceLengthInDays}' : ${SimulationLengthInDays} -gt ${ExperienceLengthInDays}" 
    314         break ; 
    315     fi  
    316     
    317     #D- 
    318     # ------------------------------------------------------------------ 
    319     #D- Optionnal function in driver  
    320     #D- to set special variables used in forward lists (Param, Init or Bc). 
    321     # ------------------------------------------------------------------ 
    322     IGCM_comp_PeriodStart 
    323      
    324     #D- 
    325     # ------------------------------------------------------------------ 
    326     #D- Get parameters text files updated by job (.def, namelist ...) 
    327     #D- READ AND USE BY GCM AT EACH EXECUTION. 
    328     # ------------------------------------------------------------------ 
    329     IGCM_comp_GetInputParametersFiles 
    330  
    331     #D- 
    332     # ------------------------------------------------------------------ 
    333     #D- Get initial state (Etat0, carteveg,relief...) 
    334     #D- NECESSARY ONLY IF CumulPeriod= (=> NUMERO) == 1 
    335     #D- AND ???_Restart=NO 
    336     #D- READ AND USE BY GCM FOR ONLY ONE EXECUTION. 
    337     # ------------------------------------------------------------------ 
    338     IGCM_comp_GetInputInitialStateFiles 
    339  
    340     #D- 
    341     # ------------------------------------------------------------------ 
    342     #D- Get Boundaries Conditions (SST, WIND[X,Y,Z], LAI ...) 
    343     #D- READ AND USE BY GCM AT EACH EXECUTION. 
    344     # ------------------------------------------------------------------ 
    345     IGCM_comp_GetInputBoundaryFiles 
    346  
    347     #D- 
    348     # ------------------------------------------------------------------ 
    349     #D- Get SmoothFiles Conditions (SST, WIND[X,Y,Z], LAI ...) 
    350     #D- READ AND USE BY GCM AT EACH EXECUTION but varying in time 
    351     # ------------------------------------------------------------------ 
    352     IGCM_comp_GetInputSmoothFiles  
    353  
    354     #D- 
    355     # ------------------------------------------------------------------ 
    356     #D- Get restart files (restartphy.nc, orca_restart.nc ...) 
    357     #D- READ AND USE BY GCM AT EACH EXECUTION. 
    358     #D- 
    359     #D- IF A COMPONENT DO NOT RESTART FROM PREVIOULSY COMPUTED RESTART 
    360     #D- ONLY IF CumulPeriod= (=> NUMERO) == 1 
    361     #D- MUST EXECUTE CREATE ETAT0_LIMIT (TYPICALLY LMDZ AND ./create_etat0_limit.e) 
    362     #D- 
    363     #D- IF CumulPeriod == 1 
    364     #D- AND A COMPONENT RESTART FROM PREVIOULSY COMPUTED RESTART 
    365     #D- MUST BRING THIS RESTART IN ${RUN_DIR_PATH} 
    366     #D- 
    367     #D- ELSE BRING RESTART FROM ${JobName} IN ${RUN_DIR_PATH} 
    368     # ------------------------------------------------------------------ 
    369     IGCM_comp_GetInputRestartFiles 
    370      
    371     #D- 
    372     # ------------------------------------------------------------------ 
    373     #D- Test if all was right before Update 
    374     # ------------------------------------------------------------------ 
    375     IGCM_debug_Verif_Exit 
    376  
    377     # ------------------------------------------------------------------ 
    378     #D- Activate running environnement variables 
    379     # ------------------------------------------------------------------ 
    380     IGCM_sys_activ_variables 
    381  
    382     #D- 
    383     # ------------------------------------------------------------------ 
    384     #D- UPDATE ParametersFiles (.def, namelist ...) with  
    385     #D- current value of (ORCA_NIT00, ORCA_LRSTAR, RAZ_DATE, ...) 
    386     # ------------------------------------------------------------------ 
    387     IGCM_comp_Update 
    388  
    389     #D- 
    390     # ------------------------------------------------------------------ 
    391     #D- Test if all was right before execution 
    392     # ------------------------------------------------------------------ 
    393     IGCM_debug_Verif_Exit 
    394  
    395     #D- 
    396     #D----------------------------------------------------------------== 
    397     #D-                          3. Execution 
    398     #D----------------------------------------------------------------== 
    399  
    400     echo 
    401     echo "#######################################" 
    402     echo "#      DIR BEFORE RUN EXECUTION       #" 
    403     echo "#######################################" 
    404     echo 
    405     ls -lrt 
    406  
    407     echo "========================================================================" 
    408     if [ ${DRYRUN} -le 1 ] ; then 
    409         REAL_DATE_INIT=$( date ) 
    410         echo                                                                                   > ${Exe_Output} 
    411         echo "#######################################"                                        >> ${Exe_Output} 
    412         echo "EXECUTION of : ${EXECUTION}" 
    413         echo "EXECUTION of : ${EXECUTION}"                                                    >> ${Exe_Output} 
    414         echo                                                                                  >> ${Exe_Output} 
    415         typeset RET 
    416         RUN_DATE_BEGIN=$( date '+%Y-%m-%dT%H:%M:%S' ) 
    417         ${EXECUTION}  >> ${Exe_Output} 2>&1 
    418         RET=$? 
    419         RUN_DATE_END=$( date '+%Y-%m-%dT%H:%M:%S' ) 
    420         if [ ${RET} -gt 0 ] ; then 
    421             echo "Return code of executable :" ${RET} 
    422             IGCM_debug_Exit "EXECUTABLE" 
    423             IGCM_sys_Mkdir ${SUBMIT_DIR}/Debug 
    424             IGCM_sys_Cp ${Exe_Output} ${SUBMIT_DIR}/Debug/${PREFIX}_${Exe_Output}_error 
    425             ExecutionFail=true 
    426         fi 
    427         echo                                            >> ${Exe_Output} 
    428         echo "#######################################"  >> ${Exe_Output} 
    429         echo "libIGCM RunDateBegin=${RUN_DATE_BEGIN}"   >> ${Exe_Output} 
    430         echo "libIGCM RunDateEnd=${RUN_DATE_END}"       >> ${Exe_Output} 
    431         echo                                            >> ${Exe_Output} 
    432     else 
    433         echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN 
    434         echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN > ${Exe_Output} 
    435         if ( $DEBUG_debug ) ; then 
    436             echo "FOR EXECUTION DRYRUN mode = " $DRYRUN >> stack 
    437         fi 
     293  echo 
     294  echo "Starting iteration ${Period} / ${PeriodNb}" 
     295 
     296  #D- 
     297  # ------------------------------------------------------------------ 
     298  #D- COMPUTE AND DEFINE DATE STUFF. 
     299  # ------------------------------------------------------------------ 
     300  IGCM_config_PeriodStart 
     301  #D- => ${PeriodDateBegin} 
     302  #D- => ${PeriodDateEnd} 
     303  #D- => ${CumulPeriod} 
     304  #D- => ${DatesPeriod}=${PeriodDateBegin}_${PeriodDateEnd} 
     305  #D- => ${PeriodLength} => JOURS=31 , 28, 29, 30 ; MOIS=0 ; ANS=0 
     306  #D- => update run.card value 
     307 
     308  #D- 
     309  # ------------------------------------------------------------------ 
     310  #D- BEGIN COMPUTATION ONLY IF NEEDED 
     311  # ------------------------------------------------------------------ 
     312  if [ ${SimulationLengthInDays} -gt ${ExperienceLengthInDays} ] ; then 
     313    IGCM_debug_Print 1 "break because '${SimulationLengthInDays} -gt ${ExperienceLengthInDays}' : ${SimulationLengthInDays} -gt ${ExperienceLengthInDays}" 
     314    break ; 
     315  fi 
     316 
     317  #D- 
     318  # ------------------------------------------------------------------ 
     319  #D- Optionnal function in driver  
     320  #D- to set special variables used in forward lists (Param, Init or Bc). 
     321  # ------------------------------------------------------------------ 
     322  IGCM_comp_PeriodStart 
     323 
     324  #D- 
     325  # ------------------------------------------------------------------ 
     326  #D- Get parameters text files updated by job (.def, namelist ...) 
     327  #D- READ AND USE BY GCM AT EACH EXECUTION. 
     328  # ------------------------------------------------------------------ 
     329  IGCM_comp_GetInputParametersFiles 
     330 
     331  #D- 
     332  # ------------------------------------------------------------------ 
     333  #D- Get initial state (Etat0, carteveg,relief...) 
     334  #D- NECESSARY ONLY IF CumulPeriod= (=> NUMERO) == 1 
     335  #D- AND ???_Restart=NO 
     336  #D- READ AND USE BY GCM FOR ONLY ONE EXECUTION. 
     337  # ------------------------------------------------------------------ 
     338  IGCM_comp_GetInputInitialStateFiles 
     339 
     340  #D- 
     341  # ------------------------------------------------------------------ 
     342  #D- Get Boundaries Conditions (SST, WIND[X,Y,Z], LAI ...) 
     343  #D- READ AND USE BY GCM AT EACH EXECUTION. 
     344  # ------------------------------------------------------------------ 
     345  IGCM_comp_GetInputBoundaryFiles 
     346 
     347  #D- 
     348  # ------------------------------------------------------------------ 
     349  #D- Get SmoothFiles Conditions (SST, WIND[X,Y,Z], LAI ...) 
     350  #D- READ AND USE BY GCM AT EACH EXECUTION but varying in time 
     351  # ------------------------------------------------------------------ 
     352  IGCM_comp_GetInputSmoothFiles  
     353 
     354  #D- 
     355  # ------------------------------------------------------------------ 
     356  #D- Get restart files (restartphy.nc, orca_restart.nc ...) 
     357  #D- READ AND USE BY GCM AT EACH EXECUTION. 
     358  #D- 
     359  #D- IF A COMPONENT DO NOT RESTART FROM PREVIOULSY COMPUTED RESTART 
     360  #D- ONLY IF CumulPeriod= (=> NUMERO) == 1 
     361  #D- MUST EXECUTE CREATE ETAT0_LIMIT (TYPICALLY LMDZ AND ./create_etat0_limit.e) 
     362  #D- 
     363  #D- IF CumulPeriod == 1 
     364  #D- AND A COMPONENT RESTART FROM PREVIOULSY COMPUTED RESTART 
     365  #D- MUST BRING THIS RESTART IN ${RUN_DIR_PATH} 
     366  #D- 
     367  #D- ELSE BRING RESTART FROM ${JobName} IN ${RUN_DIR_PATH} 
     368  # ------------------------------------------------------------------ 
     369  IGCM_comp_GetInputRestartFiles 
     370 
     371  #D- 
     372  # ------------------------------------------------------------------ 
     373  #D- Test if all was right before Update 
     374  # ------------------------------------------------------------------ 
     375  IGCM_debug_Verif_Exit 
     376 
     377  # ------------------------------------------------------------------ 
     378  #D- Activate running environnement variables 
     379  # ------------------------------------------------------------------ 
     380  IGCM_sys_activ_variables 
     381 
     382  #D- 
     383  # ------------------------------------------------------------------ 
     384  #D- UPDATE ParametersFiles (.def, namelist ...) with  
     385  #D- current value of (ORCA_NIT00, ORCA_LRSTAR, RAZ_DATE, ...) 
     386  # ------------------------------------------------------------------ 
     387  IGCM_comp_Update 
     388 
     389  #D- 
     390  # ------------------------------------------------------------------ 
     391  #D- Test if all was right before execution 
     392  # ------------------------------------------------------------------ 
     393  IGCM_debug_Verif_Exit 
     394 
     395  #D- 
     396  #D----------------------------------------------------------------== 
     397  #D-                          3. Execution 
     398  #D----------------------------------------------------------------== 
     399 
     400  echo 
     401  echo "#######################################" 
     402  echo "#      DIR BEFORE RUN EXECUTION       #" 
     403  echo "#######################################" 
     404  echo 
     405  ls -lrt 
     406 
     407  echo "========================================================================" 
     408  if [ ${DRYRUN} -le 1 ] ; then 
     409    REAL_DATE_INIT=$( date ) 
     410    echo                                                                                   > ${Exe_Output} 
     411    echo "#######################################"                                        >> ${Exe_Output} 
     412    echo "EXECUTION of : ${EXECUTION}" 
     413    echo "EXECUTION of : ${EXECUTION}"                                                    >> ${Exe_Output} 
     414    echo                                                                                  >> ${Exe_Output} 
     415    typeset RET 
     416    RUN_DATE_BEGIN=$( date '+%Y-%m-%dT%H:%M:%S' ) 
     417    ${EXECUTION}  >> ${Exe_Output} 2>&1 
     418    RET=$? 
     419    RUN_DATE_END=$( date '+%Y-%m-%dT%H:%M:%S' ) 
     420    if [ ${RET} -gt 0 ] ; then 
     421      echo "Return code of executable :" ${RET} 
     422      IGCM_debug_Exit "EXECUTABLE" 
     423      IGCM_sys_Mkdir ${SUBMIT_DIR}/Debug 
     424      IGCM_sys_Cp ${Exe_Output} ${SUBMIT_DIR}/Debug/${PREFIX}_${Exe_Output}_error 
     425      ExecutionFail=true 
    438426    fi 
    439     echo "========================================================================" 
    440  
    441     echo 
    442     echo "#######################################" 
    443     echo "#       DIR AFTER RUN EXECUTION       #" 
    444     echo "#######################################" 
    445     echo 
    446     ls -lrt 
    447  
    448     #D- 
    449     # ------------------------------------------------------------------ 
    450     #D- Desactivate running environnement variables 
    451     # ------------------------------------------------------------------ 
    452     IGCM_sys_desactiv_variables 
    453  
    454     #D- 
    455     #D----------------------------------------------------------------== 
    456     #D-                    4. Post execution operations 
    457     #D----------------------------------------------------------------== 
    458  
    459     #D- 
    460     # ------------------------------------------------------------------ 
    461     #D- Save on archive machine netcdf outputs, restarts 
    462     #D- and text files of models 
    463     # ------------------------------------------------------------------ 
    464     IGCM_comp_Finalize 
    465  
    466     #D- 
    467     # ------------------------------------------------------------------ 
    468     #D- Test if all was right after Finalize 
    469     # ------------------------------------------------------------------ 
    470     IGCM_debug_Verif_Exit 
    471  
    472     #D- 
    473     # ------------------------------------------------------------------ 
    474     #D- Configure asynchronous post-treatment (Level 0) when necessary (rebuild) 
    475     #D- Configure classic post-treatment (Level 1) when necessary (TimeSeries/Seasonal) 
    476     # ------------------------------------------------------------------ 
    477     IGCM_post_Configure 
    478  
    479     #D- 
    480     # ------------------------------------------------------------------ 
    481     #D- Launch remote rebuild or/and post-treatment process if necessary 
    482     # ------------------------------------------------------------------ 
    483     IGCM_post_Submit 
    484  
    485     #D- 
    486     # ------------------------------------------------------------------ 
    487     #D- Save job output 
    488     #D- Manage executable size to save only different binary 
    489     #D- Write in run.card user, system and elapse time 
    490     #D- Check that everything went well ! No ? then we stop. 
    491     #D- Determine next computed period 
    492     # ------------------------------------------------------------------ 
    493     IGCM_config_PeriodEnd 
    494  
    495     echo "Ending iteration ${Period}" 
    496     (( Period = Period + 1 )) 
    497  
    498     # End loop if date end is reached 
    499     if [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ; then 
    500         break ; 
     427    echo                                            >> ${Exe_Output} 
     428    echo "#######################################"  >> ${Exe_Output} 
     429    echo "libIGCM RunDateBegin=${RUN_DATE_BEGIN}"   >> ${Exe_Output} 
     430    echo "libIGCM RunDateEnd=${RUN_DATE_END}"       >> ${Exe_Output} 
     431    echo                                            >> ${Exe_Output} 
     432  else 
     433    echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN 
     434    echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN > ${Exe_Output} 
     435    if ( $DEBUG_debug ) ; then 
     436      echo "FOR EXECUTION DRYRUN mode = " $DRYRUN >> stack 
    501437    fi 
    502  
    503     PeriodContinue=false 
    504     if [ ${Period} -le ${PeriodNb} ]; then 
    505         PeriodContinue=true 
    506     fi 
    507 done  
     438  fi 
     439  echo "========================================================================" 
     440 
     441  echo 
     442  echo "#######################################" 
     443  echo "#       DIR AFTER RUN EXECUTION       #" 
     444  echo "#######################################" 
     445  echo 
     446  ls -lrt 
     447 
     448  #D- 
     449  # ------------------------------------------------------------------ 
     450  #D- Desactivate running environnement variables 
     451  # ------------------------------------------------------------------ 
     452  IGCM_sys_desactiv_variables 
     453 
     454  #D- 
     455  #D----------------------------------------------------------------== 
     456  #D-                    4. Post execution operations 
     457  #D----------------------------------------------------------------== 
     458 
     459  #D- 
     460  # ------------------------------------------------------------------ 
     461  #D- Save on archive machine netcdf outputs, restarts 
     462  #D- and text files of models 
     463  # ------------------------------------------------------------------ 
     464  IGCM_comp_Finalize 
     465 
     466  #D- 
     467  # ------------------------------------------------------------------ 
     468  #D- Test if all was right after Finalize 
     469  # ------------------------------------------------------------------ 
     470  IGCM_debug_Verif_Exit 
     471 
     472  #D- 
     473  # ------------------------------------------------------------------ 
     474  #D- Configure asynchronous post-treatment (Level 0) when necessary (rebuild) 
     475  #D- Configure classic post-treatment (Level 1) when necessary (TimeSeries/Seasonal) 
     476  # ------------------------------------------------------------------ 
     477  IGCM_post_Configure 
     478 
     479  #D- 
     480  # ------------------------------------------------------------------ 
     481  #D- Launch remote rebuild or/and post-treatment process if necessary 
     482  # ------------------------------------------------------------------ 
     483  IGCM_post_Submit 
     484 
     485  #D- 
     486  # ------------------------------------------------------------------ 
     487  #D- Save job output 
     488  #D- Manage executable size to save only different binary 
     489  #D- Write in run.card user, system and elapse time 
     490  #D- Check that everything went well ! No ? then we stop. 
     491  #D- Determine next computed period 
     492  # ------------------------------------------------------------------ 
     493  IGCM_config_PeriodEnd 
     494 
     495  echo "Ending iteration ${Period}" 
     496  (( Period = Period + 1 )) 
     497 
     498  # End loop if date end is reached 
     499  if [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ; then 
     500    break ; 
     501  fi 
     502 
     503  PeriodContinue=false 
     504  if [ ${Period} -le ${PeriodNb} ]; then 
     505    PeriodContinue=true 
     506  fi 
     507done 
    508508 
    509509#D- 
Note: See TracChangeset for help on using the changeset viewer.