Opened 12 years ago

Closed 11 years ago

#62 closed enhancement (fixed)

Problem with pack function in SPINUP configuration

Reported by: jgipsl Owned by: sdipsl
Priority: major Milestone: libIGCM_v2.0
Component: treatment Version:
Keywords: Cc:

Description (last modified by sdipsl)

In spinup configuration the pack does not work because in spinup.driver there is a copy of a restart file. forcesoil is a subjob that contains only the component stomate. Therefor the copy of sechiba restart file must be done before relanching next subjob.

    # For forcesoil, we have to copy the sechiba restart of last Stage
    if [ X${StageName} = X"FORC" ] ; then
        # This must be done on the ARCHIVE HOST.
        IGCM_sys_MkdirArchive ${config_SBG_RestartPath}/${SubJobName}/SRF/Restart
        IGCM_sys_RshArchive \
            "cp -fp ${config_SBG_RestartPath}/${LastJobName}/SRF/Restart/${LastJobName}_${output_PreviousStage_LastRestartDate}_sechiba_rest.nc"\
                  " ${config_SBG_RestartPath}/${SubJobName}/SRF/Restart/${SubJobName}_${This_Job_DateEnd}_sechiba_rest.nc"
    fi

Some other problemes have been corrected reecently for SPINUP configuration, use : trunk/ORCHIDEE_OL rev 988 and libIGCM trunk rev 704 (or later revisions).

Change History (3)

comment:1 Changed 12 years ago by sdipsl

  • Component changed from Documentation to treatment
  • Milestone set to libIGCM_v2.0
  • Owner changed from somebody to sdipsl
  • Status changed from new to assigned
  • Type changed from defect to enhancement

Solution : ajouter une fonction, utilisable par spinup.driver pour aller chercher ce qui lui faut.

comment:2 Changed 11 years ago by sdipsl

  • Description modified (diff)

Ce qui suit devrait marcher dans ce cas particulier a condittion que forcesoil détermine les espace ${config_SBG_RestartPathBUF} et ${config_SBG_RestartPathOUT}. A tester!

A orchidee de voir où doivent être "stocké" ces restarts intermédiaires, je propose de les mettre sur l'espace Buffer (pas sur archive en tout cas).

Path_BUF=${config_SBG_RestartPathBUF}/${LastJobName}/SRF/Restart/${LastJobName}_${output_PreviousStage_LastRestartDate}_sechiba_rest.nc
Path_OUT=${config_SBG_RestartPathOUT}/${LastJobName}/SRF/Restart/${LastJobName}_${output_PreviousStage_LastRestartDate}_sechiba_rest.nc


if [ $( IGCM_sys_TestFileBuffer ${Path_BUF} ; echo $? ) = 0 ] ; then
  IGCM_debug_Print 3 "Buffered restart"
  Buffered=true
  Archived=false
  Tared=false
elif [ $( IGCM_sys_TestFileArchive ${Path_OUT} ; echo $? ) = 0 ] ; then
  IGCM_debug_Print 3 "Archived restart"
  Buffered=false
  Archived=true
  Tared=false
else
  IGCM_debug_Print 3 "Tared restart"
  Buffered=false
  Archived=false
  Tared=true
  # Look after the tar file we want if we did not found it already
  if [ X${IsMatching} = X ] ; then
    for PotentialTarFile in $( IGCM_sys_RshArchive "find ${config_SBG_RestartPath}/${LastJobName}/RESTART -name "${LastJobName}_*_restart.tar" -print" ) ; do
      IsMatching=$( echo ${PotentialTarFile##*/} | sed "s:^${LastJobName}_::" | sed "s:\.restart\.tar$::" | gawk -F_ -v restartdate=${output_PreviousStage_LastRestartDate} '{if (($1 < restartdate) && ($2 >= restartdate)) {print $1"_"$2}}' )
      if [ ! X${IsMatching} = X ] ; then
        TarFileFound=${PotentialTarFile}
        break
      fi
    done
  fi
  TarFileLocation=$( IGCM_sys_PrepareTaredRestart ${TarFileFound} )
  IGCM_debug_Print 1 "tar xvf ${TarFileLocation} SRF_${LastJobName}_${output_PreviousStage_LastRestartDate}_sechiba_rest.nc"
  tar xvf ${TarFileLocation} SRF_${LastJobName}_${output_PreviousStage_LastRestartDate}_sechiba_rest.nc
fi

if [ X${Buffered} = Xtrue ] ; then
  IGCM_sys_Mkdir ${config_SBG_RestartPath}/${SubJobName}/SRF/Restart
  IGCM_sys_Cp -fp ${config_SBG_RestartPath}/${LastJobName}/SRF/Restart/${LastJobName}_${output_PreviousStage_LastRestartDate}_sechiba_rest.nc ${config_SBG_RestartPath}/${SubJobName}/SRF/Restart/${SubJobName}_${This_Job_DateEnd}_sechiba_rest.nc
elif [ X${Archived} = Xtrue ] ; then
  IGCM_sys_MkdirArchive ${config_SBG_RestartPath}/${SubJobName}/SRF/Restart
  IGCM_sys_RshArchive \
    "cp -fp ${config_SBG_RestartPath}/${LastJobName}/SRF/Restart/${LastJobName}_${output_PreviousStage_LastRestartDate}_sechiba_rest.nc"\
    " ${config_SBG_RestartPath}/${SubJobName}/SRF/Restart/${SubJobName}_${This_Job_DateEnd}_sechiba_rest.nc"
elif [ X${Tared} = Xtrue ] ; then
  IGCM_sys_Mkdir ${config_SBG_RestartPath}/${SubJobName}/SRF/Restart
  IGCM_sys_Mv ${comp}_${file_in_Name} ${file_out}
fi

comment:3 Changed 11 years ago by sdipsl

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.