Index: gs/libIGCM_v3.0_beta1/AA_clean_PeriodLenght
===================================================================
--- /tags/libIGCM_v3.0_beta1/AA_clean_PeriodLenght	(revision 1398)
+++ 	(revision )
@@ -1,224 +1,0 @@
-#!/bin/ksh
-#**************************************************************
-# Author: Martial Mancip
-# Contact: Martial.Mancip__at__ipsl.jussieu.fr
-# $Revision::                                          $ Revision of last commit
-# $Author::                                            $ Author of last commit
-# $Date::                                              $ 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::
-
-#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
-
-#==================================
-# 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
-    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
-  fi
-fi
-exit 0
Index: /tags/libIGCM_v3.0_beta1/AA_clean_PeriodLength
===================================================================
--- /tags/libIGCM_v3.0_beta1/AA_clean_PeriodLength	(revision 1399)
+++ /tags/libIGCM_v3.0_beta1/AA_clean_PeriodLength	(revision 1399)
@@ -0,0 +1,246 @@
+#!/bin/ksh
+#**************************************************************
+# Author: Martial Mancip
+# Contact: Martial.Mancip__at__ipsl.jussieu.fr
+# $Revision::                                          $ Revision of last commit
+# $Author::                                            $ Author of last commit
+# $Date::                                              $ 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::
+
+#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
+
+#==================================
+# 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
+    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: /tags/libIGCM_v3.0_beta1/AA_clean_latestPackperiod
===================================================================
--- /tags/libIGCM_v3.0_beta1/AA_clean_latestPackperiod	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/AA_clean_latestPackperiod	(revision 1399)
@@ -256,5 +256,5 @@
         IGCM_sys_Rm ${SUBMIT_DIR}/run.card
       else
-        #Â Update run.card
+        # Update run.card
         cp ${SUBMIT_DIR}/run.card ${SUBMIT_DIR}/run.card.old
         IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodState "OnQueue"
@@ -264,5 +264,5 @@
         IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodDateEnd \
                               $( IGCM_date_HumanDigit ${PeriodDateEnd} )
-        #Â Update job
+        # Update job
         cp Job_${config_UserChoices_JobName} Job_${config_UserChoices_JobName}.old
         sed -e "s/\(#.*Script_Output_${config_UserChoices_JobName}\.\)\([0-9]*\)\(.*\)/\1${Suffix}\3/" \
Index: /tags/libIGCM_v3.0_beta1/AA_clean_month
===================================================================
--- /tags/libIGCM_v3.0_beta1/AA_clean_month	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/AA_clean_month	(revision 1399)
@@ -5,5 +5,5 @@
   
 echo ""
-echo "This script has been renamed. Now please use clean_PeriodLenght.job in libIGCM directory."
+echo "This script has been renamed. Now please use clean_PeriodLength.job in libIGCM directory."
 echo "See documentation https://forge.ipsl.jussieu.fr/igcmg_doc/wiki/DocGmonitor#Unknownerror"
 echo ""
Index: /tags/libIGCM_v3.0_beta1/AA_create_multi_se
===================================================================
--- /tags/libIGCM_v3.0_beta1/AA_create_multi_se	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/AA_create_multi_se	(revision 1399)
@@ -424,4 +424,5 @@
      [ ${config_UserChoices_TagName} = "IPSLCM5B" ]        || \
      [ ${config_UserChoices_TagName} = "IPSLCM5A-MR" ]     || \
+     [ ${config_UserChoices_TagName} = "IPSLCM5A2" ]       || \
      [ ${config_UserChoices_TagName} = "IPSLCM6" ] ; then
   export Script_Post_Output=atlas_ORCHIDEE.${PeriodDateEnd} ;
Index: /tags/libIGCM_v3.0_beta1/AA_create_se
===================================================================
--- /tags/libIGCM_v3.0_beta1/AA_create_se	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/AA_create_se	(revision 1399)
@@ -584,4 +584,5 @@
      [ ${config_UserChoices_TagName} = "IPSLCM5B" ]        || \
      [ ${config_UserChoices_TagName} = "IPSLCM5A-MR" ]     || \
+     [ ${config_UserChoices_TagName} = "IPSLCM5A2" ]       || \
      [ ${config_UserChoices_TagName} = "IPSLCM6" ] ; then
   # METRICS
Index: /tags/libIGCM_v3.0_beta1/AA_create_ts
===================================================================
--- /tags/libIGCM_v3.0_beta1/AA_create_ts	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/AA_create_ts	(revision 1399)
@@ -736,29 +736,4 @@
         #
         if [ "${DEPOT}" = "TRUE" ] ; then
