Index: trunk/libIGCM/AA_additionnal
===================================================================
--- trunk/libIGCM/AA_additionnal	(revision 107)
+++ trunk/libIGCM/AA_additionnal	(revision 108)
@@ -32,5 +32,5 @@
 #-Q- aix6 # Nom du travail LoadLeveler
 #-Q- aix6 # @ job_name   = ATL_ADD
-#-Q- aix6 # Fichier de sortie standard du travail       
+#-Q- aix6 # Fichier de sortie standard du travail   
 #-Q- aix6 # @ output     = $(job_name).$(jobid)
 #-Q- aix6 # Fichier de sortie d'erreur du travail
@@ -61,4 +61,7 @@
 #  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
 
+#set -eu
+#set -vx
+
 date
 
@@ -68,7 +71,12 @@
 #########################################################################
 
-. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh ;
-. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh     ; #IGCM_debug_Check
-. ${libIGCM}/libIGCM_card/libIGCM_card.ksh   ; #IGCM_card_Check
+. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
+      ( ${DEBUG_debug} ) && IGCM_debug_Check
+. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
+     ( ${DEBUG_debug} ) && IGCM_card_Check
+. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
+     ( ${DEBUG_debug} ) && IGCM_date_Check
+#-------
+. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
 
 #######################################################################
@@ -76,4 +84,5 @@
 #set -vx
 
+#===========================================
 R_ATLAS=ATLAS/SE_${YEARS}
 R_OUT_OCE=${R_SAVE}/OCE
Index: trunk/libIGCM/AA_atlas_LMDZ
===================================================================
--- trunk/libIGCM/AA_atlas_LMDZ	(revision 107)
+++ trunk/libIGCM/AA_atlas_LMDZ	(revision 108)
@@ -61,17 +61,26 @@
 #  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
 
+#set -eu
+#set -vx
+
 date
 
 #-Q- sx8brodie export OMP_NUM_THREADS=1
+#-Q- aix6 export OMP_NUM_THREADS=1
 
 ######################################################################
 
-. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh ;
-. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh     ; #IGCM_debug_Check
-. ${libIGCM}/libIGCM_card/libIGCM_card.ksh   ; #IGCM_card_Check
+. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
+      ( ${DEBUG_debug} ) && IGCM_debug_Check
+. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
+     ( ${DEBUG_debug} ) && IGCM_card_Check
+. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
+     ( ${DEBUG_debug} ) && IGCM_date_Check
+#-------
+. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
 
 ######################################################################
 
-#set -vx 
+#set -vx
 
 R_ATLAS=ATLAS/SE_${YEARS}
Index: trunk/libIGCM/AA_atlas_ORCA_LIM
===================================================================
--- trunk/libIGCM/AA_atlas_ORCA_LIM	(revision 107)
+++ trunk/libIGCM/AA_atlas_ORCA_LIM	(revision 108)
@@ -61,4 +61,5 @@
 #  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
 
+#set -eu
 #set -vx 
 
@@ -66,10 +67,16 @@
 
 #-Q- sx8brodie export OMP_NUM_THREADS=1
+#-Q- aix6 export OMP_NUM_THREADS=1
 
 ########################################################################
 
-. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh ;
-. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh     ; #IGCM_debug_Check
-. ${libIGCM}/libIGCM_card/libIGCM_card.ksh   ; #IGCM_card_Check
+. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
+      ( ${DEBUG_debug} ) && IGCM_debug_Check
+. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
+     ( ${DEBUG_debug} ) && IGCM_card_Check
+. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
+     ( ${DEBUG_debug} ) && IGCM_date_Check
+#-------
+. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
 
 ########################################################################
Index: trunk/libIGCM/AA_atlas_ORCHIDEE
===================================================================
--- trunk/libIGCM/AA_atlas_ORCHIDEE	(revision 107)
+++ trunk/libIGCM/AA_atlas_ORCHIDEE	(revision 108)
@@ -61,9 +61,11 @@
 #  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
 
+#set -eu
+#set -vx
+
 date
 
 #-Q- sx8brodie export OMP_NUM_THREADS=1
-
-#set -vx
+#-Q- aix6 export OMP_NUM_THREADS=1
 
 #D- Low level debug : to bypass lib test checks and stack construction
@@ -79,7 +81,12 @@
 ########################################################################
 
-. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh ;
-. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh     ; #IGCM_debug_Check
-. ${libIGCM}/libIGCM_card/libIGCM_card.ksh   ; #IGCM_card_Check
+. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
+      ( ${DEBUG_debug} ) && IGCM_debug_Check
+. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
+     ( ${DEBUG_debug} ) && IGCM_card_Check
+. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
+     ( ${DEBUG_debug} ) && IGCM_date_Check
+#-------
+. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
 
 ########################################################################
