Ignore:
Timestamp:
01/26/24 09:27:27 (4 months ago)
Author:
jgipsl
Message:

Added possibility to declare a restart file as optional which means that libIGCM want stop if the file is not found. Only a warning will be written.

For example, in the following case, if the routing_restart file is not available when starting the model or if it is not produced, libIGCM will not stop. But if the file sechiba_rest is not available, libIGCM will stop as usual.

[RestartFiles]
List=   (sechiba_rest_out.nc, sechiba_rest.nc, sechiba_rest_in.nc) ,\
        (routing_restart.nc, routing_restart.nc, routing_start.nc, OPTIONAL)
  • Read optional argument OPTIONAL on the line where the restart file is declared.
  • Each time when a restart file is not found for coping in or out, if the argument OPTIONAL is set, then just continue. If not set, the file is considered as MANDATORY and libIGCM will exist if it is missing as before.
  • on irene-amd and jean-zay, corrected a bug for the case in config.card DataProject?=DEFAULT


Location:
trunk/libIGCM/libIGCM_sys
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys.ksh

    r1574 r1624  
    677677    echo "IGCM_sys_PutBuffer_Rest :" $@ 
    678678  fi 
     679 
    679680  if [ $DRYRUN = 0 ]; then 
    680681    if [ ! -f ${1} ] ; then 
    681       echo "ERROR : IGCM_sys_PutBuffer_Rest ${1} DOES NOT EXIST ." 
    682       IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest" 
    683     fi 
    684  
    685     typeset status 
    686     # 
    687     # USUAL WAY 
    688     \cp $1 $2 > ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1 
    689     status=$? 
    690  
    691     if [ ${status} -gt 0 ] ; then 
    692       echo "IGCM_sys_PutBuffer_Rest : error code ${status}" 
    693       [ -f ${2} ] && ls -l ${2} 
    694       [ -f ${2}/${1} ] && ls -l ${2}/${1} 
    695       cat ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 
    696       IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest" 
    697     else 
    698  
    699       if [ X${JobType} = XRUN ] ; then 
    700         [ -f ${2} ] && IGCM_sys_Chmod 444 ${2} 
    701         [ -f ${2}/${1} ] && IGCM_sys_Chmod 444 ${2}/${1} 
     682      # The file is missing 
     683      if [ X${3} = X'OPTIONAL' ] ; then 
     684        echo "WARINING : IGCM_sys_PutBuffer_Rest ${1} DOES NOT EXIST ." 
     685        IGCM_debug_Print 1 "IGCM_sys_PutBuffer_Rest: Optional restart file ${1} is missing, now continue." 
     686      else  
     687        echo "ERROR : IGCM_sys_PutBuffer_Rest ${1} DOES NOT EXIST ." 
     688        IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest" 
    702689      fi 
    703  
    704       \rm ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 
     690     
     691    else 
     692      # The file exist 
     693      typeset status 
     694      # 
     695      # USUAL WAY 
     696      \cp $1 $2 > ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1 
     697      status=$? 
     698 
     699      if [ ${status} -gt 0 ] ; then 
     700        echo "IGCM_sys_PutBuffer_Rest : error code ${status}" 
     701        [ -f ${2} ] && ls -l ${2} 
     702        [ -f ${2}/${1} ] && ls -l ${2}/${1} 
     703        cat ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 
     704        IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest" 
     705      else 
     706        if [ X${JobType} = XRUN ] ; then 
     707          [ -f ${2} ] && IGCM_sys_Chmod 444 ${2} 
     708          [ -f ${2}/${1} ] && IGCM_sys_Chmod 444 ${2}/${1} 
     709        fi 
     710        \rm ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 
     711      fi 
    705712    fi 
    706713  fi 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh

    r1485 r1624  
    491491  if [ $DRYRUN = 0 ]; then 
    492492    if [ ! -f ${1} ] ; then 
    493       echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
    494       IGCM_debug_Exit "IGCM_sys_Put_Rest" 
    495     fi 
    496  
     493        # The file is missing 
     494        if [ X${3} = X'OPTIONAL' ] ; then 
     495            echo "WARINING : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
     496            IGCM_debug_Print 1 "IGCM_sys_Put_Rest: Optional restart file ${1} is missing, now continue for the next" 
     497        else 
     498            echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
     499            IGCM_debug_Exit "IGCM_sys_Put_Rest" 
     500        fi 
     501        
     502    else 
     503      # The file exist     
    497504    typeset status 
    498505    # 
     
    530537 
    531538      \rm ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 
     539    fi 
    532540    fi 
    533541  fi 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_irene-amd.ksh

    r1593 r1624  
    223223 
    224224  # Load dfldatadir depending on the project used for submission (default) or set in config.card (optional) 
    225   if [ X${config_UserChoices_DataProject} = X ] || [ X${config_UserChoices_DataProject} = DEFAULT ]; then 
     225  if [ X${config_UserChoices_DataProject} = X ] || [ X${config_UserChoices_DataProject} = XDEFAULT ]; then 
    226226    # Default option: Change the dfldatadir according to the project used for submission 
    227227    # The variable DataProject in section UserChoices in config.card is not set or is set to DEFAULT 
     
    613613  if [ $DRYRUN = 0 ]; then 
    614614    if [ ! -f ${1} ] ; then 
    615       echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
    616       IGCM_debug_Exit "IGCM_sys_Put_Rest" 
    617     fi 
     615        # The file is missing      
     616        if [ X${3} = X'OPTIONAL' ] ; then 
     617            echo "WARINING : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
     618            IGCM_debug_Print 1 "IGCM_sys_Put_Rest: Optional restart file ${1} is missing, now continue for the next" 
     619        else 
     620            echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
     621            IGCM_debug_Exit "IGCM_sys_Put_Rest" 
     622        fi 
     623 
     624    else 
     625      # The file exist 
    618626 
    619627    typeset status 
     
    652660 
    653661      \rm ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 
     662    fi 
    654663    fi 
    655664  fi 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_irene.ksh

    r1598 r1624  
    616616  if [ $DRYRUN = 0 ]; then 
    617617    if [ ! -f ${1} ] ; then 
    618       echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
    619       IGCM_debug_Exit "IGCM_sys_Put_Rest" 
    620     fi 
     618      # The file is missing        
     619      if [ X${3} = X'OPTIONAL' ] ; then 
     620          echo "WARINING : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
     621          IGCM_debug_Print 1 "IGCM_sys_Put_Rest: Optional restart file ${1} is missing, now continue for the next" 
     622      else 
     623          echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
     624          IGCM_debug_Exit "IGCM_sys_Put_Rest" 
     625      fi 
     626       
     627    else 
     628      # The file exist 
    621629 
    622630    typeset status 
     
    656664      \rm ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 
    657665    fi 
     666     
     667    fi 
     668     
    658669  fi 
    659670  IGCM_debug_PopStack "IGCM_sys_Put_Rest" 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_jeanzay.ksh

    r1569 r1624  
    205205 
    206206  # Load dfldatadir depending on the project used for submission (default) or set in config.card (optional) 
    207   if [ X${config_UserChoices_DataProject} = X ] || [ X${config_UserChoices_DataProject} = DEFAULT ]; then 
     207  if [ X${config_UserChoices_DataProject} = X ] || [ X${config_UserChoices_DataProject} = XDEFAULT ]; then 
    208208    # The variable DataProject is not set in in section UserChoices in config.card or it is set to DEFAULT 
    209209    # Default option: Set DataProject according to the project used for submission 
     
    620620  if [ $DRYRUN = 0 ]; then 
    621621    if [ ! -f ${1} ] ; then 
    622       echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
    623       IGCM_debug_Exit "IGCM_sys_Put_Rest" 
    624     fi 
     622        # The file is missing 
     623        if [ X${3} = X'OPTIONAL' ] ; then 
     624            echo "WARINING : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
     625            IGCM_debug_Print 1 "IGCM_sys_Put_Rest: Optional restart file ${1} is missing, now continue for the next" 
     626        else 
     627            echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
     628            IGCM_debug_Exit "IGCM_sys_Put_Rest" 
     629        fi 
     630 
     631    else 
     632      # The file exist 
    625633 
    626634    typeset status 
     
    659667 
    660668      \rm ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 
     669    fi 
    661670    fi 
    662671  fi 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_mesoipsl.ksh

    r1569 r1624  
    566566  if [ $DRYRUN = 0 ]; then 
    567567    if [ ! -f ${1} ] ; then 
    568       echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
    569       IGCM_debug_Exit "IGCM_sys_Put_Rest" 
    570     fi 
     568        # The file is missing      
     569        if [ X${3} = X'OPTIONAL' ] ; then 
     570            echo "WARINING : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
     571            IGCM_debug_Print 1 "IGCM_sys_Put_Rest: Optional restart file ${1} is missing, now continue for the next" 
     572        else 
     573            echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
     574            IGCM_debug_Exit "IGCM_sys_Put_Rest" 
     575        fi 
     576 
     577    else 
     578      # The file exist 
    571579 
    572580    typeset status 
     
    605613 
    606614      \rm ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 
     615    fi 
    607616    fi 
    608617  fi 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh

    r1601 r1624  
    548548  fi 
    549549  if [ $DRYRUN = 0 ]; then 
     550       
    550551    if [ ! -f ${1} ] ; then 
    551       echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
    552       IGCM_debug_Exit "IGCM_sys_Put_Rest" 
    553     fi 
     552        # The file is missing      
     553        if [ X${3} = X'OPTIONAL' ] ; then 
     554            echo "WARINING : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
     555            IGCM_debug_Print 1 "IGCM_sys_Put_Rest: Optional restart file ${1} is missing, now continue for the next" 
     556        else 
     557            echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ." 
     558            IGCM_debug_Exit "IGCM_sys_Put_Rest" 
     559        fi 
     560 
     561    else 
     562      # The file exist 
    554563 
    555564    typeset status 
     
    588597 
    589598      \rm ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 
     599    fi 
    590600    fi 
    591601  fi 
Note: See TracChangeset for help on using the changeset viewer.