-          # YEARLY AVERAGE DERIVED FROM MONTHLY MEAN
-          if ( [ ${FlagDir} = "1M" ] && [ -f ${file_out} ] ) ; then
-            file_before_YE=${config_UserChoices_JobName}_${DateBegin}_${DATE_FIN_JOB_B}_1Y_${var}.nc
-            file_out_YE=${config_UserChoices_JobName}_${DATE_BUILD_END}_1Y_${var}.nc
-            #
-            # Compute yearly average considering calendar
-            IGCM_sys_cdo yearmonmean -selvar,${var} ${file_out} ${file_out_YE}
-            # Extract all ancillary variables except $var, they will be appended after the cdo command
-            # Needed because cdo applies calculs on all variables
-            IGCM_sys_ncks -Oh -x -v ${var} ${file_out} ${file_out_YE%%.nc}_tmp1.nc
-            # This will remove the time axis because cdo rewrites severely with only considered useful variables
-            IGCM_sys_cdo -mulc,1 ${file_out_YE%%.nc}_tmp1.nc ${file_out_YE%%.nc}_tmp2.nc 2>/dev/null
-            if [ $? -eq 0 ] ; then
-              # Now append all ancillary variables if previous cdo operator ok
-              IGCM_sys_ncks -h -A ${file_out_YE%%.nc}_tmp2.nc ${file_out_YE}
-            fi
-
-            # Put global history attribut
-            IGCM_sys_ncatted -Oh -a history,global,o,c,"build by libIGCM/create_ts" ${file_out_YE}
-            IGCM_debug_Verif_Exit
-            #
-            eval IGCM_sys_Put_Out ${file_out_YE} \${R_OUT_${comp}}/Analyse/TS_MO_YE/${file_out_YE}
-            [ "${FLAG_B}" = "TRUE" ] && eval MENAGE \${R_OUT_${comp}}/Analyse/TS_MO_YE/ ${file_before_YE} ${file_out_YE}
-            IGCM_sys_Rm ${file_out_YE%%.nc}_tmp*.nc
-          fi
           # WE PUT FINAL FILE ON FILE SYSTEM
           [ "${FLAG_B}" = "FALSE" ] && file_out=${config_UserChoices_JobName}_${DATE_BUILD}_${FlagDir}_${var}.nc
@@ -786,5 +761,5 @@
 # DODS copy
 for comp in ${config_ListOfComponents[*]} ; do
-  for TS_Dir in TS_YE TS_MO TS_MO_YE TS_DA TS_HF TS_INS ; do
+  for TS_Dir in TS_YE TS_MO TS_DA TS_HF TS_INS ; do
     IGCM_sys_TestDirArchive ${R_SAVE}/${comp}/Analyse/${TS_Dir}
     [ $? = 0 ] && IGCM_sys_Put_Dods ${comp}/Analyse/${TS_Dir}
Index: /tags/libIGCM_v3.0_beta1/AA_job
===================================================================
--- /tags/libIGCM_v3.0_beta1/AA_job	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/AA_job	(revision 1399)
@@ -11,7 +11,7 @@
 #-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 medium             # priority within a project
 #-Q- curie #MSUB -A ::default_project::
 #-Q- curie # Below specific options that can be activated 
Index: /tags/libIGCM_v3.0_beta1/AA_metrics_NEMO
===================================================================
--- /tags/libIGCM_v3.0_beta1/AA_metrics_NEMO	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/AA_metrics_NEMO	(revision 1399)
@@ -161,11 +161,11 @@
 orca_grid=${DB}/grids/${opa9_UserChoices_ORCA_version}_grid.nc
 