Index: trunk/libIGCM/AA_create_se
===================================================================
--- trunk/libIGCM/AA_create_se	(revision 107)
+++ trunk/libIGCM/AA_create_se	(revision 108)
@@ -55,10 +55,4 @@
 #-Q- default ##################
 
-#set -vx
-
-date
-
-#-Q- sx8brodie export OMP_NUM_THREADS=1
-
 # $Date$
 # $Author$
@@ -67,4 +61,12 @@
 #  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
 
+#set -eu
+#set -vx
+
+date
+
+#-Q- sx8brodie export OMP_NUM_THREADS=1
+#-Q- aix6 export OMP_NUM_THREADS=1
+
 ########################################################################
 
@@ -87,5 +89,5 @@
 #D- Low level debug : to bypass lib test checks and stack construction
 #D- Default : value from AA_job if any
-libIGCM=${libIGCM:=/home/rech/ces/rces452/libIGCM}
+libIGCM=${libIGCM:=/path/to/your/libIGCM}
 
 #D- TEMPORARY Flag to determine atmospheric resolution
@@ -107,8 +109,12 @@
 ########################################################################
 
-. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh ;
-. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh     #; IGCM_debug_Check
-. ${libIGCM}/libIGCM_card/libIGCM_card.ksh   #; IGCM_card_Check
-. ${libIGCM}/libIGCM_date/libIGCM_date.ksh   #; IGCM_date_Check
+. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
+      ( ${DEBUG_debug} ) && IGCM_debug_Check
+. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
+     ( ${DEBUG_debug} ) && IGCM_card_Check
+. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
+     ( ${DEBUG_debug} ) && IGCM_date_Check
+#-------
+. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
 
 ########################################################################
Index: trunk/libIGCM/AA_create_ts
===================================================================
--- trunk/libIGCM/AA_create_ts	(revision 107)
+++ trunk/libIGCM/AA_create_ts	(revision 108)
@@ -55,10 +55,4 @@
 #-Q- default ##################
 
-#set -vx
-
-date
-
-#-Q- sx8brodie export OMP_NUM_THREADS=1
-
 # $Date$
 # $Author$
@@ -67,4 +61,12 @@
 #  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
 
+#set -eu
+#set -vx
+
+date
+
+#-Q- sx8brodie export OMP_NUM_THREADS=1
+#-Q- aix6 export OMP_NUM_THREADS=1
+
 ########################################################################
 
@@ -87,5 +89,5 @@
 #D- Low level debug : to bypass lib test checks and stack construction
 #D- Default : value from AA_job if any
-libIGCM=${libIGCM:=/work/cont003/p86denv/PARA_SX8_ORCA2xLMD144142/Prelude/modipsl/libIGCM}
+libIGCM=${libIGCM:=/path/to/your/libIGCM}
 
 #D- TEMPORARY Flag to determine atmospheric resolution
@@ -105,10 +107,18 @@
 RESOL_SRF=${RESOL_SRF:=LMD144142}
 
-########################################################################
-
-. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh ;
-. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh     #; IGCM_debug_Check
-. ${libIGCM}/libIGCM_card/libIGCM_card.ksh   #; IGCM_card_Check
-. ${libIGCM}/libIGCM_date/libIGCM_date.ksh   #; IGCM_date_Check
+#D- Flag to determine allready produced time series.
+#D- Default : Commented. Uncomment for StandAlone case if you want to continue a time series
+#CompletedFlag=
+
+########################################################################
+
+. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
+      ( ${DEBUG_debug} ) && IGCM_debug_Check
+. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
+     ( ${DEBUG_debug} ) && IGCM_card_Check
+. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
+     ( ${DEBUG_debug} ) && IGCM_date_Check
+#-------
+. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
 
 ########################################################################
@@ -490,4 +500,5 @@
 	if [ X${file} != X${NULL_STR} ] ; then
 	    IGCM_sys_Get /l liste_file[*] ${RUN_DIR_PATH}/${comp}
+	    ExitFlag=false
 	    IGCM_debug_Verif_Exit_Post
 	fi
@@ -659,5 +670,5 @@
 	    # Get selected files
 	    IGCM_sys_Get /l liste_file[*] ${RUN_DIR_PATH}/${comp}
-	    eval ExitFlag=false
+	    ExitFlag=false
 	    IGCM_debug_Verif_Exit_Post
 
@@ -717,5 +728,5 @@
 	        fi
 		#
-		eval ExitFlag=false
+		ExitFlag=false
 		IGCM_debug_Verif_Exit_Post
 	    done     # for var in ${liste_var} ; do
@@ -723,5 +734,5 @@
 	done         # for file in ${liste_file_brut} do
     done             # for comp in ${config_ListOfComponents[*]} ; do
-    eval ExitFlag=false
+    ExitFlag=false
     IGCM_debug_Verif_Exit_Post
     # GO AHEAD IN DEEPEST LOOP
