Index: /trunk/libIGCM/AA_SE_Checker
===================================================================
--- /trunk/libIGCM/AA_SE_Checker	(revision 615)
+++ /trunk/libIGCM/AA_SE_Checker	(revision 616)
@@ -57,19 +57,35 @@
 #set -vx
 
+#==================================
 # First of all
+#
+typeset option
+
+#==================================
+# Read UserChoices section: 
 IGCM_card_DefineArrayFromSection       ${CARD_DIR}/config.card UserChoices
-typeset option
+echo
+IGCM_debug_Print 1 "DefineArrayFromOption  : config_UserChoices"
 for option in ${config_UserChoices[*]} ; do
     IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card UserChoices ${option}
+    eval auxprint=\${config_UserChoices_${option}}
+    IGCM_debug_Print 3 "${option} : ${auxprint}"
 done
-
-echo
-IGCM_debug_Print 1 "DefineVariableFromOption  : config_UserChoices"
-IGCM_debug_PrintVariables 3 config_UserChoices_JobName
-#IGCM_debug_PrintVariables 3 config_UserChoices_SpaceName
-#IGCM_debug_PrintVariables 3 config_UserChoices_ExperimentName
-IGCM_debug_PrintVariables 3 config_UserChoices_CalendarType
-IGCM_debug_PrintVariables 3 config_UserChoices_DateBegin
-IGCM_debug_PrintVariables 3 config_UserChoices_DateEnd
+#
+echo
+
+#==================================
+# Read Post section: 
+IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card Post
+echo
+IGCM_debug_Print 1 "DefineArrayFromOption : config_Post"
+
+for option in ${config_Post[*]} ; do
+  IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card Post ${option}
+  eval auxprint=\${config_Post_${option}}
+  IGCM_debug_Print 3 "${option} : ${auxprint}"
+done
+#
+echo
 
 DateEnd=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} )
@@ -79,5 +95,4 @@
 IGCM_date_GetYearMonth ${DateEnd}   YearEnd   MonthEnd
 
-echo
 IGCM_debug_Print 1 "DateBegin for SE_Checker : "${DateBegin}
 IGCM_debug_Print 1 "DateEnd   for SE_Checker : "${DateEnd}
Index: /trunk/libIGCM/AA_SaveSourceModifications
===================================================================
--- /trunk/libIGCM/AA_SaveSourceModifications	(revision 615)
+++ /trunk/libIGCM/AA_SaveSourceModifications	(revision 616)
@@ -35,5 +35,5 @@
 #-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
 #-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
-#-Q- sx9mercure #PBS -l cputim_job=0:10:00   # Limite temps a 1 heures
+#-Q- sx9mercure #PBS -l elapstim_req=0:10:00   # Limite temps a 1 heures
 #-Q- sx9mercure #PBS -q scalaire
 #-Q- titane #!/bin/ksh
Index: /trunk/libIGCM/AA_additionnal
===================================================================
--- /trunk/libIGCM/AA_additionnal	(revision 615)
+++ /trunk/libIGCM/AA_additionnal	(revision 616)
@@ -79,14 +79,13 @@
 #-Q- sx8mercure #PBS -q scalaire
 #-Q- sx9mercure #!/bin/ksh
-#-Q- sx9mercure #########################
-#-Q- sx9mercure ## CESIUM FOR SX9  CEA ##
-#-Q- sx9mercure #########################
-#-Q- sx9mercure #MSUB -r ATL_ADD        # Nom du job
-#-Q- sx9mercure #MSUB -N 1              # Reservation du noeud
-#-Q- sx9mercure #MSUB -n 2              # Reservation du processus
-#-Q- sx9mercure #MSUB -c 4              # Reservation du core
-#-Q- sx9mercure #MSUB -T 86400          # Limite de temps elapsed du job
-#-Q- sx9mercure #MSUB -E "-j o"
-#-Q- sx9mercure #MSUB -E "-S /bin/ksh"
+#-Q- sx9mercure ######################
+#-Q- sx9mercure ## SX9MERCURE  CCRT ##
+#-Q- sx9mercure ######################
+#-Q- sx9mercure #PBS -N  ATL_ADD            # Nom du job
+#-Q- sx9mercure #PBS -j o                   # regroupement des stdout et stderr
+#-Q- sx9mercure #PBS -S /usr/bin/ksh        # shell de soumission
+#-Q- sx9mercure #PBS -l memsz_job=1gb       # Limite memoire a 1 Go
+#-Q- sx9mercure #PBS -l elapstim_req=2:00:00  # Limite temps a 2 heures
+#-Q- sx9mercure #PBS -q scalaire
 #-Q- titane #!/bin/ksh
 #-Q- titane ######################
Index: /trunk/libIGCM/AA_atlas_LMDZ
===================================================================
--- /trunk/libIGCM/AA_atlas_LMDZ	(revision 615)
+++ /trunk/libIGCM/AA_atlas_LMDZ	(revision 616)
@@ -78,13 +78,13 @@
 #-Q- sx8mercure #PBS -q scalaire
 #-Q- sx9mercure #!/bin/ksh
