Index: /trunk/libIGCM/AA_job
===================================================================
--- /trunk/libIGCM/AA_job	(revision 156)
+++ /trunk/libIGCM/AA_job	(revision 157)
@@ -132,4 +132,8 @@
 #SUBMIT_DIR=$( pwd )
 
+#D- Define BIG_DIR directory
+#D- Default=(strongly machine dependant/see libIGCM_sys for details)
+#BIG_DIR=/somewhere/with/lot/of/space/scratchdir/may/be
+
 #D- Turn in dry run mode ? (0,1,2,3)
 #D- Default=0
Index: /trunk/libIGCM/AA_rebuild_fromArchive
===================================================================
--- /trunk/libIGCM/AA_rebuild_fromArchive	(revision 156)
+++ /trunk/libIGCM/AA_rebuild_fromArchive	(revision 157)
@@ -123,26 +123,15 @@
 #set -vx
 
-if [ ${RebuildFromArchive} = true ] ; then
-    RUN_DIR=${RUN_DIR_PATH}
-    ListAllRebuildDir=$( IGCM_sys_RshArchive ls -d ${REBUILD_DIR}/REBUILD_* | grep -B $(( ${NbRebuildDir} -1 )) ${PeriodDateBegin} )
-else
-    RUN_DIR=${REBUILD_DIR}
-    ListAllRebuildDir=$( ls -d ${REBUILD_DIR}/REBUILD_* | grep  ${PeriodDateBegin} | tail -${NbRebuildDir} )
-fi
+RUN_DIR=${RUN_DIR_PATH}
+ListAllRebuildDir=$( IGCM_sys_RshArchive ls -d ${REBUILD_DIR}/REBUILD_* | grep -B $(( ${NbRebuildDir} -1 )) ${PeriodDateBegin} )
+#
 IGCM_sys_Cd ${RUN_DIR}
 
 for directory in ${ListAllRebuildDir} ; do
     #
-    if [ ${RebuildFromArchive} = true ] ; then
-	IGCM_sys_Get_Dir ${directory} ${RUN_DIR}
-    fi
+    IGCM_sys_Get_Dir ${directory} ${RUN_DIR}
+    #
     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_FlushRebuild" >> rebuild.ksh
-    echo }                                       >> rebuild.ksh
 
-    IGCM_sys_Put_Out rebuild.ksh ${directory}
     # --------------------------------------------------------------------
     # Source function include in the REBUILD ksh and rebuild
@@ -153,4 +142,4 @@
     IGCM_sys_Cd ${RUN_DIR}
     # Clean Up
-    #IGCM_sys_RshArchive IGCM_sys_Rm -rf ${directory}
+    IGCM_sys_RshArchive rm -rf ${directory}
 done
Index: /trunk/libIGCM/AA_rebuild_fromWorkdir
===================================================================
--- /trunk/libIGCM/AA_rebuild_fromWorkdir	(revision 156)
+++ /trunk/libIGCM/AA_rebuild_fromWorkdir	(revision 157)
@@ -124,26 +124,13 @@
 #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
+RUN_DIR=${REBUILD_DIR}
+ListAllRebuildDir=$( ls -d ${REBUILD_DIR}/REBUILD_* | grep  ${PeriodDateBegin} | tail -${NbRebuildDir} )
+#
 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_FlushRebuild" >> rebuild.ksh
-    echo }                                       >> rebuild.ksh
 
-    IGCM_sys_Put_Out rebuild.ksh ${directory}
     # --------------------------------------------------------------------
     # Source function include in the REBUILD ksh and rebuild
Index: /trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh	(revision 156)
+++ /trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh	(revision 157)
@@ -753,4 +753,5 @@
 			# Prepare the shell dedicated to offline rebuild
 			echo IGCM_sys_rebuild ${file_in} ${generic_file_name}_*.nc    >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+			echo IGCM_debug_Verif_Exit                                    >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
 			#
 			# Load Patch we need to apply and apply
@@ -763,4 +764,5 @@
 			#
 			echo IGCM_sys_Put_Out ${file_in} ${file_out}                  >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+			echo IGCM_debug_Verif_Exit                                    >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
 			echo IGCM_sys_Rm ${generic_file_name}_*.nc                    >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
 			SaveOnArchive=false
@@ -783,4 +785,5 @@
 			    #
 			    echo IGCM_sys_Put_Out ${file_in} ${file_out}                  >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+			    echo IGCM_debug_Verif_Exit                                    >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
 		            #
 			fi
Index: /trunk/libIGCM/libIGCM_config/libIGCM_config.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_config/libIGCM_config.ksh	(revision 156)
+++ /trunk/libIGCM/libIGCM_config/libIGCM_config.ksh	(revision 157)
@@ -197,10 +197,7 @@
 	IGCM_sys_MkdirArchive ${REBUILD_DIR}
     else
