Index: branches/libIGCM_CESMEP/AA_SaveSourceModifications
===================================================================
--- branches/libIGCM_CESMEP/AA_SaveSourceModifications	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_SaveSourceModifications	(revision 1585)
@@ -58,13 +58,13 @@
 #-Q- ada # @ environment  = $POST_DIR ; $SUBMIT_DIR ; $libIGCM ; $StandAlone ; $MASTER
 #-Q- ada # @ queue
-#-Q- lxiv8 ######################
-#-Q- lxiv8 ## OBELIX      LSCE ##
-#-Q- lxiv8 ######################
-#-Q- lxiv8 #PBS -N SaveSource
-#-Q- lxiv8 #PBS -m a
-#-Q- lxiv8 #PBS -j oe
-#-Q- lxiv8 #PBS -q test
-#-Q- lxiv8 #PBS -o SaveSource.$$
-#-Q- lxiv8 #PBS -S /bin/ksh
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N SaveSource
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q test
+#-Q- obelix #PBS -o SaveSource.$$
+#-Q- obelix #PBS -S /bin/ksh
 #-Q- ifort_CICLAD ######################
 #-Q- ifort_CICLAD ##   CICLAD    IPSL ##
Index: branches/libIGCM_CESMEP/AA_additionnal
===================================================================
--- branches/libIGCM_CESMEP/AA_additionnal	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_additionnal	(revision 1585)
@@ -58,13 +58,13 @@
 #-Q- ada # @ environment  = $POST_DIR ; $SUBMIT_DIR ; $libIGCM ; $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $R_INIT ; $R_BC ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $R_SAVE ; $config_UserChoices_JobName ; $config_UserChoices_TagName ; $YEARS ; $MASTER ; wall_clock_limit=$(wall_clock_limit)
 #-Q- ada # @ queue
-#-Q- lxiv8 ######################
-#-Q- lxiv8 ## OBELIX      LSCE ##
-#-Q- lxiv8 ######################
-#-Q- lxiv8 #PBS -N ATL_ADD
-#-Q- lxiv8 #PBS -m a
-#-Q- lxiv8 #PBS -j oe
-#-Q- lxiv8 #PBS -q test
-#-Q- lxiv8 #PBS -o ATL_ADD.$$
-#-Q- lxiv8 #PBS -S /bin/ksh
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N ATL_ADD
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q test
+#-Q- obelix #PBS -o ATL_ADD.$$
+#-Q- obelix #PBS -S /bin/ksh
 #-Q- ifort_CICLAD ######################
 #-Q- ifort_CICLAD ##   CICLAD    IPSL ##
Index: branches/libIGCM_CESMEP/AA_atlas_LMDZ
===================================================================
--- branches/libIGCM_CESMEP/AA_atlas_LMDZ	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_atlas_LMDZ	(revision 1585)
@@ -58,13 +58,13 @@
 #-Q- ada # @ environment  = $POST_DIR ; $Script_Post_Output ; $SUBMIT_DIR ; $libIGCM ; $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $R_INIT ; $R_BC ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $YEARS ; $DIR_OUT ; $MASTER ; $libIGCM_SX ; wall_clock_limit=$(wall_clock_limit)
 #-Q- ada # @ queue
-#-Q- lxiv8 ######################
-#-Q- lxiv8 ## OBELIX      LSCE ##
-#-Q- lxiv8 ######################
-#-Q- lxiv8 #PBS -N ATL_LMDZ
-#-Q- lxiv8 #PBS -m a
-#-Q- lxiv8 #PBS -j oe
-#-Q- lxiv8 #PBS -q test
-#-Q- lxiv8 #PBS -o ATL_LMDZ.$$
-#-Q- lxiv8 #PBS -S /bin/ksh
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N ATL_LMDZ
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q test
+#-Q- obelix #PBS -o ATL_LMDZ.$$
+#-Q- obelix #PBS -S /bin/ksh
 #-Q- ifort_CICLAD ######################
 #-Q- ifort_CICLAD ##   CICLAD    IPSL ##
Index: branches/libIGCM_CESMEP/AA_atlas_ORCA_LIM
===================================================================
--- branches/libIGCM_CESMEP/AA_atlas_ORCA_LIM	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_atlas_ORCA_LIM	(revision 1585)
@@ -58,13 +58,13 @@
 #-Q- ada # @ environment  = $POST_DIR ; $Script_Post_Output ; $SUBMIT_DIR ; $libIGCM ; $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $R_INIT ; $R_BC ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $YEARS ; $DIR_OUT ; $MASTER ; $libIGCM_SX ; wall_clock_limit=$(wall_clock_limit)
 #-Q- ada # @ queue
-#-Q- lxiv8 ######################
-#-Q- lxiv8 ## OBELIX      LSCE ##
-#-Q- lxiv8 ######################
-#-Q- lxiv8 #PBS -N ATL_OPA
-#-Q- lxiv8 #PBS -m a
-#-Q- lxiv8 #PBS -j oe
-#-Q- lxiv8 #PBS -q test
-#-Q- lxiv8 #PBS -o ATL_OPA.$$
-#-Q- lxiv8 #PBS -S /bin/ksh
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N ATL_OPA
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q test
+#-Q- obelix #PBS -o ATL_OPA.$$
+#-Q- obelix #PBS -S /bin/ksh
 #-Q- ifort_CICLAD ######################
 #-Q- ifort_CICLAD ##   CICLAD    IPSL ##
Index: branches/libIGCM_CESMEP/AA_atlas_ORCHIDEE
===================================================================
--- branches/libIGCM_CESMEP/AA_atlas_ORCHIDEE	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_atlas_ORCHIDEE	(revision 1585)
@@ -58,13 +58,13 @@
 #-Q- ada # @ environment  = $POST_DIR ; $Script_Post_Output ; $SUBMIT_DIR ; $libIGCM ; $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $R_INIT ; $R_BC ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $YEARS ; $DIR_OUT ; $MASTER ; $libIGCM_SX ; wall_clock_limit=$(wall_clock_limit)
 #-Q- ada # @ queue
-#-Q- lxiv8 ######################
-#-Q- lxiv8 ## OBELIX      LSCE ##
-#-Q- lxiv8 ######################
-#-Q- lxiv8 #PBS -N ATL_ORCH
-#-Q- lxiv8 #PBS -m a
-#-Q- lxiv8 #PBS -j oe
-#-Q- lxiv8 #PBS -q medium
-#-Q- lxiv8 #PBS -o ATL_ORCH.$$
-#-Q- lxiv8 #PBS -S /bin/ksh
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N ATL_ORCH
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q medium
+#-Q- obelix #PBS -o ATL_ORCH.$$
+#-Q- obelix #PBS -S /bin/ksh
 #-Q- ifort_CICLAD ######################
 #-Q- ifort_CICLAD ##   CICLAD    IPSL ##
Index: branches/libIGCM_CESMEP/AA_atlas_PISCES
===================================================================
--- branches/libIGCM_CESMEP/AA_atlas_PISCES	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_atlas_PISCES	(revision 1585)
@@ -58,13 +58,13 @@
 #-Q- ada # @ environment  = $POST_DIR ; $Script_Post_Output ; $SUBMIT_DIR ; $libIGCM ; $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $R_INIT ; $R_BC ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $YEARS ; $DIR_OUT ; $MASTER ; $libIGCM_SX ; wall_clock_limit=$(wall_clock_limit)
 #-Q- ada # @ queue
-#-Q- lxiv8 ######################
-#-Q- lxiv8 ## OBELIX      LSCE ##
-#-Q- lxiv8 ######################
-#-Q- lxiv8 #PBS -N ATL_PIS
-#-Q- lxiv8 #PBS -m a
-#-Q- lxiv8 #PBS -j oe
-#-Q- lxiv8 #PBS -q test
-#-Q- lxiv8 #PBS -o ATL_PIS.$$
-#-Q- lxiv8 #PBS -S /bin/ksh
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N ATL_PIS
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q test
+#-Q- obelix #PBS -o ATL_PIS.$$
+#-Q- obelix #PBS -S /bin/ksh
 #-Q- ifort_CICLAD ######################
 #-Q- ifort_CICLAD ##   CICLAD    IPSL ##
Index: branches/libIGCM_CESMEP/AA_clean_PeriodLength
===================================================================
--- branches/libIGCM_CESMEP/AA_clean_PeriodLength	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_clean_PeriodLength	(revision 1585)
@@ -10,258 +10,12 @@
 #
 #**************************************************************
-# ID of your genci project. Curie only : post-processing jobs need it to run properly
-#-Q- curie export BRIDGE_MSUB_PROJECT=::default_project::
-#-Q- irene export BRIDGE_MSUB_PROJECT=::default_project::
-#-Q- irene-amd export BRIDGE_MSUB_PROJECT=::default_project::
 