-IGCM_sys_ncks --append -v bounds_lat,bounds_lon ${orca_grid} ${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc
-IGCM_sys_ncatted -O -a bounds,nav_lat,o,c,bounds_lat ${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc
-IGCM_sys_ncatted -O -a bounds,nav_lon,o,c,bounds_lon ${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc
-
-IGCM_sys_ncks --append -v bounds_lat,bounds_lon ${orca_grid} ${config_UserChoices_JobName}_SE_${YEARS}_1MVertLevels_grid_T.nc
-IGCM_sys_ncatted -O -a bounds,nav_lat,o,c,bounds_lat ${config_UserChoices_JobName}_SE_${YEARS}_1MVertLevels_grid_T.nc
-IGCM_sys_ncatted -O -a bounds,nav_lon,o,c,bounds_lon ${config_UserChoices_JobName}_SE_${YEARS}_1MVertLevels_grid_T.nc
+## IGCM_sys_ncks --append -v bounds_lat,bounds_lon ${orca_grid} ${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc
+## IGCM_sys_ncatted -O -a bounds,nav_lat,o,c,bounds_lat ${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc
+## IGCM_sys_ncatted -O -a bounds,nav_lon,o,c,bounds_lon ${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc
+
+## IGCM_sys_ncks --append -v bounds_lat,bounds_lon ${orca_grid} ${config_UserChoices_JobName}_SE_${YEARS}_1MVertLevels_grid_T.nc
+## IGCM_sys_ncatted -O -a bounds,nav_lat,o,c,bounds_lat ${config_UserChoices_JobName}_SE_${YEARS}_1MVertLevels_grid_T.nc
+## IGCM_sys_ncatted -O -a bounds,nav_lon,o,c,bounds_lon ${config_UserChoices_JobName}_SE_${YEARS}_1MVertLevels_grid_T.nc
 
 #==================================
Index: /tags/libIGCM_v3.0_beta1/AA_pack_restart
===================================================================
--- /tags/libIGCM_v3.0_beta1/AA_pack_restart	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/AA_pack_restart	(revision 1399)
@@ -27,5 +27,5 @@
 #-Q- ada # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
 #-Q- ada # @ notification = error
-#-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 # @ 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 ######################
@@ -205,4 +205,5 @@
 rm -f ${RUN_DIR}/new_liste_restart_files.txt
 rm -f ${RUN_DIR}/liste_pack_*.txt
+rm -f ${RUN_DIR}/liste_pack_light_*.txt
 
 # Create sorted restart list to work with
@@ -251,9 +252,19 @@
       [ ${date_file} -eq ${date_end_pack} ] || echo $( readlink ${file} ) >> ${RUN_DIR}/liste_remove_pack_${date_begin_pack}_${date_end_pack}.txt
     fi
+    # light pack list of restarts files that will be used
+    if [ X${config_Post_LightRestartPack} = XTRUE ] ; then
+      if [ ${date_file} -le ${date_end_pack} ] && [ ${date_file} -ge ${PeriodDateBegin} ] ; then
+        echo $( basename ${file} ) >> ${RUN_DIR}/liste_pack_light_${date_begin_pack}_${date_end_pack}.txt
+      fi
+    fi
   done
 
   # Create tar files
   IGCM_debug_Print 1 "Tar ongoing"
-  tar -cvf ${JobName}_${date_begin_pack}_${date_end_pack}_restart.tar --dereference --files-from ${RUN_DIR}/liste_pack_${date_begin_pack}_${date_end_pack}.txt
+  if [ X${config_Post_LightRestartPack} = XTRUE ] ; then
+    tar -cvf ${JobName}_${date_begin_pack}_${date_end_pack}_restart.tar --dereference --files-from ${RUN_DIR}/liste_pack_${date_begin_pack}_${date_end_pack}.txt
+  else
+    tar -cvf ${JobName}_${date_begin_pack}_${date_end_pack}_restart.tar --dereference --files-from ${RUN_DIR}/liste_pack_light_${date_begin_pack}_${date_end_pack}.tx
+  fi
   # Save it
   IGCM_sys_Put_Out ${JobName}_${date_begin_pack}_${date_end_pack}_restart.tar ${STORE_RESTART}
Index: /tags/libIGCM_v3.0_beta1/AA_purge_simulation
===================================================================
--- /tags/libIGCM_v3.0_beta1/AA_purge_simulation	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/AA_purge_simulation	(revision 1399)
@@ -28,7 +28,14 @@
 Verbosity=3
 
-#D- Low level debug : to bypass lib test checks and stack construction
+#D- Low level debug : to perform lib test checks, stack construction and IO functions instrumentation
 #D- Default=true
-DEBUG_debug=false
+DEBUG_debug=true
+
+#D- Messaging : all activities and call stacks will be sent to ipsl servers
+#D- If true will imply DEBUG_debug=true
+#D- Default=false
+#D-
+BigBrother=true
+
 
 #D--------------------------------------------------------------------==
@@ -55,4 +62,9 @@
 ( ${DEBUG_debug} ) && IGCM_card_Check
 ( ${DEBUG_debug} ) && IGCM_date_Check
+
+if [ ! -f ${SUBMIT_DIR}/config.card ] ; then
+  echo "A config.card is needed to proceed"
+  exit
+fi
 
 #==================================
@@ -82,6 +94,9 @@
     IGCM_debug_Print 2 -e "\033[1;31m ${dir}\033[m"
   done
+  IGCM_debug_Print 2 -e "\033[1;31m ${SUBMIT_DIR}/run.card\033[m"
+  IGCM_debug_Print 2 -e "\033[1;31m ${SUBMIT_DIR}/Debug\033[m"
+  IGCM_debug_Print 2 -e "\033[1;31m ${SUBMIT_DIR}/Script_Output_*.??????\033[m"
 
-  echo -e "\033[1;32mDo you REALLY want to erase all those directories ?"
+  echo -e "\033[1;32mDo you REALLY want to erase all those directories and files?"
   echo -n -e " Your answer (y/n) : \033[m"
   read reponse
Index: /tags/libIGCM_v3.0_beta1/ins_job
===================================================================
--- /tags/libIGCM_v3.0_beta1/ins_job	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/ins_job	(revision 1399)
@@ -218,6 +218,11 @@
   fi # if ( ! ${x_pm} )
   echo MPIEnvironment is ${MPIEnvironment}
-else
-  echo No option for Header regarding ProjectID, ProjectNode, ProjectCore or MPIEnvironment because we are not on curie or ada
+elif [ X"${SYSTEM}" == "Xlxiv8" ] || [ X"${SYSTEM}" == "Xifort_CICLAD" ] ; then
+  # obelix, ciclad, climserv
+  echo ""
+  echo "You need to check and maybe adapt headers in the main job especially the line: "
+  echo "  #PBS -l nodes=x:ppn=y "
+  echo "where x is the number of nodes, y the number of cores per node and x*y is the total number of cores for the job. "
+  echo "y must not be bigger than the maximum numer of cores per node on the machine (often 8 or 16)."
 fi # if [ X"${SYSTEM}" == "Xcurie" ]
 
Index: /tags/libIGCM_v3.0_beta1/libIGCM_comp/libIGCM_comp.ksh
===================================================================
--- /tags/libIGCM_v3.0_beta1/libIGCM_comp/libIGCM_comp.ksh	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/libIGCM_comp/libIGCM_comp.ksh	(revision 1399)
@@ -778,5 +778,5 @@
               if [ X${OCE_PROC_MPI} != X ] ; then
                 if [ ${OCE_PROC_MPI} -ne ${nb_restart_file} ] ; then
-                  IGCM_sys_rebuild ${generic_restart_file_name_out}.${extension_out} ${generic_restart_file_name_out}_????.${extension_out}
+                  IGCM_sys_rebuild_nemo ${generic_restart_file_name_out} ${nb_restart_file} ${extension_out} ${generic_restart_file_name_out}_????.${extension_out}
                   IGCM_sys_Rm ${generic_restart_file_name_out}_????.${extension_out}
                 fi
@@ -1326,15 +1326,20 @@
   fi
 
-  # Test if keyid is set in filein, otherwise exit
+  # Test if keyid is set in filein. If not exit for case all cases(blocker, force) except nonblocker.
   if [ $( grep -w ${keyid} ${filein} | wc -l ) = 0 ] ; then
-    # Variable key is not set in filein, stop.
-    IGCM_debug_Exit "IGCM_comp_modifyXmlFile : ${keyid} is not set in the file. Bad syntax of ${filein} file."
-    IGCM_debug_PopStack "IGCM_comp_modifyXmlFile"
-    return
+      if [ ${type} = nonblocker ] ; then
+          # This is a nonblocker case, print warning but do nothing else
+	  IGCM_debug_Print 1 "IGCM_comp_modifyXmlFile: ${keyid} is not set in ${filein}. This is a nonblocker call so nothing is done."
+      else
+          # This is a blocker or force case : stop now
+	  IGCM_debug_Exit "IGCM_comp_modifyXmlFile : ${keyid} is not set in the file. Bad syntax of ${filein} file."
+	  IGCM_debug_PopStack "IGCM_comp_modifyXmlFile"
+	  return
+      fi
   fi
 
   # Check if AUTO is set on the same line as keyid and keyattrib
   if [  $( grep -w ${keyid} ${filein} | grep AUTO | wc -l ) = 1 ] ; then
-    # Modifification will be done
+    # Modification will be done
     modify=yes
   else
@@ -1715,5 +1720,11 @@
           if [ X${AsynchronousRebuild} = Xfalse ] ; then
             IGCM_debug_Print 2 "Rebuilding ${file_in} online"
-            IGCM_sys_rebuild ${file_in} ${generic_file_name}_[0-9]*.nc
+            #
+            # for output.abort file, let use rebuild_NEMO : 13s instead of 20 mn.
+            if [ ${file_in} = output.abort.nc ] ; then
+              IGCM_sys_rebuild_nemo ${generic_file_name} ${nb_rebuild_file} "nc" ${generic_file_name}_[0-9]*.nc
+            else
+              IGCM_sys_rebuild ${file_in} ${generic_file_name}_[0-9]*.nc
+            fi
           else
             IGCM_debug_Print 2 "Preparing offline rebuild for ${file_in}"
Index: /tags/libIGCM_v3.0_beta1/libIGCM_config/libIGCM_config.ksh
===================================================================
--- /tags/libIGCM_v3.0_beta1/libIGCM_config/libIGCM_config.ksh	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/libIGCM_config/libIGCM_config.ksh	(revision 1399)
@@ -169,4 +169,10 @@
   if ( [ X${config_Post_IgnoreNonMonotonic} = X${NULL_STR} ] || [ X${config_Post_IgnoreNonMonotonic} = X ] ) ; then
     config_Post_IgnoreNonMonotonic=FALSE
+  fi
+
+  #====================================================
+  # LightRestartPack : apply default value if not defined
+  if ( [ X${config_Post_LightRestartPack} = X${NULL_STR} ] || [ X${config_Post_LightRestartPack} = X ] ) ; then
+    config_Post_LightRestartPack=FALSE
   fi
 
@@ -830,5 +836,5 @@
           ( IGCM_sys_TestFileBuffer  ${R_BUF_KSH}/${Potential} ) || IGCM_sys_Cp ${Potential} ${R_BUF_KSH}/${Potential}.$$
         else
-          ( IGCM_sys_TestFileArchive ${R_OUT_KSH}/${Potential} ) || IGCM_sys_Cp ${Potential} ${R_OUT_KSH}/${Potential}.$$
+          ( IGCM_sys_TestFileArchive ${R_OUT_KSH}/${Potential} ) || IGCM_sys_Put_Out ${Potential} ${R_OUT_KSH}/${Potential}.$$ NOCHMOD
         fi
       done
@@ -836,8 +842,9 @@
       IGCM_debug_Print 2 "Save current run.card"
       IGCM_card_CheckConflict run.card
+
       if [ X${Pack} = Xtrue ] ; then
         IGCM_sys_Cp ${SUBMIT_DIR}/run.card ${R_BUF_KSH}/run.card
       else
-        IGCM_sys_Cp ${SUBMIT_DIR}/run.card ${R_OUT_KSH}/run.card
+        IGCM_sys_Put_Out ${SUBMIT_DIR}/run.card ${R_OUT_KSH}/run.card NOCHMOD
       fi
       #
Index: /tags/libIGCM_v3.0_beta1/libIGCM_debug/libIGCM_debug.ksh
===================================================================
--- /tags/libIGCM_v3.0_beta1/libIGCM_debug/libIGCM_debug.ksh	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/libIGCM_debug/libIGCM_debug.ksh	(revision 1399)
@@ -147,5 +147,5 @@
   b64_encoded_msg=$1
 
-  mail_recipient="superviseur@ipsl.jussieu.fr"
+  mail_recipient="superviseur@mail.ipsl.upmc.fr"
   send_messages=0
   mail_frequency=3600 # in seconds
Index: /tags/libIGCM_v3.0_beta1/libIGCM_ensemble/libIGCM_ensemble.ksh
===================================================================
--- /tags/libIGCM_v3.0_beta1/libIGCM_ensemble/libIGCM_ensemble.ksh	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/libIGCM_ensemble/libIGCM_ensemble.ksh	(revision 1399)
@@ -954,5 +954,5 @@
       ${PerturbExe} ${RUN_DIR}/${FileOut}.nc ${PerturbVar} ${PerturbAmp}  > /dev/null 2>&1
       if [ $? -ne 0 ] ; then
-        IGCM_debug_Exit "Abend $( basename ${PerturbExe} )"
+        IGCM_debug_Exit "Error with $( basename ${PerturbExe} )"
         IGCM_debug_Verif_Exit
       fi
@@ -981,5 +981,5 @@
       ${PerturbExe} ${RUN_DIR}/${FileOut}.nc ${PerturbVar} ${PatternFile} ${MaskFile}  > /dev/null 2>&1
       if [ $? -ne 0 ] ; then
-        IGCM_debug_Exit "Abend $( basename ${PerturbExe} )"
+        IGCM_debug_Exit "Error with $( basename ${PerturbExe} )"
         IGCM_debug_Verif_Exit
       fi
Index: /tags/libIGCM_v3.0_beta1/libIGCM_post/libIGCM_post.ksh
===================================================================
--- /tags/libIGCM_v3.0_beta1/libIGCM_post/libIGCM_post.ksh	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/libIGCM_post/libIGCM_post.ksh	(revision 1399)
@@ -264,4 +264,5 @@
       export POST_DIR=${POST_DIR}
       export MASTER=${MASTER}
+      export PeriodDateBegin=${PeriodDateBegin}
       export DateBegin=${PackDateBegin}
       export DateEnd=${PeriodDateEnd}
Index: /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys.ksh
===================================================================
--- /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys.ksh	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys.ksh	(revision 1399)
@@ -52,40 +52,40 @@
 case $( hostname -s ) in
     ada*)
-        [ ! X${TaskType} = Xchecking ] && echo "sys source ada Intel X-64 lib."
+        [ ! X${TaskType} = Xchecking ] && echo "Source machine dependent settings for ada Intel X-64."
         CENTER=IDRIS
         SYSTEM=ada
         . ${libIGCM}/libIGCM_sys/libIGCM_sys_ada.ksh;;
     curie*)
-        [ ! X${TaskType} = Xchecking ] && echo "sys source curie Intel X-64 lib."
+        [ ! X${TaskType} = Xchecking ] && echo "Source machine dependent settings for curie Intel X-64."
         CENTER=TGCC
         SYSTEM=curie
         . ${libIGCM}/libIGCM_sys/libIGCM_sys_curie.ksh;;
     airain*)