-#-Q- sx9mercure #########################
-#-Q- sx9mercure ## CESIUM FOR SX9  CEA ##
-#-Q- sx9mercure #########################
-#-Q- sx9mercure #MSUB -r ATL_LMDZ       # Nom du job                
-#-Q- sx9mercure #MSUB -N 1              # Reservation du noeud
-#-Q- sx9mercure #MSUB -n 1              # Reservation du processus
-#-Q- sx9mercure #MSUB -T 86400          # Limite de temps elapsed du job
-#-Q- sx9mercure #MSUB -E "-j o"
-#-Q- sx9mercure #MSUB -E "-S /bin/ksh"
+#-Q- sx9mercure ######################
+#-Q- sx9mercure ## SX9MERCURE  CCRT ##
+#-Q- sx9mercure ######################
+#-Q- sx9mercure #PBS -N  ATL_LMDZ           # Nom du job
+#-Q- sx9mercure #PBS -j o                   # regroupement des stdout et stderr
+#-Q- sx9mercure #PBS -S /usr/bin/ksh        # shell de soumission
+#-Q- sx9mercure #PBS -l memsz_job=1gb       # Limite memoire a 1 Go
+#-Q- sx9mercure #PBS -l elapstim_req=2:00:00  # Limite temps a 2 heures
+#-Q- sx9mercure #PBS -q scalaire
 #-Q- titane #!/bin/ksh
 #-Q- titane ######################
Index: /trunk/libIGCM/AA_atlas_ORCA_LIM
===================================================================
--- /trunk/libIGCM/AA_atlas_ORCA_LIM	(revision 615)
+++ /trunk/libIGCM/AA_atlas_ORCA_LIM	(revision 616)
@@ -78,13 +78,13 @@
 #-Q- sx8mercure #PBS -q scalaire
 #-Q- sx9mercure #!/bin/ksh
-#-Q- sx9mercure #########################
-#-Q- sx9mercure ## CESIUM FOR SX9  CEA ##
-#-Q- sx9mercure #########################
-#-Q- sx9mercure #MSUB -r ATL_OPA        # Nom du job                
-#-Q- sx9mercure #MSUB -N 1              # Reservation du noeud
-#-Q- sx9mercure #MSUB -n 1              # Reservation du processus
-#-Q- sx9mercure #MSUB -T 86400          # Limite de temps elapsed du job
-#-Q- sx9mercure #MSUB -E "-j o"
-#-Q- sx9mercure #MSUB -E "-S /bin/ksh"
+#-Q- sx9mercure ######################
+#-Q- sx9mercure ## SX9MERCURE  CCRT ##
+#-Q- sx9mercure ######################
+#-Q- sx9mercure #PBS -N  ATL_OPA             # Nom du job
+#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
+#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
+#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
+#-Q- sx9mercure #PBS -l elapstim_req=2:00:00   # Limite temps a 2 heures
+#-Q- sx9mercure #PBS -q scalaire
 #-Q- titane #!/bin/ksh
 #-Q- titane ######################
Index: /trunk/libIGCM/AA_atlas_ORCHIDEE
===================================================================
--- /trunk/libIGCM/AA_atlas_ORCHIDEE	(revision 615)
+++ /trunk/libIGCM/AA_atlas_ORCHIDEE	(revision 616)
@@ -78,13 +78,13 @@
 #-Q- sx8mercure #PBS -q scalaire
 #-Q- sx9mercure #!/bin/ksh
-#-Q- sx9mercure #########################
-#-Q- sx9mercure ## CESIUM FOR SX9  CEA ##
-#-Q- sx9mercure #########################
-#-Q- sx9mercure #MSUB -r ATL_ORCH       # Nom du job                
-#-Q- sx9mercure #MSUB -N 1              # Reservation du noeud
-#-Q- sx9mercure #MSUB -n 1              # Reservation du processus
-#-Q- sx9mercure #MSUB -T 86400          # Limite de temps elapsed du job
-#-Q- sx9mercure #MSUB -E "-j o"
-#-Q- sx9mercure #MSUB -E "-S /bin/ksh"
+#-Q- sx9mercure ######################
+#-Q- sx9mercure ## SX9MERCURE  CCRT ##
+#-Q- sx9mercure ######################
+#-Q- sx9mercure #PBS -N  ATL_ORCH            # Nom du job
+#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
+#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
+#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
+#-Q- sx9mercure #PBS -l elapstim_req=1:00:00   # Limite temps a 2 heures
+#-Q- sx9mercure #PBS -q scalaire
 #-Q- titane #!/bin/ksh
 #-Q- titane ######################
Index: /trunk/libIGCM/AA_atlas_PISCES
===================================================================
--- /trunk/libIGCM/AA_atlas_PISCES	(revision 615)
+++ /trunk/libIGCM/AA_atlas_PISCES	(revision 616)
@@ -78,13 +78,13 @@
 #-Q- sx8mercure #PBS -q scalaire
 #-Q- sx9mercure #!/bin/ksh