-#set -eu
-#set -vx
-
-libIGCM=::modipsl::/libIGCM
-
-#D- Task type DO NOT CHANGE (computing, post-processing or checking)
-TaskType=post-processing
-
-#D--------------------------------------------------------------------==
-#D-                   -1. User modification place
-#D--------------------------------------------------------------------==
-
-#D- Increased verbosity (1, 2, 3)
-Verbosity=3
-
-#D- Low level debug : to bypass lib test checks and stack construction
-#D- Default=true
-DEBUG_debug=false
-
-#D--------------------------------------------------------------------==
-
-echo "clean PeriodLenght script :"
-echo "Script used to clean a PeriodLength from the IGCM_OUT directory !"
-echo "This script will erase files !!! Be careful and read all informations !"
-echo "----"
-echo "It must be called in Experience directory (so-called SUBMIT_DIR)."
-echo "----"
-
-#D--------------------------------------------------------------------==
-
-. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
-. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
-. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
-#-------
-SUBMIT_DIR=$( pwd )
-. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
-. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
-#-------
-( ${DEBUG_debug} ) && IGCM_debug_Check
-( ${DEBUG_debug} ) && IGCM_card_Check
-( ${DEBUG_debug} ) && IGCM_date_Check
-
-clean_CESMEP()
-{
-    IGCM_card_DefineVariableFromOption ${prefix}config.card Post Cesmep
-    if [ ${config_Post_Cesmep} != FALSE ]; then
-	echo -e "\033[1;32mDo you want to erase the CESMEP atlas and dedicated CliMAF cache) ?"
-	echo -n -e " Your answer (y/n) : \033[m"
-	read reponse
-	case ${reponse} in
-	    oui|OUI|o|y|yes|YES)
-		$SUBMIT_DIR/cesmep_lite/libIGCM_clean.sh
-		;;
-	esac  
-    fi
-}
-
-#==================================
-# First of all
-#
-# Read libIGCM compatibility version in config.card
-# Read UserChoices section
-# Read Ensemble section
-# Read Post section
-# Define all netcdf output directories
-#==================================
-IGCM_config_CommonConfiguration ${SUBMIT_DIR}/config.card
-
-#==================================
-# Define default value to keep compatibility with previous card: means before changes due to TGCC
-if [ X${PackDefault} = Xtrue ] ; then
-  [ X${config_Post_PackFrequency} = X ] && config_Post_PackFrequency=${config_Post_RebuildFrequency}
-else
-  config_Post_PackFrequency=NONE
-fi
-
-#==================================
-# Is the pack active
-if ( [ ! X${config_Post_PackFrequency} = X${NULL_STR} ] && [ ! X${config_Post_PackFrequency} = XNONE ] ) ; then
-  Pack=true
-fi
-
-IGCM_sys_TestDirArchive ${R_SAVE}
-[ $? != 0 ] && IGCM_debug_Exit "IGCM_sys_TestDirArchive"
-
-if [ ! -f ${SUBMIT_DIR}/run.card ]; then
-  echo "You seem NOT to have a run.card in this directory !!"
-  echo "This script will fail because it doesn't know what to do without run.card available."
-  exit 1
-else
-  #===================================#
-  #        Read updated run.card      #
-  #===================================#
-  IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration PeriodState
-  IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration PeriodDateBegin
-  IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration PeriodDateEnd
-  IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration CumulPeriod
-
-  # 
-  if [ X${run_Configuration_CumulPeriod} = X ] ; then
-    echo -e "\033[1;32mCumulPeriod is empty so we want to erase run.card to start properly. Do you want that?"
-    echo -n -e " Your answer (y/n) : \033[m"
-    read reponse
-    case ${reponse} in
-
-    oui|OUI|o|y|yes|YES)
-      echo "OK. Now you can submit the Job : ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}."
-      IGCM_sys_Rm ${SUBMIT_DIR}/run.card
-      ;;
-    non|NON|n|no|NO)
-      echo "Nothing to do !"
-      ;;
-    esac
-    clean_CESMEP
-    exit 0
-  fi
-
-  PeriodDateEnd=$( IGCM_date_ConvertFormatToGregorian ${run_Configuration_PeriodDateEnd} )
-  echo "Search files with ${PeriodDateEnd} in ${R_SAVE}"
-  set +A ListFiles -- $( IGCM_sys_RshArchive "find ${R_SAVE} -name \"*${PeriodDateEnd}*\" " )
-  CountListFiles=${#ListFiles[@]}
-
-  if [ X${Pack} = Xtrue ] ; then
-    echo "Search files with ${PeriodDateEnd} in ${R_BUFR}"
-    set +A ListFilesBuf -- $( IGCM_sys_RshMaster "find ${R_BUFR} -name \"*${PeriodDateEnd}*\" " )
-    CountListFilesBuf=${#ListFilesBuf[@]}
-  else
-    CountListFilesBuf=0
-  fi
-
-  # If exist, erase REBUILD DIR
-  PeriodDateBegin=$( IGCM_date_ConvertFormatToGregorian ${run_Configuration_PeriodDateBegin} )
-  CountRebuildDir=0
-  if [ X${config_Post_RebuildFrequency} != X ] ; then
-    set +A RebuildDir -- $( find ${REBUILD_DIR} -type d -name "*${PeriodDateBegin}*" )
-    CountRebuildDir=${#RebuildDir[@]}
-  fi
-
-  IGCM_debug_Print 1 "Number of files to be erased : ${CountListFiles}."
-  if ( [ ${CountListFiles} -gt 0 ] || [ ${CountListFilesBuf} -gt 0 ] ) ; then
-    for file in ${ListFiles[@]} ; do
-      IGCM_debug_Print 2 -e "\033[1;31m ${file}\033[m"
-    done
-    if [ X${Pack} = Xtrue ] ; then
-      for file in ${ListFilesBuf[@]} ; do
-        IGCM_debug_Print 2 -e "\033[1;31m ${file}\033[m"
-      done
-    fi
-    echo -e "\033[1;32mDo you REALLY want to erase all those files ?"
-    echo -n -e " Your answer (y/n) : \033[m"
-    read reponse
-    case ${reponse} in
-
-      oui|OUI|o|y|yes|YES)
-        echo "OK. It will be erased."
-        IGCM_sys_RshArchive "find ${R_SAVE} -name \"*${PeriodDateEnd}*\" -exec rm -f '{}' \;"
-        if [ X${Pack} = Xtrue ] ; then
-          IGCM_sys_RshMaster  "find ${R_BUFR} -name \"*${PeriodDateEnd}*\" -exec rm -f '{}' \;"
-        fi
-        echo "done."
-        ;;
-      non|NON|n|no|NO)
-        echo "Nothing to do !"
-        ;;
-    esac
-  fi
-
-  if [ ${CountRebuildDir} -gt 0 ] ; then
-    IGCM_debug_Print 1 "Number of REBUILD Dirs to be erased : ${CountRebuildDir}."
-    for Dir in ${RebuildDir[@]} ; do
-      IGCM_debug_Print 2 -e "\033[1;31m ${Dir}\033[m"
-    done
-
-    echo -e "\033[1;32mDo you REALLY want to erase all those Directories ?"
-    echo -n -e " Your answer (y/n) : \033[m"
-    read reponse
-    case ${reponse} in
-
-      oui|OUI|o|y|yes|YES)
-        echo "OK. It will be erased."
-        find ${REBUILD_DIR} -type d -name "*${PeriodDateBegin}*" -exec rm -Rf '{}' \;
-        echo "done."
-        ;;
-      non|NON|n|no|NO)
-        echo "Nothing to do !"
-        ;;
-    esac
-  fi
-
-  IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration PeriodState
-  if ( [ ${run_Configuration_PeriodState} != "Running" ] && [ ${run_Configuration_PeriodState} != "OnQueue" ] && [ ${run_Configuration_PeriodState} != "Continue" ] ) ; then
-
-    echo -e "\033[1;32mNOW do you want to continue the simulation (Set PeriodState=OnQueue into run.card) ?"
-    echo -n -e " Your answer (y/n) : \033[m"
-    read reponse
-    case ${reponse} in
-
-      oui|OUI|o|y|yes|YES)
-        echo "OK. Now you can submit the Job : ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}."
-        IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodState "OnQueue"
-        ;;
-      non|NON|n|no|NO)
-        echo "Nothing to do !"
-        ;;
-    esac
-  else
-    echo "You can submit the Job : ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}."
-  fi
-
-  if [ X${run_Configuration_CumulPeriod} = X1 ] ; then
-    echo -e "\033[1;32mCumulPeriod=1 so we want to erase run.card to start properly. Do you want that too?"
-    echo -n -e " Your answer (y/n) : \033[m"
-    read reponse
-    case ${reponse} in
-
-      oui|OUI|o|y|yes|YES)
-        echo "OK. Now you can submit the Job : ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}."
-        IGCM_sys_Rm ${SUBMIT_DIR}/run.card
-        ;;
-      non|NON|n|no|NO)
-        echo "Nothing to do !"
-        ;;
-    esac
-  else
-    # if not first period
-    Script_Output_Prefix=${config_UserChoices_Script_Output_Prefix:='Script_Output'}
-    Script_Output_Job=${Script_Output_Prefix}_${config_UserChoices_JobName}
-    Script_Output=${Script_Output_Prefix}_${config_UserChoices_JobName}.$( printf "%06d" ${run_Configuration_CumulPeriod} )
-
-    echo -e "\033[1;32mDo you want to change the number in Script_Output? (${Script_Output} into Job) ?"
-    echo -n -e " Your answer (y/n) : \033[m"
-    read reponse
-    case ${reponse} in
-
-      oui|OUI|o|y|yes|YES)
-        cp ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}_SAVED_$$
-        sed -e"s/${Script_Output_Job}.[0-9][0-9][0-9][0-9][0-9][0-9]/${Script_Output}/"  ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}_SAVED_$$  >${SUBMIT_DIR}/Job_${config_UserChoices_JobName}
-        echo "Job : Job_${config_UserChoices_JobName} modified."
-        echo "Old job saved here : Job_${config_UserChoices_JobName}_SAVED_$$"
-        ;;
-      non|NON|n|no|NO)
-        echo "Nothing done in Job_${config_UserChoices_JobName} !"
-        ;;
-    esac
-
-  fi
-
-  clean_CESMEP
-  
-fi
-exit 0
+echo ""
+echo "clean_PeriodLength.job has been replaced by clean_or_continue.job."
+echo "The new script keeps the same funtionnalities as the old one. "
+echo "Launch using "
+echo "../../../libIGCM/clean_or_continue.job -h   : for help"
+echo "../../../libIGCM/clean_or_continut.job      : for normal execution"
+echo "Exit now"
+echo ""
+exit
Index: branches/libIGCM_CESMEP/AA_clean_or_continue
===================================================================
--- branches/libIGCM_CESMEP/AA_clean_or_continue	(revision 1585)
+++ branches/libIGCM_CESMEP/AA_clean_or_continue	(revision 1585)
@@ -0,0 +1,288 @@
+#!/bin/ksh
+#**************************************************************
+# Author: Martial Mancip
+# Contact: Martial.Mancip__at__ipsl.jussieu.fr
+# $Revision:: 1575                                     $ Revision of last commit
+# $Author:: jgipsl                                     $ Author of last commit
+# $Date:: 2023-02-16 11:56:52 +0100 (Thu, 16 Feb 2023) $ Date of last commit
+# IPSL (2006)
+#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
+#
+#**************************************************************
+# ID of your genci project. Curie only : post-processing jobs need it to run properly
+#-Q- curie export BRIDGE_MSUB_PROJECT=::default_project::
+#-Q- irene export BRIDGE_MSUB_PROJECT=::default_project::
+#-Q- irene-amd export BRIDGE_MSUB_PROJECT=::default_project::
+
+#set -eu
+#set -vx
+
+libIGCM=::modipsl::/libIGCM
+
+#D- Task type DO NOT CHANGE (computing, post-processing or checking)
+TaskType=post-processing
+
+#D--------------------------------------------------------------------==
+#D-                   -1. User modification place
+#D--------------------------------------------------------------------==
+
+#D- Increased verbosity (1, 2, 3)
+Verbosity=3
+
+#D- Low level debug : to bypass lib test checks and stack construction
+#D- Default=true
+DEBUG_debug=false
+
+#D--------------------------------------------------------------------==
+echo ""
+echo "clean_or_continue.job "
+if  [ $# -gt 0 ] ; then
+    # Print help and exit
+    echo ""
+    echo "The script is called from in the your experiment directory, the so-called SUBMIT_DIR, in the following way"
+    echo "../../../libIGCM/clean_or_continue.job -h      : to print following information"
+    echo "../../../libIGCM/clean_or_continue.job         : normal execution"
+    echo ""
+    echo "This script can be used for 3 cases:"
+    echo "1- The simulation crashed and you have PeriodState=Fatal in run.card."
+    echo "For this case, all output from the current PeriodLength set in run.card will be deleted. "
+    echo "You need to answer yes to the questions."
+    echo ""
+    echo "2- The simulation stopped due to an exceeded time limit, PeriodState=Running in run.card". 
+    echo "As for case 1, all output from the current PeriodLength will be deleted and you should answer yes to questions".
+    echo ""
+    echo "3- The simulation is completed but you want to continue it, PeriodState=Completed in run.card."
+    echo "For this case, you just need to change DateEnd in config.card and launch this script."
+    echo ""
+    echo "For all cases, the run.card is changed as needed and the number for the current period is set in the main Job_ for the Script_Output_ file"
+    echo ""
+    echo "This script needs to delete files to work correctly. Therefore you should answer yes to the questions."
+    echo ""
+
+    exit
+fi
+echo ""
+echo "This script needs to delete files to work correctly. Therefore you should answer yes to the questions."
+echo "Use ../../../libIGCM/clean_or_contine.job -h  for more information"
+echo ""
+
+#D--------------------------------------------------------------------==
+
+. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
+. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
+. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
+#-------
+SUBMIT_DIR=$( pwd )
+. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
+. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
+#-------
+( ${DEBUG_debug} ) && IGCM_debug_Check
+( ${DEBUG_debug} ) && IGCM_card_Check
+( ${DEBUG_debug} ) && IGCM_date_Check
+
+clean_CESMEP()
+{
+    IGCM_card_DefineVariableFromOption ${prefix}config.card Post Cesmep
+    if [ ${config_Post_Cesmep} != FALSE ]; then
+	echo -e "\033[1;32mDo you want to erase the CESMEP atlas and dedicated CliMAF cache) ?"
+	echo -n -e " Your answer (y/n) : \033[m"
+	read reponse
+	case ${reponse} in
+	    oui|OUI|o|y|yes|YES)
+		$SUBMIT_DIR/cesmep_lite/libIGCM_clean.sh
+		;;
+	esac  
+    fi
+}
+
+#==================================
+# First of all
+#
+# Read libIGCM compatibility version in config.card
+# Read UserChoices section
+# Read Ensemble section
+# Read Post section
+# Define all netcdf output directories
+#==================================
+IGCM_config_CommonConfiguration ${SUBMIT_DIR}/config.card
+
+#==================================
+# Define default value to keep compatibility with previous card: means before changes due to TGCC
+if [ X${PackDefault} = Xtrue ] ; then
+  [ X${config_Post_PackFrequency} = X ] && config_Post_PackFrequency=${config_Post_RebuildFrequency}
+else
+  config_Post_PackFrequency=NONE
+fi
+
+#==================================
+# Is the pack active
+if ( [ ! X${config_Post_PackFrequency} = X${NULL_STR} ] && [ ! X${config_Post_PackFrequency} = XNONE ] ) ; then
+  Pack=true
+fi
+
+IGCM_sys_TestDirArchive ${R_SAVE}
+[ $? != 0 ] && IGCM_debug_Exit "IGCM_sys_TestDirArchive"
+
+if [ ! -f ${SUBMIT_DIR}/run.card ]; then
+  echo "You seem NOT to have a run.card in this directory !!"
+  echo "This script will fail because it doesn't know what to do without run.card available."
+  exit 1
+else
+  #===================================#
+  #        Read updated run.card      #
+  #===================================#
+  IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration PeriodState
+  IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration PeriodDateBegin
+  IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration PeriodDateEnd
+  IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration CumulPeriod
+
+  # 
+  if [ X${run_Configuration_CumulPeriod} = X ] ; then
+    echo -e "\033[1;32mCumulPeriod is empty so we want to erase run.card to start properly. Do you want that?"
+    echo -n -e " Your answer (y/n) : \033[m"
+    read reponse
+    case ${reponse} in
+
+    oui|OUI|o|y|yes|YES)
+      echo "OK. Now you can submit the Job : ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}."
+      IGCM_sys_Rm ${SUBMIT_DIR}/run.card
+      ;;
+    non|NON|n|no|NO)
+      echo "Nothing to do !"
+      ;;
+    esac
+    clean_CESMEP
+    exit 0
+  fi
+
+  PeriodDateEnd=$( IGCM_date_ConvertFormatToGregorian ${run_Configuration_PeriodDateEnd} )
+  echo "Search files with ${PeriodDateEnd} in ${R_SAVE}"
+  set +A ListFiles -- $( IGCM_sys_RshArchive "find ${R_SAVE} -name \"*${PeriodDateEnd}*\" " )
+  CountListFiles=${#ListFiles[@]}
+
+  if [ X${Pack} = Xtrue ] ; then
+    echo "Search files with ${PeriodDateEnd} in ${R_BUFR}"
+    set +A ListFilesBuf -- $( IGCM_sys_RshMaster "find ${R_BUFR} -name \"*${PeriodDateEnd}*\" " )
+    CountListFilesBuf=${#ListFilesBuf[@]}
+  else
+    CountListFilesBuf=0
+  fi
+
+  # If exist, erase REBUILD DIR
+  PeriodDateBegin=$( IGCM_date_ConvertFormatToGregorian ${run_Configuration_PeriodDateBegin} )
+  CountRebuildDir=0
+  if [ X${config_Post_RebuildFrequency} != X ] ; then
+    set +A RebuildDir -- $( find ${REBUILD_DIR} -type d -name "*${PeriodDateBegin}*" )
+    CountRebuildDir=${#RebuildDir[@]}
+  fi
+
+  IGCM_debug_Print 1 "Number of files to be erased : ${CountListFiles}."
+  if ( [ ${CountListFiles} -gt 0 ] || [ ${CountListFilesBuf} -gt 0 ] ) ; then
+    for file in ${ListFiles[@]} ; do
+      IGCM_debug_Print 2 -e "\033[1;31m ${file}\033[m"
+    done
+    if [ X${Pack} = Xtrue ] ; then
+      for file in ${ListFilesBuf[@]} ; do
+        IGCM_debug_Print 2 -e "\033[1;31m ${file}\033[m"
+      done
+    fi
+    echo -e "\033[1;32mDo you REALLY want to erase all those files ?"
+    echo -n -e " Your answer (y/n) : \033[m"
+    read reponse
+    case ${reponse} in
+
+      oui|OUI|o|y|yes|YES)
+        echo "OK. It will be erased."
+        IGCM_sys_RshArchive "find ${R_SAVE} -name \"*${PeriodDateEnd}*\" -exec rm -f '{}' \;"
+        if [ X${Pack} = Xtrue ] ; then
+          IGCM_sys_RshMaster  "find ${R_BUFR} -name \"*${PeriodDateEnd}*\" -exec rm -f '{}' \;"
+        fi
+        echo "done."
+        ;;
+      non|NON|n|no|NO)
+        echo "Nothing to do !"
+        ;;
+    esac
+  fi
+
+  if [ ${CountRebuildDir} -gt 0 ] ; then
+    IGCM_debug_Print 1 "Number of REBUILD Dirs to be erased : ${CountRebuildDir}."
+    for Dir in ${RebuildDir[@]} ; do
+      IGCM_debug_Print 2 -e "\033[1;31m ${Dir}\033[m"
+    done
+
+    echo -e "\033[1;32mDo you REALLY want to erase all those Directories ?"
+    echo -n -e " Your answer (y/n) : \033[m"
+    read reponse
+    case ${reponse} in
+
+      oui|OUI|o|y|yes|YES)
+        echo "OK. It will be erased."
+        find ${REBUILD_DIR} -type d -name "*${PeriodDateBegin}*" -exec rm -Rf '{}' \;
+        echo "done."
+        ;;
+      non|NON|n|no|NO)
+        echo "Nothing to do !"
+        ;;
+    esac
+  fi
+
+  IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration PeriodState
+  if ( [ ${run_Configuration_PeriodState} != "Running" ] && [ ${run_Configuration_PeriodState} != "OnQueue" ] && [ ${run_Configuration_PeriodState} != "Continue" ] ) ; then
+
+    echo -e "\033[1;32mNOW do you want to continue the simulation (Set PeriodState=OnQueue into run.card) ?"
+    echo -n -e " Your answer (y/n) : \033[m"
+    read reponse
+    case ${reponse} in
+
+      oui|OUI|o|y|yes|YES)
+        echo "OK. Now you can submit the Job : ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}."
+        IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodState "OnQueue"
+        ;;
+      non|NON|n|no|NO)
+        echo "Nothing to do !"
+        ;;
+    esac
+  else
+    echo "You can submit the Job : ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}."
+  fi
+
+  if [ X${run_Configuration_CumulPeriod} = X1 ] ; then
+    echo -e "\033[1;32mCumulPeriod=1 so we want to erase run.card to start properly. Do you want that too?"
+    echo -n -e " Your answer (y/n) : \033[m"
+    read reponse
+    case ${reponse} in
+
+      oui|OUI|o|y|yes|YES)
+        echo "OK. Now you can submit the Job : ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}."
+        IGCM_sys_Rm ${SUBMIT_DIR}/run.card
+        ;;
+      non|NON|n|no|NO)
+        echo "Nothing to do !"
+        ;;
+    esac
+  else
+    # if not first period
+    Script_Output_Prefix=${config_UserChoices_Script_Output_Prefix:='Script_Output'}
+    Script_Output_Job=${Script_Output_Prefix}_${config_UserChoices_JobName}
+    Script_Output=${Script_Output_Prefix}_${config_UserChoices_JobName}.$( printf "%06d" ${run_Configuration_CumulPeriod} )
+
+    echo -e "\033[1;32mDo you want to change the number in Script_Output? (${Script_Output} into Job) ?"
+    echo -n -e " Your answer (y/n) : \033[m"
+    read reponse
+    case ${reponse} in
+
+      oui|OUI|o|y|yes|YES)
+        cp ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}_SAVED_$$
+        sed -e"s/${Script_Output_Job}.[0-9][0-9][0-9][0-9][0-9][0-9]/${Script_Output}/"  ${SUBMIT_DIR}/Job_${config_UserChoices_JobName}_SAVED_$$  >${SUBMIT_DIR}/Job_${config_UserChoices_JobName}
+        echo "Job : Job_${config_UserChoices_JobName} modified."
+        echo "Old job saved here : Job_${config_UserChoices_JobName}_SAVED_$$"
+        ;;
+      non|NON|n|no|NO)
+        echo "Nothing done in Job_${config_UserChoices_JobName} !"
+        ;;
+    esac
+
+  fi
+fi
+exit 0
Index: branches/libIGCM_CESMEP/AA_create_multi_se
===================================================================
--- branches/libIGCM_CESMEP/AA_create_multi_se	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_create_multi_se	(revision 1585)
@@ -58,13 +58,13 @@
 #-Q- ada # @ environment  = $DEBUG_debug ; $BigBrother ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $POST_DIR ; $Script_Post_Output ; $MASTER ; $DateBegin ; $PeriodDateEnd ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; wall_clock_limit=$(wall_clock_limit)
 #-Q- ada # @ queue
-#-Q- lxiv8 ######################
-#-Q- lxiv8 ## OBELIX      LSCE ##
-#-Q- lxiv8 ######################
-#-Q- lxiv8 #PBS -N MULTISE
-#-Q- lxiv8 #PBS -m a
-#-Q- lxiv8 #PBS -j oe
-#-Q- lxiv8 #PBS -q medium
-#-Q- lxiv8 #PBS -o MULTISE.$$
-#-Q- lxiv8 #PBS -S /bin/ksh
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N MULTISE
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q medium
+#-Q- obelix #PBS -o MULTISE.$$
+#-Q- obelix #PBS -S /bin/ksh
 #-Q- ifort_CICLAD ######################
 #-Q- ifort_CICLAD ##   CICLAD    IPSL ##
Index: branches/libIGCM_CESMEP/AA_create_se
===================================================================
--- branches/libIGCM_CESMEP/AA_create_se	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_create_se	(revision 1585)
@@ -72,13 +72,22 @@
 #-Q- ada # @ environment  = $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $POST_DIR ; $Script_Post_Output ; $MASTER ; $DateBegin ; $PeriodDateEnd ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; wall_clock_limit=$(wall_clock_limit)
 #-Q- ada # @ queue
-#-Q- lxiv8 ######################
-#-Q- lxiv8 ## OBELIX      LSCE ##
-#-Q- lxiv8 ######################
-#-Q- lxiv8 #PBS -N SE
-#-Q- lxiv8 #PBS -m a
-#-Q- lxiv8 #PBS -j oe
-#-Q- lxiv8 #PBS -q medium
-#-Q- lxiv8 #PBS -o SE.$$
-#-Q- lxiv8 #PBS -S /bin/ksh
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N SE
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q medium
+#-Q- obelix #PBS -o SE.$$
+#-Q- obelix #PBS -S /bin/ksh
+#-Q- mesoipsl #!/bin/ksh
+#-Q- mesoipsl ######################
+#-Q- mesoipsl ## MESO ESPRI IPSL  ##
+#-Q- mesoipsl ######################
+#-Q- mesoipsl #SBATCH --job-name=TS         # Job Name
+#-Q- mesoipsl #SBATCH --output=TS.out_%I    # standard output
+#-Q- mesoipsl #SBATCH --error=TS.out_%I     # error output
+#-Q- mesoipsl #SBATCH -N  1                        # Number of core
+#-Q- mesoipsl #SBATCH --time=10:00:00       # Wall clock limit (seconds)
 #-Q- ifort_CICLAD ######################
 #-Q- ifort_CICLAD ##   CICLAD    IPSL ##
Index: branches/libIGCM_CESMEP/AA_create_ts
===================================================================
--- branches/libIGCM_CESMEP/AA_create_ts	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_create_ts	(revision 1585)
@@ -70,13 +70,22 @@
 #-Q- ada # @ environment  = $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $POST_DIR ; $Script_Post_Output ; $MASTER ; $RebuildFrequency ; $DateBegin ; $PeriodDateEnd ; $StandAlone ; $CompletedFlag ; $TsTask ; $CompToRead ; $FlagToRead ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; wall_clock_limit=$(wall_clock_limit)
 #-Q- ada # @ queue
-#-Q- lxiv8 ######################
-#-Q- lxiv8 ## OBELIX      LSCE ##
-#-Q- lxiv8 ######################
-#-Q- lxiv8 #PBS -N TS
-#-Q- lxiv8 #PBS -m a
-#-Q- lxiv8 #PBS -j oe
-#-Q- lxiv8 #PBS -q medium
-#-Q- lxiv8 #PBS -o TS.$$
-#-Q- lxiv8 #PBS -S /bin/ksh
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N TS
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q medium
+#-Q- obelix #PBS -o TS.$$
+#-Q- obelix #PBS -S /bin/ksh
+#-Q- mesoipsl #!/bin/ksh
+#-Q- mesoipsl ######################
+#-Q- mesoipsl ## MESO ESPRI IPSL  ##
+#-Q- mesoipsl ######################
+#-Q- mesoipsl #SBATCH --job-name=TS         # Job Name
+#-Q- mesoipsl #SBATCH --output=TS.out_%I    # standard output
+#-Q- mesoipsl #SBATCH --error=TS.out_%I     # error output
+#-Q- mesoipsl #SBATCH -N  1                        # Number of core
+#-Q- mesoipsl #SBATCH --time=10:00:00       # Wall clock limit (seconds)
 #-Q- ifort_CICLAD ######################
 #-Q- ifort_CICLAD ##   CICLAD    IPSL ##
@@ -824,5 +833,5 @@
 if ( [ X${TsTask} = X2D ] || [ X${TsTask} = X3D ] || [ X${TsTask} = X ] ) ; then
   # From 2D and 3D it is the last one to finish that will submit the monitoring.
-  if [ ! "X$( grep "IGCM_sys_RmRunDir" ${POST_DIR}/create_ts.${PeriodDateEnd}.[23]D.out 2> /dev/null )" = "X" ] ; then
+  if ( [ $( ls ${POST_DIR}/create_ts.${PeriodDateEnd}.[23]D.out | wc -l ) = 1 ] || [ ! "X$( grep "IGCM_sys_RmRunDir" ${POST_DIR}/create_ts.${PeriodDateEnd}.[23]D.out 2> /dev/null )" = "X" ] ) ; then
     Script_Post_Output=monitoring.${PeriodDateEnd}
     IGCM_sys_QsubPost monitoring
@@ -832,5 +841,4 @@
   fi
 fi
-
 #D-
 # --------------------------------------------------------------------
Index: branches/libIGCM_CESMEP/AA_job
===================================================================
--- branches/libIGCM_CESMEP/AA_job	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_job	(revision 1585)
@@ -99,15 +99,27 @@
 #-Q- ada # End of the header options
 #-Q- ada # @ queue
-#-Q- lxiv8 ######################
-#-Q- lxiv8 ## OBELIX      LSCE ##
-#-Q- lxiv8 ######################
-#-Q- lxiv8 #PBS -N ::Jobname::
-#-Q- lxiv8 #PBS -m a
-#-Q- lxiv8 #PBS -j oe
-#-Q- lxiv8 #PBS -q mediump
-#-Q- lxiv8 #PBS -o Script_Output_::Jobname::.000001
-#-Q- lxiv8 #PBS -S /bin/ksh
-#-Q- lxiv8 #PBS -v BATCH_NUM_PROC_TOT=::JobNumProcTot::
-#-Q- lxiv8 #PBS -l nodes=1:ppn=::JobNumProcTot::
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N ::Jobname::
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q mediump
+#-Q- obelix #PBS -o Script_Output_::Jobname::.000001
+#-Q- obelix #PBS -S /bin/ksh
+#-Q- obelix #PBS -v BATCH_NUM_PROC_TOT=::JobNumProcTot::
+#-Q- obelix #PBS -l nodes=1:ppn=::JobNumProcTot::
+#-Q- mesoipsl #!/bin/ksh
+#-Q- mesoipsl ######################
+#-Q- mesoipsl ## MESO ESPRI IPSL  ##
+#-Q- mesoipsl ######################
+#-Q- mesoipsl #SBATCH --job-name=::Jobname::        # Job Name
+#-Q- mesoipsl #SBATCH --output=Script_Output_::Jobname::.000001    # standard output
+#-Q- mesoipsl #SBATCH --error=Script_Output_::Jobname::.000001    # error output
+#-Q- mesoipsl #SBATCH --ntasks=::JobNumProcTot::   # Number of MPI tasks
+#-Q- mesoipsl #SBATCH --cpus-per-task=::openMPthreads::  # Number of openMP threads.
+#-Q- mesoipsl #SBATCH --hint=nomultithread         # 1 processus MPI par par physical core (no hyperthreading) 
+#-Q- mesoipsl #SBATCH --time=30                    # Wall clock limit (minutes)
+#-Q- mesoipsl set +x
 #-Q- ifort_CICLAD ######################
 #-Q- ifort_CICLAD ##   CICLAD    IPSL ##
@@ -205,5 +217,5 @@
 #D- Default=false
 #D-
-BigBrother=true
+BigBrother=false
 
 #D- Set DEBUG_sys to false to disable output calls of function