-        [ ! X${TaskType} = Xchecking ] && echo "sys source airain Intel X-64 lib."
+        [ ! X${TaskType} = Xchecking ] && echo "Source machine dependent settings for airain Intel X-64."
         CENTER=TGCC
         SYSTEM=curie
         . ${libIGCM}/libIGCM_sys/libIGCM_sys_curie.ksh;;
     asterix*|obelix*)
-        [ ! X${TaskType} = Xchecking ] && echo "sys source obelix or asterix lib."
+        [ ! X${TaskType} = Xchecking ] && echo "Source machine dependent settings for obelix or asterix."
         CENTER=LSCE
         SYSTEM=lxiv8
         . ${libIGCM}/libIGCM_sys/libIGCM_sys_obelix.ksh;;
     ciclad*)
-        [ ! X${TaskType} = Xchecking ] && echo "sys source ciclad lib for running at ciclad."
+        [ ! X${TaskType} = Xchecking ] && echo "Source machine dependent settings for ciclad for running at ciclad."
         CENTER=IPSL-ciclad
         SYSTEM=ifort_CICLAD
         . ${libIGCM}/libIGCM_sys/libIGCM_sys_ciclad.ksh;;
     camelot*|loholt1*|loholt2*|merlin*)
-        [ ! X${TaskType} = Xchecking ] && echo "sys source ciclad lib for running at climserv."
+        [ ! X${TaskType} = Xchecking ] && echo "Source machine dependent settings for ciclad for running at climserv."
         CENTER=IPSL-climserv
         SYSTEM=ifort_CICLAD
         . ${libIGCM}/libIGCM_sys/libIGCM_sys_ciclad.ksh;;
     iitm*)