-#-Q- sx9mercure #########################
-#-Q- sx9mercure ## CESIUM FOR SX9  CEA ##
-#-Q- sx9mercure #########################
-#-Q- sx9mercure #MSUB -r ATL_PIS        # Nom du job                
-#-Q- sx9mercure #MSUB -N 1              # Reservation du noeud
-#-Q- sx9mercure #MSUB -n 1              # Reservation du processus
-#-Q- sx9mercure #MSUB -T 86400          # Limite de temps elapsed du job
-#-Q- sx9mercure #MSUB -E "-j o"
-#-Q- sx9mercure #MSUB -E "-S /bin/ksh"
+#-Q- sx9mercure ######################
+#-Q- sx9mercure ## SX9MERCURE  CCRT ##
+#-Q- sx9mercure ######################
+#-Q- sx9mercure #PBS -N  ATL_PIS             # Nom du job
+#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
+#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
+#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
+#-Q- sx9mercure #PBS -l elapstim_req=2:00:00   # Limite temps a 2 heures
+#-Q- sx9mercure #PBS -q scalaire
 #-Q- titane #!/bin/ksh
 #-Q- titane ######################
Index: /trunk/libIGCM/AA_create_multi_se
===================================================================
--- /trunk/libIGCM/AA_create_multi_se	(revision 615)
+++ /trunk/libIGCM/AA_create_multi_se	(revision 616)
@@ -78,13 +78,13 @@
 #-Q- sx8mercure #PBS -q scalaire
 #-Q- sx9mercure #!/bin/ksh
-#-Q- sx9mercure #########################
-#-Q- sx9mercure ## CESIUM FOR SX9  CEA ##
-#-Q- sx9mercure #########################
-#-Q- sx9mercure #MSUB -r MULTISE             # Nom du job                
-#-Q- sx9mercure #MSUB -N 1              # Reservation du noeud
-#-Q- sx9mercure #MSUB -n 1              # Reservation du processus
-#-Q- sx9mercure #MSUB -T 86400          # Limite de temps elapsed du job
-#-Q- sx9mercure #MSUB -E "-j o"
-#-Q- sx9mercure #MSUB -E "-S /bin/ksh"
+#-Q- sx9mercure ######################
+#-Q- sx9mercure ## SX9MERCURE  CCRT ##
+#-Q- sx9mercure ######################
+#-Q- sx9mercure #PBS -N MULTISE                   # Nom du job
+#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
+#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
+#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
+#-Q- sx9mercure #PBS -l elapstim_req=1:00:00   # Limite temps a 1 heures
+#-Q- sx9mercure #PBS -q scalaire
 #-Q- titane #!/bin/ksh
 #-Q- titane ######################
Index: /trunk/libIGCM/AA_create_se
===================================================================
--- /trunk/libIGCM/AA_create_se	(revision 615)
+++ /trunk/libIGCM/AA_create_se	(revision 616)
@@ -78,13 +78,13 @@
 #-Q- sx8mercure #PBS -q scalaire
 #-Q- sx9mercure #!/bin/ksh
-#-Q- sx9mercure #########################
-#-Q- sx9mercure ## CESIUM FOR SX9  CEA ##
-#-Q- sx9mercure #########################
-#-Q- sx9mercure #MSUB -r SE             # Nom du job                
-#-Q- sx9mercure #MSUB -N 1              # Reservation du noeud
-#-Q- sx9mercure #MSUB -n 1              # Reservation du processus
-#-Q- sx9mercure #MSUB -T 86400          # Limite de temps elapsed du job
-#-Q- sx9mercure #MSUB -E "-j o"
-#-Q- sx9mercure #MSUB -E "-S /bin/ksh"
+#-Q- sx9mercure ######################
+#-Q- sx9mercure ## SX9MERCURE  CCRT ##
+#-Q- sx9mercure ######################
+#-Q- sx9mercure #PBS -N SE                   # Nom du job
+#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
+#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
+#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
+#-Q- sx9mercure #PBS -l elapstim_req=1:00:00   # Limite temps a 1 heures
+#-Q- sx9mercure #PBS -q scalaire
 #-Q- titane #!/bin/ksh
 #-Q- titane ######################
@@ -217,25 +217,44 @@
 fi
 
-#
+#==================================
 # First of all
 #
-IGCM_card_DefineArrayFromSection   ${CARD_DIR}/config.card UserChoices
 typeset option
+
+#==================================
+# Read UserChoices section: 
+IGCM_card_DefineArrayFromSection       ${CARD_DIR}/config.card UserChoices
+echo
+IGCM_debug_Print 1 "DefineArrayFromOption  : config_UserChoices"
 for option in ${config_UserChoices[*]} ; do
     IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card UserChoices ${option}
+    eval auxprint=\${config_UserChoices_${option}}
+    IGCM_debug_Print 3 "${option} : ${auxprint}"
 done
 #
 echo
-IGCM_debug_Print 1 "DefineArrayFromOption  : config_UserChoices"
-IGCM_debug_PrintVariables 3 config_UserChoices_JobName
-IGCM_debug_PrintVariables 3 config_UserChoices_LongName
-IGCM_debug_PrintVariables 3 config_UserChoices_TagName
-IGCM_debug_PrintVariables 3 config_UserChoices_SpaceName
-IGCM_debug_PrintVariables 3 config_UserChoices_ExperimentName
-IGCM_debug_PrintVariables 3 config_UserChoices_CalendarType
-IGCM_debug_PrintVariables 3 config_UserChoices_DateBegin
-IGCM_debug_PrintVariables 3 config_UserChoices_DateEnd
-IGCM_debug_PrintVariables 3 config_UserChoices_PeriodLength
+
+#==================================
+# Read Post section: 
+IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card Post
 echo
