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


File:
1 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 
Note: See TracChangeset for help on using the changeset viewer.