-        [ ! X${TaskType} = Xchecking ] && echo "sys source iitm lib."
+        [ ! X${TaskType} = Xchecking ] && echo "Source machine dependent settings for iitm."
         CENTER=IITM
         SYSTEM=iitm
         . ${libIGCM}/libIGCM_sys/libIGCM_sys_iitm.ksh;;
     *)
-        [ ! X${TaskType} = Xchecking ] && echo "sys source default lib."
+        [ ! X${TaskType} = Xchecking ] && echo "Source machine dependent settings for a default machine."
         CENTER=DEFAULT
         SYSTEM=default
Index: /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_ada.ksh
===================================================================
--- /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_ada.ksh	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_ada.ksh	(revision 1399)
@@ -807,4 +807,46 @@
 
   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
+
+  typeset status
+  if [ $DRYRUN = 0 ]; then
+    if [ "$#" -eq 1 ]; then
+      rsh ${STOREHOST} exec /bin/ksh <<EOF
+          cd ${R_SAVE}
+          /arch/local/bin/dods_rm DODS/pub/${LOGIN}/${R_DODS}/${1} > /dev/null 2>&1
+EOF
+      status=$?
+    else
+      rsh ${STOREHOST} exec /bin/ksh <<EOF
+          cd ${R_SAVE}
+          /arch/local/bin/dods_rm DODS/pub/${LOGIN}/${R_DODS} > /dev/null 2>&1
+EOF
+      status=$?
+    fi
+  fi
+
+  return ${status}
+}
+
+#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
 }
 