+IGCM_debug_Print 1 "DefineArrayFromOption : config_Post"
+for option in ${config_Post[*]} ; do
+  IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card Post ${option}
+  eval auxprint=\${config_Post_${option}}
+  IGCM_debug_Print 3 "${option} : ${auxprint}"
+done
+#
+echo
+
+#==================================
+# Define default value to keep compatibility with previous card: means before changes due to TGCC 
+[ X${config_Post_PackFrequency} = X ] && config_Post_PackFrequency=${config_Post_RebuildFrequency}
+
+#==================================
+# If pack is active then PackFrequency overule the config_UserChoices_PeriodLength
+if ( [ ! X${config_Post_PackFrequency} = X${NULL_STR} ] && [ ! X${config_Post_PackFrequency} = XNONE ] ) ; then
+  config_UserChoices_PeriodLength=${config_Post_PackFrequency}
+fi
 
 #==================================
Index: /trunk/libIGCM/AA_create_ts
===================================================================
--- /trunk/libIGCM/AA_create_ts	(revision 615)
+++ /trunk/libIGCM/AA_create_ts	(revision 616)
@@ -78,13 +78,13 @@
 #-Q- sx8mercure #PBS -q scalaire
 #-Q- sx9mercure #!/bin/ksh
-#-Q- sx9mercure #########################
-#-Q- sx9mercure ## CESIUM FOR SX9  CEA ##
-#-Q- sx9mercure #########################
-#-Q- sx9mercure #MSUB -r TS             # Nom du job                
-#-Q- sx9mercure #MSUB -N 1              # Reservation du noeud
-#-Q- sx9mercure #MSUB -n 1              # Reservation du processus
-#-Q- sx9mercure #MSUB -T 86400          # Limite de temps elapsed du job
-#-Q- sx9mercure #MSUB -E "-j o"
-#-Q- sx9mercure #MSUB -E "-S /bin/ksh"
+#-Q- sx9mercure ######################
+#-Q- sx9mercure ## SX9MERCURE  CCRT ##
+#-Q- sx9mercure ######################
+#-Q- sx9mercure #PBS -N TS                   # Nom du job
+#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
+#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
+#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
+#-Q- sx9mercure #PBS -l elapstim_req=24:00:00   # Limite temps a 2 heures
+#-Q- sx9mercure #PBS -q scalaire
 #-Q- titane #!/bin/ksh
 #-Q- titane ######################
@@ -815,5 +815,5 @@
 			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
+			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
Index: /trunk/libIGCM/AA_monitoring
===================================================================
--- /trunk/libIGCM/AA_monitoring	(revision 615)
+++ /trunk/libIGCM/AA_monitoring	(revision 616)
@@ -78,13 +78,13 @@
 #-Q- sx8mercure #PBS -q scalaire
 #-Q- sx9mercure #!/bin/ksh
-#-Q- sx9mercure #########################
-#-Q- sx9mercure ## CESIUM FOR SX9  CEA ##
-#-Q- sx9mercure #########################
-#-Q- sx9mercure #MSUB -r MONITORING     # Nom du job                
-#-Q- sx9mercure #MSUB -N 1              # Reservation du noeud
-#-Q- sx9mercure #MSUB -n 1              # Reservation du processus
-#-Q- sx9mercure #MSUB -T 86400          # Limite de temps elapsed du job
-#-Q- sx9mercure #MSUB -E "-j o"
-#-Q- sx9mercure #MSUB -E "-S /bin/ksh"
+#-Q- sx9mercure ######################
+#-Q- sx9mercure ## SX9MERCURE  CCRT ##
+#-Q- sx9mercure ######################
+#-Q- sx9mercure #PBS -N  MONITORING          # Nom du job
+#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
+#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
+#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
+#-Q- sx9mercure #PBS -l elapstim_req=1:00:00   # Limite temps a 2 heures
+#-Q- sx9mercure #PBS -q scalaire
 #-Q- titane #!/bin/ksh
 #-Q- titane ######################
Index: /trunk/libIGCM/AA_pack_debug
===================================================================
--- /trunk/libIGCM/AA_pack_debug	(revision 615)
+++ /trunk/libIGCM/AA_pack_debug	(revision 616)
@@ -79,12 +79,12 @@
 #-Q- sx9mercure #!/bin/ksh
 #-Q- sx9mercure ######################
-#-Q- sx9mercure ## CESIUM   CEA ##
+#-Q- sx9mercure ## SX9MERCURE  CCRT ##
 #-Q- sx9mercure ######################
-#-Q- sx9mercure #MSUB -r PACKDEBUG    # Nom du job
-#-Q- sx9mercure #MSUB -N 1              # Reservation du noeud
-#-Q- sx9mercure #MSUB -n 1              # Reservation du processus
-#-Q- sx9mercure #MSUB -T 86400          # Limite de temps elapsed du job
-#-Q- sx9mercure #MSUB -E "-j o"
-#-Q- sx9mercure #MSUB -E "-S /bin/ksh"
+#-Q- sx9mercure #PBS -N PACKDEBUG          # Nom du job
+#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
+#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
+#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
+#-Q- sx9mercure #PBS -l elapstim_req=24:00:00  # Limite temps a 1 heures
+#-Q- sx9mercure #PBS -q scalaire
 #-Q- titane #!/bin/ksh
 #-Q- titane ######################