@@ -232,8 +244,8 @@
 #R_IN=/u/rech/por/rpor111/DATA
 
-#D- Turn in dry run mode ? (0,1,2,3)
+#D- Turn in dry run mode ? (0,1,2,3,4)
 #D- Default=0
 #D-
-#DRYRUN=3
+DRYRUN=0
 #D-# YOU HAVE TO COMPILE YOUR EXE FILES to USE DRYRUN MODE !
 #D-# -------------------------------------------------------------------------------------
@@ -250,5 +262,6 @@
 #D-# |    3     |       yes           |    no      |  no     |      no                   |
 #D-# -------------------------------------------------------------------------------------
-
+#D-# |    4     |       yes           |    yes     |  creation of RUN_DIR and Job_debug  |
+#D-# -------------------------------------------------------------------------------------
 #D-
 # --------------------------------------------------------------------------------------------------#
@@ -520,34 +533,38 @@
 
   echo "========================================================================"
-  if [ ${DRYRUN} -le 1 ] ; then
-    REAL_DATE_INIT=$( date )
-    echo                                                                                   > ${Exe_Output}
-    echo "#######################################"                                        >> ${Exe_Output}
-    echo "EXECUTION of : ${EXECUTION}"
-    echo "EXECUTION of : ${EXECUTION}"                                                    >> ${Exe_Output}
-    echo                                                                                  >> ${Exe_Output}
-    typeset RET
-    RUN_DATE_BEGIN=$( date '+%Y-%m-%dT%H:%M:%S' )
-    ${EXECUTION}  >> ${Exe_Output} 2>&1
-    RET=$?
-    RUN_DATE_END=$( date '+%Y-%m-%dT%H:%M:%S' )
-    if [ ${RET} -gt 0 ] ; then
-      echo "Return code of executable :" ${RET}
-      IGCM_debug_Exit "EXECUTABLE"
-      IGCM_sys_Mkdir ${SUBMIT_DIR}/Debug
-      IGCM_sys_Cp ${Exe_Output} ${SUBMIT_DIR}/Debug/${PREFIX}_${Exe_Output}_error
-      ExecutionFail=true
-    fi
-    echo                                            >> ${Exe_Output}
-    echo "#######################################"  >> ${Exe_Output}
-    echo "libIGCM RunDateBegin=${RUN_DATE_BEGIN}"   >> ${Exe_Output}
-    echo "libIGCM RunDateEnd=${RUN_DATE_END}"       >> ${Exe_Output}
-    echo                                            >> ${Exe_Output}
+  if [ ${DRYRUN_DEBUG} = 4 ] ; then
+      IGCM_sys_create_run_dir 
   else
-    echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN
-    echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN > ${Exe_Output}
-    if ( $DEBUG_debug ) ; then
-      echo "FOR EXECUTION DRYRUN mode = " $DRYRUN >> stack
-    fi
+      if [ ${DRYRUN} -le 1 ] ; then
+	  REAL_DATE_INIT=$( date )
+	  echo                                                                                   > ${Exe_Output}
+	  echo "#######################################"                                        >> ${Exe_Output}
+	  echo "EXECUTION of : ${EXECUTION}"
+	  echo "EXECUTION of : ${EXECUTION}"                                                    >> ${Exe_Output}
+	  echo                                                                                  >> ${Exe_Output}
+	  typeset RET
+	  RUN_DATE_BEGIN=$( date '+%Y-%m-%dT%H:%M:%S' )
+	  ${EXECUTION}  >> ${Exe_Output} 2>&1
+	  RET=$?
+	  RUN_DATE_END=$( date '+%Y-%m-%dT%H:%M:%S' )
+	  if [ ${RET} -gt 0 ] ; then
+	      echo "Return code of executable :" ${RET}
+	      IGCM_debug_Exit "EXECUTABLE"
+	      IGCM_sys_Mkdir ${SUBMIT_DIR}/Debug
+	      IGCM_sys_Cp ${Exe_Output} ${SUBMIT_DIR}/Debug/${PREFIX}_${Exe_Output}_error
+	      ExecutionFail=true
+	  fi
+	  echo                                            >> ${Exe_Output}
+	  echo "#######################################"  >> ${Exe_Output}
+	  echo "libIGCM RunDateBegin=${RUN_DATE_BEGIN}"   >> ${Exe_Output}
+	  echo "libIGCM RunDateEnd=${RUN_DATE_END}"       >> ${Exe_Output}
+	  echo                                            >> ${Exe_Output}
+      else
+	  echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN
+	  echo "EXECUTION of : ${EXECUTION} simulated for DRYRUN = " $DRYRUN > ${Exe_Output}
+	  if ( $DEBUG_debug ) ; then
+	      echo "FOR EXECUTION DRYRUN mode = " $DRYRUN >> stack
+	  fi
+      fi
   fi
   echo "========================================================================"
Index: branches/libIGCM_CESMEP/AA_job_debug
===================================================================
--- branches/libIGCM_CESMEP/AA_job_debug	(revision 1585)
+++ branches/libIGCM_CESMEP/AA_job_debug	(revision 1585)
@@ -0,0 +1,256 @@
+#-Q- curie #!/bin/ksh
+#-Q- curie ######################
+#-Q- curie ## CURIE   TGCC/CEA ##
+#-Q- curie ######################
+#-Q- curie #MSUB -r ::Jobname::        # Job Name
+#-Q- curie #MSUB -o Script_Output_::Jobname::.000001    # standard output
+#-Q- curie #MSUB -e Script_Output_::Jobname::.000001    # error output
+#-Q- curie #MSUB -eo
+#-Q- curie #MSUB -n ::JobNumProcTot::  # Number of MPI tasks (SPMD case) or cores (MPMD case)
+#-Q- curie #MSUB -c ::openMPthreads::  # Number of openMP threads. To specify only for SMPD
+#-Q- curie #MSUB -x                    # exclusive node. To specify only for MPMD together with the one below
+#-Q- curie #MSUB -E '--cpu_bind=none'
+#-Q- curie ##MSUB -E '--distribution cyclic' 
+#-Q- curie #MSUB -T 86400              # Wall clock limit (seconds)
+#-Q- curie #MSUB -q standard           # thin nodes
+#-Q- curie ##MSUB -U high
+#-Q- curie #MSUB -U medium
+#-Q- curie ##MSUB -U low
+#-Q- curie #MSUB -A ::default_project::
+#-Q- curie #MSUB -E --no-requeue
+#-Q- curie # Below specific options that can be activated 
+#-Q- curie ##MSUB -q ivybridge         # Option for Airain
+#-Q- curie
+#-Q- curie BATCH_NUM_PROC_TOT=$BRIDGE_MSUB_NPROC
+#-Q- curie set +x
+#-Q- irene #!/bin/ksh
+#-Q- irene ######################
+#-Q- irene ## IRENE   TGCC/CEA ##
+#-Q- irene ######################
+#-Q- irene #MSUB -r ::Jobname::        # Job Name
+#-Q- irene #MSUB -o Script_Output_::Jobname::.000001    # standard output
+#-Q- irene #MSUB -e Script_Output_::Jobname::.000001    # error output
+#-Q- irene #MSUB -eo
+#-Q- irene #MSUB -n ::JobNumProcTot::  # Number of MPI tasks (SPMD case) or cores (MPMD case)
+#-Q- irene #MSUB -c ::openMPthreads::  # Number of openMP threads. To specify only for SMPD
+#-Q- irene #MSUB -x                    # exclusive node. To specify only for MPMD together with the one below
+#-Q- irene #MSUB -E '--cpu_bind=none'
+#-Q- irene #MSUB -T ::WallTime::              # Wall clock limit (seconds)
+#-Q- irene #MSUB -A ::default_project::
+#-Q- irene #MSUB -q skylake
+#-Q- irene #MSUB -m store,work,scratch
+#-Q- irene
+#-Q- irene BATCH_NUM_PROC_TOT=$BRIDGE_MSUB_NPROC
+#-Q- irene set +x
+#-Q- irene-amd #!/bin/ksh
+#-Q- irene-amd ######################
+#-Q- irene-amd ## IRENE-AMD   TGCC/CEA ##
+#-Q- irene-amd ######################
+#-Q- irene-amd #MSUB -r ::Jobname::        # Job Name
+#-Q- irene-amd #MSUB -o Script_Output_::Jobname::.000001    # standard output
+#-Q- irene-amd #MSUB -e Script_Output_::Jobname::.000001    # error output
+#-Q- irene-amd #MSUB -eo
+#-Q- irene-amd #MSUB -n ::JobNumProcTot::  # Number of MPI tasks (SPMD case) or cores (MPMD case)
+#-Q- irene-amd #MSUB -c ::openMPthreads::  # Number of openMP threads. To specify only for SMPD
+#-Q- irene-amd #MSUB -x                    # exclusive node. To specify only for MPMD together with the one below
+#-Q- irene-amd #MSUB -T ::WallTime::              # Wall clock limit (seconds)
+#-Q- irene-amd #MSUB -A ::default_project::
+#-Q- irene-amd #MSUB -q rome
+#-Q- irene-amd #MSUB -m store,work,scratch
+#-Q- irene-amd
+#-Q- irene-amd BATCH_NUM_PROC_TOT=$BRIDGE_MSUB_NPROC
+#-Q- irene-amd set +x
+#-Q- jeanzay #!/bin/ksh
+#-Q- jeanzay ######################
+#-Q- jeanzay ## JEANZAY    IDRIS ##
+#-Q- jeanzay ######################
+#-Q- jeanzay #SBATCH --job-name=::Jobname::        # Job Name
+#-Q- jeanzay #SBATCH --output=Script_Output_::Jobname::.000001    # standard output
+#-Q- jeanzay #SBATCH --error=Script_Output_::Jobname::.000001    # error output
+#-Q- jeanzay #SBATCH --ntasks=::JobNumProcTot::   # Number of MPI tasks
+#-Q- jeanzay #SBATCH --cpus-per-task=::openMPthreads::  # Number of openMP threads.
+#-Q- jeanzay #SBATCH --hint=nomultithread         # 1 processus MPI par par physical core (no hyperthreading) 
+#-Q- jeanzay #SBATCH --time=::WallTime::             # Wall clock limit (minutes)
+#-Q- jeanzay #SBATCH --account ::default_project::@cpu
+#-Q- jeanzay
+#-Q- jeanzay ##BATCH_NUM_PROC_TOT=$BRIDGE_SBATCH_NPROC
+#-Q- jeanzay set +x
+#-Q- ada #!/bin/ksh
+#-Q- ada # ######################
+#-Q- ada # ##  ADA       IDRIS ##
+#-Q- ada # ######################
+#-Q- ada # Job name 
+#-Q- ada # @ job_name = ::Jobname::
+#-Q- ada # Standard output file name
+#-Q- ada # @ output = Script_Output_::Jobname::.000001
+#-Q- ada # Error output file name
+#-Q- ada # @ error = Script_Output_::Jobname::.000001
+#-Q- ada # Job type
+#-Q- ada # @ job_type = parallel
+#-Q- ada # Total number of tasks
+#-Q- ada # @ total_tasks = ::JobNumProcTot::
+#-Q- ada # Specific option for OpenMP parallelization: Number of OpenMP threads per MPI task
+#-Q- ada # @ parallel_threads = ::openMPthreads::
+#-Q- ada # Memory : as_limit=3.5gb max per process per core. With 4 threads per process use max as_limit=14gb
+#-Q- ada # @ as_limit = 3.5gb
+#-Q- ada # Maximum CPU time per task hh:mm:ss
+#-Q- ada # @ wall_clock_limit = 1:00:00
+#-Q- ada # @ environment = "BATCH_NUM_PROC_TOT=::JobNumProcTot::" ; wall_clock_limit=$(wall_clock_limit)
+#-Q- ada # End of the header options
+#-Q- ada # @ queue
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N ::Jobname::
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q mediump
+#-Q- obelix #PBS -o Script_Output_::Jobname::.000001
+#-Q- obelix #PBS -S /bin/ksh
+#-Q- obelix #PBS -v BATCH_NUM_PROC_TOT=::JobNumProcTot::
+#-Q- obelix #PBS -l nodes=1:ppn=::JobNumProcTot::
+#-Q- mesoipsl #!/bin/ksh
+#-Q- mesoipsl ######################
+#-Q- mesoipsl ## MESO ESPRI IPSL  ##
+#-Q- mesoipsl ######################
+#-Q- mesoipsl #SBATCH --job-name=::Jobname::        # Job Name
+#-Q- mesoipsl #SBATCH --output=Script_Output_::Jobname::.000001    # standard output
+#-Q- mesoipsl #SBATCH --error=Script_Output_::Jobname::.000001    # error output
+#-Q- mesoipsl #SBATCH --ntasks=::JobNumProcTot::   # Number of MPI tasks
+#-Q- mesoipsl #SBATCH --cpus-per-task=::openMPthreads::  # Number of openMP threads.
+#-Q- mesoipsl #SBATCH --hint=nomultithread         # 1 processus MPI par par physical core (no hyperthreading) 
+#-Q- mesoipsl #SBATCH --time=30                    # Wall clock limit (minutes)
+#-Q- mesoipsl set +x
+#-Q- ifort_CICLAD ######################
+#-Q- ifort_CICLAD ##   CICLAD    IPSL ##
+#-Q- ifort_CICLAD ######################
+#-Q- ifort_CICLAD #PBS -N ::Jobname::
+#-Q- ifort_CICLAD #PBS -m a
+#-Q- ifort_CICLAD #PBS -j oe
+#-Q- ifort_CICLAD ###PBS -q h12   # Queue for 12 hours at ciclad only
+#-Q- ifort_CICLAD #PBS -o Script_Output_::Jobname::.000001
+#-Q- ifort_CICLAD #PBS -S /bin/ksh
+#-Q- ifort_CICLAD #PBS -v BATCH_NUM_PROC_TOT=::JobNumProcTot::
+#-Q- ifort_CICLAD #PBS -l nodes=1:ppn=::JobNumProcTot::
+#-Q- ifort_CICLAD #PBS -l mem=6gb
+#-Q- ifort_CICLAD #PBS -l vmem=30gb
+#-Q- default #!/bin/ksh
+#-Q- default ##################
+#-Q- default ## DEFAULT HOST ##
+#-Q- default ##################
+#-Q- default #For MPI use, uncomment next line :
+#-Q- default #BATCH_NUM_PROC_TOT=::JobNumProcTot::
+
+#**************************************************************
+# Author: Sebastien Denvil
+# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
+# $Revision:: 1536                                     $ Revision of last commit
+# $Author:: rpennel                                    $ Author of last commit
+# $Date:: 2020-07-03 15:16:53 +0200 (Fri, 03 Jul 2020) $ Date of last commit
+# IPSL (2006)
+#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
+#
+#**************************************************************
+
+date
+
+echo
+echo "#######################################"
+echo "#  ANOTHER GREAT DEBUG SIMULATION #"
+echo "#######################################"
+echo
+
+#D------------------------------------------------------
+#D- ENVIRONMENT
+#D-     - Loading environment needed to run
+#D------------------------------------------------------
+
+MODIPSL=::modipsl::
+libIGCM=${MODIPSL}/libIGCM
+SRF_comp=::SRF_comp::
+OCE_comp=::OCE_comp::
+CPL_comp=::CPL_comp::
+CHM_comp=::CHM_comp::
+JobName=::JOBNAME::
+::SUBMIT_DIR::
+ExecutionType=::EXECUTION_TYPE::
+
+#-Q- jeanzay . /gpfslocalsup/spack_soft/environment-modules/current/init/ksh
+#-Q- mesoipsl . /etc/profile.d/modules.sh
+
+. ./arch.env
+
+module list
+
+# Enable the copy of binary files from modipsl directory (default n)
+# Could be useful in case of modifications (and so recompilation) in the sources
+copy_executable=n
+
+#D------------------------------------------------------
+#D- EXECUTION
+#D-     - Copy binary files from modipsl directory (only if copy_executable=y)
+#D-     - Remove of some out restart files 
+#D-     - Execution
+#D------------------------------------------------------
+
+cd ${SUBMIT_DIR}
+
+if [ X${copy_executable} = Xy ] ; then
+while read EXEIN EXEOUT ;do
+ eval EXEIN=${EXEIN}
+ cp ${MODIPSL}/bin/${EXEIN} ${EXEOUT}
+done < components_binary.txt
+fi
+
+if [ X${SRF_comp} = Xy ] ; then
+  [ -f sechiba_rest_out.nc ] && rm -f sechiba_rest_out.nc
+  [ -f stomate_rest_out.nc ] && rm -f stomate_rest_out.nc
+  [ -f driver_rest_out.nc ] && rm -f driver_rest_out.nc
+fi
+if [ X${OCE_comp} = Xy ] ; then
+  [ X${JobName} != X ] && rm -f ${JobName}*restart*.nc
+fi
+
+if [ X${CPL_comp} = Xy ] ; then
+  if [ -f sstoc_orig.nc ] ; then
+    cp sstoc_orig.nc sstoc.nc
+    cp flxat_orig.nc flxat.nc
+    cp icbrg_orig.nc icbrg.nc
+    cp icshf_orig.nc icshf.nc
+  else
+   cp sstoc.nc sstoc_orig.nc
+   cp flxat.nc flxat_orig.nc
+   cp icbrg.nc icbrg_orig.nc
+   cp icshf.nc icshf_orig.nc
+  fi
+fi
+if [ X${CHM_comp} = Xy ] ; then
+  [ -f reprecipinsoil.dat ] && rm -f reprecipinsoil.dat
+fi
+
+#-Q- jeanzay #Case MPMD + MPI/OpenMP
+#-Q- jeanzay if [ ${ExecutionType} -eq 2 ] ; then
+#-Q- jeanzay    _bkIFS=$IFS;
+#-Q- jeanzay    IFS=$'\n'; set -f
+#-Q- jeanzay    listnodes=($(< <( scontrol show hostnames $SLURM_JOB_NODELIST )))
+#-Q- jeanzay    IFS=$_bkIFS; set +f
+#-Q- jeanzay    rm -f hostlist ; cp hostlist_template hostlist
+#-Q- jeanzay    for nb_proc in `seq 0 $(($SLURM_JOB_NUM_NODES-1))`; do
+#-Q- jeanzay        mv hostlist hostlist_tmp
+#-Q- jeanzay        host_value=${listnodes[${nb_proc}]}
+#-Q- jeanzay        sed -e "s/node_${nb_proc}_X/${host_value}/" hostlist_tmp > hostlist
+#-Q- jeanzay    done
+#-Q- jeanzay    export SLURM_HOSTFILE=./hostlist
+#-Q- jeanzay fi
+#-Q- jeanzay # Workaround at Jean-Zay
+#-Q- jeanzay source $I_MPI_ROOT/intel64/bin/mpivars.sh release_mt
+
+
+::EXECUTION:: > out_execution  2>&1
+RET=$?
+if [ ${RET} -gt 0 ] ; then
+    echo "Return code of executable :" ${RET}
+fi
+
+date
+exit
Index: branches/libIGCM_CESMEP/AA_metrics_LMDZ
===================================================================
--- branches/libIGCM_CESMEP/AA_metrics_LMDZ	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_metrics_LMDZ	(revision 1585)
@@ -58,13 +58,13 @@
 #-Q- ada # @ environment  = $POST_DIR ; $Script_Post_Output ; $SUBMIT_DIR ; $libIGCM ; $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $R_INIT ; $R_BC ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $YEARS ; $DIR_OUT ; $MASTER ; $libIGCM_SX ; wall_clock_limit=$(wall_clock_limit)
 #-Q- ada # @ queue
-#-Q- lxiv8 ######################
-#-Q- lxiv8 ## OBELIX      LSCE ##
-#-Q- lxiv8 ######################
-#-Q- lxiv8 #PBS -N METRICS_LMDZ
-#-Q- lxiv8 #PBS -m a
-#-Q- lxiv8 #PBS -j oe
-#-Q- lxiv8 #PBS -q test
-#-Q- lxiv8 #PBS -o METRICS_LMDZ.$$
-#-Q- lxiv8 #PBS -S /bin/ksh
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N METRICS_LMDZ
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q test
+#-Q- obelix #PBS -o METRICS_LMDZ.$$
+#-Q- obelix #PBS -S /bin/ksh
 #-Q- ifort_CICLAD ######################
 #-Q- ifort_CICLAD ##   CICLAD    IPSL ##
