Changes between Initial Version and Version 2 of Ticket #62


Ignore:
Timestamp:
04/26/13 10:37:22 (11 years ago)
Author:
sdipsl
Comment:

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

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #62

    • Property Status changed from new to assigned
    • Property Component changed from Documentation to treatment
    • Property Milestone changed from to libIGCM_v2.0
    • Property Owner changed from somebody to sdipsl
    • Property Type changed from defect to enhancement
  • Ticket #62 – Description

    initial v2  
    55 
    66{{{ 
     7#!sh 
    78    # For forcesoil, we have to copy the sechiba restart of last Stage 
    89    if [ X${StageName} = X"FORC" ] ; then