@@ -220,4 +220,5 @@
 else
     CARD_DIR=${RUN_DIR_PATH}/$( basename ${SUBMIT_DIR} )
+    # warning! we copy useless files : Job_xxx, Script_output_xxx, ....
     IGCM_sys_Get_Master ${SUBMIT_DIR} ${RUN_DIR_PATH}
 fi
@@ -276,4 +277,5 @@
 # Clear txt file lists
 rm -f ${RUN_DIR}/liste_debug_files.txt
+rm -f ${RUN_DIR}/liste_out_files.txt
 rm -f ${RUN_DIR}/new_liste_debug_files.txt
 rm -f ${RUN_DIR}/liste_pack_*.txt
@@ -282,10 +284,16 @@
 find ${R_BUFR}/*/Debug -type f | sort >> ${RUN_DIR}/liste_debug_files.txt
 
-# Rename debug files we will work with using symlinks
+# Rename debug files we will work with using symlinks. use ???_ prefix ie NF-2
 #gawk -F/ '{dest_name=$(NF-2)("_") $(NF); system("cp --preserve " $0 " "dest_name)}' ${RUN_DIR}/liste_debug_files.txt
 gawk -F/ '{dest_name=$(NF-2)("_") $(NF); system("ln -s " $0 " "dest_name)}' ${RUN_DIR}/liste_debug_files.txt
 
-# List renamed debug files
-find ${RUN_DIR} -name "???_*${JobName}*" -ls | sort -k 11 > ${RUN_DIR}/new_liste_debug_files.txt
+# Add out_ : output of execution files
+find ${R_BUFR}/Out -type f -name '*out_*' | sort >> ${RUN_DIR}/liste_out_files.txt
+
+# Rename out files we will work with using symlinks. use Out_ prefix ie NF-1
+gawk -F/ '{dest_name=$(NF-1)("_") $(NF); system("ln -s " $0 " "dest_name)}' ${RUN_DIR}/liste_out_files.txt
+
+# List renamed debug files. Exclude Job_xxx files.
+find ${RUN_DIR} -name "???_*${JobName}*" -ls | grep -v Job_ | sort -k 11 > ${RUN_DIR}/new_liste_debug_files.txt
 
 # ------------------------------------------------------------------
Index: /trunk/libIGCM/AA_pack_output
===================================================================
--- /trunk/libIGCM/AA_pack_output	(revision 615)
+++ /trunk/libIGCM/AA_pack_output	(revision 616)
@@ -79,12 +79,12 @@
 #-Q- sx9mercure #!/bin/ksh
 #-Q- sx9mercure ######################
-#-Q- sx9mercure ## CESIUM   CEA ##
+#-Q- sx9mercure ## SX9MERCURE  CCRT ##
 #-Q- sx9mercure ######################
-#-Q- sx9mercure #MSUB -r PACKOUTPUT    # Nom du job
-#-Q- sx9mercure #MSUB -N 1              # Reservation du noeud
-#-Q- sx9mercure #MSUB -n 1              # Reservation du processus
-#-Q- sx9mercure #MSUB -T 86400          # Limite de temps elapsed du job
-#-Q- sx9mercure #MSUB -E "-j o"
-#-Q- sx9mercure #MSUB -E "-S /bin/ksh"
+#-Q- sx9mercure #PBS -N PACKOUTPUT          # Nom du job
+#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
+#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
+#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
+#-Q- sx9mercure #PBS -l elapstim_req=24:00:00  # Limite temps a 1 heures
+#-Q- sx9mercure #PBS -q scalaire
 #-Q- titane #!/bin/ksh
 #-Q- titane ######################
Index: /trunk/libIGCM/AA_pack_restart
===================================================================
--- /trunk/libIGCM/AA_pack_restart	(revision 615)
+++ /trunk/libIGCM/AA_pack_restart	(revision 616)
@@ -79,12 +79,12 @@
 #-Q- sx9mercure #!/bin/ksh
 #-Q- sx9mercure ######################
-#-Q- sx9mercure ## CESIUM   CEA ##
+#-Q- sx9mercure ## SX9MERCURE  CCRT ##
 #-Q- sx9mercure ######################
-#-Q- sx9mercure #MSUB -r PACKRESTART    # Nom du job
-#-Q- sx9mercure #MSUB -N 1              # Reservation du noeud
-#-Q- sx9mercure #MSUB -n 1              # Reservation du processus
-#-Q- sx9mercure #MSUB -T 86400          # Limite de temps elapsed du job
-#-Q- sx9mercure #MSUB -E "-j o"
-#-Q- sx9mercure #MSUB -E "-S /bin/ksh"
+#-Q- sx9mercure #PBS -N PACKRESTART          # Nom du job
+#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
+#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
+#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
+#-Q- sx9mercure #PBS -l elapstim_req=24:00:00  # Limite temps a 1 heures
+#-Q- sx9mercure #PBS -q scalaire
 #-Q- titane #!/bin/ksh
 #-Q- titane ######################
@@ -303,4 +303,8 @@
 IGCM_debug_PrintVariables 3 date_end_simulation
 
+# last restart of the previous period : to be deleted
+typeset date_end_previous
+date_end_previous=$( IGCM_date_AddDaysToGregorianDate ${date_begin_pack} -1 )
+
 while [ ${date_begin_pack} -le ${date_end_simulation} ] ; do
 
@@ -313,8 +317,11 @@
     extract_date_file=$( echo ${file}  | sed -e "s/.*${JobName}_//" )
     date_file=$( echo ${extract_date_file} | sed 's/\([0-9]\{8\}\)_.*$/\1/g' )
-#   echo pack nÂ°${number_pack}  ${date_file} ${date_begin_pack} ${date_end_pack}
+#   warning demenagement. delete last restart of the previous pack
+    [  ${date_file} -eq ${date_end_previous} ] && echo $( readlink ${file} ) >> ${RUN_DIR}/liste_remove_pack_${number_pack}.txt
+#   echo pack number ${number_pack}  ${date_file} ${date_begin_pack} ${date_end_pack}
     if [ ${date_file} -le ${date_end_pack} ] && [ ${date_file} -ge ${date_begin_pack} ] ; then
       echo $( basename ${file} ) >> ${RUN_DIR}/liste_pack_${number_pack}.txt
-      echo $( readlink ${file} ) >> ${RUN_DIR}/liste_remove_pack_${number_pack}.txt
+#   warning demenagement. do not delete last restart of this pack
+      [ ${date_file} -eq ${date_end_pack} ] || echo $( readlink ${file} ) >> ${RUN_DIR}/liste_remove_pack_${number_pack}.txt
 #   Will not work. Need to find a better ordering.
 #   elif [ ${date_file} -ge ${date_end_pack} ] ; then
Index: /trunk/libIGCM/AA_rebuild_fromArchive
===================================================================
--- /trunk/libIGCM/AA_rebuild_fromArchive	(revision 615)
+++ /trunk/libIGCM/AA_rebuild_fromArchive	(revision 616)
@@ -79,12 +79,12 @@
 #-Q- sx9mercure #!/bin/ksh
 #-Q- sx9mercure ######################
-#-Q- sx9mercure ## CESIUM FOR SX9  CEA ##
+#-Q- sx9mercure ## SX9MERCURE  CCRT ##
 #-Q- sx9mercure ######################
-#-Q- sx9mercure #MSUB -r REBUILDARCH    # Nom du job                
-#-Q- sx9mercure #MSUB -N 1              # Reservation du noeud
-#-Q- sx9mercure #MSUB -n 1              # Reservation du processus
-#-Q- sx9mercure #MSUB -T 86400          # Limite de temps elapsed du job
-#-Q- sx9mercure #MSUB -E "-j o"
-#-Q- sx9mercure #MSUB -E "-S /bin/ksh"
+#-Q- sx9mercure #PBS -N REBUILDARCH          # Nom du job
+#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
+#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
+#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
+#-Q- sx9mercure #PBS -l elapstim_req=24:00:00  # Limite temps a 1 heures
+#-Q- sx9mercure #PBS -q scalaire
 #-Q- titane #!/bin/ksh
 #-Q- titane ######################
Index: /trunk/libIGCM/AA_rebuild_fromWorkdir
===================================================================
--- /trunk/libIGCM/AA_rebuild_fromWorkdir	(revision 615)
+++ /trunk/libIGCM/AA_rebuild_fromWorkdir	(revision 616)
@@ -79,12 +79,12 @@
 #-Q- sx9mercure #!/bin/ksh
 #-Q- sx9mercure ######################
-#-Q- sx9mercure ## CESIUM   CEA ##
+#-Q- sx9mercure ## SX9MERCURE  CCRT ##
 #-Q- sx9mercure ######################
-#-Q- sx9mercure #MSUB -r REBUILDWRK     # Nom du job                
-#-Q- sx9mercure #MSUB -N 1              # Reservation du noeud
-#-Q- sx9mercure #MSUB -n 1              # Reservation du processus
-#-Q- sx9mercure #MSUB -T 86400          # Limite de temps elapsed du job
-#-Q- sx9mercure #MSUB -E "-j o"
-#-Q- sx9mercure #MSUB -E "-S /bin/ksh"
+#-Q- sx9mercure #PBS -N REBUILDWRK           # Nom du job
+#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
+#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
+#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
+#-Q- sx9mercure #PBS -l elapstim_req=24:00:00  # Limite temps a 1 heures
+#-Q- sx9mercure #PBS -q scalaire
 #-Q- titane #!/bin/ksh
 #-Q- titane ######################
Index: /trunk/libIGCM/libIGCM_config/libIGCM_config.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_config/libIGCM_config.ksh	(revision 615)
+++ /trunk/libIGCM/libIGCM_config/libIGCM_config.ksh	(revision 616)
@@ -603,4 +603,166 @@
   fi
 
+  typeset ExeNameIn ExeNameFirst CompNameFirst
+  typeset comp i
+  typeset tempvar tempvarMPI tempvarNOD NbElts j NbExec
+
+  (( PROCESSUS_NUMBER = 0 ))
+  (( i=0 ))
+  (( NbExec=0 ))
+
+  OK_PARA_MPI=false
+  OK_PARA_OMP=false
+  OK_PARA_NOD=false
+  OK_PARA_MPMD=false
+
+  for comp in ${config_ListOfComponents[*]} ; do
+
+    IGCM_debug_Print 1 ${comp}
+
+    eval ExeNameIn=\${config_Executable_${comp}[0]}
+
+    # NO order in config.card for parallelized values ! 
+    # just use suffix : MPI , OMP and NOD (for number of NODes.)
+
+    # NOD is the number of NODes allocated
+    eval ${comp}_PROC_NOD=0
+
+    # MPI is the number of MPI processus per nodes
+    eval ${comp}_PROC_MPI=0
+
+    # OMP is the number of OpenMP threads per MPI processus
+    eval ${comp}_PROC_OMP=0
+	
+    # Only if we really have an executable for the component :
+    if [ X${ExeNameIn} != X\"\" ] ; then
+
+      # Keep the first executable found and the first CompName
+      ExeNameFirst=${ExeNameIn}
+      CompNameFirst=${comp}
+
+      # Are we a second executable?
+      (( NbExec = NbExec + 1 ))
+
+      # set 1 MPI task, 1 OpenMP thread and 1 node as default
+      eval ${comp}_PROC_MPI=1
+      eval ${comp}_PROC_OMP=1
+      eval ${comp}_PROC_NOD=1
+
+      eval NbElts=\${#config_Executable_${comp}[@]}
+
+      if [ ${NbElts} -ge 2 ] ; then
+        (( j = 2 ))
+
+        while [ $j -lt ${NbElts} ] ; do 
+          eval tempvar=\${config_Executable_${comp}[${j}]}
+
+          if [ X${tempvar} = X ] ; then
+            echo "Error reading MPI/OMP parameters !!!" 
+            echo "Check your config.card." 
+            exit 1
+          fi
+
+          eval IGCM_debug_Print 2 ${tempvar}
+
+          case ${tempvar} in
+            *[mM][pP][iI]*)
+               # Read MPI parameter for composante
+               eval ${comp}_PROC_MPI=$( echo ${tempvar} | tr '[a-z]' '[A-Z]' | sed -e "s/MPI//" )
+               OK_PARA_MPI=true;;
+            *[oO][mM][pP]*)
+               # Read OMP parameter for composante
+               eval ${comp}_PROC_OMP=$( echo ${tempvar} | tr '[a-z]' '[A-Z]' | sed -e "s/OMP//" )
+               OK_PARA_OMP=true;;
+            *[nN][oO][dD]*)
+               # Read NOD (NumBer of Nodes) parameter for composante
+               eval ${comp}_PROC_NOD=$( echo ${tempvar} | tr '[a-z]' '[A-Z]' | sed -e "s/NOD//" )
+               OK_PARA_NOD=true
+               OK_PARA_MPI=true;;
+          esac
+
+          (( j = j + 1 ))
+        done
+
+      fi
+
+      eval tempvarMPI=\${${comp}_PROC_MPI}
+      eval tempvarNOD=\${${comp}_PROC_NOD}
+      eval tempvarOMP=\${${comp}_PROC_OMP}
+
+      (( PROCESSUS_NUMBER = PROCESSUS_NUMBER + tempvarMPI * tempvarNOD * tempvarOMP ))
+
+    fi
+
+    (( i=i+1 ))
+  done
+
+  # set MPMD mode if more than 2 executable names.
+  [ ${NbExec} -ge 2 ] && OK_PARA_MPMD=true
+
+  # Verification of BATCH_NUM_PROC_TOT total number of processors set in job header.
+  if [ X${BATCH_NUM_PROC_TOT} != X ] ; then
+    # BATCH_NUM_PROC_TOT is set
+    if ( ${OK_PARA_MPI} ) ; then
+      IGCM_debug_Print 1 "MPI/OMP/NOD found into config.card and BATCH_NUM_PROC_TOT = ${BATCH_NUM_PROC_TOT} "
+    else
+      # with previous method.
+      if [ ${BATCH_NUM_PROC_TOT} -gt 1 ] ; then
+        # with more than 1 proc
+        if ( ${OK_PARA_MPMD} ) ; then
+          # with MPMD ie CPL/oasis method
+          echo "We will use default number of MPI tasks for this machine : "
+          echo "${DEFAULT_NUM_PROC_OCE} for OCE; "
+          echo "${DEFAULT_NUM_PROC_CPL} for CPL; "
+          echo "${DEFAULT_NUM_PROC_ATM} for ATM; "
+          echo "${DEFAULT_NUM_PROC_TOTAL} for the total number of processors; "
+          OK_PARA_MPI=true
+          CPL_PROC_MPI=${DEFAULT_NUM_PROC_CPL}
+          OCE_PROC_MPI=${DEFAULT_NUM_PROC_OCE}
+          ATM_PROC_MPI=${DEFAULT_NUM_PROC_ATM}
+          NUM_PROC_CPL=${DEFAULT_NUM_PROC_CPL} # for backward compatibility
+          NUM_PROC_OCE=${DEFAULT_NUM_PROC_OCE} # for backward compatibility
+          NUM_PROC_ATM=${DEFAULT_NUM_PROC_ATM} # for backward compatibility
+          PROCESSUS_NUMBER=${DEFAULT_NUM_PROC_TOTAL}
+        else
+          # with have only one executable
+          echo "We will use ${BATCH_NUM_PROC_TOT} MPI tasks for ${CompNameFirst} : ${config_Executable_Name} "
+          OK_PARA_MPI=true
+          eval ${CompNameFirst}_PROC_MPI=${BATCH_NUM_PROC_TOT}
+          PROCESSUS_NUMBER=${BATCH_NUM_PROC_TOT}
+        fi
+      else 
+        PROCESSUS_NUMBER=1
+      fi
+    fi
+    # Verification with PBS parameter
+    if [ ${BATCH_NUM_PROC_TOT} -ne ${PROCESSUS_NUMBER} ] ; then
+      echo "Warning with parallelization parameters !"
+      echo "Job header variable BATCH_NUM_PROC_TOT = ${BATCH_NUM_PROC_TOT} "
+      echo "is the total number of _processors_ reserved."
+      echo "It is not equal to the sum of _processus_  = ${PROCESSUS_NUMBER}."
+      echo "We stop now."
+      exit 1
+    fi
+  else # BATCH_NUM_PROC_TOT=""
+    if ( ${OK_PARA_MPI} ) ; then
+      echo "You have not given a value of ${BATCH_NUM_PROC_TOT} processors,"
+      echo "but you have filled the parallel parameter in config->Executable->list."
+      echo "Please add BATCH_NUM_PROC_TOT variable in job header."
+      echo "We stop now."
+      exit 1
+    else
+      # sequential case !
+      if [ ${PROCESSUS_NUMBER} -eq 0 ] ; then
+        (( PROCESSUS_NUMBER = 1 ))
+        echo "PROCESSUS_NUMBER is all 0 (sequential use of old definition in config->Executable->list)."
+        echo "We set it to 1."
+      fi
+    fi
+  fi
+
+  IGCM_debug_Print 1 "MPI/OMP treatment PROCESSUS_NUMBER = ${PROCESSUS_NUMBER}"
+
+  IGCM_sys_build_execution_scripts
+
   ExecutionFail=false
 
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys.ksh	(revision 615)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys.ksh	(revision 616)
@@ -34,4 +34,8 @@
     echo "===================================================="
 fi
+
+#====================================================
+#- set PackDefault false by default
+PackDefault=false 
 
 case $( hostname -s ) in
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh	(revision 615)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh	(revision 616)
@@ -135,5 +135,4 @@
 #====================================================
 #- RUN_DIR_PATH : Temporary working directory (=> TMP)
-#typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${CSCRATCHDIR}/TMPDIR_IGCM/${JOBID}}
 typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${TMPDIR}}
 
@@ -721,26 +720,14 @@
 #D-* Purpose: rm tmpdir (dummy function most of the time batch
 #D-                      scheduler will do the job)
+#D-           Dummy function on mercure front-end
 #D-* Examples:
 #D-
 function IGCM_sys_RmRunDir {
-  IGCM_debug_PushStack "IGCM_sys_RmRunDir" -- $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_RmRunDir :" $@
-  fi
-
-  typeset RET
-
-  echo rm $@ > out_rsync 2>&1
-  \rm $@ >> out_rsync 2>&1
-  RET=$?
-
-  if [ ${RET} -gt 0 ] ; then
-    echo "IGCM_sys_RmRunDir : error."
-    cat out_rsync
-    IGCM_debug_Exit "IGCM_sys_RmRunDir"
-  else
-    \rm out_rsync
-  fi
-  IGCM_debug_PopStack "IGCM_sys_RmRunDir"
+    IGCM_debug_PushStack "IGCM_sys_RmRunDir" -- $@
+    if ( $DEBUG_sys ) ; then
+        echo "IGCM_sys_RmRunDir :" $@
+        echo "Dummy call, let the scheduler do that."
+    fi
+    IGCM_debug_PopStack "IGCM_sys_RmRunDir"
 }
 
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex9.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex9.ksh	(revision 615)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex9.ksh	(revision 616)
@@ -170,4 +170,17 @@
 #- Max number of arguments passed to nco operator or demigration command
 UNIX_MAX_LIMIT=360
+
+#====================================================
+#- set PackDefault true on NEC SX9
+PackDefault=true
+
+#====================================================
+#- Default number of MPI task for IPSL coupled model
+#- required for backward compatibility
+#-
+DEFAULT_NUM_PROC_OCE=1
+DEFAULT_NUM_PROC_CPL=1
+(( DEFAULT_NUM_PROC_ATM = BATCH_NUM_PROC_TOT - 1 ))
+DEFAULT_NUM_PROC_TOTAL=${BATCH_NUM_PROC_TOT}
 
 #D-#==================================================
@@ -285,4 +298,6 @@
   Job ended   : ${DateEnd}
   Output files are available in ${R_SAVE}
+  Files to be rebuild are temporarily available in ${REBUILD_DIR}
+  Pre-packed files are temporarily available in ${R_BUFR}
   Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR}
 END_MAIL
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh	(revision 615)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh	(revision 616)
@@ -188,4 +188,19 @@
 #- Max number of arguments passed to nco operator or demigration command
 UNIX_MAX_LIMIT=360
+
+#====================================================
+#- set PackDefault true on titane
+PackDefault=true
+
+NUM_COREPERNODE=8
+	
+#====================================================
+#- 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=26
+DEFAULT_NUM_PROC_TOTAL=32
 
 #D-#==================================================
@@ -334,4 +349,6 @@
   Job ended   : ${DateEnd}
   Output files are available in ${R_SAVE}
+  Files to be rebuild are temporarily available in ${REBUILD_DIR}
+  Pre-packed files are temporarily available in ${R_BUFR}
   Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR}
 END_MAIL