Index: branches/libIGCM_CESMEP/AA_metrics_NEMO
===================================================================
--- branches/libIGCM_CESMEP/AA_metrics_NEMO	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_metrics_NEMO	(revision 1585)
@@ -58,13 +58,13 @@
 #-Q- ada # @ environment  = $POST_DIR ; $Script_Post_Output ; $SUBMIT_DIR ; $libIGCM ; $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $R_INIT ; $R_BC ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $YEARS ; $DIR_OUT ; $MASTER ; $libIGCM_SX ; wall_clock_limit=$(wall_clock_limit)
 #-Q- ada # @ queue
-#-Q- lxiv8 ######################
-#-Q- lxiv8 ## OBELIX      LSCE ##
-#-Q- lxiv8 ######################
-#-Q- lxiv8 #PBS -N METRICS_NEMO
-#-Q- lxiv8 #PBS -m a
-#-Q- lxiv8 #PBS -j oe
-#-Q- lxiv8 #PBS -q test
-#-Q- lxiv8 #PBS -o METRICS_NEMO.$$
-#-Q- lxiv8 #PBS -S /bin/ksh
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N METRICS_NEMO
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q test
+#-Q- obelix #PBS -o METRICS_NEMO.$$
+#-Q- obelix #PBS -S /bin/ksh
 #-Q- ifort_CICLAD ######################
 #-Q- ifort_CICLAD ##   CICLAD    IPSL ##
Index: branches/libIGCM_CESMEP/AA_metrics_ORCHIDEE
===================================================================
--- branches/libIGCM_CESMEP/AA_metrics_ORCHIDEE	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_metrics_ORCHIDEE	(revision 1585)
@@ -58,13 +58,13 @@
 #-Q- ada # @ environment  = $POST_DIR ; $Script_Post_Output ; $SUBMIT_DIR ; $libIGCM ; $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $R_INIT ; $R_BC ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $YEARS ; $DIR_OUT ; $MASTER ; $libIGCM_SX ; wall_clock_limit=$(wall_clock_limit)
 #-Q- ada # @ queue
-#-Q- lxiv8 ######################
-#-Q- lxiv8 ## OBELIX      LSCE ##
-#-Q- lxiv8 ######################
-#-Q- lxiv8 #PBS -N METRICS_ORCHIDEE
-#-Q- lxiv8 #PBS -m a
-#-Q- lxiv8 #PBS -j oe
-#-Q- lxiv8 #PBS -q test
-#-Q- lxiv8 #PBS -o METRICS_ORCHIDEE.$$
-#-Q- lxiv8 #PBS -S /bin/ksh
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N METRICS_ORCHIDEE
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q test
+#-Q- obelix #PBS -o METRICS_ORCHIDEE.$$
+#-Q- obelix #PBS -S /bin/ksh
 #-Q- ifort_CICLAD ######################
 #-Q- ifort_CICLAD ##   CICLAD    IPSL ##
Index: branches/libIGCM_CESMEP/AA_monitoring
===================================================================
--- branches/libIGCM_CESMEP/AA_monitoring	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_monitoring	(revision 1585)
@@ -73,13 +73,25 @@
 #-Q- ada # @ environment  = $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $POST_DIR ; $Script_Post_Output ; $SUBMIT_DIR ; $libIGCM ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; wall_clock_limit=$(wall_clock_limit)
 #-Q- ada # @ queue
-#-Q- lxiv8 ######################
-#-Q- lxiv8 ## OBELIX      LSCE ##
-#-Q- lxiv8 ######################
-#-Q- lxiv8 #PBS -N MONITORING
-#-Q- lxiv8 #PBS -m a
-#-Q- lxiv8 #PBS -j oe
-#-Q- lxiv8 #PBS -q medium
-#-Q- lxiv8 #PBS -o MONITORING.$$
-#-Q- lxiv8 #PBS -S /bin/ksh
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N MONITORING
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q medium
+#-Q- obelix #PBS -o MONITORING.$$
+#-Q- obelix #PBS -S /bin/ksh
+#-Q- mesoipsl #!/bin/ksh 
+#-Q- mesoipsl ######################
+#-Q- mesoipsl ## MESO ESPRI IPSL  ##
+#-Q- mesoipsl ######################
+#-Q- mesoipsl #SBATCH --job-name=MONITORING         # Job Name
+#-Q- mesoipsl #SBATCH --output=MONITORING.out_%J    # standard output
+#-Q- mesoipsl #SBATCH --error=MONITORING.out_%J     # error output
+#-Q- mesoipsl #SBATCH --ntasks=1                    # Number of core
+#-Q- mesoipsl #SBATCH --hint=nomultithread          # 1 processus MPI par coeur physique (pas d'hyperthreading)
+#-Q- mesoipsl #SBATCH --time=10:00:00               # Wall clock limit (seconds)
+#-Q- mesoipsl set +x
+#-Q- mesoipsl exit
 #-Q- ifort_CICLAD ######################
 #-Q- ifort_CICLAD ##   CICLAD    IPSL ##
Index: branches/libIGCM_CESMEP/AA_pack_debug
===================================================================
--- branches/libIGCM_CESMEP/AA_pack_debug	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_pack_debug	(revision 1585)
@@ -70,13 +70,13 @@
 #-Q- ada # @ environment  = $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $POST_DIR ; $Script_Post_Output ; $SUBMIT_DIR ; $DateBegin ; $DateEnd ; $PeriodPack ; $StandAlone ; $MASTER ; wall_clock_limit=$(wall_clock_limit)
 #-Q- ada # @ queue
-#-Q- lxiv8 ######################
-#-Q- lxiv8 ## OBELIX      LSCE ##
-#-Q- lxiv8 ######################
-#-Q- lxiv8 #PBS -N PACKDEBUG
-#-Q- lxiv8 #PBS -m a
-#-Q- lxiv8 #PBS -j oe
-#-Q- lxiv8 #PBS -q medium
-#-Q- lxiv8 #PBS -o PACKDEBUG.$$
-#-Q- lxiv8 #PBS -S /bin/ksh
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N PACKDEBUG
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q medium
+#-Q- obelix #PBS -o PACKDEBUG.$$
+#-Q- obelix #PBS -S /bin/ksh
 #-Q- ifort_CICLAD ######################
 #-Q- ifort_CICLAD ##   CICLAD    IPSL ##
Index: branches/libIGCM_CESMEP/AA_pack_output
===================================================================
--- branches/libIGCM_CESMEP/AA_pack_output	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_pack_output	(revision 1585)
@@ -72,13 +72,13 @@
 #-Q- ada # @ environment  = $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $POST_DIR ; $Script_Post_Output ; $SUBMIT_DIR ; $DateBegin ; $DateEnd ; $PeriodPack ; $StandAlone ; $MASTER ; wall_clock_limit=$(wall_clock_limit)
 #-Q- ada # @ queue
-#-Q- lxiv8 ######################
-#-Q- lxiv8 ## OBELIX      LSCE ##
-#-Q- lxiv8 ######################
-#-Q- lxiv8 #PBS -N PACKOUTPUT
-#-Q- lxiv8 #PBS -m a
-#-Q- lxiv8 #PBS -j oe
-#-Q- lxiv8 #PBS -q medium
-#-Q- lxiv8 #PBS -o PACKOUTPUT.$$
-#-Q- lxiv8 #PBS -S /bin/ksh
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N PACKOUTPUT
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q medium
+#-Q- obelix #PBS -o PACKOUTPUT.$$
+#-Q- obelix #PBS -S /bin/ksh
 #-Q- ifort_CICLAD ######################
 #-Q- ifort_CICLAD ##   CICLAD    IPSL ##
Index: branches/libIGCM_CESMEP/AA_pack_restart
===================================================================
--- branches/libIGCM_CESMEP/AA_pack_restart	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_pack_restart	(revision 1585)
@@ -70,13 +70,13 @@
 #-Q- ada # @ environment  = $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $POST_DIR ; $Script_Post_Output ; $SUBMIT_DIR ; $PeriodDateBegin ; $DateBegin ; $DateEnd ; $PeriodPack ; $StandAlone ; $MASTER ; wall_clock_limit=$(wall_clock_limit)
 #-Q- ada # @ queue
-#-Q- lxiv8 ######################
-#-Q- lxiv8 ## OBELIX      LSCE ##
-#-Q- lxiv8 ######################
-#-Q- lxiv8 #PBS -N PACKRESTART
-#-Q- lxiv8 #PBS -m a
-#-Q- lxiv8 #PBS -j oe
-#-Q- lxiv8 #PBS -q medium
-#-Q- lxiv8 #PBS -o PACKRESTART.$$
-#-Q- lxiv8 #PBS -S /bin/ksh
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N PACKRESTART
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q medium
+#-Q- obelix #PBS -o PACKRESTART.$$
+#-Q- obelix #PBS -S /bin/ksh
 #-Q- ifort_CICLAD ######################
 #-Q- ifort_CICLAD ##   CICLAD    IPSL ##
Index: branches/libIGCM_CESMEP/AA_purge_simulation
===================================================================
--- branches/libIGCM_CESMEP/AA_purge_simulation	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_purge_simulation	(revision 1585)
@@ -38,5 +38,5 @@
 #D- Default=false
 #D-
-BigBrother=true
+BigBrother=false
 
 
Index: branches/libIGCM_CESMEP/AA_rebuild_fromWorkdir
===================================================================
--- branches/libIGCM_CESMEP/AA_rebuild_fromWorkdir	(revision 1567)
+++ branches/libIGCM_CESMEP/AA_rebuild_fromWorkdir	(revision 1585)
@@ -60,13 +60,13 @@
 #-Q- ada # @ environment  = $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $POST_DIR ; $Script_Post_Output ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; wall_clock_limit=$(wall_clock_limit)
 #-Q- ada # @ queue
-#-Q- lxiv8 ######################
-#-Q- lxiv8 ## OBELIX      LSCE ##
-#-Q- lxiv8 ######################
-#-Q- lxiv8 #PBS -N REBUILDWRK
-#-Q- lxiv8 #PBS -m a
-#-Q- lxiv8 #PBS -j oe
-#-Q- lxiv8 #PBS -q medium
-#-Q- lxiv8 #PBS -o REBUILDWRK.$$
-#-Q- lxiv8 #PBS -S /bin/ksh
+#-Q- obelix ######################
+#-Q- obelix ## OBELIX      LSCE ##
+#-Q- obelix ######################
+#-Q- obelix #PBS -N REBUILDWRK
+#-Q- obelix #PBS -m a
+#-Q- obelix #PBS -j oe
+#-Q- obelix #PBS -q medium
+#-Q- obelix #PBS -o REBUILDWRK.$$
+#-Q- obelix #PBS -S /bin/ksh
 #-Q- ifort_CICLAD ######################
 #-Q- ifort_CICLAD ##   CICLAD    IPSL ##
Index: branches/libIGCM_CESMEP/ins_job
===================================================================
--- branches/libIGCM_CESMEP/ins_job	(revision 1567)
+++ branches/libIGCM_CESMEP/ins_job	(revision 1585)
@@ -116,8 +116,11 @@
 #  { print - "directory 'modipsl' unreachable"; exit 3; }
 W_W=${d_n}'/../libIGCM'
+#W_W=${d_n}  # S.Senesi - not sure of the intent in line above, but that clashes with using a symbolic link for libIGCM in modipsl/, which is must useful for development
 [[ ! -d ${W_W} ]] && { print - "${W_W} unreachable"; exit 3; }
 libIGCM=$(cd ${W_W};/bin/pwd;)
 F_JOB=${libIGCM}'/AA_job';
 [[ ! -f ${F_JOB} ]] && { print - "${F_JOB} unreachable"; exit 3; }
+F_JOB_DEBUG=${libIGCM}'/AA_job_debug';
+[[ ! -f ${F_JOB_DEBUG} ]] && { print - "${F_JOB_DEBUG} unreachable"; exit 3; }
 F_RCI=${libIGCM}'/run.card.init';
 [[ ! -f ${F_RCI} ]] && { print - "${F_RCI} unreachable"; exit 3; }
@@ -404,5 +407,5 @@
   echo MPIEnvironment is ${MPIEnvironment}
 
-elif [ X"${SYSTEM}" == "Xlxiv8" ] || [ X"${SYSTEM}" == "Xifort_CICLAD" ] ; then
+elif [ X"${SYSTEM}" == "Xobelix" ] || [ X"${SYSTEM}" == "Xifort_CICLAD" ] ; then
   # obelix, ciclad, climserv
   echo ""
@@ -558,4 +561,19 @@
   # openMPthreads : NUMBER OF OpenMP THREADS
 
+  # File name for Job_debug
+  n_f='Job_debug_'${JobName};
+  [[ ${x_v} = 'verbose' ]] && print - "\nWorking with file ${F_CFG}\nin directory ${j}\nfor ${n_f}";
+  sed -e "/^${W_W} */ s///" \
+      -e "/^${W_P}/d"       \
+      -e "s%::modipsl::%${F_MOD}%" \
+      -e "s/::Jobname::/${JobName}/" \
+      -e "s/::default_project::/${ProjectID}/" \
+      -e "s/::WallTime::/${WallTime}/" \
+      ${F_JOB_DEBUG} > ${libIGCM}'/'${n_f}
+  chmod u+x ${libIGCM}'/'${n_f}
+
+  # update Headers so that ressources description are accurate (MPMD/SPMD/...)
+  IGCM_sys_updateHeaders ${libIGCM}'/'${n_f}
+
   # File name for Job
   n_f='Job_'${JobName};
@@ -573,4 +591,5 @@
   # update Headers so that ressources description are accurate (MPMD/SPMD/...)
   IGCM_sys_updateHeaders ${j}'/'${n_f}
+  
 done
 