Index: trunk/libIGCM/AA_monitoring
===================================================================
--- trunk/libIGCM/AA_monitoring	(revision 107)
+++ trunk/libIGCM/AA_monitoring	(revision 108)
@@ -61,13 +61,22 @@
 #  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
 
+#set -eu
+#set -vx
+
 date
 
 #-Q- sx8brodie export OMP_NUM_THREADS=1
+#-Q- aix6 export OMP_NUM_THREADS=1
 
 ######################################################################
 
-. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh ;
-. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh     ; #IGCM_debug_Check
-. ${libIGCM}/libIGCM_card/libIGCM_card.ksh   ; #IGCM_card_Check
+. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
+      ( ${DEBUG_debug} ) && IGCM_debug_Check
+. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
+     ( ${DEBUG_debug} ) && IGCM_card_Check
+. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
+     ( ${DEBUG_debug} ) && IGCM_date_Check
+#-------
+. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
 
 ######################################################################
Index: trunk/libIGCM/AA_rebuild
===================================================================
--- trunk/libIGCM/AA_rebuild	(revision 107)
+++ 	(revision )
@@ -1,162 +1,0 @@
-#-Q- platine #!/usr/bin/ksh
-#-Q- platine ###################
-#-Q- platine ## PLATINE   CEA ##
-#-Q- platine ###################
-#-Q- platine #BSUB -J REBUILD                # Nom du job
-#-Q- platine #BSUB -N                        # message a la fin du job
-#-Q- platine #BSUB -n 1                      # reservation des processeurs pour le job
-#-Q- platine #BSUB -W 4:00                   # Limite temps
-#-Q- platine #BSUB -q post                   # Passage en queue post
-#-Q- sx8brodie #!/bin/ksh
-#-Q- sx8brodie #######################
-#-Q- sx8brodie ## SX8BRODIE   IDRIS ##
-#-Q- sx8brodie #######################
-#-Q- sx8brodie # Temps Elapsed max. d'une requete hh:mm:ss
-#-Q- sx8brodie # @ wall_clock_limit = 10:00:00
-#-Q- sx8brodie # Nom du travail LoadLeveler
-#-Q- sx8brodie # @ job_name   = REBUILD
-#-Q- sx8brodie # Fichier de sortie standard du travail       
-#-Q- sx8brodie # @ output     = $(job_name).$(jobid)
-#-Q- sx8brodie # Fichier de sortie d'erreur du travail
-#-Q- sx8brodie # @ error      =  $(job_name).$(jobid)
-#-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
-#-Q- sx8brodie # @ notification = error
-#-Q- sx8brodie # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_SRF ; $MASTER
-#-Q- sx8brodie # @ queue
-#-Q- aix6 #!/bin/ksh
-#-Q- aix6 #######################
-#-Q- aix6 ##   VARGAS   IDRIS  ##
-#-Q- aix6 #######################
-#-Q- aix6 # Temps Elapsed max. d'une requete hh:mm:ss
-#-Q- aix6 # @ wall_clock_limit = 10:00:00
-#-Q- aix6 # Nom du travail LoadLeveler
-#-Q- aix6 # @ job_name   = REBUILD
-#-Q- aix6 # Fichier de sortie standard du travail       
-#-Q- aix6 # @ output     = $(job_name).$(jobid)
-#-Q- aix6 # Fichier de sortie d'erreur du travail
-#-Q- aix6 # @ error      =  $(job_name).$(jobid)
-#-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
-#-Q- aix6 # @ notification = error
-#-Q- aix6 # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_SRF ; $MASTER
-#-Q- aix6 # @ queue
-#-Q- sx8mercure #!/bin/ksh
-#-Q- sx8mercure ######################
-#-Q- sx8mercure ## SX8MERCURE   CEA ##
-#-Q- sx8mercure ######################
-#-Q- sx8mercure #PBS -N REBUILD              # Nom du job
-#-Q- sx8mercure #PBS -j o                    # regroupement des stdout et stderr
-#-Q- sx8mercure #PBS -S /usr/bin/ksh         # shell de soumission
-#-Q- sx8mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
-#-Q- sx8mercure #PBS -l cputim_job=24:00:00   # Limite temps a 1 heures
-#-Q- sx8mercure #PBS -q scalaire
-#-Q- default #!/bin/ksh
-#-Q- default ##################
-#-Q- default ## DEFAULT HOST ##
-#-Q- default ##################
-
-#set -vx
-
-date
-
-#-Q- sx8brodie export OMP_NUM_THREADS=1
-
-# $Date: $
-# $Author: $
-# $Revision: $
-# IPSL (2006)
-#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
-
-########################################################################
-
-#D- Flag to determine if this job in a standalone mode
-#D- Default : value from AA_job if any
-StandAlone=${StandAlone:=true}
-
-#D- Flag to determine atlas job's output directory
-#D- Default : value from libIGCM_post.ksh if any
-POST_DIR=${POST_DIR:=${PBS_O_WORKDIR}}
-
-#D- Increased verbosity (1, 2, 3)
-#D- Default : value from AA_job if any
-Verbosity=${Verbosity:=3}
-
-#D- Low level debug : to bypass lib test checks and stack construction
-#D- Default : value from AA_job if any
-DEBUG_debug=${DEBUG_debug:=false}
-
-#D- Low level debug : to bypass lib test checks and stack construction
-#D- Default : value from AA_job if any
-libIGCM=${libIGCM:=/home/rech/ces/rces452/libIGCM}
-
-########################################################################
-
-. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
-        ( ${DEBUG_debug} ) && IGCM_debug_Check
-. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
-       ( ${DEBUG_debug} ) && IGCM_card_Check
-. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
-       ( ${DEBUG_debug} ) && IGCM_date_Check
-#-------
-. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
-. ${libIGCM}/libIGCM_post/libIGCM_post.ksh
-
-########################################################################
-
-#set -vx
-
-if [ ${StandAlone} = true ] ; then
-    CARD_DIR=${SUBMIT_DIR}
-else
-    CARD_DIR=${RUN_DIR_PATH}/$( basename ${SUBMIT_DIR} )
-    IGCM_sys_Get_Master ${SUBMIT_DIR} ${RUN_DIR_PATH}
-fi
-
-#
-# Perhaps not usefull ?
-#
-IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card UserChoices
-typeset option
-for option in ${config_UserChoices[*]} ; do
-    IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card UserChoices ${option}
-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_CalendarType
-IGCM_debug_PrintVariables 3 config_UserChoices_DateBegin
-IGCM_debug_PrintVariables 3 config_UserChoices_DateEnd
-IGCM_debug_PrintVariables 3 config_UserChoices_PeriodLength
-echo
-
-if [ ${RebuildFromArchive} = true ] ; then
-    RUN_DIR=${RUN_DIR_PATH}
-else
-    RUN_DIR=${REBUILD_DIR}
-fi
-IGCM_sys_Cd ${RUN_DIR}
-ListAllRebuildDir=$( IGCM_sys_RshArchive ls -d ${REBUILD_DIR}/REBUILD_* | grep -B $(( ${NbRebuildDir} -1 )) ${PeriodDateBegin} )
-
-for directory in ${ListAllRebuildDir} ; do
-    #
-    if [ ${RebuildFromArchive} = true ] ; then
-	IGCM_sys_Get_Dir ${directory} ${RUN_DIR}
-    fi
-    IGCM_sys_Cd ${RUN_DIR}/$( basename ${directory} )
-    # --------------------------------------------------------------------
-    # Function define in rebuild.ksh has not been closed yet. Do it now
-    # --------------------------------------------------------------------
-    echo IGCM_debug_PopStack "IGCM_post_Submit" >> rebuild.ksh
-    echo }                                      >> rebuild.ksh
-
-    # --------------------------------------------------------------------
-    # Source function include in the REBUILD ksh and rebuild
-    # --------------------------------------------------------------------
-    . ${RUN_DIR}/$( basename ${directory} )/rebuild.ksh
-    IGCM_FlushRebuild
-    #
-    IGCM_sys_Cd ${RUN_DIR}
-    IGCM_sys_Rm -rf ${directory}
-done
Index: trunk/libIGCM/AA_rebuild_fromArchive
===================================================================
--- trunk/libIGCM/AA_rebuild_fromArchive	(revision 108)
+++ trunk/libIGCM/AA_rebuild_fromArchive	(revision 108)
@@ -0,0 +1,158 @@
+#-Q- platine #!/usr/bin/ksh
+#-Q- platine ###################
+#-Q- platine ## PLATINE   CEA ##
+#-Q- platine ###################
+#-Q- platine #BSUB -J REBUILDARCH            # Nom du job
+#-Q- platine #BSUB -N                        # message a la fin du job
+#-Q- platine #BSUB -n 1                      # reservation des processeurs pour le job
+#-Q- platine #BSUB -W 4:00                   # Limite temps
+#-Q- platine #BSUB -q post                   # Passage en queue post
+#-Q- sx8brodie #!/bin/ksh
+#-Q- sx8brodie #######################
+#-Q- sx8brodie ## SX8BRODIE   IDRIS ##
+#-Q- sx8brodie #######################
+#-Q- sx8brodie # Temps Elapsed max. d'une requete hh:mm:ss
+#-Q- sx8brodie # @ wall_clock_limit = 10:00:00
+#-Q- sx8brodie # Nom du travail LoadLeveler
+#-Q- sx8brodie # @ job_name   = REBUILDARCH
+#-Q- sx8brodie # Fichier de sortie standard du travail       
+#-Q- sx8brodie # @ output     = $(job_name).$(jobid)
+#-Q- sx8brodie # Fichier de sortie d'erreur du travail
+#-Q- sx8brodie # @ error      =  $(job_name).$(jobid)
+#-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
+#-Q- sx8brodie # @ notification = error
+#-Q- sx8brodie # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_SRF ; $MASTER
+#-Q- sx8brodie # @ queue
+#-Q- aix6 #!/bin/ksh
+#-Q- aix6 #######################
+#-Q- aix6 ##   VARGAS   IDRIS  ##
+#-Q- aix6 #######################
+#-Q- aix6 # Temps Elapsed max. d'une requete hh:mm:ss
+#-Q- aix6 # @ wall_clock_limit = 10:00:00
+#-Q- aix6 # Nom du travail LoadLeveler
+#-Q- aix6 # @ job_name   = REBUILDARCH
+#-Q- aix6 # Fichier de sortie standard du travail
+#-Q- aix6 # @ output     = $(job_name).$(jobid)
+#-Q- aix6 # Fichier de sortie d'erreur du travail
+#-Q- aix6 # @ error      =  $(job_name).$(jobid)
+#-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
+#-Q- aix6 # @ notification = error
+#-Q- aix6 # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_SRF ; $MASTER
+#-Q- aix6 # @ queue
+#-Q- sx8mercure #!/bin/ksh
+#-Q- sx8mercure ######################
+#-Q- sx8mercure ## SX8MERCURE   CEA ##
+#-Q- sx8mercure ######################
+#-Q- sx8mercure #PBS -N REBUILDARCH          # Nom du job
+#-Q- sx8mercure #PBS -j o                    # regroupement des stdout et stderr
+#-Q- sx8mercure #PBS -S /usr/bin/ksh         # shell de soumission
+#-Q- sx8mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
+#-Q- sx8mercure #PBS -l cputim_job=24:00:00  # Limite temps a 1 heures
+#-Q- sx8mercure #PBS -q scalaire
+#-Q- default #!/bin/ksh
+#-Q- default ##################
+#-Q- default ## DEFAULT HOST ##
+#-Q- default ##################
+
+# $Date: $
+# $Author: $
+# $Revision: $
+# IPSL (2006)
+#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
+
+#set -eu
+#set -vx
+
+date
+
+#-Q- sx8brodie export OMP_NUM_THREADS=1
+#-Q- aix6 export OMP_NUM_THREADS=1
+
+########################################################################
+
+#D- Flag to determine if this job in a standalone mode
+#D- Default : value from AA_job if any
+StandAlone=${StandAlone:=true}
+
+#D- Flag to determine atlas job's output directory
+#D- Default : value from libIGCM_post.ksh if any
+POST_DIR=${POST_DIR:=${PBS_O_WORKDIR}}
+
+#D- Increased verbosity (1, 2, 3)
+#D- Default : value from AA_job if any
+Verbosity=${Verbosity:=3}
+
+#D- Low level debug : to bypass lib test checks and stack construction
+#D- Default : value from AA_job if any
+DEBUG_debug=${DEBUG_debug:=false}
+
+#D- Low level debug : to bypass lib test checks and stack construction
+#D- Default : value from AA_job if any
+libIGCM=${libIGCM:=/path/to/your/libIGCM}
+
+#D- TEMPORARY Flag to determine atmospheric resolution
+#D- Default : value from atmospheric driver if any
+RESOL_ATM=${RESOL_ATM:=LMD144142}
+
+#D- TEMPORARY Flag to determine ocean resolution
+#D- Default : value from ocean driver if any
+RESOL_OCE=${RESOL_OCE:=ORCA2}
+
+#D- TEMPORARY Flag to determine ice resolution
+#D- Default : value from ice driver if any
+RESOL_ICE=${RESOL_ICE:=ORCA2}
+
+#D- Flag to determine surface resolution
+#D- Default : value from surface driver if any
+RESOL_SRF=${RESOL_SRF:=LMD144142}
+
+########################################################################
+
+. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
+      ( ${DEBUG_debug} ) && IGCM_debug_Check
+. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
+     ( ${DEBUG_debug} ) && IGCM_card_Check
+. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
+     ( ${DEBUG_debug} ) && IGCM_date_Check
+#-------
+. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
+. ${libIGCM}/libIGCM_post/libIGCM_post.ksh
+
+########################################################################
+
+#set -vx
+
+if [ ${RebuildFromArchive} = true ] ; then
+    RUN_DIR=${RUN_DIR_PATH}
+    ListAllRebuildDir=$( IGCM_sys_RshArchive ls -d ${REBUILD_DIR}/REBUILD_* | grep  ${PeriodDateBegin} | tail -${NbRebuildDir} )
+else
+    RUN_DIR=${REBUILD_DIR}
+    ListAllRebuildDir=$( ls -d ${REBUILD_DIR}/REBUILD_* | grep  ${PeriodDateBegin} | tail -${NbRebuildDir} )
+fi
+IGCM_sys_Cd ${RUN_DIR}
+
+for directory in ${ListAllRebuildDir} ; do
+    #
+    if [ ${RebuildFromArchive} = true ] ; then
+	IGCM_sys_Get_Dir ${directory} ${RUN_DIR}
+    fi
+    IGCM_sys_Cd ${RUN_DIR}/$( basename ${directory} )
+    # --------------------------------------------------------------------
+    # Function define in rebuild.ksh has not been closed yet. Do it now
+    # --------------------------------------------------------------------
+    echo IGCM_debug_PopStack "IGCM_post_Submit" >> rebuild.ksh
+    echo }                                      >> rebuild.ksh
+
+    # --------------------------------------------------------------------
+    # Source function include in the REBUILD ksh and rebuild
+    # --------------------------------------------------------------------
+    . ${RUN_DIR}/$( basename ${directory} )/rebuild.ksh
+    IGCM_FlushRebuild
+    #
+    IGCM_sys_Cd ${RUN_DIR}
+    if [ ${RebuildFromArchive} = true ] ; then
+	IGCM_sys_RshArchive IGCM_sys_Rm -rf ${directory}
+    else
+	IGCM_sys_Rm -rf ${directory}
+    fi
+done
Index: trunk/libIGCM/AA_rebuild_fromWorkdir
===================================================================
--- trunk/libIGCM/AA_rebuild_fromWorkdir	(revision 108)
+++ trunk/libIGCM/AA_rebuild_fromWorkdir	(revision 108)
@@ -0,0 +1,159 @@
+#-Q- platine #!/usr/bin/ksh
+#-Q- platine ###################
+#-Q- platine ## PLATINE   CEA ##
+#-Q- platine ###################
+#-Q- platine #BSUB -J REBUILDWRK             # Nom du job
+#-Q- platine #BSUB -N                        # message a la fin du job
+#-Q- platine #BSUB -n 1                      # reservation des processeurs pour le job
+#-Q- platine #BSUB -W 4:00                   # Limite temps
+#-Q- platine #BSUB -q post                   # Passage en queue post
+#-Q- sx8brodie #!/bin/ksh
+#-Q- sx8brodie #######################
+#-Q- sx8brodie ## SX8BRODIE   IDRIS ##
+#-Q- sx8brodie #######################
+#-Q- sx8brodie # Temps Elapsed max. d'une requete hh:mm:ss
+#-Q- sx8brodie # @ wall_clock_limit = 10:00:00
+#-Q- sx8brodie # Nom du travail LoadLeveler
+#-Q- sx8brodie # @ job_name   = REBUILDWRK
+#-Q- sx8brodie # Fichier de sortie standard du travail       
+#-Q- sx8brodie # @ output     = $(job_name).$(jobid)
+#-Q- sx8brodie # Fichier de sortie d'erreur du travail
+#-Q- sx8brodie # @ error      =  $(job_name).$(jobid)
+#-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
+#-Q- sx8brodie # @ notification = error
+#-Q- sx8brodie # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_SRF ; $MASTER
+#-Q- sx8brodie # @ queue
+#-Q- aix6 #!/bin/ksh
+#-Q- aix6 #######################
+#-Q- aix6 ##   VARGAS   IDRIS  ##
+#-Q- aix6 #######################
+#-Q- aix6 # @ class = archive
+#-Q- aix6 # Temps Elapsed max. d'une requete hh:mm:ss
+#-Q- aix6 # @ wall_clock_limit = 20:00:00
+#-Q- aix6 # Nom du travail LoadLeveler
+#-Q- aix6 # @ job_name   = REBUILDWRK
+#-Q- aix6 # Fichier de sortie standard du travail
+#-Q- aix6 # @ output     = $(job_name).$(jobid)
+#-Q- aix6 # Fichier de sortie d'erreur du travail
+#-Q- aix6 # @ error      =  $(job_name).$(jobid)
+#-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
+#-Q- aix6 # @ notification = error
+#-Q- aix6 # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_SRF ; $MASTER
+#-Q- aix6 # @ queue
+#-Q- sx8mercure #!/bin/ksh
+#-Q- sx8mercure ######################
+#-Q- sx8mercure ## SX8MERCURE   CEA ##
+#-Q- sx8mercure ######################
+#-Q- sx8mercure #PBS -N REBUILDWRK           # Nom du job
+#-Q- sx8mercure #PBS -j o                    # regroupement des stdout et stderr
+#-Q- sx8mercure #PBS -S /usr/bin/ksh         # shell de soumission
+#-Q- sx8mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
+#-Q- sx8mercure #PBS -l cputim_job=24:00:00  # Limite temps a 1 heures
+#-Q- sx8mercure #PBS -q scalaire
+#-Q- default #!/bin/ksh
+#-Q- default ##################
+#-Q- default ## DEFAULT HOST ##
+#-Q- default ##################
+
+# $Date: $
+# $Author: $
+# $Revision: $
+# IPSL (2006)
+#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
+
+#set -eu
+#set -vx
+
+date
+
+#-Q- sx8brodie export OMP_NUM_THREADS=1
+#-Q- aix6 export OMP_NUM_THREADS=1
+
+########################################################################
+
+#D- Flag to determine if this job in a standalone mode
+#D- Default : value from AA_job if any
+StandAlone=${StandAlone:=true}
+
+#D- Flag to determine atlas job's output directory
+#D- Default : value from libIGCM_post.ksh if any
+POST_DIR=${POST_DIR:=${PBS_O_WORKDIR}}
+
+#D- Increased verbosity (1, 2, 3)
+#D- Default : value from AA_job if any
+Verbosity=${Verbosity:=3}
+
+#D- Low level debug : to bypass lib test checks and stack construction
+#D- Default : value from AA_job if any
+DEBUG_debug=${DEBUG_debug:=false}
+
+#D- Low level debug : to bypass lib test checks and stack construction
+#D- Default : value from AA_job if any
+libIGCM=${libIGCM:=/path/to/your/libIGCM}
+
+#D- TEMPORARY Flag to determine atmospheric resolution
+#D- Default : value from atmospheric driver if any
+RESOL_ATM=${RESOL_ATM:=LMD144142}
+
+#D- TEMPORARY Flag to determine ocean resolution
+#D- Default : value from ocean driver if any
+RESOL_OCE=${RESOL_OCE:=ORCA2}
+
+#D- TEMPORARY Flag to determine ice resolution
+#D- Default : value from ice driver if any
+RESOL_ICE=${RESOL_ICE:=ORCA2}
+
+#D- Flag to determine surface resolution
+#D- Default : value from surface driver if any
+RESOL_SRF=${RESOL_SRF:=LMD144142}
+
+########################################################################
+
+. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
+      ( ${DEBUG_debug} ) && IGCM_debug_Check
+. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
+     ( ${DEBUG_debug} ) && IGCM_card_Check
+. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
+     ( ${DEBUG_debug} ) && IGCM_date_Check
+#-------
+. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
+. ${libIGCM}/libIGCM_post/libIGCM_post.ksh
+
+########################################################################
+
+#set -vx
+
+if [ ${RebuildFromArchive} = true ] ; then
+    RUN_DIR=${RUN_DIR_PATH}
+    ListAllRebuildDir=$( IGCM_sys_RshArchive ls -d ${REBUILD_DIR}/REBUILD_* | grep  ${PeriodDateBegin} | tail -${NbRebuildDir} )
+else
+    RUN_DIR=${REBUILD_DIR}
+    ListAllRebuildDir=$( ls -d ${REBUILD_DIR}/REBUILD_* | grep  ${PeriodDateBegin} | tail -${NbRebuildDir} )
+fi
+IGCM_sys_Cd ${RUN_DIR}
+
+for directory in ${ListAllRebuildDir} ; do
+    #
+    if [ ${RebuildFromArchive} = true ] ; then
+	IGCM_sys_Get_Dir ${directory} ${RUN_DIR}
+    fi
+    IGCM_sys_Cd ${RUN_DIR}/$( basename ${directory} )
+    # --------------------------------------------------------------------
+    # Function define in rebuild.ksh has not been closed yet. Do it now
+    # --------------------------------------------------------------------
+    echo IGCM_debug_PopStack "IGCM_post_Submit" >> rebuild.ksh
+    echo }                                      >> rebuild.ksh
+
+    # --------------------------------------------------------------------
+    # Source function include in the REBUILD ksh and rebuild
+    # --------------------------------------------------------------------
+    . ${RUN_DIR}/$( basename ${directory} )/rebuild.ksh
+    IGCM_FlushRebuild
+    #
+    IGCM_sys_Cd ${RUN_DIR}
+    if [ ${RebuildFromArchive} = true ] ; then
+	IGCM_sys_RshArchive IGCM_sys_Rm -rf ${directory}
+    else
+	IGCM_sys_Rm -rf ${directory}
+    fi
+done
Index: trunk/libIGCM/libIGCM_config/libIGCM_config.ksh
===================================================================
--- trunk/libIGCM/libIGCM_config/libIGCM_config.ksh	(revision 107)
+++ trunk/libIGCM/libIGCM_config/libIGCM_config.ksh	(revision 108)
@@ -134,4 +134,8 @@
 	IGCM_debug_Print 3 "${option} : ${auxprint}"
     done