@@ -1546,2 +1588,24 @@
 }
 
+#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: /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_ciclad.ksh
===================================================================
--- /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_ciclad.ksh	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_ciclad.ksh	(revision 1399)
@@ -1233,2 +1233,25 @@
 }
 
+#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: /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_curie.ksh
===================================================================
--- /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 1399)
@@ -178,5 +178,5 @@
 #====================================================
 #- HOST_MPIRUN_COMMAND
-typeset -r HOST_MPIRUN_COMMAND=${HOST_MPIRUN_COMMAND:="/usr/bin/time ccc_mprun -E-K1"}
+typeset -r HOST_MPIRUN_COMMAND=${HOST_MPIRUN_COMMAND:="/usr/bin/time ccc_mprun -E-K1 "}
 
 #====================================================
@@ -922,6 +922,11 @@
 #    fi
 
-    /ccc/cont003/home/dsm/p86ipsl/bin/dods_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
-    status=$?
+    if [ "$#" -eq 1 ]; then
+      /ccc/cont003/home/dsm/p86ipsl/bin/dods_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
+      status=$?
+    else
+      /ccc/cont003/home/dsm/p86ipsl/bin/dods_rm public/${LOGIN}/${R_DODS} # > out_dods_rm 2>&1
+      status=$?
+    fi
 
 #    if [ ${status} -gt 0 ] ; then