@@ -583,4 +602,5 @@
   i_f=${i##*/};
   [[ ${i_f} = 'AA_job' ]] && { continue; }
+  [[ ${i_f} = 'AA_job_debug' ]]  && { continue; }
   j=${i%/*}; n_f=${i_f#AA_}'.job';
   [[ ${x_f} = 'false' ]] && [[ -f ${j}'/'${n_f} ]] && { ins_job_Warning; continue; }
Index: branches/libIGCM_CESMEP/libIGCM_card/libIGCM_card.ksh
===================================================================
--- branches/libIGCM_CESMEP/libIGCM_card/libIGCM_card.ksh	(revision 1567)
+++ branches/libIGCM_CESMEP/libIGCM_card/libIGCM_card.ksh	(revision 1585)
@@ -323,8 +323,9 @@
     echo "Check libIGCM_card ...........................................[ FAILED ]"
     echo "--Error--> Execution of ${libIGCM}/libIGCM_card/IGCM_card_Test.ksh"
-    echo "           has produced the file IGCM_card_Test.ref.failed"
-    echo "           Please analyse differences with the reference file by typing:"
-    echo "           diff IGCM_card_Test.ref.failed ${libIGCM}/libIGCM_card/IGCM_card_Test.ref"
-    echo "           Report errors to the author: Patrick.Brockmann@cea.fr"
+    echo "           has produced an error in the checking phase"
+    echo "           If you are working on TGCC computer : please verify if your login is in the groupe igcmg"
+    echo "           if not, ask to hotline to be add to this group"
+    echo "           If this is not the solution to your problem, verify you didn't made any modifications"
+    echo "           in libIGCM_sys, libIGCM_debug, libIGCM_card"
     diff ${libIGCM}/libIGCM_card/IGCM_card_Test.ref <(${libIGCM}/libIGCM_card/IGCM_card_Test.ksh)
     IGCM_debug_Exit "IGCM_card_Check"
Index: branches/libIGCM_CESMEP/libIGCM_comp/libIGCM_comp.ksh
===================================================================
--- branches/libIGCM_CESMEP/libIGCM_comp/libIGCM_comp.ksh	(revision 1567)
+++ branches/libIGCM_CESMEP/libIGCM_comp/libIGCM_comp.ksh	(revision 1585)
@@ -1031,10 +1031,4 @@
   fi
 
-# Test on compiler version for IPSLCM6* configuration on irene (only for CMIP6 production)
-  if [ ${SYSTEM} = irene ]; then
-    if ( [ X"$( echo ${config_UserChoices_LongName} | grep IPSLCM6.0.13 )" != "X" ] && [ X${compilerFull} != XV17 ] )  || ( [ X"$( echo ${config_UserChoices_LongName} | grep IPSLCM6.0.14 )" != "X" ] && [ X${compilerFull} != XV17 ] ) || ( [ X"$( echo ${config_UserChoices_LongName} | grep IPSLCM6.0.15 )" != "X" ] && [ X${compilerFull} != XV17 ] ) || ( [ X"$( echo ${config_UserChoices_LongName} | grep IPSLCM6.1 )" != "X" ] && [ X${compilerFull} != XV17 ] ) || ( [ X"$( echo ${config_UserChoices_LongName} | grep IPSLCM5A2.1 )" != "X" ] && [ X${compilerFull} != XV17 ] ) ; then
-      IGCM_debug_Exit "IPSLCM6.0.13, IPSLCM6.0.14, IPSLCM6.0.15, IPSLCM6.1 and IPSLCM5A2.1 must be compiled with intel 2017 compiler"
-    fi
-  fi
 
   IGCM_debug_PopStack "IGCM_comp_GetInputBinaryFiles"
Index: branches/libIGCM_CESMEP/libIGCM_config/libIGCM_config.ksh
===================================================================
--- branches/libIGCM_CESMEP/libIGCM_config/libIGCM_config.ksh	(revision 1567)
+++ branches/libIGCM_CESMEP/libIGCM_config/libIGCM_config.ksh	(revision 1585)
@@ -111,10 +111,53 @@
   if ( [ ! X${config_UserChoices_SpaceName} = X ] && [ ! X${config_UserChoices_ExperimentName} = X ] ) ; then
     FreeName=$( echo ${config_UserChoices_JobName} | sed 's/.*_//' )
-    if ( [ ! X${config_Ensemble_EnsembleName} = X ] && [ ! X${config_Ensemble_EnsembleDate} = X ] ) ; then
-      R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_Ensemble_EnsembleName}/${config_Ensemble_EnsembleDate}/${FreeName}
-      R_FIGR=${R_FIG}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_Ensemble_EnsembleName}/${config_Ensemble_EnsembleDate}/${FreeName}
-      R_BUFR=${R_BUF}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_Ensemble_EnsembleName}/${config_Ensemble_EnsembleDate}/${FreeName}
-      R_DODS=${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_Ensemble_EnsembleName}/${config_Ensemble_EnsembleDate}/${FreeName}
-      R_CMIP=${CMIP6_BUF}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_Ensemble_EnsembleName}/${config_Ensemble_EnsembleDate}/${FreeName}
+
+    if ( [ X${config_Post_StorageCMIP} = XSCRATCH ] || [ X${config_Post_StorageCMIP} = Xscratch ] ) ; then
+      IGCM_debug_Print 1 "LIBIGCM CONFIG:: SCRATCH R_BUF=${R_BUF}"
+      StoreCMIP=${R_BUF}
+    elif ( [ X${config_Post_StorageCMIP} = XSTORE ] || [ X${config_Post_StorageCMIP} = Xstore ] ) ; then
+      IGCM_debug_Print 1 "LIBIGCM CONFIG:: SCRATCH R_OUT=${R_OUT}"
+      StoreCMIP=${R_OUT}
+    else
+      IGCM_debug_Print 1 "LIBIGCM CONFIG:: ELSE CMIP_BUF=${CMIP6_BUF}"
+      StoreCMIP=${CMIP6_BUF}
+    fi
+    # Ensemble cases (default all members outputs in same directory)
+    if ( [ ! X${config_Ensemble_EnsembleName} = X ] ) ; then
+      R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_Ensemble_EnsembleName}
+      R_FIGR=${R_FIG}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_Ensemble_EnsembleName}
+      R_BUFR=${R_BUF}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_Ensemble_EnsembleName}
+      R_DODS=${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_Ensemble_EnsembleName}
+      R_CMIP=${StoreCMIP}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${config_Ensemble_EnsembleName}
+      IGCM_debug_Print 1 "LIBIGCM CONFIG:: ENSEMBLE R_CMIP=${R_CMIP}"
+
+      # PERTURB Ensemble Outputs
+      if ( [ X${config_Ensemble_EnsembleType} = XEns_PERTURB ] ) ; then
+	if ( [ ! X${config_Ensemble_EnsembleDate} = X ] ) ; then
+          R_SAVE=${R_SAVE}/${config_Ensemble_EnsembleDate}/${FreeName}
+	  R_FIGR=${R_FIGR}/${config_Ensemble_EnsembleDate}/${FreeName}
+	  R_BUFR=${R_BUFR}/${config_Ensemble_EnsembleDate}/${FreeName}
+	  R_DODS=${R_DODS}/${config_Ensemble_EnsembleDate}/${FreeName}
+	  R_CMIP=${R_CMIP}/${config_Ensemble_EnsembleDate}/${FreeName}
+	else
+	  R_SAVE=${R_SAVE}/${FreeName}
+	  R_FIGR=${R_FIGR}/${FreeName}
+	  R_BUFR=${R_BUFR}/${FreeName}
+	  R_DODS=${R_DODS}/${FreeName}
+	  R_CMIP=${R_CMIP}/${FreeName}
+	fi
+      # DATE Ensemble Outputs
+      elif ( [ X${config_Ensemble_EnsembleType} = XEns_DATE ] ) ; then
+	R_FIGR=${R_FIGR}/${FreeName}
+	R_BUFR=${R_BUFR}/${FreeName}
+	R_DODS=${R_DODS}/${FreeName}
+	IGCM_debug_Print 1 "LIBIGCM CONFIG:: ENSEMBLE DATE R_CMIP=${R_CMIP}"
+        if ( [ X${config_Ensemble_EnsembleMergeSave} = X ] || [ X${config_Ensemble_EnsembleMergeSave} = Xn ] || 
+	     [ X${config_Ensemble_EnsembleMergeSave} = Xno ] ) ; then
+	  # One SAVE directory per member, else common output dir for all members
+          R_SAVE=${R_SAVE}/${FreeName}
+	  R_CMIP=${R_CMIP}/${FreeName}
+	  IGCM_debug_Print 1 "LIBIGCM CONFIG:: ENSEMBLE DATE MERGE R_CMIP=${R_CMIP}"
+	fi
+      fi
     else
       R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
@@ -122,5 +165,5 @@
       R_BUFR=${R_BUF}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
       R_DODS=${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
-      R_CMIP=${CMIP6_BUF}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
+      R_CMIP=${StoreCMIP}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
     fi
   else
@@ -137,5 +180,7 @@
     fi
   fi
-
+  
+  IGCM_debug_Print 1 "LIBIGCM CONFIG:: R_CMIP = ${R_CMIP}"
+  
   #====================================================
   # Define R_OUT_KSH : Storage place for job output
Index: branches/libIGCM_CESMEP/libIGCM_date/libIGCM_date.ksh
===================================================================
--- branches/libIGCM_CESMEP/libIGCM_date/libIGCM_date.ksh	(revision 1567)
+++ branches/libIGCM_CESMEP/libIGCM_date/libIGCM_date.ksh	(revision 1585)
@@ -1043,8 +1043,6 @@
     echo "Check libIGCM_date ...........................................[ FAILED ]"
     echo "--Error--> Execution of ${libIGCM}/libIGCM_date/IGCM_date_Test.ksh"
-    echo "           has produced the file IGCM_date_Test.ref.failed"
-    echo "           Please analyse differences with the reference file by typing:"
-    echo "           diff IGCM_date_Test.ref.failed ${libIGCM}/libIGCM_date/IGCM_date_Test${dY}.ref"
-    echo "           Report errors to the author: Sebastien.Denvil@ipsl.jussieu.fr"
+    echo "           has produced an error in the checking phase"
+    echo "           To solve it: verify you didn't made any modifications in libIGCM_debug or in libIGCM_date"
     diff ${libIGCM}/libIGCM_date/IGCM_date_Test${dY}.ref <(${libIGCM}/libIGCM_date/IGCM_date_Test.ksh)
     IGCM_debug_Exit "IGCM_date_Check"
Index: branches/libIGCM_CESMEP/libIGCM_debug/libIGCM_debug.ksh
===================================================================
--- branches/libIGCM_CESMEP/libIGCM_debug/libIGCM_debug.ksh	(revision 1567)
+++ branches/libIGCM_CESMEP/libIGCM_debug/libIGCM_debug.ksh	(revision 1585)
@@ -1052,8 +1052,6 @@
     echo "Check libIGCM_debug ..........................................[ FAILED ]"
     echo "--Error--> Execution of ${libIGCM}/libIGCM_debug/IGCM_debug_Test.ksh"
-    echo "           has produced the file IGCM_debug_Test.ref.failed"
-    echo "           Please analyse differences with the reference file by typing:"
-    echo "           diff IGCM_debug_Test.ref.failed ${libIGCM}/libIGCM_debug/IGCM_debug_Test.ref"
-    echo "           Report errors to the author: Patrick.Brockmann@cea.fr"
+    echo "           has produced an error in the checking phase"
+    echo "           To solve it: verify you didn't made any modifications in libIGCM_debug"
     diff ${libIGCM}/libIGCM_debug/IGCM_debug_Test.ref <(${libIGCM}/libIGCM_debug/IGCM_debug_Test.ksh | sed -e "s:[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]\:[0-9][0-9]\:[0-9][0-9] ::g")
     exit 4
Index: branches/libIGCM_CESMEP/libIGCM_ensemble/libIGCM_ensemble.ksh
===================================================================
--- branches/libIGCM_CESMEP/libIGCM_ensemble/libIGCM_ensemble.ksh	(revision 1567)
+++ branches/libIGCM_CESMEP/libIGCM_ensemble/libIGCM_ensemble.ksh	(revision 1585)
@@ -29,6 +29,6 @@
 #                         : removed Ens_PERTURB_PERTU_MAP_LIST case
 # 
-# Author: Simona Flavoni & Nicola Lebas
-# Contact: Simona.Flavoni__at__locean-ipsl.upmc.fr
+# Author: Simona Flavoni & Nicolas Lebas
+# Contact: Simona.Flavoni__at__locean.ipsl.fr & Nicolas.Lebas__at__locean.ipsl.fr
 # IPSL (2019)
 #**************************************************************
@@ -38,14 +38,22 @@
 {
   IGCM_debug_PushStack "IGCM_ensemble_Init"
-
+  
   IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_PERTURB active
   IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_DATE active
- 
-  Job_Period=10 # PARAMETER USED in function IGCM_ensemble_FilesUpdate
-
+  
+  Job_Period=10 # Default PARAMETER USED in function IGCM_ensemble_FilesUpdate
+  answer=""
+  print - "\nHit Enter or give PERIOD_NB for all member's Job (default is 10)"
+  read answer
+  
+  if [ "X${answer}" != "X" ] ; then
+      Job_Period=${answer}
+  fi
+  print "\nPeriodNb in ensemble Jobs is ${Job_Period}"
+  
   IGCM_debug_Print 1 "Ens_PERTURB ACTIVE     = ${ensemble_Ens_PERTURB_active}"
   IGCM_debug_Print 1 "Ens_DATE ACTIVE        = ${ensemble_Ens_DATE_active}"
   echo ""
-
+  
   #====================================================
   # Define ARCHIVE : Dedicated to large files
@@ -55,5 +63,5 @@
   # Define R_BUF   : USELESS and DEPRECATED output tree.
   IGCM_sys_defineArchives
-
+  
   IGCM_debug_PopStack "IGCM_ensemble_Init"
 }
@@ -139,8 +147,8 @@
   # ==> config.card
   # [ENSEMBLE]
-  IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Ensemble EnsembleRun 'y'
   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Ensemble EnsembleName $(eval echo $\ensemble_Ens_${EnsembleType}_NAME)
   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Ensemble EnsembleDate ${HumanDateBegin}
   IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Ensemble EnsembleType "Ens_${EnsembleType}"
+  IGCM_card_WriteOption ${SUBMIT_DIR}/${StartDir}/${MemberDir}/config.card Ensemble EnsembleMergeSave ${ensemble_Ens_DATE_MERGE_SAVE}
   
   # [UserChoices]
@@ -369,6 +377,8 @@
       IGCM_sys_Mkdir ${SUBMIT_DIR}/${StartDir}
       IGCM_sys_Cd ${SUBMIT_DIR}/${StartDir}
-      ln -s ../../.resol .
-      ln -s ../../.libmpi .
+      ln -s ../../.resol .                        # TODO: remove for future version (>6.1)
+      ln -s ../../.libmpi .                       # TODO: remove for future version (>6.1)
+      ln -s ../../SOURCES .
+      ln -s ../../ARCH .
       IGCM_sys_Cd ${RUN_DIR}
     fi
@@ -470,6 +480,8 @@
     IGCM_sys_Mkdir ${SUBMIT_DIR}/${StartDir}
     IGCM_sys_Cd ${SUBMIT_DIR}/${StartDir}
-    ln -s ../../.resol .
-    ln -s ../../.libmpi .
+    ln -s ../../.resol .                        # TODO: remove for future version (>6.1)
+    ln -s ../../.libmpi .                       # TODO: remove for future version (>6.1)
+    ln -s ../../SOURCES .
+    ln -s ../../ARCH .
     IGCM_sys_Cd ${RUN_DIR}
   fi
@@ -773,7 +785,5 @@
   IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_DATE active
   IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_DATE NAME
-  IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_DATE BEGIN_INIT
-  IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_DATE BEGIN_RESTART
-  IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_DATE END_INIT
+  IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_DATE MERGE_SAVE
   IGCM_card_DefineVariableFromOption ${F_CFG_ENS} Ens_DATE STARTDATE
   IGCM_card_DefineArrayFromOption    ${F_CFG_ENS} Ens_DATE NONPERIODIC
@@ -794,7 +804,5 @@
   IGCM_debug_Print 1 "ACTIVE               = ${ensemble_Ens_DATE_active}"
   IGCM_debug_Print 1 "NAME                 = ${ensemble_Ens_DATE_NAME}"
-  IGCM_debug_Print 1 "BEGIN_INIT           = ${ensemble_Ens_DATE_BEGIN_INIT}"
-  IGCM_debug_Print 1 "END_INIT             = ${ensemble_Ens_DATE_END_INIT}"
-  IGCM_debug_Print 1 "BEGIN_RESTART        = ${ensemble_Ens_DATE_BEGIN_RESTART}"
+  IGCM_debug_Print 1 "MERGE_SAVE           = ${ensemble_Ens_DATE_MERGE_SAVE}"
   IGCM_debug_Print 1 "STARTDATE            = ${ensemble_Ens_DATE_STARTDATE}"
   IGCM_debug_Print 1 "NONPERIODIC          = ${ensemble_Ens_DATE_NONPERIODIC[*]}"
@@ -828,8 +836,4 @@
   # A few checks for the Non-Periodic case:
   # ***************************************
-#  if [[ ${#ensemble_Ens_DATE_NONPERIODIC[*]} != ${#ensemble_Ens_DATE_RESTART_NONPERIODIC[*]} ]] ; then
-#    IGCM_debug_Exit "IGCM_ensemble_DateInit: NONPERIODIC and RESTART_NONPERIODIC lists have different sizes"
-#    IGCM_debug_Verif_Exit
-#  fi
 
   if [[ ${#ensemble_Ens_DATE_RESTART_NONPERIODIC[*]} > 0 ]] && [[ ${ensemble_Ens_DATE_RESTART_NONPERIODIC[*]} != _0_ ]]; then
@@ -837,13 +841,12 @@
 
     # Use LENGTH if no NONPERIODIC_LENGTH given
-    if [[ ${#ensemble_Ens_DATE_LENGTH_NONPERIODIC[*]} < ${#ensemble_Ens_DATE_NONPERIODIC[*]} ]] ||
-	   [[ X"${ensemble_Ens_DATE_LENGTH_NONPERIODIC[0]}" = "XOption" ]] ; then
+    if ( [ ${#ensemble_Ens_DATE_LENGTH_NONPERIODIC[*]} -lt ${#ensemble_Ens_DATE_NONPERIODIC[*]} ] || [[ "X${ensemble_Ens_DATE_LENGTH_NONPERIODIC[0]}" = "XOption" ]] ) ; then
 	IGCM_debug_Print 1 "WARNING: LENGTH_NONPERIODIC is not fill (or not correctly). "
 	IGCM_debug_Print 1 "Use LENGTH value '${ensemble_Ens_DATE_LENGTH}' for all NONPERIODIC runs"
-      DateNum=0
-      while [ ${DateNum} -lt ${#ensemble_Ens_DATE_NONPERIODIC[*]} ] ; do
-        ensemble_Ens_DATE_LENGTH_NONPERIODIC[${DateNum}]=${ensemble_Ens_DATE_LENGTH}
-        (( DateNum = DateNum + 1 ))
-      done
+	DateNum=0
+	while [ ${DateNum} -lt ${#ensemble_Ens_DATE_RESTART_NONPERIODIC[*]} ] ; do
+            ensemble_Ens_DATE_LENGTH_NONPERIODIC[${DateNum}]=${ensemble_Ens_DATE_LENGTH}
+            (( DateNum = DateNum + 1 ))
+	done
     fi
     
@@ -864,5 +867,5 @@
       IGCM_debug_Print 1 "WARNING: INITFROM_NONPERIODIC is not fill (or not correctly). Use INITFROM value '${ensemble_Ens_DATE_INITFROM}' for all NONPERIODIC runs"
       DateNum=0
-      while [ ${DateNum} -lt ${#ensemble_Ens_DATE_NONPERIODIC[*]} ] ; do
+      while [ ${DateNum} -lt ${#ensemble_Ens_DATE_RESTART_NONPERIODIC[*]} ] ; do
         ensemble_Ens_DATE_INITFROM_NONPERIODIC[${DateNum}]=${ensemble_Ens_DATE_INITFROM}
         (( DateNum = DateNum + 1 ))
@@ -874,5 +877,5 @@
       IGCM_debug_Print 1 "WARNING: INITPATH_NONPERIODIC is not fill (or not correctly). Use INITPATH value '${ensemble_Ens_DATE_INITPATH}' for all NONPERIODIC runs"
       DateNum=0
-      while [ ${DateNum} -lt ${#ensemble_Ens_DATE_NONPERIODIC[*]} ] ; do
+      while [ ${DateNum} -lt ${#ensemble_Ens_DATE_RESTART_NONPERIODIC[*]} ] ; do
         ensemble_Ens_DATE_INITPATH_NONPERIODIC[${DateNum}]=${ensemble_Ens_DATE_INITPATH}
         (( DateNum = DateNum + 1 ))
@@ -934,6 +937,8 @@
     IGCM_sys_Mkdir ${SUBMIT_DIR}/${StartDir}
     IGCM_sys_Cd ${SUBMIT_DIR}/${StartDir}
-    ln -s ../../.resol .
-    ln -s ../../.libmpi .
+    ln -s ../../.resol .                        # TODO: remove for future version (>6.1)
+    ln -s ../../.libmpi .                       # TODO: remove for future version (>6.1)
+    ln -s ../../SOURCES .
+    ln -s ../../ARCH .
     IGCM_sys_Cd ${RUN_DIR}
   fi
@@ -949,5 +954,10 @@
     (( ii=DateNum + 1 ))
     
-    MemberDir="${ensemble_Ens_DATE_NAME}${ii}"
+    # Member number on 2 digits (01 02 ... 10 11)
+    if (( ii < 10)) then
+	MemberDir="${ensemble_Ens_DATE_NAME}-0${ii}"
+    else
+	 MemberDir="${ensemble_Ens_DATE_NAME}-${ii}"
+    fi
     IGCM_debug_Print 3 "${MemberDir}"
     echo "Create: ${MemberDir}"
Index: branches/libIGCM_CESMEP/libIGCM_sys/libIGCM_sys.ksh
===================================================================
--- branches/libIGCM_CESMEP/libIGCM_sys/libIGCM_sys.ksh	(revision 1567)
+++ branches/libIGCM_CESMEP/libIGCM_sys/libIGCM_sys.ksh	(revision 1585)
@@ -81,6 +81,16 @@
         [ ! X${TaskType} = Xchecking ] && echo "Source machine dependent settings for obelix or asterix."
         CENTER=LSCE
-        SYSTEM=lxiv8
+        SYSTEM=obelix
         . ${libIGCM}/libIGCM_sys/libIGCM_sys_obelix.ksh;;
+    spiritx*)
+	    [ ! X${TaskType} = Xchecking ] && echo "Source machine dependent settings for spiritx at MESO ESPRI IPSL cluster."
+        CENTER=spiritx
+        SYSTEM=mesoipsl
+        . ${libIGCM}/libIGCM_sys/libIGCM_sys_mesoipsl.ksh;;
+    spirit*)
+	    [ ! X${TaskType} = Xchecking ] && echo "Source machine dependent settings for spirit at MESO ESPRI IPSL cluster."
+        CENTER=spirit
+        SYSTEM=mesoipsl
+        . ${libIGCM}/libIGCM_sys/libIGCM_sys_mesoipsl.ksh;;
     ciclad*)
         [ ! X${TaskType} = Xchecking ] && echo "Source machine dependent settings for ciclad for running at ciclad."
@@ -1631,4 +1641,64 @@
   IGCM_debug_PopStack "IGCM_sys_cdo"
 }
-
 # 
+#D-#==================================================
+#D-function IGCM_sys_create_run_dir
+#D-* Purpose: stop the simulation in order to work into the run_dir directory
+#D-* Examples:
+#D-
+function IGCM_sys_create_run_dir {
+  IGCM_debug_PushStack "IGCM_sys_create_run_dir"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_create_run_dir :"
+  fi
+  if [ -f ${libIGCM}/Job_debug_${config_UserChoices_JobName} ] ; then
+
+      CPL_comp=n ; SRF_comp=n ; OCE_comp=n ; CHM_comp=n
+      for comp in ${config_ListOfComponents[*]} ; do
+        [ "X${comp}" = "XCPL" ] && CPL_comp=y
+        [ "X${comp}" = "XSRF" ] && SRF_comp=y
+        [ "X${comp}" = "XOCE" ] && OCE_comp=y
+        [ "X${comp}" = "XCHM" ] && CHM_comp=y
+        eval ExeNameIn=\${config_Executable_${comp}[0]}
+        eval ExeNameOut=\${config_Executable_${comp}[1]}
+        if [ X${ExeNameIn} != X\"\" ] ; then
+          eval ExeNameIn=${ExeNameIn}
+          echo "$ExeNameIn"" ""$ExeNameOut" >> components_binary.txt 
+        fi
+      done
+   SUBMIT_DIRECTORY=$(grep SUBMIT_DIR ${libIGCM}/libIGCM_sys/libIGCM_sys_${SYSTEM}.ksh | grep -m1 typeset | cut -dx -f2)
+      sed -e "s%::EXECUTION::%${EXECUTION}%" \
+	  -e "s%::EXECUTION_TYPE::%${executionType}%" \
+          -e "s%::JOBNAME::%${config_UserChoices_JobName}%" \
+          -e "s%::SUBMIT_DIR::%${SUBMIT_DIRECTORY}%" \
+          -e "s%::CPL_comp::%${CPL_comp}%" \
+          -e "s%::OCE_comp::%${OCE_comp}%" \
+          -e "s%::SRF_comp::%${SRF_comp}%" \
+	  -e "s%::CHM_comp::%${CHM_comp}%" \
+	  ${libIGCM}/Job_debug_${config_UserChoices_JobName} > ${RUN_DIR}/Job_debug_${config_UserChoices_JobName}
+      cp ${EnvFile} ${RUN_DIR}/.
+      echo
+      echo "############################################"
+      echo "#    DEBUG PHASE : CREATION OF RUN_DIR    #"
+      echo "############################################"
+      echo
+      echo "You are in development or debug phase"
+      echo "You can run directly into the running directory which is here "
+      echo ${RUN_DIR}
+      echo "Inside the run directory you will find a Job_debug_${config_UserChoices_JobName}"
+      echo "to be used to launch the run as follows :"
+      echo "${SUBMIT} Job_debug_${config_UserChoices_JobName}"
+      exit
+  else
+      echo "############################################"
+      echo "#    DEBUG PHASE : CREATION OF RUN_DIR    #"
+      echo "############################################"
+      echo
+      echo "You are in development or debug phase"
+      echo "You can run directly into the running directory which is here "
+      echo ${RUN_DIR}
+      exit
+  fi
+ 
+  IGCM_debug_PopStack "IGCM_sys_create_run_dir"
+}
Index: branches/libIGCM_CESMEP/libIGCM_sys/libIGCM_sys_irene-amd.ksh
===================================================================
--- branches/libIGCM_CESMEP/libIGCM_sys/libIGCM_sys_irene-amd.ksh	(revision 1567)
+++ branches/libIGCM_CESMEP/libIGCM_sys/libIGCM_sys_irene-amd.ksh	(revision 1585)
@@ -38,5 +38,11 @@
 #====================================================
 # Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get)
-typeset -r DRYRUN=${DRYRUN:=0}
+if ([ X${DRYRUN} != X ] && [ ${DRYRUN} = 4 ]) ; then
+  typeset -r DRYRUN=0
+  typeset -r DRYRUN_DEBUG=4
+else
+  typeset -r DRYRUN=${DRYRUN:=0}
+  typeset -r DRYRUN_DEBUG=0
+fi
 
 # YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
@@ -54,4 +60,7 @@
 # |    3     |       yes           |    no      |  no     |      no                   |
 # -------------------------------------------------------------------------------------
+# |    4     |       yes           |    yes     |  creation of RUN_DIR and Job_debug  |
+# -------------------------------------------------------------------------------------
+
 
 #=====================================================
@@ -96,10 +105,16 @@
 # Set environment tools (ferret, nco, cdo, rebuild, ...)
 #====================================================
+typeset CCCOS=${CCCOS:=$( ccc_os )}
+
 if [ X${TaskType} = Xcomputing ] ; then
   IGCM_debug_Print 1 "Modules will be loaded later in IGCM_sys_activ_variables."
 else
   module purge > /dev/null 2>&1
-  . $( ccc_home -u igcmg)/MachineEnvironment/irene-amd/env_irene-amd > /dev/null 2>&1
-  . $( ccc_home -u igcmg)/MachineEnvironment/irene-amd/env_atlas_irene-amd > /dev/null 2>&1
+  if [ X${CCCOS} = X"Rhel_8__x86_64" ] ; then
+      . $( ccc_home -u igcmg)/MachineEnvironment/irene/env_atlas_irene > /dev/null 2>&1
+  else
+      . $( ccc_home -u igcmg)/MachineEnvironment/irene-amd_prev/env_irene-amd > /dev/null 2>&1
+      . $( ccc_home -u igcmg)/MachineEnvironment/irene-amd_prev/env_atlas_irene-amd > /dev/null 2>&1
+  fi
 
   export PCMDI_MP=/ccc/work/cont003/igcmg/igcmg/PCMDI-MP
@@ -112,8 +127,8 @@
 
 # For AddNoise and AddPertu3DOCE
-export PATH=${PATH}:$(ccc_home -u igcmg)/Tools/irene-amd/bin
+export PATH=${PATH}:$(ccc_home -u igcmg)/Tools/irene/bin
 
 # For rebuild
-export PATH=${PATH}:$(ccc_home -u igcmg)/Tools/irene-amd/rebuild/modipsl_IOIPSL_PLUS_v2_2_4/bin
+export PATH=${PATH}:$(ccc_home -u igcmg)/Tools/irene/rebuild/modipsl/bin
 
 #====================================================
@@ -942,8 +957,8 @@
 
     if [ "$#" -eq 1 ]; then
-      $(ccc_home -u igcmg)/Tools/irene-amd/thredds_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
+      $(ccc_home -u igcmg)/Tools/irene/thredds_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
       status=$?
     else
-      $(ccc_home -u igcmg)/Tools/irene-amd/thredds_rm public/${LOGIN}/${R_DODS} # > out_dods_rm 2>&1
+      $(ccc_home -u igcmg)/Tools/irene/thredds_rm public/${LOGIN}/${R_DODS} # > out_dods_rm 2>&1
       status=$?
     fi
@@ -979,5 +994,5 @@
 #    fi
 
-    $(ccc_home -u igcmg)/Tools/irene-amd/thredds_cp ${1} public/${LOGIN}/${R_DODS} # > out_dods_cp 2>&1
+    $(ccc_home -u igcmg)/Tools/irene/thredds_cp ${1} public/${LOGIN}/${R_DODS} # > out_dods_cp 2>&1
     status=$?
 
@@ -1912,5 +1927,5 @@
   fi
 
-  $( ccc_home -u igcmg)/Tools/irene-amd/bin/rebuild_nemo ${1} ${2}
+  $( ccc_home -u igcmg)/Tools/irene/bin/rebuild_nemo ${1} ${2}
 
   IGCM_debug_PopStack "IGCM_sys_rebuild_nemo"
Index: branches/libIGCM_CESMEP/libIGCM_sys/libIGCM_sys_irene.ksh
===================================================================
--- branches/libIGCM_CESMEP/libIGCM_sys/libIGCM_sys_irene.ksh	(revision 1567)
+++ branches/libIGCM_CESMEP/libIGCM_sys/libIGCM_sys_irene.ksh	(revision 1585)
@@ -38,5 +38,12 @@
 #====================================================
 # Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get)
-typeset -r DRYRUN=${DRYRUN:=0}
+if ([ X${DRYRUN} != X ] && [ ${DRYRUN} = 4 ]) ; then
+  typeset -r DRYRUN=0
+  typeset -r DRYRUN_DEBUG=4
+else
+  typeset -r DRYRUN=${DRYRUN:=0}
+  typeset -r DRYRUN_DEBUG=0
+fi
+
 
 # YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
@@ -54,4 +61,7 @@
 # |    3     |       yes           |    no      |  no     |      no                   |
 # -------------------------------------------------------------------------------------
+# |    4     |       yes           |    yes     |  creation of RUN_DIR and Job_debug  |
+# -------------------------------------------------------------------------------------
+
 
 #=====================================================
@@ -70,9 +80,10 @@
 typeset MASTER=irene
 # add default project on irene
-if [ ! -z $BRIDGE_MSUB_PROJECT ]; then 
-    typeset PROJECT=$(echo ${BRIDGE_MSUB_PROJECT} | cut -d@ -f1 )
-else
-    typeset PROJECT=$(echo ${CCCHOME} | cut -d/ -f5 )
-fi
+typeset PROJECT=$(echo ${BRIDGE_MSUB_PROJECT:=gen0826} | cut -d@ -f1 )
+# if [ ! -z $BRIDGE_MSUB_PROJECT ]; then 
+#     typeset PROJECT=$(echo ${BRIDGE_MSUB_PROJECT} | cut -d@ -f1 )
+# else
+#     typeset PROJECT=$(echo ${CCCHOME} | cut -d/ -f5 )
+# fi
 # jobWarningDelay in seconds
 typeset jobWarningDelay=${BRIDGE_MSUB_MAXTIME}
@@ -96,12 +107,16 @@
 # Set environment tools (ferret, nco, cdo, rebuild, ...)
 #====================================================
+typeset CCCOS=${CCCOS:=$( ccc_os )}
+
 if [ X${TaskType} = Xcomputing ] ; then
   IGCM_debug_Print 1 "Modules will be loaded later in IGCM_sys_activ_variables."
 else
   module purge > /dev/null 2>&1
-  ##. /ccc/cont003/home/igcmg/igcmg/MachineEnvironment/irene/env_irene > /dev/null 2>&1
-  . $( ccc_home -u igcmg)/MachineEnvironment/irene/env_irene > /dev/null 2>&1
-  ##. /ccc/cont003/home/igcmg/igcmg/MachineEnvironment/irene/env_atlas_irene > /dev/null 2>&1
-  . $( ccc_home -u igcmg)/MachineEnvironment/irene/env_atlas_irene > /dev/null 2>&1
+  if [ X${CCCOS} = X"Rhel_8__x86_64" ] ; then
+      . $( ccc_home -u igcmg)/MachineEnvironment/irene/env_atlas_irene > /dev/null 2>&1
+  else
+      . $( ccc_home -u igcmg)/MachineEnvironment/irene_prev/env_irene > /dev/null 2>&1
+      . $( ccc_home -u igcmg)/MachineEnvironment/irene_prev/env_atlas_irene > /dev/null 2>&1
+  fi
 
   export PCMDI_MP=/ccc/work/cont003/igcmg/igcmg/PCMDI-MP
@@ -214,4 +229,5 @@
 function IGCM_sys_defineArchives {
   IGCM_debug_PushStack "IGCM_sys_defineArchives"
+
   # Load dfldatadir depending on the project used for submission (default) or set in config.card (optional)
   if [ X${config_UserChoices_DataProject} = X ] || [ X${config_UserChoices_DataProject} = XDEFAULT ]; then
@@ -222,5 +238,4 @@
       IGCM_debug_Print 1 "Load dfldatadir for forced gencmip6 project"
     else 
-      echo "Load dfldatadir for project ${PROJECT}"
       module switch dfldatadir dfldatadir/${PROJECT}
       IGCM_debug_Print 1 "Load dfldatadir for project ${PROJECT}"
@@ -231,8 +246,8 @@
     IGCM_debug_Print 1 "Load dfldatadir for DataProject read in config.card : ${config_UserChoices_DataProject}"
   fi
+
  #====================================================
  #- RUN_DIR_PATH : Temporary working directory (=> TMP)
  typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${CCCSCRATCHDIR}/RUN_DIR/${BRIDGE_MSUB_JOBID}_${$}}
-
   if [ ! X${config_UserChoices_ARCHIVE} = X ]; then
     #====================================================
@@ -275,5 +290,4 @@
     R_FIG=${STORAGE}/IGCM_OUT
   fi
-
   #====================================================
   #- CMIP6 (hosting CMIP6 files produced by XIOS2 and configured by dr2xml)
Index: branches/libIGCM_CESMEP/libIGCM_sys/libIGCM_sys_jeanzay.ksh
===================================================================
--- branches/libIGCM_CESMEP/libIGCM_sys/libIGCM_sys_jeanzay.ksh	(revision 1567)
+++ branches/libIGCM_CESMEP/libIGCM_sys/libIGCM_sys_jeanzay.ksh	(revision 1585)
@@ -38,5 +38,11 @@
 #====================================================
 # Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get)
-typeset -r DRYRUN=${DRYRUN:=0}
+if ([ X${DRYRUN} != X ] && [ ${DRYRUN} = 4 ]) ; then
+  typeset -r DRYRUN=0
+  typeset -r DRYRUN_DEBUG=4
+else
+  typeset -r DRYRUN=${DRYRUN:=0}
+  typeset -r DRYRUN_DEBUG=0
+fi
 
 # YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
@@ -54,4 +60,7 @@
 # |    3     |       yes           |    no      |  no     |      no                   |
 # -------------------------------------------------------------------------------------
+# |    4     |       yes           |    yes     |  creation of RUN_DIR and Job_debug  |
+# -------------------------------------------------------------------------------------
+
 
 #=====================================================
@@ -1406,5 +1415,8 @@
              (( index_host = current_core / NB_CORE_PER_NODE ))
              host_value=${listnodes[${index_host}]}
-               echo "$host_value" >> hostlist
+             echo "$host_value" >> hostlist
+	     if [ ${DRYRUN_DEBUG} = 4 ] ; then
+		 echo "node_${index_host}_X" >> hostlist_template
+	     fi
              (( current_core = current_core + offset_comp_proc_loc ))
           done
@@ -1467,5 +1479,5 @@
         EXECUTION="${HOST_MPIRUN_COMMAND} ./script_${ExeNameOut}.ksh"
 
-        IGCM_debug_Print 1 "sys Irene : script_${ExeNameOut}.ksh contains"
+        IGCM_debug_Print 1 "sys Jean-Zay : script_${ExeNameOut}.ksh contains"
         cat script_${ExeNameOut}.ksh
 
@@ -1476,5 +1488,5 @@
   fi # ${OK_PARA_MPMD}
 
-  IGCM_debug_Print 1 "sys Irene : execution command is "
+  IGCM_debug_Print 1 "sys Jean-Zay : execution command is "
   IGCM_debug_Print 1 "$EXECUTION"
 
Index: branches/libIGCM_CESMEP/libIGCM_sys/libIGCM_sys_mesoipsl.ksh
===================================================================
--- branches/libIGCM_CESMEP/libIGCM_sys/libIGCM_sys_mesoipsl.ksh	(revision 1585)
+++ branches/libIGCM_CESMEP/libIGCM_sys/libIGCM_sys_mesoipsl.ksh	(revision 1585)
@@ -0,0 +1,1339 @@
+#!/bin/ksh
+
+#**************************************************************
+# Author: Sebastien Denvil
+# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
+# $Revision:: 1569                                     $ Revision of last commit
+# $Author:: aclsce                                     $ Author of last commit
+# $Date:: 2022-12-15 11:08:40 +0100 (Thu, 15 Dec 2022) $ Date of last commit
+# IPSL (2006)
+#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
+#
+#**************************************************************
+
+#=========================================================
+# The documentation of this file can be automatically generated
+# if you use the prefix #D- for comments to be extracted.
+# Extract with command: cat lib* | grep "^#D-" | cut -c "4-"
+#=========================================================
+
+#D-#==================================================
+#D-LibIGCM_sys for IPSL ESPRI MESO cluster: spirit and spiritx
+#D-#==================================================
+#D-
+#D- This ksh library if a layer under some usefull
+#D-environment variables and shell commands.
+#D-All those definitions depend on host particularities.
+#D-It manages a stack mechanism and test validity of operations.
+#D-All function described bellow must be prefixed by IGCM_sys.
+
+#====================================================
+# libIGCM_sys PARAMETERS
+#====================================================
+
+#====================================================
+# set DEBUG_sys to true to output calls of function
+typeset -r DEBUG_sys=${DEBUG_sys:=true}
+
+#====================================================
+# Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get)
+if ([ X${DRYRUN} != X ] && [ ${DRYRUN} = 4 ]) ; then
+  typeset -r DRYRUN=0
+  typeset -r DRYRUN_DEBUG=4
+else
+  typeset -r DRYRUN=${DRYRUN:=0}
+  typeset -r DRYRUN_DEBUG=0
+fi
+
+# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
+# -------------------------------------------------------------------------------------
+# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
+# |          |  Cp/Exe/param/files |            |         |                           |
+# |          |  Chmod Qsub         |            |         |                           |
+# -------------------------------------------------------------------------------------
+# |    0     |       yes           |    yes     |  yes    |      yes                  |
+# -------------------------------------------------------------------------------------
+# |    1     |       yes           |    yes     |  yes    |      no                   |
+# -------------------------------------------------------------------------------------
+# |    2     |       yes           |    yes     |  no     |      no                   |
+# -------------------------------------------------------------------------------------
+# |    3     |       yes           |    no      |  no     |      no                   |
+# -------------------------------------------------------------------------------------
+# |    4     |       yes           |    yes     |  creation of RUN_DIR and Job_debug  |
+# -------------------------------------------------------------------------------------
+
+#=====================================================
+# Global Variables :
+#=====================================================
+# Language : "fr" or "en"
+typeset -r MYLANG="fr"
+
+#=====================================================
+# Host user names project maxCpuTime
+# $hostname ou hostname
+typeset HOST=${HOST:=$( hostname )}
+# $username ou whoami
+typeset LOGIN=${LOGIN:=$( whoami )}
+# $hostname of the MASTER job
+typeset MASTER=${MASTER:=$( hostname )}
+# project name
+typeset PROJECT=NONE
+# jobWarningDelay in seconds
+#typeset jobWarningDelay=${PBS_WALLTIME}
+
+#D-
+#D-#==================================================
+#D-Program used in libIGCM
+#D-#==================================================
+
+# Submit command
+typeset SUBMIT=${SUBMIT:=sbatch}
+# rsync with path
+typeset -r RSYNC=/usr/bin/rsync
+# RSYNC_opt args to rsync
+typeset -r RSYNC_opt="-va"
+# ie storage filesystem
+typeset -r STOREHOST=${MASTER}
+
+#====================================================
+# Access to module command
+#====================================================
+. /etc/profile.d/modules.sh
+
+#====================================================
+# Set environment tools (ferret, nco, cdo, rebuild, ...)
+#====================================================
+if [ X${TaskType} = Xcomputing ] ; then
+    IGCM_debug_Print 1 "Modules will be loaded later in IGCM_sys_activ_variables."
+else
+    if [ $CENTER == spirit ] ; then
+        # At spirit
+        . /home/igcmg/MachineEnvironment/mesoipsl/atlas_env_mesoipsl
+    elif [ $CENTER == spiritx ] ; then
+        # At spiritx
+	. /ciclad-home/igcmg/MachineEnvironment/mesoipsl/atlas_env_mesoipsl
+    fi
+fi
+
+[ ! X${TaskType} = Xchecking ] && IGCM_debug_Print 1 "List of loaded modules:"
+[ ! X${TaskType} = Xchecking ] && module list
+
+#====================================================
+# Host specific DIRECTORIES
+#====================================================
+# For rebuild
+if [ $CENTER == spirit ] ; then
+    export PATH=${PATH}:/home/igcmg/rebuild/spirit/modipsl/modeles/IOIPSL/bin/
+else
+    export PATH=${PATH}:/ciclad-home/igcmg/rebuild/spirit/modipsl/modeles/IOIPSL/bin/
+fi
+#====================================================
+#- MirrorlibIGCM for frontend
+typeset -r MirrorlibIGCM=${MirrorlibIGCM:=false}
+
+#====================================================
+#- libIGCM_POST for frontend
+typeset -r libIGCM_POST=${libIGCM}
+
+#====================================================
+#- R_EXE   (==> BIN_DIR = ${MODIPSL}/bin )
+typeset -r R_EXE="${MODIPSL}/bin"
+
+#====================================================
+#- SUBMIT_DIR : submission dir
+if [ X${SLURM_SUMBIT_DIR} != X ] ; then
+  typeset -x SUBMIT_DIR=${SUBMIT_DIR:=${SLURM_SUBMIT_DIR}}
+else
+  typeset -x SUBMIT_DIR=${SUBMIT_DIR:=${PWD}}
+fi
+
+#====================================================
+#- IN
+typeset -r R_IN=${R_IN:=/projsu/igcmg/IGCM}
+
+#====================================================
+#- RUN_DIR_PATH : Temporary working directory
+
+if [ $CENTER == spirit ] ; then
+    RUN_DIR_PATH=${RUN_DIR_PATH:=/scratchu/${LOGIN}/RUN_DIR}
+else
+    RUN_DIR_PATH=${RUN_DIR_PATH:=/scratchx/${LOGIN}/RUN_DIR}
+fi
+if [ X${SLURM_JOBID} != X ] ; then
+    typeset -r RUN_DIR_PATH=${RUN_DIR_PATH}/${SLURM_JOBID}_${$}
+else
+    typeset -r RUN_DIR_PATH=${RUN_DIR_PATH}/${$}
+fi
+
+#====================================================
+#- OUTCOMMAND_PATH : tmp place to store command lines standard error and outputs
+# Note that typeset -r can not be set at spirit because it sets the path as read-only
+typeset OUTCOMMAND_PATH=/tmp
+
+#====================================================
+#- HOST_MPIRUN_COMMAND
+typeset -r HOST_MPIRUN_COMMAND=${HOST_MPIRUN_COMMAND:="time mpirun"}
+
+#====================================================
+#- Max number of arguments passed to nco operator or demigration command
+UNIX_MAX_LIMIT=360
+
+#====================================================
+#- set PackDefault to false on meso-ipsl 
+PackDefault=false
+
+#====================================================
+#- Default number of MPI task for IPSL coupled model
+#- required for backward compatibility
+#-
+DEFAULT_NUM_PROC_OCE=5
+DEFAULT_NUM_PROC_CPL=1
+(( DEFAULT_NUM_PROC_ATM = BATCH_NUM_PROC_TOT - DEFAULT_NUM_PROC_OCE - DEFAULT_NUM_PROC_CPL ))
+
+#D-#==================================================
+#D-function IGCM_sys_defineArchives
+#D-* Purpose:
+#D-* Define ARCHIVE : Dedicated to large files
+#D-* Define STORAGE : Dedicated to small/medium files
+#D-* Define R_OUT   : Output tree located on ARCHIVE
+#D-* Define R_FIG   : Output tree located on STORAGE hosting figures (monitoring and atlas, and/or small files)
+#D-* Define R_BUF   : Output tree located on STORAGE hosting files waiting for rebuild or pack processes
+#D-* if SpaceName=TEST nothing special will hapen
+#D-* Examples:
+#D-
+function IGCM_sys_defineArchives {
+  IGCM_debug_PushStack "IGCM_sys_defineArchives"
+
+  if [ ! X${config_UserChoices_ARCHIVE} = X ]; then
+    #====================================================
+    #- ARCHIVE (dedicated to large files)
+    ARCHIVE=${config_UserChoices_ARCHIVE}
+  else
+    #====================================================
+    #- ARCHIVE (dedicated to large files)
+    if [ $CENTER == spirit ] ; then
+	# At spirit
+   	ARCHIVE=${ARCHIVE:=/data/${LOGIN}}
+    else
+	# At spiritx
+	ARCHIVE=${ARCHIVE:=/homedata/${LOGIN}}
+    fi
+  fi
+
+  if [ ! X${config_UserChoices_STORAGE} = X ]; then
+    #====================================================
+    #- STORAGE (dedicated to small/medium files)
+    STORAGE=${config_UserChoices_STORAGE}
+  else
+    #====================================================
+    #- STORAGE (dedicated to small/medium files)
+    STORAGE=${ARCHIVE}
+  fi
+
+  # ON MESO-IPSL NO SPECIAL CASE WHEN X${config_UserChoices_SpaceName} = XTEST
+
+  #====================================================
+  #- R_OUT
+  R_OUT=${ARCHIVE}/IGCM_OUT
+
+  #====================================================
+  #- R_FIG (hosting figures : monitoring and atlas, and/or small files)
+  R_FIG=${STORAGE}/IGCM_OUT
+
+  #====================================================
+  #- CMIP6 (hosting CMIP6 files produced by XIOS2 and configured by dr2xml)
+  CMIP6_BUF=${STORAGE}/IGCM_OUT
+
+  #====================================================
+  #- R_BUF (ONLY FOR double copy an scratch)
+  R_BUF=${STORAGE}/IGCM_OUT
+
+  IGCM_debug_Print 1 "R_OUT has been defined = ${R_OUT}"
+  IGCM_debug_Print 1 "R_BUF has been defined = ${R_BUF}"
+  IGCM_debug_Print 1 "R_FIG has been defined = ${R_FIG}"
+
+  IGCM_debug_PopStack "IGCM_sys_defineArchives"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_RshArchive
+#D-* Purpose: Archive rsh command
+#D-* Examples:
+#D-
+function IGCM_sys_RshArchive {
+  IGCM_debug_PushStack "IGCM_sys_RshArchive" $@
+  /bin/ksh <<-EOF
+    ${@}
+EOF
+  status=$?
+  if [ ${status} -gt 0 ] ; then
+    IGCM_debug_Print 2 "IGCM_sys_RshArchive : command failed error code ${status}"
+    IGCM_debug_Exit "IGCM_sys_RshArchive"
+  fi
+  IGCM_debug_PopStack "IGCM_sys_RshArchive"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_RshArchive_NoError
+#D-* Purpose: Archive rsh command, without error
+#D-*          used only in monitoring.job
+#D-* Examples:
+#D-
+function IGCM_sys_RshArchive_NoError {
+  IGCM_debug_PushStack "IGCM_sys_RshArchive_NoError" $@
+  /bin/ksh <<-EOF
+    ${@} 2> /dev/null
+EOF
+  IGCM_debug_PopStack "IGCM_sys_RshArchive_NoError"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_MkdirArchive
+#D-* Purpose: Mkdir on Archive
+#D-* Examples:
+#D-
+function IGCM_sys_MkdirArchive {
+  IGCM_debug_PushStack "IGCM_sys_MkdirArchive" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_MkdirArchive :" $@
+  fi
+  #- creation de repertoire sur le serveur fichier
+  if [ ! -d ${1} ]; then
+    \mkdir -p $1
+    status=$?
+
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_MkdirArchive : mkdir failed error code ${status}"
+      IGCM_debug_Exit "IGCM_sys_MkdirArchive"
+    fi
+  fi
+  IGCM_debug_PopStack "IGCM_sys_MkdirArchive"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_TestDirArchive
+#D-* Purpose: Test Directory that must exists on Archive
+#D-* Examples:
+#D-
+function IGCM_sys_TestDirArchive {
+  IGCM_debug_PushStack "IGCM_sys_TestDirArchive" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_TestDirArchive :" $@
+  fi
+  typeset ExistFlag
+  ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
+  IGCM_debug_PopStack "IGCM_sys_TestDirArchive"
+  return ${ExistFlag}
+}
+
+#D-#==================================================
+#D-function IGCM_sys_IsFileArchived
+#D-* Purpose: Test file that must NOT EXISTS on Archive based on filename only
+#D-* Examples:
+#D-
+function IGCM_sys_IsFileArchived {
+  IGCM_debug_PushStack "IGCM_sys_IsFileArchived" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_IsFileArchived :" $@
+  fi
+  typeset IsArchivedFlag
+  # Never archived for this system
+  IsArchivedFlag=1
+  IGCM_debug_PopStack "IGCM_sys_IsFileArchived"
+
+  return ${IsArchivedFlag}
+}
+
+#D-#==================================================
+#D-function IGCM_sys_TestFileArchive
+#D-* Purpose: Test file that must NOT EXISTS on Archive
+#D-* Examples:
+#D-
+function IGCM_sys_TestFileArchive {
+  IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@
+  typeset ExistFlag
+  ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
+  IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
+
+  return ${ExistFlag}
+}
+
+#D-#==================================================
+#D-function IGCM_sys_CountFileArchive
+#D-* Purpose: Count files on Archive filesystem
+#D-* Examples:
+#D-
+function IGCM_sys_CountFileArchive {
+  IGCM_debug_PushStack "IGCM_sys_CountFileArchive" $@
+  ls ${@} 2>/dev/null | wc -l
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_CountFileArchive : erreur."
+  fi
+  IGCM_debug_PopStack "IGCM_sys_CountFileArchive"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_Tree
+#D-* Purpose: Tree directories with files on ${ARCHIVE}
+#D-* Examples: IGCM_sys_Tree ${R_IN} ${R_OUT}
+#D-
+function IGCM_sys_Tree {
+  IGCM_debug_PushStack "IGCM_sys_Tree" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Tree :" $@
+  fi
+
+  \ls -lR ${@}
+
+  IGCM_debug_PopStack "IGCM_sys_Tree"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_Qsub
+#D-* Purpose: Qsub new job
+#D-* Examples:
+#D-
+function IGCM_sys_Qsub {
+  IGCM_debug_PushStack "IGCM_sys_Qsub" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Qsub :" $@
+  fi
+  typeset options status
+  options="-o ${SUBMIT_DIR}/${Script_Output} -e ${SUBMIT_DIR}/${Script_Output}"
+  /usr/bin/time sbatch ${options} $1 > ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1
+  status=$?
+
+  cat ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+  if [ ${status} -gt 0 ] ; then
+    IGCM_debug_Print 2 "IGCM_sys_Qsub ${options} $1 : error code ${status}"
+    IGCM_debug_Exit "IGCM_sys_Qsub"
+  else
+    JobID=$( gawk {'print $4'} ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ )
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Qsub"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_QsubPost
+#D-* Purpose: Qsub new job on scalaire
+#D-* Examples:
+#D-
+function IGCM_sys_QsubPost {
+  IGCM_debug_PushStack "IGCM_sys_QsubPost" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_QsubPost :" $@
+  fi
+  typeset options status
+  options="-o ${POST_DIR}/${Script_Post_Output}.out  -e ${POST_DIR}/${Script_Post_Output}.out"
+  sbatch ${options} ${libIGCM_POST}/$1.job > ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1
+  status=$?
+
+  cat ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+  if [ ${status} -gt 0 ] ; then
+    IGCM_debug_Print 2 "IGCM_sys_QsubPost ${options} ${libIGCM_POST}/$1.job : error code ${status}"
+    IGCM_debug_Exit "IGCM_sys_QsubPost"
+  else
+    JobID=$( gawk {'print $4'} ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ )
+  fi
+  IGCM_debug_PopStack "IGCM_sys_QsubPost"
+}
+
+#D-*************************
+#D- File transfer functions
+#D-*************************
+#D-
+
+#D-#==================================================
+#D-function IGCM_sys_RmRunDir
+#D-* Purpose: rm tmpdir (dummy function most of the time batch
+#D-                      scheduler will do the job)
+#D-* Examples:
+#D-
+function IGCM_sys_RmRunDir {
+  IGCM_debug_PushStack "IGCM_sys_RmRunDir" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_RmRunDir :" $@
+  fi
+
+  typeset status
+
+  echo rm $@ > ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1
+  \rm $@ >> ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1
+  status=$?
+
+  if [ ${status} -gt 0 ] ; then
+    IGCM_debug_Print 1 "IGCM_sys_RmRunDir : rm error code is ${status}."
+    cat ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+    IGCM_debug_Exit "IGCM_sys_RmRunDir"
+  else
+    \rm ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+  fi
+  IGCM_debug_PopStack "IGCM_sys_RmRunDir"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_Put_Dir
+#D-* Purpose: Copy a complete directory on $(ARCHIVE)
+#D-* Examples:
+#D-
+function IGCM_sys_Put_Dir {
+  IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Put_Dir :" $@
+  fi
+  if [ $DRYRUN = 0 ]; then
+    if [ ! -d ${1} ] ; then
+      echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ."
+      IGCM_debug_PopStack "IGCM_sys_Put_Dir"
+      return
+    fi
+
+    typeset status
+
+    # Only if we use rsync
+    #IGCM_sys_TestDirArchive $( dirname $2 )
+    #
+    #USUAL WAY
+    \cp -r $1 $2 > ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1
+    status=$?
+
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_Put_Dir : cp failed error code ${status}"
+      cat ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+      IGCM_debug_Exit "IGCM_sys_Put_Dir"
+    else
+      \rm ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+    fi
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Put_Dir"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_Get_Dir
+#D-* Purpose: Copy a complete directory from ${ARCHIVE}
+#D-* Examples:
+#D-
+function IGCM_sys_Get_Dir {
+  IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Get_Dir :" $@
+  fi
+  if [ $DRYRUN = 0 ]; then
+    typeset NB_ESSAI DELAI status i
+    # number of tentative
+    NB_ESSAI=3
+    # time delay between tentative
+    DELAI=2
+
+    #
+    # USUAL WAY
+    i=0
+    while [ $i -lt $NB_ESSAI ] ; do
+      \cp -ur $1 $2 >> ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1
+      status=$?
+      if [ ${status} -gt 0 ] ; then
+        IGCM_debug_Print 2 "IGCM_sys_Get_Dir : cp failed error code ${status} ${i}/${NB_ESSAI}"
+        IGCM_debug_Print 2 "IGCM_sys_Get_Dir : sleep ${DELAI} seconds and try again."
+        sleep $DELAI
+      else
+        break
+      fi
+      (( i = i + 1 ))
+    done
+
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_Get_Dir : cp failed error code ${status}"
+      cat ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+      IGCM_debug_Exit "IGCM_sys_Get_Dir"
+    else
+      \rm ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+    fi
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Get_Dir"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_Put_Rest
+#D-* Purpose: Put computied restarts on ${ARCHIVE}.
+#D-           File and target directory must exist.
+#D-* Examples:
+#D-
+function IGCM_sys_Put_Rest {
+  IGCM_debug_PushStack "IGCM_sys_Put_Rest" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Put_Rest :" $@
+  fi
+  if [ $DRYRUN = 0 ]; then
+    if [ ! -f ${1} ] ; then
+      echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ."
+      IGCM_debug_Exit "IGCM_sys_Put_Rest"
+    fi
+
+    typeset status
+    #
+    # USUAL WAY
+    \cp $1 $2 > ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1
+    status=$?
+
+#       #RSYNC WITH NETWORK SSH CALL
+#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1
+#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1
+
+#       #RSYNC WITH NFS USE
+#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1
+#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1
+
+#       status=$?
+#       IGCM_sys_Rsync_out $status
+
+#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+#       (( status=status+$? ))
+
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_Put_Rest : cp failed error code ${status}"
+      [ -f ${1} ] && ls -l ${1}
+      [ -f ${2} ] && ls -l ${2}
+      [ -f ${2}/${1} ] && ls -l ${2}/${1}
+      cat ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+      IGCM_debug_Exit "IGCM_sys_Put_Rest"
+    else
+
+      if [ X${JobType} = XRUN ] ; then
+        [ -f ${2} ] && IGCM_sys_Chmod 444 ${2}
+        [ -f ${2}/${1} ] && IGCM_sys_Chmod 444 ${2}/${1}
+      fi
+
+      \rm ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+    fi
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Put_Rest"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_Put_Out
+#D-* Purpose: Copy a file on ${ARCHIVE} after having chmod it in readonly
+#D-* Examples:
+#D-
+function IGCM_sys_Put_Out {
+  IGCM_debug_PushStack "IGCM_sys_Put_Out" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Put_Out :" $@
+  fi
+
+  typeset status
+
+  if [ $DRYRUN = 0 ]; then
+    if [ ! -f ${1} ] ; then
+      echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ."
+      IGCM_debug_PopStack "IGCM_sys_Put_Out"
+      return 1
+    fi
+    #
+    IGCM_sys_MkdirArchive $( dirname $2 )
+    #
+    if [ X${JobType} = XRUN ] ; then
+      if [ X${3} = X ] ; then
+        IGCM_sys_Chmod 444 ${1}
+      fi
+    fi
+    #
+
+    echo ${RSYNC} ${RSYNC_opt} $1 $2 > ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1
+    ${RSYNC} ${RSYNC_opt} $1 $2 >> ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1
+    status=$?
+    IGCM_sys_Rsync_out $status
+
+    ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+    (( status=status+$? ))
+
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_Put_Out : rsync failed error code ${status}"
+      cat ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+      IGCM_debug_Exit "IGCM_sys_Put_Out"
+    else
+      \rm ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+    fi
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Put_Out"
+  return 0
+}
+
+#D-#==================================================
+#D-function IGCM_sys_Get
+#D-* Purpose: Get a file from ${ARCHIVE}
+#D-* Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX
+#D-            IGCM_sys_Get /l Array_contain_myfiles /destpath/
+function IGCM_sys_Get {
+  IGCM_debug_PushStack "IGCM_sys_Get" $@
+
+  typeset DEST status dm_liste
+
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Get :" $@
+  fi
+  if [ $DRYRUN -le 2 ]; then
+    if [ X${1} = X'/l' ] ; then
+      eval set +A dm_liste \${${2}}
+    else
+      dm_liste=${1}
+    fi
+    eval DEST=\${${#}}
+
+    # test if the (first) file is present in the old computation :
+    IGCM_sys_TestFileArchive ${dm_liste[0]}
+    status=$?
+    if [ ${status} -gt 0 ] ; then
+      echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ."
+      IGCM_debug_Exit "IGCM_sys_Get"
+      return
+    fi
+
+    #USUAL WAY
+    \cp ${dm_liste[*]} ${DEST} > ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1
+    status=$?
+
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status}"
+      cat ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+      IGCM_debug_Exit "IGCM_sys_Get"
+    else
+      \rm ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+    fi
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Get"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_GetDate_Monitoring
+#D-* Purpose: get the last year for which the monitoring has been computed
+#D-* Examples:
+#D-
+function IGCM_sys_GetDate_Monitoring {
+  IGCM_debug_PushStack "IGCM_sys_GetDate_Monitoring" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_GetDate_Monitoring :" $@
+  fi
+
+  eval ${2}=$( cdo showyear ${1} 2> /dev/null | gawk '{ print $NF }' )
+
+  IGCM_debug_PopStack "IGCM_sys_GetDate_Monitoring"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_Dods_Rm
+#D-* Purpose: DO NOTHING ! Put ${ARCHIVE} files on DODS internet protocole.
+#D-* Examples:
+#D-
+function IGCM_sys_Dods_Rm {
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Dods_Rm :" $@
+  fi
+  return 0
+}
+
+#D-#==================================================
+#D-function IGCM_sys_Dods_Cp
+#D-* Purpose: Copy $(ARCHIVE) files on DODS internet protocole.
+#D-* Examples:
+#D-
+function IGCM_sys_Dods_Cp {
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Dods_Cp :" $@
+  fi
+  return 0
+}
+
+#D-#==================================================
+#D-function IGCM_sys_Put_Dods
+#D-* Purpose: Put ${ARCHIVE} files on DODS internet protocole. Dummy function here
+#D-* Examples:
+#D-
+function IGCM_sys_Put_Dods {
+  IGCM_debug_PushStack "IGCM_sys_Put_Dods" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Put_Dods :" $@
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Put_Dods"
+}
+
+##############################################################
+# REBUILD OPERATOR
+
+#D-#==================================================
+#D-function IGCM_sys_sync
+#D-* Purpose: flush buffer on disk (dummy function on Ciclad)
+#D-* Examples:
+#D-
+function IGCM_sys_sync {
+  IGCM_debug_PushStack "IGCM_sys_sync" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_sync :" $@
+    echo "Dummy call, let the system do that."
+  fi
+  IGCM_debug_PopStack "IGCM_sys_sync"
+}
+
+############################################################
+# Activate Running Environnment Variables
+
+#D-#==================================================
+#D-function IGCM_sys_activ_variables
+#D-* Purpose: set environement variables prior to execution
+#D-* Examples:
+#D-
+function IGCM_sys_activ_variables {
+  IGCM_debug_PushStack "IGCM_sys_activ_variables"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_activ_variables"
+  fi
+
+# --------------------------------------------------------------------
+#D- MODULE specifications
+# --------------------------------------------------------------------
+  # Source the file EnvFile containing all module load needed to run the model.
+  # EnvFile can be specified in config.card. If this is the case and if the file exists, 
+  # it will be used. Otherwise a default file will be used.
+  if [ ! X${config_UserChoices_EnvFile} = X ] && [ -f ${config_UserChoices_EnvFile} ] ; then
+      # EnvFile is set in config.card and the file exists
+      IGCM_debug_Print 1 "EnvFile set in config.card will be used"
+      EnvFile=${config_UserChoices_EnvFile}
+  else
+      IGCM_debug_Print 1 "IGCM_sys_active_variables : Default modules will be used"
+      if [ $CENTER == spirit ] ; then
+          # At spirit
+	  EnvFile=/home/igcmg/MachineEnvironment/mesoipsl/atlas_env_mesoipsl
+      else
+          # At spirit
+	  EnvFile=/ciclad-home/igcmg/MachineEnvironment/mesoipsl/atlas_env_mesoipsl
+      fi
+  fi
+  IGCM_debug_Print 1 "IGCM_sys_active_variables : Following EnvFile will be used :" 
+  IGCM_debug_Print 1 ${EnvFile}
+  . ${EnvFile}
+
+
+  IGCM_debug_Print 1 "IGCM_sys_active_variables : Now loaded modules for meso-ipsl . "
+  module list
+  
+
+# --------------------------------------------------------------------
+#D- MPI specifications
+# --------------------------------------------------------------------
+
+# --------------------------------------------------------------------
+#D- Other specifications
+# --------------------------------------------------------------------
+
+  ulimit -s unlimited
+
+  IGCM_debug_PopStack "IGCM_sys_activ_variables"
+}
+
+############################################################
+# Desactivate Running Environnment Variables
+
+#D-#==================================================
+#D-function IGCM_sys_desactiv_variables
+#D-* Purpose: unset environement variables after execution
+#D-* Examples:
+#D-
+function IGCM_sys_desactiv_variables {
+  IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_desactiv_variables"
+  fi
+# --------------------------------------------------------------------
+#D- MPI specifications
+# --------------------------------------------------------------------
+
+# --------------------------------------------------------------------
+#D- Other specifications
+# --------------------------------------------------------------------
+
+  IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
+}
+
+############################################################
+# Update job headers to be used by the scheduler
+
+#D-#==================================================
+#D-function IGCM_sys_updateHeaders
+#D-* Purpose: Update job headers to be used by the scheduler
+#D-* Examples: IGCM_sys_updateHeaders /path/to/Job_MYEXP
+#D-
+function IGCM_sys_updateHeaders {
+  IGCM_debug_PushStack "IGCM_sys_updateHeaders"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_updateHeaders"
+  fi
+  typeset file
+  file=$1
+
+  if [ ${executionType} -eq 1 ] ; then
+    # MPMD + MPI
+    sed -e "/::openMPthreads::/d"                  \
+        -e "s/::JobNumProcTot::/${coreNumber}/"    \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 2 ] ; then
+    # MPMD + MPI + OMP
+      (( nodeNumber = coreNumber / NB_CORE_PER_NODE ))
+      [ $(( ${coreNumber} % ${NB_CORE_PER_NODE} )) -ne 0 ] && (( nodeNumber = nodeNumber + 1 ))
+      sed -e "/::openMPthreads::/d"                 \
+        -e "s/::JobNumProcTot::/${mpiTasks}/"       \
+	-e "/ntasks/i\#SBATCH --nodes=${nodeNumber}"\
+        -e "/ntasks/i\#SBATCH --exclusive"          \
+         ${file} > ${file}.tmp
+  elif [ ${executionType} -eq 3 ] ; then
+    # SPMD + MPI/OMP
+    sed -e "s/::openMPthreads::/${openMPthreads}/" \
+        -e "s/::JobNumProcTot::/${mpiTasks}/"      \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 4 ] ; then
+    # SPMD + MPI only
+    sed -e "s/::JobNumProcTot::/${mpiTasks}/"      \
+        -e "/::openMPthreads::/d"                  \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 5 ] ; then
+    # SPMD + OMP only
+    sed -e "s/::openMPthreads::/${openMPthreads}/" \
+        -e "/::JobNumProcTot::/d"                  \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 6 ] ; then
+    # SEQUENTIAL THEN
+    sed -e "s/::JobNumProcTot::/1/"                \
+        -e "/::openMPthreads::/d"                  \
+      ${file} > ${file}.tmp
+
+  fi
+
+  IGCM_sys_Mv ${file}.tmp ${file}
+
+  IGCM_debug_PopStack "IGCM_sys_updateHeaders"
+}
+
+############################################################
+# Build MPI/OMP scripts run file (dummy function)
+
+#D-#==================================================
+#D-function IGCM_sys_build_run_file
+#D-* Purpose: build run file (deprecated)
+#D-* Examples:
+#D-
+function IGCM_sys_build_run_file {
+  IGCM_debug_Print 3 " dummy function : IGCM_sys_build_run_file "
+}
+
+############################################################
+# Build MPI/OMP scripts
+
+#D-#==================================================
+#D-function IGCM_sys_build_execution_scripts
+#D-* Purpose: build execution scripts to be launch by ${HOST_MPIRUN_COMMAND}
+#D-* Examples:
+#D-
+function IGCM_sys_build_execution_scripts
+{
+  IGCM_debug_PushStack "IGCM_sys_build_execution_scripts" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_build_execution_scripts " $@
+  fi
+  IGCM_debug_Print 1 "executionType= ${executionType}"
+  EXECUTION=${HOST_MPIRUN_COMMAND}
+
+  if ( ${OK_PARA_MPMD} ) ; then
+
+    # MPMD mode
+    # 1 MPI only : executionType=1
+    # 2 MPI/OpenMP : executionType=2
+
+    if [ -f run_file ] ; then
+      IGCM_sys_Rm -f run_file
+    fi
+    touch run_file
+
+    # case 1 : Only MPI (MPMD)
+    if  ( ! ${OK_PARA_OMP} ) ; then
+      # Build run_file
+      current_core=0
+      # First loop on the components for the coupler ie oasis (only if oasis3)
+      # the coupler ie oasis3 must be the first one
+      for comp in ${config_ListOfComponents[*]} ; do
+
+        eval ExeNameIn=\${config_Executable_${comp}[0]}
+        eval ExeNameOut=\${config_Executable_${comp}[1]}
+
+        # Only if the component has an executable
+        if ( [ "X${ExeNameOut}" != X\"\" ] ) ; then
+
+#          eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
+#          (( end_core = ${current_core} + ${comp_proc_mpi_loc} - 1 ))
+#          echo "${current_core}-${end_core} ./${ExeNameOut}" >> run_file
+#          (( current_core = ${end_core} + 1 ))
+          eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
+          eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
+          echo "-np ${comp_proc_mpi_loc} ./${ExeNameOut}" >> run_file
+
+	fi
+      done
+
+      EXECUTION="${HOST_MPIRUN_COMMAND} --app ./run_file"
+
+      IGCM_sys_Chmod u+x run_file
+      if ( $DEBUG_sys ) ; then
+        echo "run_file contains : "
+        cat run_file
+      fi
+
+    else 
+
+    # 2 MPI/OpenMP : executionType=2
+
+    # MPI-OpenMP (MPMD)
+    # export SLURM_HOSTFILE=./hostlist 
+    # srun --cpu-bind=none --distribution=arbitrary --multi-prog ./run_file
+    # example of  hostlist file :
+    # r3i3n33
+    # r3i3n33
+    # ...
+    # example of run_file :
+    # 0-70 ./prog_lmdz.x.sh %o %t
+    # 71-430 ./prog_opa.xx.sh %o %t
+    # 431-431 ./prog_xios.x.sh %o %t
+    # examples of prog_file :
+    # prog_lmdz.x.sh :
+    # (( init = 0 + $1 ))
+    # (( index = init * 10 ))
+    # (( slot = index % 40 ))
+    # taskset -c $slot-$((slot + 10 - 1)) ./script_lmdz.x.ksh
+    # that will become
+    # taskset -c 0-9 ./script_lmdz.x.ksh
+    # ...
+    # with script_lmdz.x.ksh
+    # export OMP_STACKSIZE=3g
+    # export OMP_PLACES=cores
+    # export OMP_NUM_THREADS=10
+    # ./lmdz.x > out_lmdz.x.out.${SLURM_PROCID} 2>out_lmdz.x.err.${SLURM_PROCID}
+
+    #  Hosts treatment
+    _bkIFS=$IFS;
+	IFS=$'\n'; set -f
+	listnodes=($(< <( scontrol show hostnames $SLURM_JOB_NODELIST )))
+	IFS=$_bkIFS; set +f
+	rm -f hostlist
+
+     # Loop on the components to build run_file and script_exec files
+	rank=0
+	current_core=0
+        current_core_mpi=0
+
+      for comp in ${config_ListOfComponents[*]} ; do
+
+        eval ExeNameIn=\${config_Executable_${comp}[0]}
+        eval ExeNameOut=\${config_Executable_${comp}[1]}
+
+        # Not possible if oasis has an executable (i.e old version of oasis3)
+        if ( [ "X${ExeNameOut}" != X\"\" ] &&  [ "X${comp}" = "XCPL" ] ) ; then
+          IGCM_debug_Exit "ERROR MPMD with hybrid MPI-OpenMP is not available with oasis3 version"
+          IGCM_debug_Print 2 "Only available with oasis3-MCT version coupler"
+          IGCM_debug_Verif_Exit
+        fi
+
+        # Only if we really have an executable for the component :
+        if [ "X${ExeNameOut}" != X\"\" ] ; then
+
+          eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
+          eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
+          eval comp_proc_nod_loc=\${${comp}_PROC_NOD}
+     
+
+          # Build script files
+
+          echo "#!/bin/ksh" > script_${ExeNameOut}.ksh
+          echo ""  >> script_${ExeNameOut}.ksh
+          if [ ${comp_proc_omp_loc} -gt 1 ] ; then
+          # Check if the number of threads is correct
+	      case ${comp_proc_omp_loc} in
+		  2|4|5|10|20)
+		      IGCM_debug_Print 1 "You run ${ExeNameOut} on ${comp_proc_omp_loc} OMP threads"
+		      ;;
+		  *)
+		      IGCM_debug_Exit "ERROR with OMP parameters !"
+		      IGCM_debug_Print 2 "${comp_proc_omp_loc} is not possible as number of OMP threads"
+		      IGCM_debug_Print 2 "Only 2,4,5,10,20 as number of OMP threads are possible "
+		      IGCM_debug_Verif_Exit
+		      ;;
+	      esac
+            echo "export OMP_STACKSIZE=3g"  >> script_${ExeNameOut}.ksh
+            echo "export OMP_PLACES=cores"  >> script_${ExeNameOut}.ksh
+            echo "export OMP_NUM_THREADS=${comp_proc_omp_loc}"  >> script_${ExeNameOut}.ksh
+
+          fi
+
+          # to have out/err per process on different files
+          echo "./${ExeNameOut} > out_${ExeNameOut}.out.\${SLURM_PROCID} 2>out_${ExeNameOut}.err.\${SLURM_PROCID}" >> script_${ExeNameOut}.ksh
+
+          IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh
+
+        # Build run_file
+        # Only if the component has an executable
+        if ( [ "X${ExeNameOut}" != X\"\" ] ) ; then
+
+          eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
+          (( end_core = ${current_core_mpi} + ${comp_proc_mpi_loc} - 1 ))
+          echo "${current_core_mpi}-${end_core} ./prog_${ExeNameOut}.sh %o %t" >> run_file
+          (( current_core_mpi = ${end_core} + 1 ))
+        fi
+
+          if [ ${comp_proc_nod_loc} -gt 1 ] ; then
+              (( offset_comp_proc_loc =  NB_CORE_PER_NODE / (comp_proc_mpi_loc / comp_proc_nod_loc) ))
+          else
+              (( offset_comp_proc_loc =  comp_proc_omp_loc ))
+          fi
+
+          # Build configuration file
+ 
+	      echo "#!/bin/sh" > prog_${ExeNameOut}.sh
+          echo "(( init = $current_core + \$1 ))" >> prog_${ExeNameOut}.sh
+          echo "(( index = init * $comp_proc_omp_loc ))" >> prog_${ExeNameOut}.sh
+          echo "(( slot = index % 40 ))" >> prog_${ExeNameOut}.sh
+	      echo "echo ${ExeNameOut} taskset -c \$slot"-"\$((slot + $comp_proc_omp_loc - 1))" >> prog_${ExeNameOut}.sh
+          echo "taskset -c \$slot"-"\$((slot + $comp_proc_omp_loc - 1)) ./script_${ExeNameOut}.ksh" >> prog_${ExeNameOut}.sh
+
+          IGCM_sys_Chmod u+x prog_${ExeNameOut}.sh
+
+        # Build hostlist file
+
+          for nb_proc_mpi in `seq 0 $(($comp_proc_mpi_loc-1))`; do
+             (( index_host = current_core / NB_CORE_PER_NODE ))
+             host_value=${listnodes[${index_host}]}
+               echo "$host_value" >> hostlist
+             (( current_core = current_core + offset_comp_proc_loc ))
+          done
+        fi
+      done
+
+      ## variable added to stop after 60s instead of 600s by default. 
+      ## This is used when no error comes from executables and when something stopped an executable without notice. 
+      export SLURM_WAIT=60
+
+      EXECUTION="${HOST_MPIRUN_COMMAND} --cpu-bind=none --distribution=arbitrary --multi-prog ./run_file"
+
+      IGCM_sys_Chmod u+x run_file
+      if ( $DEBUG_sys ) ; then
+        echo "run_file contains : "
+        cat run_file
+      fi
+
+    fi # if ${OK_PARA_MPMD}
+
+  else
+  # Only one executable (SPMD mode):  executionType=3, 4, 5 and 6
+
+    for comp in ${config_ListOfComponents[*]} ; do
+
+      # Only if we really have an executable for the component :
+      eval ExeNameOut=\${config_Executable_${comp}[1]}
+      if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${ExeNameOut}" != "Xinca.dat" ] ) ; then
+
+        # Build script files
+
+        echo "#!/bin/ksh" > script_${ExeNameOut}.ksh
+        echo ""  >> script_${ExeNameOut}.ksh
+        IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh
+
+        if ( ${OK_PARA_OMP} ) ; then
+            eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
+	    # Check if the number of threads is correct
+	    case ${comp_proc_omp_loc} in
+		2|4|5|10|20)
+		    IGCM_debug_Print 1 "You run ${ExeNameOut} on ${comp_proc_omp_loc} OMP threads"
+		    ;;
+		*)
+		    IGCM_debug_Exit "ERROR with OMP parameters !"
+		    IGCM_debug_Print 2 "${comp_proc_omp_loc} is not possible as number of OMP threads"
+		    IGCM_debug_Print 2 "Only 2,4,5,10,20 as number of OMP threads are possible "
+		    IGCM_debug_Verif_Exit
+		    ;;
+	    esac 
+            echo ""  >> script_${ExeNameOut}.ksh
+            echo "export OMP_STACKSIZE=3g"  >> script_${ExeNameOut}.ksh
+            echo "export OMP_PLACES=cores"  >> script_${ExeNameOut}.ksh
+            echo "OMP_NUM_THREADS=${comp_proc_omp_loc}" >> script_${ExeNameOut}.ksh
+        fi
+
+        eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
+        
+        # To have out/err per process on different files
+        echo "./${ExeNameOut} > out_${ExeNameOut}.out.\${SLURM_PROCID} 2>out_${ExeNameOut}.err.\${SLURM_PROCID}"  >> script_${ExeNameOut}.ksh
+        EXECUTION="${HOST_MPIRUN_COMMAND} ./script_${ExeNameOut}.ksh"
+
+        IGCM_debug_Print 1 "sys Jean-Zay : script_${ExeNameOut}.ksh contains"
+        cat script_${ExeNameOut}.ksh
+
+      fi
+
+    done
+
+  fi # ${OK_PARA_MPMD}
+
+  IGCM_debug_Print 1 "sys meso-ipsl : execution command is "
+  IGCM_debug_Print 1 "$EXECUTION"
+
+  IGCM_debug_PopStack "IGCM_sys_build_execution_scripts"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_check_path
+#D-* Purpose: check that RUN_DIR_PATH that will be removed on some machine
+#D-* do not point to an important use directory. Stop immediately in that case.
+#D-* Examples:
+#D-
+function IGCM_sys_check_path {
+  IGCM_debug_PushStack "IGCM_sys_check_path"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_check_path"
+  fi
+
+  if ( [ X${RUN_DIR_PATH} = X${HOME} ] || [ X${RUN_DIR_PATH} = X${ARCHIVE} ] ) ; then
+    IGCM_debug_Print 1 "Variable RUN_DIR_PATH is pointing to an important directory : ${RUN_DIR_PATH}"
+    IGCM_debug_Print 1 "Please check the RUN_DIR_PATH definition in your Job : Job_${config_UserChoices_JobName}"
+    IGCM_debug_Exit "This will stop the job"
+  fi
+  IGCM_debug_PopStack "IGCM_sys_check_path"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_check_quota. Dummy call here
+#D-* Purpose: check user quota. Stop the simulation if quota above 90%
+#D-* Examples:
+#D-
+function IGCM_sys_check_quota {
+  IGCM_debug_PushStack "IGCM_sys_check_quota"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_check_quota"
+  fi
+
+  # TO BE IMPLEMENTED
+
+  IGCM_debug_PopStack "IGCM_sys_check_quota"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_projectAccounting
+#D-* Purpose: store project accounting information in a file
+#D-* Examples:
+#D-
+function IGCM_sys_projectAccounting {
+  IGCM_debug_PushStack "IGCM_sys_projectAccounting"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_check_quota"
+  fi
+
+  touch $1
+
+  IGCM_debug_PopStack "IGCM_sys_projectAccounting"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_getJobSchedulerID
+#D-* Purpose: Get the job ID during execution
+#D-* Examples: IGCM_sys_getJobSchedulerID jobSchedulerID
+#D-
+function IGCM_sys_getJobSchedulerID {
+  IGCM_debug_PushStack "IGCM_sys_getJobSchedulerID"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_getJobSchedulerID"
+  fi
+
+  eval ${1}=$( echo ${PBS_JOBID} | awk -F. '{print $1}' )
+
+  IGCM_debug_PopStack "IGCM_sys_getJobSchedulerID"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_GetJobID
+#D-* Purpose: Get the job ID from the JobName
+#D-* Examples: IGCM_sys_GetJobID ${JobName} ${TargetUsr} JobID
+#D-
+function IGCM_sys_GetJobID {
+  IGCM_debug_PushStack "IGCM_sys_GetJobID"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_GetJobID"
+  fi
+
+  # With -f option, the full job name is given in the last column
+  ID="$( qstat -u $2 | grep -w $1 | gawk '-F ' '{print $10}' )"
+
+  eval ${3}=${ID}
+  IGCM_debug_PopStack "IGCM_sys_GetJobID"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_CountJobInQueue
+#D-* Purpose: Count number of users job
+#D-* Examples: IGCM_sys_CountJobInQueue ${JobName} NbRun
+#D-
+function IGCM_sys_CountJobInQueue {
+  IGCM_debug_PushStack "IGCM_sys_CountJobInQueue"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_CountJobInQueue"
+  fi
+  IGCM_debug_PopStack "IGCM_sys_CountJobInQueue"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_atlas
+#D-* Purpose: encapsulate atlas call so as to manage error code and curie specificity
+#D-* Examples:
+#D-
+function IGCM_sys_atlas {
+  IGCM_debug_PushStack "IGCM_sys_atlas" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_atlas :" $@
+  fi
+
+  typeset status
+
+  \atlas $@ > ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1
+  status=$?
+  if [ ${status} -gt 0 ] ; then
+    echo "IGCM_sys_atlas : error code ${status}"
+    cat ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+    \rm ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+    IGCM_debug_PopStack "IGCM_sys_atlas"
+    return 1
+  else
+    IGCM_debug_PopStack "IGCM_sys_atlas"
+    return 0
+  fi
+
+  IGCM_debug_PopStack "IGCM_sys_atlas"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_rebuild_nemo
+#D-* Purpose: rebuild nemo parallel files with general rebuild
+#D-* Examples:
+#D-
+
+function IGCM_sys_rebuild_nemo {
+  IGCM_debug_PushStack "IGCM_sys_rebuild_nemo" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_rebuild_nemo :" $@
+  fi
+
+  nemo_generic_restart_file_name_out=${1}
+  nemo_extension_out=${3}
+  shift ; shift ; shift
+
+  IGCM_sys_rebuild -o ${nemo_generic_restart_file_name_out}.${nemo_extension_out} $@
+
+  IGCM_debug_PopStack "IGCM_sys_rebuild_nemo"
+}
+
+
+
Index: branches/libIGCM_CESMEP/libIGCM_sys/libIGCM_sys_obelix.ksh
===================================================================
--- branches/libIGCM_CESMEP/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 1567)
+++ branches/libIGCM_CESMEP/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 1585)
@@ -38,5 +38,11 @@
 #====================================================
 # Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get)
-typeset -r DRYRUN=${DRYRUN:=0}
+if ([ X${DRYRUN} != X ] && [ ${DRYRUN} = 4 ]) ; then
+  typeset -r DRYRUN=0
+  typeset -r DRYRUN_DEBUG=4
+else
+  typeset -r DRYRUN=${DRYRUN:=0}
+  typeset -r DRYRUN_DEBUG=0
+fi
 
 # YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
@@ -54,4 +60,7 @@
 # |    3     |       yes           |    no      |  no     |      no                   |
 # -------------------------------------------------------------------------------------
+# |    4     |       yes           |    yes     |  creation of RUN_DIR and Job_debug  |
+# -------------------------------------------------------------------------------------
+
 
 #=====================================================
@@ -140,8 +149,12 @@
 #====================================================
 #- RUN_DIR_PATH : Temporary working directory (=> TMP)
-if [ X${PBS_JOBID} != X ] ; then
-  typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=/scratch/$PBS_O_LOGNAME.$PBS_JOBID}
+if [ ${DRYRUN_DEBUG} = 4 ] ; then
+    typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=/home/scratch01/$LOGIN/RUN_DIR}
 else
-  typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=/tmp/tmp$$}
+    if [ X${PBS_JOBID} != X ] ; then
+	typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=/scratch/$PBS_O_LOGNAME.$PBS_JOBID}
+    else
+	typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=/tmp/tmp$$}
+    fi
 fi
 
