Changeset 1598


Ignore:
Timestamp:
09/20/23 15:28:50 (8 months ago)
Author:
falletti
Message:

Integration of C-ESM-EP (post-processing) in libIGCM. From the work done by Stephane Senesi. To be activated in config.card [Post] with the keyword Cesmep (default: FALSE).

Location:
trunk/libIGCM
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM

    • Property svn:ignore set to
      *.job
  • trunk/libIGCM/AA_create_se

    r1568 r1598  
    728728fi 
    729729 
     730# Execute C-ESM-EP driver (which launches jobs) 
     731if [ $PostCesmep = SE ] ; then 
     732    ${SUBMIT_DIR}/cesmep_lite/libIGCM_post.sh $DateBegin $PeriodDateEnd 
     733fi 
     734 
    730735# Clean RUN_DIR_PATH (necessary for cesium and titane only) 
    731736IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH} 
  • trunk/libIGCM/AA_create_ts

    r1577 r1598  
    829829IGCM_debug_Verif_Exit 
    830830# -------------------------------------------------------------------- 
    831 #D- Submit MONITORING 
     831#D- Submit MONITORING and C-ESM-EP 
    832832# -------------------------------------------------------------------- 
    833833if ( [ X${TsTask} = X2D ] || [ X${TsTask} = X3D ] || [ X${TsTask} = X ] ) ; then 
     
    836836    Script_Post_Output=monitoring.${PeriodDateEnd} 
    837837    IGCM_sys_QsubPost monitoring 
     838    if [ $PostCesmep = TS ] ; then 
     839        ${SUBMIT_DIR}/cesmep_lite/libIGCM_post.sh $DateBegin $PeriodDateEnd 
     840    fi 
    838841  fi 
    839842fi 
  • trunk/libIGCM/AA_pack_output

    r1568 r1598  
    330330done 
    331331 
     332# Execute C-ESM-EP driver (which launches jobs) 
     333if [ $PostCesmep = Pack ] ; then 
     334    ${SUBMIT_DIR}/cesmep_lite/libIGCM_post.sh $DateBegin $DateEnd 
     335fi 
     336 
    332337# Flush post-processing submission 
    333338if [ -f ${R_BUFR}/FlushPost_${DateEnd}.ksh ] ; then 
  • trunk/libIGCM/AA_purge_simulation

    r1557 r1598  
    171171fi 
    172172 
     173IGCM_card_DefineVariableFromOption ${prefix}config.card Post Cesmep 
     174if [ ${config_Post_Cesmep} != FALSE ]; then 
     175    echo -e "\033[1;32mDo you want to erase the CESMEP atlas and dedicated CliMAF cache) ?" 
     176    echo -n -e " Your answer (y/n) : \033[m" 
     177    read reponse 
     178    case ${reponse} in 
     179        oui|OUI|o|y|yes|YES) 
     180            $SUBMIT_DIR/cesmep_lite/libIGCM_clean.sh 
     181            ;; 
     182    esac 
     183fi 
     184 
    173185exit 0 
  • trunk/libIGCM/ins_job

    r1597 r1598  
    702702   
    703703fi 
     704# 
     705# Install a light copy of C-ESM-EP in SUBMIT_DIR/Cesmep and create a 
     706# C-ESM-EP launch script there. 
     707# 
     708[ ${new_struct?} == yes ] && prefix="$JobName/"   
     709IGCM_card_DefineVariableFromOption ${prefix}config.card Post Cesmep 
     710if ( [ X${config_Post_Cesmep} = X${NULL_STR} ] || [ X${config_Post_Cesmep} = XNONE ] || \ 
     711         [ X${config_Post_Cesmep} = X ] ) ; then 
     712    config_Post_Cesmep=FALSE 
     713fi 
     714if [ ${config_Post_Cesmep} != FALSE ]; then 
     715    IGCM_config_CommonConfiguration ${prefix}config.card 
     716    if [ x"${config_Post_CesmepMail}" == x"TRUE" ] || [ x"${config_Post_CesmepMail}" == x"True" ] ; then 
     717        # Compute mail adress - inspired by libIGCM_post.ksh - should be turned in a function  
     718        if [ ! -z ${config_UserChoices_MailName} ] ; then 
     719            MailAdress=${config_UserChoices_MailName} 
     720        elif [ -f ~/.forward ] ; then 
     721            MailAdress=$( cat ~/.forward ) 
     722        else 
     723            MailAdress=${USER} 
     724        fi 
     725    else 
     726        MailAdress=None 
     727    fi 
     728    # 
     729    components="," 
     730    for comp in ${config_ListOfComponents[*]} ; do 
     731        components=${components}${comp}, ; 
     732    done 
     733    if ( [ X"${SYSTEM}" == X"irene" ]    || [ X"${SYSTEM}" == X"irene-amd" ] || \ 
     734         [ X"${SYSTEM}" == X"mesoipsl" ] || [ X"${SYSTEM}" == X"jeanzay" ] ) ; then 
     735        IGCM_card_DefineVariableFromOption ${prefix}config.card UserChoices DateBegin 
     736        ${config_Post_CesmepCode}/libIGCM_install.sh $(pwd)/${prefix} \ 
     737                   ${config_Post_CesmepComparison} $JobName ${R_SAVE} "${ProjectID}" \ 
     738                   ${MailAdress} ${config_UserChoices_DateBegin//-/} \ 
     739                   ${config_Post_Cesmep} ${CesmepPeriod} ${config_Post_CesmepSlices} \ 
     740                   $components $CENTER 
     741        [ $? -ne 0 ] && echo -e "\nERROR : cannot configure C-ESM-EP run" && exit 5 
     742    else 
     743        echo -e "\nERROR Cannot (yet) handle CESMEP atlas on this computer system (${SYSTEM})" 
     744        echo "=> Variable Cesmep in config.card's section Post must be set to FALSE (rather than $config_Post_Cesmep)" 
     745        exit 6 
     746    fi 
     747fi 
    704748#- 
    705749[[ ${x_v} = 'verbose' ]] && print - ""; 
  • trunk/libIGCM/libIGCM_config/libIGCM_config.ksh

    r1565 r1598  
    225225    config_Post_MetricsPCMDI=FALSE 
    226226  fi 
    227  
     227  #==================================================== 
     228  # Cesmep : apply default value FALSE if not defined, and if TRUE 
     229  # or *Y set it based on an adhoc algorithm 
     230  if ( [ X${config_Post_Cesmep} = X${NULL_STR} ] || [ X${config_Post_Cesmep} = XNONE ] || \ 
     231       [ X${config_Post_Cesmep} = X ] || [ X${config_Post_Cesmep} = XFALSE ] ) ; then 
     232    config_Post_Cesmep=FALSE 
     233  elif [ X${config_Post_Cesmep} = XTRUE ] || [[ X${config_Post_Cesmep} =~ X[1-9][0-9]?Y ]] ; then 
     234      if [[ X${config_Post_Cesmep} =~ X[1-9][0-9]?Y ]] ; then 
     235          CesmepPeriod=${config_Post_Cesmep%Y} 
     236      fi 
     237      if ([ ! X${config_Post_SeasonalFrequency} = XNONE ] && [ ! X${config_Post_SeasonalFrequency} = X ] ) ; then 
     238          config_Post_Cesmep="SE" 
     239      elif ([ ! X${config_Post_TimeSeriesFrequency} = XNONE ] && [ ! X${config_Post_TimeSeriesFrequency} = X ] ) ; then 
     240          config_Post_Cesmep="TS" 
     241      elif ([ ! X${config_Post_PackFrequency} = XNONE ] && [ ! X${config_Post_PackFrequency} = X ] ) ; then 
     242          config_Post_Cesmep="Pack" 
     243      else 
     244          # This covers case SpaceName=TEST with no SE nor TS (nor Pack) 
     245          config_Post_Cesmep=AtEnd 
     246      fi 
     247  fi 
     248  # 
     249  if [ X${config_Post_Cesmep} != XFALSE ] ; then 
     250      if [ X${config_Post_Cesmep} = XSE ] ; then 
     251          if ([ X${config_Post_SeasonalFrequency} = XNONE ] || [ X${config_Post_SeasonalFrequency} = X ] ) ; then 
     252              IGCM_debug_Exit "Cannot use SE for Cesmep : SE post-processing is not active" 
     253          else 
     254              [ -z $CesmepPeriod ] && CesmepPeriod=${config_Post_SeasonalFrequency%Y} 
     255          fi 
     256      elif [ X${config_Post_Cesmep} = XTS ] ; then 
     257          if ([ X${config_Post_TimeSeriesFrequency} = XNONE ] || [ X${config_Post_TimeSeriesFrequency} = X ] ) ; then 
     258              IGCM_debug_Exit "Cannot use TS for Cesmep : TS post-processing is not active" 
     259          else 
     260              [ -z $CesmepPeriod ] && CesmepPeriod=${config_Post_TimeSeriesFrequency%Y} 
     261          fi 
     262      elif [ X${config_Post_Cesmep} = XPack ] ; then 
     263          if ([ X${config_Post_PackFrequency} = XNONE ] || [ X${config_Post_PackFrequency} = X ] ) ; then 
     264              IGCM_debug_Exit "Cannot use Packed output for Cesmep : Pack post-processing is not active" 
     265          else 
     266              [ -z $CesmepPeriod ] && CesmepPeriod=${config_Post_PackFrequency%Y} 
     267          fi 
     268      elif [ X${config_Post_Cesmep} != XAtEnd ] ; then 
     269          IGCM_debug_Exit "config.card's Post section's value for Cesmep (${config_Post_Cesmep}) is invalid; use SE, TS, Pack, AtEnd, TRUE or <n>Y" 
     270      else 
     271          [ -z $CesmepPeriod ] && CesmepPeriod=0 
     272      fi 
     273 
     274      if ( [ X${config_Post_CesmepComparison} = XNONE ] || [ X${config_Post_CesmepComparison} = X ] ) ; then 
     275          config_Post_CesmepComparison=run_comparison 
     276      fi 
     277       
     278      if ( [ X${config_Post_CesmepCode} = XNONE ] || [ X${config_Post_CesmepCode} = X ] ) ; then 
     279          if ( [ X"${SYSTEM}" == "Xirene" ] || [ X"${SYSTEM}" == "Xirene-amd" ] ); then  
     280              config_Post_CesmepCode=/ccc/cont003/home/igcmg/igcmg/Tools/cesmep 
     281          elif ( [ X"${SYSTEM}" == "Xjeanzay" ] ); then 
     282              config_Post_CesmepCode=/gpfswork/rech/psl/commun/Tools/cesmep 
     283          elif ( [ X"${SYSTEM}" == "Xmesoipsl" ] ); then 
     284              config_Post_CesmepCode=/net/nfs/tools/Users/SU/jservon/cesmep_installs/cesmep_for_libIGCM 
     285          elif [ ${config_Post_Cesmep} != FALSE ] ; then 
     286              IGCM_debug_Exit "Cannot locate a default C-ESM-EP code on $SYSTEM, please set CesmepCode in section Post" 
     287          fi 
     288      fi 
     289      if ( [ X${config_Post_CesmepSlices} = XNONE ] || [ X${config_Post_CesmepSlices} = X ] ) ; then 
     290          config_Post_CesmepSlices=8 
     291      fi 
     292  fi 
     293  IGCM_debug_Print 3 "config_Post_Cesmep=${config_Post_Cesmep}, CesmepPeriod=$CesmepPeriod, config_Post_CesmepSlices=$config_Post_CesmepSlices  " 
    228294  #==================================================== 
    229295  # IgnoreNonMonotonic : apply default value if not defined 
  • trunk/libIGCM/libIGCM_post/libIGCM_post.ksh

    r1396 r1598  
    2929  TimeSeriesFrequency=false 
    3030  SeasonalFrequency=false 
     31  CesmepAtEnd=false 
    3132  unset list_post 
    3233  # 
     
    108109    fi 
    109110  fi 
     111 
     112  if ( [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] && [ X${config_Post_Cesmep} = XAtEnd ] ) ; then 
     113      CesmepAtEnd=true 
     114  fi 
     115   
     116   
    110117  IGCM_debug_PopStack "IGCM_post_Configure" 
    111118} 
     
    197204            echo "export RESOL_SBG=${RESOL_SBG}                            " >> ${FunctionPath} 
    198205            echo "export listVarEnv=${listVarEnv}                          " >> ${FunctionPath} 
     206            echo "export PostCesmep=${config_Post_Cesmep}                  " >> ${FunctionPath} 
    199207            echo "export Script_Post_Output=${Script_Post_Output}          " >> ${FunctionPath} 
    200208#           if [ X${MASTER} = Xtitane ] ; then 
     
    234242                    export RESOL_SRF=${RESOL_SRF} 
    235243                    export RESOL_SBG=${RESOL_SBG} 
     244                    export PostCesmep=${config_Post_Cesmep} 
    236245                    export listVarEnv=${listVarEnv} 
    237246                    export Script_Post_Output=${Script_Post_Output} 
     
    315324              echo "export RESOL_SBG=${RESOL_SBG}                            " >> ${FunctionPath} 
    316325              echo "export listVarEnv=${listVarEnv}                          " >> ${FunctionPath} 
     326              echo "export PostCesmep=${config_Post_Cesmep}                  " >> ${FunctionPath} 
    317327              echo "export Script_Post_Output=${Script_Post_Output}          " >> ${FunctionPath} 
    318328#             if [ X${MASTER} = Xtitane ] ; then 
     
    353363                        export RESOL_SBG=${RESOL_SBG} 
    354364                        export listVarEnv=${listVarEnv} 
     365                        export PostCesmep=${config_Post_Cesmep} 
    355366                        export Script_Post_Output=${Script_Post_Output} 
    356367                        . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh 
     
    415426      echo "export RESOL_SBG=${RESOL_SBG}                            " >> ${FunctionPath} 
    416427      echo "export listVarEnv=${listVarEnv}                          " >> ${FunctionPath} 
     428      echo "export PostCesmep=${config_Post_Cesmep}                  " >> ${FunctionPath} 
    417429      echo "export Script_Post_Output=${Script_Post_Output}          " >> ${FunctionPath} 
    418430#     if [ X${MASTER} = Xtitane ] ; then 
     
    448460            export RESOL_SBG=${RESOL_SBG} 
    449461            export listVarEnv=${listVarEnv} 
     462            export PostCesmep=${config_Post_Cesmep} 
    450463            export Script_Post_Output=${Script_Post_Output} 
    451464            . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh 
     
    499512    export StandAlone=false 
    500513    export listVarEnv=${listVarEnv} 
     514    export PostCesmep=${config_Post_Cesmep} 
    501515    export Script_Post_Output=${Script_Post_Output} 
    502516    . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh 
     
    529543      export StandAlone=false 
    530544      export listVarEnv=${listVarEnv} 
     545      export PostCesmep=${config_Post_Cesmep} 
    531546      export Script_Post_Output=${Script_Post_Output} 
    532547      . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh 
     
    560575      echo "export StandAlone=false                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh 
    561576      echo "export listVarEnv=${listVarEnv}                " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh 
     577      echo "export PostCesmep=${config_Post_Cesmep}        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh 
    562578      echo "export Script_Post_Output=${Script_Post_Output}" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh 
    563579      echo "export script=${script}                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh 
     
    590606        export StandAlone=false 
    591607        export listVarEnv=${listVarEnv} 
     608        export PostCesmep=${config_Post_Cesmep} 
    592609        export Script_Post_Output=${Script_Post_Output} 
    593610        . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh 
     
    645662      export RESOL_SBG=${RESOL_SBG} 
    646663      export listVarEnv=${listVarEnv} 
     664      export PostCesmep=${config_Post_Cesmep} 
    647665      export Script_Post_Output=${Script_Post_Output} 
    648666      . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh 
     
    655673EOF 
    656674  fi 
     675 
     676  #========== CESMEP POST-PROCESSING at job end  ========# 
     677 
     678  if [ ${CesmepAtEnd} = true ] ; then 
     679      # 
     680      IGCM_debug_Print 1 "Launching C-ESM-EP run script" 
     681      TaskType=post 
     682      . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh 
     683      ${SUBMIT_DIR}/cesmep_lite/libIGCM_post.sh $DateBegin $PeriodDateEnd 
     684  fi 
     685 
    657686  IGCM_debug_PopStack "IGCM_post_Submit" 
    658687} 
     
    790819  # - from libIGCM (config_UserChoices_PeriodLength frequency * CumulPeriod) and 
    791820  # - post-processing compatible frequency (*Y, *M, *D, *y, *m, *d) 
    792   # --> turn on post-processing submission when their modulo is zero 
     821  # --> turn on post-processing submission when their modulo is zero by  
     822  # setting env variable post_freq 
    793823  # Input parameter are the name of the variable, not the frequency value itself 
    794824  # example 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_irene.ksh

    r1581 r1598  
    226226 
    227227  # Load dfldatadir depending on the project used for submission (default) or set in config.card (optional) 
    228   if [ X${config_UserChoices_DataProject} = X ] || [ X${config_UserChoices_DataProject} = DEFAULT ]; then 
     228  if [ X${config_UserChoices_DataProject} = X ] || [ X${config_UserChoices_DataProject} = XDEFAULT ]; then 
    229229    # Default option: Change the dfldatadir according to the project used for submission 
    230230    # The variable DataProject in section UserChoices in config.card is not set or is set to DEFAULT 
     
    239239    # Use the project set by the variable DataProject in section UserChoices in config.card 
    240240    module switch dfldatadir dfldatadir/${config_UserChoices_DataProject} 
    241     IGCM_debug_Print 1 "Load dfldatadir for DataProject red in config.card : ${config_UserChoices_DataProject}" 
     241    IGCM_debug_Print 1 "Load dfldatadir for DataProject read in config.card : ${config_UserChoices_DataProject}" 
    242242  fi 
    243243 
Note: See TracChangeset for help on using the changeset viewer.