@@ -1111,9 +1116,18 @@
 
   elif [ ${executionType} -eq 2 ] ; then
-    # MPMD + MPI + OMP
-    sed -e "/::openMPthreads::/d"                  \
-        -e "s/::JobNumProcTot::/${coreNumber}/"    \
-      ${file} > ${file}.tmp
-
+    # MPMD + MPI + OMP : mpirun/ccc_mprun/error
+    if ( [ "X${config_UserChoices_ExecutionModeOnCurie}" = "X" ] || [ "X${config_UserChoices_ExecutionModeOnCurie}" = "Xmpirun" ] ) ; then
+      sed -e "/::openMPthreads::/d"                  \
+          -e "s/::JobNumProcTot::/${coreNumber}/"    \
+        ${file} > ${file}.tmp
+    elif ( [ "X${config_UserChoices_ExecutionModeOnCurie}" = "Xccc_mprun" ] ) ; then
+      sed -e "/::openMPthreads::/d"                  \
+          -e "s/::JobNumProcTot::/${coreNumber}/"    \
+          -e "/--cpu_bind=none/d"                    \
+        ${file} > ${file}.tmp
+    else
+     IGCM_debug_Print 1 "You have to set ExecutionModeOnCurie=ccc_mprun or mpirun in config.card"
+     IGCM_debug_Exit "IGCM_sys_updateHeaders"
+    fi
   elif [ ${executionType} -eq 3 ] ; then
     # SPMD + MPI/OMP
@@ -1184,14 +1198,18 @@
   EXECUTION=${HOST_MPIRUN_COMMAND}
 
-  # MPMD mode
   if ( ${OK_PARA_MPMD} ) ; then
 
-    # Only MPI (MPMD)
+    # MPMD mode
+    # 1 MPI only
+    # 2 MPI/OpenMP mpirun method
+    # 3 MPI/OpenMP ccc_mprun method
+
+    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
-
-      if [ -f run_file ] ; then
-        IGCM_sys_Rm -f run_file
-      fi
-      touch run_file
 
       # Build run_file
@@ -1236,6 +1254,7 @@
       fi
 
-    # MPI-OpenMP (MPMD)
-    else
+    elif ( [ "X${config_UserChoices_ExecutionModeOnCurie}" = "X" ] || [ "X${config_UserChoices_ExecutionModeOnCurie}" = "Xmpirun" ] ) ; then
+
+    # 2 MPI/OpenMP mpirun method
 
       # Use of mpirun instead of ccc_mprun
@@ -1309,8 +1328,8 @@
 
           #echo "./${ExeNameOut}" >> script_${ExeNameOut}.ksh