+
+    IGCM_debug_Print 1 "For now force RebuildFromArchive=true in libIGM_config"
+    config_Post_RebuildFromArchive=true
+    IGCM_debug_Print 3 "RebuildFromArchive : true"
 
     #================================================================#
Index: trunk/libIGCM/libIGCM_date/libIGCM_date.ksh
===================================================================
--- trunk/libIGCM/libIGCM_date/libIGCM_date.ksh	(revision 107)
+++ trunk/libIGCM/libIGCM_date/libIGCM_date.ksh	(revision 108)
@@ -22,5 +22,5 @@
 #D-#==================================================================
 #D-libIGCM_date
-#D-This ksh library handles date calculs and convertions in different calendars. 
+#D-This ksh library handles date calculs and convertions in different calendars.
 #D-  types of calendars are possible :
 #D-
Index: trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh
===================================================================
--- trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh	(revision 107)
+++ trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh	(revision 108)
@@ -180,5 +180,5 @@
     echo "IGCM_debug_Exit : " "${@}"
     IGCM_debug_CallStack
-    eval ExitFlag=true
+    ExitFlag=true
     IGCM_debug_PopStack "IGCM_debug_Exit"
 }
Index: trunk/libIGCM/libIGCM_post/libIGCM_post.ksh
===================================================================
--- trunk/libIGCM/libIGCM_post/libIGCM_post.ksh	(revision 107)
+++ trunk/libIGCM/libIGCM_post/libIGCM_post.ksh	(revision 108)
@@ -518,32 +518,41 @@
         IGCM_sys_MkdirWork ${POST_DIR}
         IGCM_debug_Verif_Exit