-	REBUILD_DIR=${RUN_DIR}
-    fi
-
-    IGCM_debug_Print 1 "For now force RebuildFromArchive=true in libIGM_config"
-    config_Post_RebuildFromArchive=true
-    IGCM_debug_Print 3 "RebuildFromArchive : true"
+	REBUILD_DIR=${BIG_DIR}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
+	IGCM_sys_MkdirWork ${REBUILD_DIR}
+    fi
 
     #====================================================
Index: /trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh	(revision 156)
+++ /trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh	(revision 157)
@@ -90,6 +90,6 @@
 	    let $((i=i+1))
 	done
-    fi
-    echo "!------------------------!"
+	echo "!------------------------!"
+    fi
 }
 
Index: /trunk/libIGCM/libIGCM_post/libIGCM_post.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_post/libIGCM_post.ksh	(revision 156)
+++ /trunk/libIGCM/libIGCM_post/libIGCM_post.ksh	(revision 157)
@@ -563,5 +563,4 @@
 	done
     fi
-
     set +vx
 
@@ -627,7 +626,15 @@
 
     #============== REBUILD POST-TREATMENT =============#
-
-    if ( [ ${config_Post_RebuildFromArchive} = true ] && [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] && [ ! X${config_Post_RebuildFrequency} = XNONE ] ) ; then
-	IGCM_sys_Put_Dir REBUILD_${PeriodDateBegin} ${REBUILD_DIR}
+    if ( [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] && [ ! X${config_Post_RebuildFrequency} = XNONE ] ) ; then
+	# -----------------------------------------------------------------------------------
+        # Function IGCM_FlushRebuild define in rebuild.ksh has not been closed yet. Do it now
+        # -----------------------------------------------------------------------------------
+	echo IGCM_debug_PopStack "IGCM_FlushRebuild" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo }                                       >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	if [ ${config_Post_RebuildFromArchive} = true ] ; then
+	    IGCM_sys_Put_Dir REBUILD_${PeriodDateBegin} ${REBUILD_DIR}
+	else
+	    IGCM_sys_Mv      REBUILD_${PeriodDateBegin} ${REBUILD_DIR}
+	fi
     fi
     #
@@ -635,70 +642,65 @@
 	#
         if ( [ ${config_Post_RebuildFromArchive} = true ] ) ; then
-        #
-        IGCM_debug_Print 2 "REBUILD POST-TREATMENT FROM ARCHIVE:"
-        echo
-        #
-        typeset listVarEnv
-        listVarEnv="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"
-        IGCM_sys_RshPost <<-EOF
-        export DEBUG_debug=${DEBUG_debug}
-        export MODIPSL=${MODIPSL}
-	export libIGCM_SX=${libIGCM}
-        export libIGCM=${libIGCM_POST}
-        export SUBMIT_DIR=${SUBMIT_DIR}
-        export RebuildFromArchive=${config_Post_RebuildFromArchive}
-        export REBUILD_DIR=${REBUILD_DIR}
-        export POST_DIR=${POST_DIR}
-        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}
-        . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
-        . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
-        IGCM_sys_MkdirWork ${POST_DIR}
-        IGCM_debug_Verif_Exit
-        IGCM_sys_QsubPost rebuild_fromArchive
+            #
+            IGCM_debug_Print 2 "REBUILD POST-TREATMENT FROM ARCHIVE:"
+            echo
+            #
+            typeset listVarEnv
+            listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,POST_DIR,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_SRF"
+            IGCM_sys_RshPost <<-EOF
+            export DEBUG_debug=${DEBUG_debug}
+            export MODIPSL=${MODIPSL}
+	    export libIGCM_SX=${libIGCM}
+            export libIGCM=${libIGCM_POST}
+            export SUBMIT_DIR=${SUBMIT_DIR}
+            export REBUILD_DIR=${REBUILD_DIR}
+            export POST_DIR=${POST_DIR}
+            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}
+            . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
+            . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
+            IGCM_sys_MkdirWork ${POST_DIR}
+            IGCM_debug_Verif_Exit
+            IGCM_sys_QsubPost rebuild_fromArchive
 EOF
-
-        else 
-        #
-        IGCM_debug_Print 2 "REBUILD POST-TREATMENT FROM WORKDIR :"
-	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,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}
-
+        else
+            #
+            IGCM_debug_Print 2 "REBUILD POST-TREATMENT FROM WORKDIR:"
+	    echo
+	    #
+            typeset listVarEnv
+            listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,POST_DIR,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_SRF"
+	    IGCM_sys_RshPost <<-EOF
+            export DEBUG_debug=${DEBUG_debug}
+            export MODIPSL=${MODIPSL}
+            export libIGCM_SX=${libIGCM}
+            export libIGCM=${libIGCM}
+            export SUBMIT_DIR=${SUBMIT_DIR}
+            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}
+            . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
+            . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
+            IGCM_sys_MkdirWork ${POST_DIR}
+            IGCM_debug_Verif_Exit
+            IGCM_sys_QsubPost rebuild_fromWorkdir
+EOF
         fi
     fi