-	  echo "(( MYMPIRANK = OMPI_COMM_WORLD_RANK )) " >> script_${ExeNameOut}.ksh
-	  echo "MYMPIRANK=\$(printf '%3.3d\n' \${MYMPIRANK})" >> script_${ExeNameOut}.ksh
-	  echo "./${ExeNameOut} > out_${ExeNameOut}.out.\${MYMPIRANK} 2>out_${ExeNameOut}.err.\${MYMPIRANK}" >> script_${ExeNameOut}.ksh
-	  IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh
+          echo "(( MYMPIRANK = OMPI_COMM_WORLD_RANK )) " >> script_${ExeNameOut}.ksh
+          echo "MYMPIRANK=\$(printf '%3.3d\n' \${MYMPIRANK})" >> script_${ExeNameOut}.ksh
+          echo "./${ExeNameOut} > out_${ExeNameOut}.out.\${MYMPIRANK} 2>out_${ExeNameOut}.err.\${MYMPIRANK}" >> script_${ExeNameOut}.ksh
+          IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh
 
           if [ ${init_exec} = y ] ; then
@@ -1352,8 +1371,98 @@
         fi
       done
-    fi
-
+
+    elif ( [ "X${config_UserChoices_ExecutionModeOnCurie}" = "Xccc_mprun" ] ) ; then
+
+    # 3 MPI/OpenMP ccc_mprun method
+
+    # MPI-OpenMP (MPMD)
+    # example of run_file
+    # 71-8 env OMP_NUM_THREADS=8 ./script_lmdz.x.ksh
+    # 480-1 env OMP_NUM_THREADS=1 ./script_opa.xx.ksh
+    # 1-1 env OMP_NUM_THREADS=1 ./script_xios.x.ksh
+
+      # Loop on the components
+      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}
+
+          # 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|8|16)
+              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,8,16 as number of OMP threads are possible "
+              IGCM_debug_Verif_Exit
+              ;;
+            esac
+            ### only for LMDZ?
+            echo "export KMP_STACKSIZE=3g"  >> script_${ExeNameOut}.ksh
+            echo "export KMP_LIBRARY=turnaround"  >> script_${ExeNameOut}.ksh
+            echo "export MKL_SERIAL=YES"  >> script_${ExeNameOut}.ksh
+            echo "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
+          #echo "./${ExeNameOut}" >> script_${ExeNameOut}.ksh
+
+          IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh
+
+          # Complete run_file
+
+          echo "${comp_proc_mpi_loc}-${comp_proc_omp_loc} env OMP_NUM_THREADS=${comp_proc_omp_loc} ./script_${ExeNameOut}.ksh " >>run_file
+
+        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
+
+      ## module advised by TGCC (instead of 2 variables)
+      module load feature/bridge/heterogenous_mpmd
+
+      # set EXECUTION for ccc_mprun case (similar to #1 : MPI only MPMD method) 
+
+      EXECUTION="${HOST_MPIRUN_COMMAND} -f ./run_file"
+
+      IGCM_sys_Chmod u+x run_file
+      if ( $DEBUG_sys ) ; then
+        echo "run_file contains : "
+        cat run_file
+      fi
+
+    else
+
+      IGCM_debug_Print 1 "sys Curie :  choose mpirun or ccc_mprun in config.card for ExecutionModeOnCurie"
+
+    fi # 1 2 or 3 if ${OK_PARA_MPMD}
+
+  else
   # Only one executable (SPMD mode).
-  else
 
     for comp in ${config_ListOfComponents[*]} ; do
@@ -1362,4 +1471,6 @@
       eval ExeNameOut=\${config_Executable_${comp}[1]}
       if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${ExeNameOut}" != "Xinca.dat" ] ) ; then
+
+        # Build script files
 
         echo "#!/bin/ksh" > script_${ExeNameOut}.ksh
@@ -1398,5 +1509,5 @@
     done
 
-  fi
+  fi # ${OK_PARA_MPMD}
 
   IGCM_debug_Print 1 "sys Curie : execution command is "
@@ -1689,2 +1800,19 @@
 }
 
+#D-#==================================================
+#D-function IGCM_sys_rebuild_nemo
+#D-* Purpose: rebuild nemo parallel files with nemo specific rebuild on curie
+#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
+
+  $( ccc_home -u p86ipsl )/REBUILD_NEMO/rebuild_nemo ${1} ${2}
+
+  IGCM_debug_PopStack "IGCM_sys_rebuild_nemo"
+}
+
Index: /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_default.ksh
===================================================================
--- /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_default.ksh	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_default.ksh	(revision 1399)
@@ -1172,2 +1172,23 @@
 }
 
+#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: /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_iitm.ksh
===================================================================
--- /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_iitm.ksh	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_iitm.ksh	(revision 1399)
@@ -1030,2 +1030,25 @@
   IGCM_debug_PopStack "IGCM_sys_CountJobInQueue"
 }
+
+#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: /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_obelix.ksh
===================================================================
--- /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 1398)
+++ /tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 1399)
@@ -1195,2 +1195,24 @@
 }
 
+
+#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"
+}
+