-        IGCM_sys_QsubPost rebuild
+        IGCM_sys_QsubPost rebuild_fromArchive
 EOF
+
         else 
         #
         IGCM_debug_Print 2 "REBUILD POST-TREATMENT FROM WORKDIR :"
-        echo
-        #
-        typeset listVarEnv
-        listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,RebuildFromArchive,POST_DIR,MASTER,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_SRF"
-        export DEBUG_debug=${DEBUG_debug}
-        export MODIPSL=${MODIPSL}
-        export libIGCM_SX=${libIGCM}
-        export libIGCM=${libIGCM}
-        export SUBMIT_DIR=${SUBMIT_DIR}
-        export RebuildFromArchive=${config_Post_RebuildFromArchive}
-        export REBUILD_DIR=${REBUILD_DIR}
-        export POST_DIR=${libIGCM}
-        export DateBegin=${DateBegin}
-        export PeriodDateBegin=${PeriodDateBegin}
-        export PeriodDateEnd=${PeriodDateEnd}
-        export NbRebuildDir=${NbRebuildDir}
-        export StandAlone=false
-        export RESOL_ATM=${RESOL_ATM}
-        export RESOL_OCE=${RESOL_OCE}
-        export RESOL_ICE=${RESOL_ICE}
-        export RESOL_SRF=${RESOL_SRF}
-        export listVarEnv=${listVarEnv}
-        IGCM_sys_Qsub rebuildtmp.job ${libIGCM}
+	echo
+	IGCM_debug_Print 2 "NOT FULLY SUPPORTED"
+	IGCM_debug_Print 2 "EXIT NOW TO AVOID BIG PROBLEM"
+	IGCM_debug_Print 2 "Contact libIGCM developpers"
+	#
+	IGCM_debug_Exit "FATAL ERROR IN REBUILD CONFIGURATION"
+	IGCM_debug_Verif_Exit 
+        #
+
+#        typeset listVarEnv
+#        listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,RebuildFromArchive,POST_DIR,MASTER,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_SRF"
+#        export DEBUG_debug=${DEBUG_debug}
+#        export MODIPSL=${MODIPSL}
+#        export libIGCM_SX=${libIGCM}
+#        export libIGCM=${libIGCM}
+#        export SUBMIT_DIR=${SUBMIT_DIR}
+#        export RebuildFromArchive=${config_Post_RebuildFromArchive}
+#        export REBUILD_DIR=${REBUILD_DIR}
+#        export POST_DIR=${libIGCM}
+#        export DateBegin=${DateBegin}
+#        export PeriodDateBegin=${PeriodDateBegin}
+#        export PeriodDateEnd=${PeriodDateEnd}
+#        export NbRebuildDir=${NbRebuildDir}
+#        export StandAlone=false
+#        export RESOL_ATM=${RESOL_ATM}
+#        export RESOL_OCE=${RESOL_OCE}
+#        export RESOL_ICE=${RESOL_ICE}
+#        export RESOL_SRF=${RESOL_SRF}
+#        export listVarEnv=${listVarEnv}
+#        IGCM_sys_Qsub rebuild_fromWorkdir ${libIGCM}
+
         fi
     fi
