Index: trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh
===================================================================
--- trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh	(revision 801)
+++ trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh	(revision 804)
@@ -79,8 +79,8 @@
 
     eval R_OUT_${comp}_R=\${R_OUT_${comp}}/Restart
-    eval IGCM_sys_MkdirArchive \${R_OUT_${comp}_R}
+    [ ${config_Post_PackFrequency} = NONE ] && eval IGCM_sys_MkdirArchive \${R_OUT_${comp}_R}
 
     eval R_OUT_${comp}_D=\${R_OUT_${comp}}/Debug
-    eval IGCM_sys_MkdirArchive \${R_OUT_${comp}_D}
+    [ ${config_Post_PackFrequency} = NONE ] && eval IGCM_sys_MkdirArchive \${R_OUT_${comp}_D}
 
     eval R_OUT_${comp}_O_I=\${R_OUT_${comp}_O}/INS
@@ -91,21 +91,23 @@
 
     # Define BUFFERED Dirs
-    eval R_BUF_${comp}=${R_BUFR}/${comp}
-    eval IGCM_sys_Mkdir \${R_BUF_${comp}}
-
-    eval R_BUF_${comp}_O=\${R_BUF_${comp}}/Output
-    eval IGCM_sys_Mkdir \${R_BUF_${comp}_O}
-
-    eval R_BUF_${comp}_R=\${R_BUF_${comp}}/Restart
-    eval IGCM_sys_Mkdir \${R_BUF_${comp}_R}
-
-    eval R_BUF_${comp}_D=\${R_BUF_${comp}}/Debug
-    eval IGCM_sys_Mkdir \${R_BUF_${comp}_D}
-
-    eval R_BUF_${comp}_O_I=\${R_BUF_${comp}_O}/INS
-    eval R_BUF_${comp}_O_H=\${R_BUF_${comp}_O}/HF
-    eval R_BUF_${comp}_O_D=\${R_BUF_${comp}_O}/DA
-    eval R_BUF_${comp}_O_M=\${R_BUF_${comp}_O}/MO
-    eval R_BUF_${comp}_O_Y=\${R_BUF_${comp}_O}/YE
+    if [ ! ${config_Post_PackFrequency} = NONE ] ; then
+      eval R_BUF_${comp}=${R_BUFR}/${comp}
+      eval IGCM_sys_Mkdir \${R_BUF_${comp}}
+
+      eval R_BUF_${comp}_O=\${R_BUF_${comp}}/Output
+      eval IGCM_sys_Mkdir \${R_BUF_${comp}_O}
+
+      eval R_BUF_${comp}_R=\${R_BUF_${comp}}/Restart
+      eval IGCM_sys_Mkdir \${R_BUF_${comp}_R}
+
+      eval R_BUF_${comp}_D=\${R_BUF_${comp}}/Debug
+      eval IGCM_sys_Mkdir \${R_BUF_${comp}_D}
+
+      eval R_BUF_${comp}_O_I=\${R_BUF_${comp}_O}/INS
+      eval R_BUF_${comp}_O_H=\${R_BUF_${comp}_O}/HF
+      eval R_BUF_${comp}_O_D=\${R_BUF_${comp}_O}/DA
+      eval R_BUF_${comp}_O_M=\${R_BUF_${comp}_O}/MO
+      eval R_BUF_${comp}_O_Y=\${R_BUF_${comp}_O}/YE
+    fi
 
     # Read UserChoices section of component card
@@ -113,4 +115,5 @@
     IGCM_card_DefineArrayFromSection ${card} UserChoices
     eval first_option=\${${compname}_UserChoices[0]} > /dev/null 2>&1
+
     # If section is not empty we define corresponding variables
     if [ X${first_option} != X"Error:" ] ; then
@@ -991,4 +994,89 @@
     card=${SUBMIT_DIR}/COMP/${compname}.card
 
+    # Save Output Text files of models
+    #---------------------------------
+    IGCM_debug_Print 2 "Save Output Text files for ${comp} : ${compname} component."
+    IGCM_card_DefineArrayFromOption ${card} OutputText List
+    ListTextName=${compname}_OutputText_List
+
+    eval TextName0=\${${ListTextName}[0]} > /dev/null 2>&1
+    if [ X${TextName0} != X${NULL_STR} ] ; then
+      eval NbFiles=\${#${ListTextName}[@]} > /dev/null 2>&1
+
+      (( i=0 ))
+      until [ $i -eq $NbFiles ]; do
+        eval file_in=\${${ListTextName}[$i]} > /dev/null 2>&1
+        eval file_out=${PREFIX}_${file_in}
+
+        (( i=i+1 ))
+
+        unset list_file
+        #set +A list_file -- $( ls ${file_in}* | sort 2>/dev/null )
+        # result for a a1 a10 a2 with file_in=a a a1 a2 a10
+        set +A list_file -- $( [ -f ${file_in} ] && ls ${file_in} ; for i in $(ls ${file_in}* 2>/dev/null | sed "s/${file_in}//" | sort -n) ; do ls ${file_in}$i ; done )
+        nlist_file=${#list_file[@]}
+        if [ ${nlist_file} -gt 1 ] ; then
+          if ( ${compactoutputs} ) ; then
+            IGCM_debug_Print 2 "Parallelism of Text Output with ${nlist_file} files."
+            IGCM_debug_Print 2 "Compact files in ${file_out} : " ${list_file[*]}
+            echo ${list_file[*]} > ${file_out}
+            echo "
+" >> ${file_out}
+
+            (( i_ = 0 ))
+            for file in ${list_file[@]}
+            do
+              echo "_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ " >> ${file_out}
+              echo "| " ${i_} " " ${file} >> ${file_out}
+              echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " >> ${file_out}
+              cat ${file} | sed "s/\(.*\)/${i_}\1/" ${file} >> ${file_out}
+              echo "
+" >> ${file_out}
+              eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file}" > /dev/null 2>&1
+                  (( i_ = i_ + 1 ))
+            done
+            if [ X${Pack} = Xtrue ] ; then
+              eval IGCM_sys_PutBuffer_Out ${file_out} \${R_BUF_${comp}_D}/${file_out}
+            else
+              eval IGCM_sys_Put_Out ${file_out} \${R_OUT_${comp}_D}/${file_out}
+            fi
+            eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file_out}" > /dev/null 2>&1
+
+            if ( ${ExecutionFail} ) ; then
+              IGCM_sys_Cp ${file_out} ${SUBMIT_DIR}/Debug
+            fi
+          else
+            for file in ${list_file[@]}
+            do
+              if [ X${Pack} = Xtrue ] ; then
+                eval IGCM_sys_PutBuffer_Out ${file} \${R_BUF_${comp}_D}/${PREFIX}_${file}
+              else
+                eval IGCM_sys_Put_Out ${file} \${R_OUT_${comp}_D}/${PREFIX}_${file}
+              fi
+              eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file}" > /dev/null 2>&1
+
+              if ( ${ExecutionFail} ) ; then
+                IGCM_sys_Cp ${file} ${SUBMIT_DIR}/Debug/${PREFIX}_${file}
+              fi
+            done
+          fi
+        else
+          if ( [ -f ${file_in}_0000 ] || [ -f ${file_in}0 ] ) ; then
+            eval IGCM_sys_Mv ${file_in}* ${file_in}
+          fi
+          if [ X${Pack} = Xtrue ] ; then
+            eval IGCM_sys_PutBuffer_Out ${file_in} \${R_BUF_${comp}_D}/${file_out}
+          else
+            eval IGCM_sys_Put_Out ${file_in} \${R_OUT_${comp}_D}/${file_out}
+          fi
+          eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file_in}" > /dev/null 2>&1
+
+          if ( ${ExecutionFail} ) ; then
+            IGCM_sys_Cp ${file_in} ${SUBMIT_DIR}/Debug/${file_out}
+          fi
+        fi
+      done
+    fi
+
     # Save Restarts files
     #--------------------
@@ -1096,8 +1184,8 @@
         #
         if ( [ ${nb_rebuild_file} -eq 1 ] && [ -f ${generic_file_name}_0000.nc ] ) ; then
-          IGCM_debug_Print 2 "Parallelism with 1 process. Rebuilding ${file_in} not needed"
+          IGCM_debug_Print 2 "Parallelism with 1 file. Rebuilding ${file_in} not needed"
           IGCM_sys_Mv ${generic_file_name}_0000.nc ${file_in}
         elif [ ${nb_rebuild_file} -gt 1 ] ; then
-          IGCM_debug_Print 2 "Parallelism detected rebuilding ${file_in} is needed"
+          IGCM_debug_Print 2 "Parallelism detected and rebuilding ${file_in} is needed"
           if [ X${AsynchronousRebuild} = Xfalse ] ; then
             IGCM_debug_Print 2 "Rebuilding ${file_in} online"
@@ -1219,89 +1307,4 @@
       done
     fi
-
-    # Save Output Text files of models
-    #---------------------------------
-    IGCM_debug_Print 2 "Save Output Text files for ${comp} : ${compname} component."
-    IGCM_card_DefineArrayFromOption ${card} OutputText List
-    ListTextName=${compname}_OutputText_List
-
-    eval TextName0=\${${ListTextName}[0]} > /dev/null 2>&1
-    if [ X${TextName0} != X${NULL_STR} ] ; then
-      eval NbFiles=\${#${ListTextName}[@]} > /dev/null 2>&1
-
-      (( i=0 ))
-      until [ $i -eq $NbFiles ]; do
-        eval file_in=\${${ListTextName}[$i]} > /dev/null 2>&1
-        eval file_out=${PREFIX}_${file_in}
-
-        (( i=i+1 ))
-
-        unset list_file
-        #set +A list_file -- $( ls ${file_in}* | sort 2>/dev/null )
-        # result for a a1 a10 a2 with file_in=a a a1 a2 a10
-        set +A list_file -- $( [ -f ${file_in} ] && ls ${file_in} ; for i in $(ls ${file_in}* 2>/dev/null | sed "s/${file_in}//" | sort -n) ; do ls ${file_in}$i ; done )
-        nlist_file=${#list_file[@]}
-        if [ ${nlist_file} -gt 1 ] ; then
-          if ( ${compactoutputs} ) ; then
-            IGCM_debug_Print 2 "Parallelism of Text Output with ${nlist_file} files."
-            IGCM_debug_Print 2 "Compact files in ${file_out} : " ${list_file[*]}
-            echo ${list_file[*]} > ${file_out}
-            echo "
-" >> ${file_out}
-
-            (( i_ = 0 ))
-            for file in ${list_file[@]}
-            do
-              echo "_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ " >> ${file_out}
-              echo "| " ${i_} " " ${file} >> ${file_out}
-              echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " >> ${file_out}
-              cat ${file} | sed "s/\(.*\)/${i_}\1/" ${file} >> ${file_out}
-              echo "
-" >> ${file_out}
-              eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file}" > /dev/null 2>&1
-                  (( i_ = i_ + 1 ))
-            done
-            if [ X${Pack} = Xtrue ] ; then
-              eval IGCM_sys_PutBuffer_Out ${file_out} \${R_BUF_${comp}_D}/${file_out}
-            else
-              eval IGCM_sys_Put_Out ${file_out} \${R_OUT_${comp}_D}/${file_out}
-            fi
-            eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file_out}" > /dev/null 2>&1
-
-            if ( ${ExecutionFail} ) ; then
-              IGCM_sys_Cp ${file_out} ${SUBMIT_DIR}/Debug
-            fi
-          else
-            for file in ${list_file[@]}
-            do
-              if [ X${Pack} = Xtrue ] ; then
-                eval IGCM_sys_PutBuffer_Out ${file} \${R_BUF_${comp}_D}/${PREFIX}_${file}
-              else
-                eval IGCM_sys_Put_Out ${file} \${R_OUT_${comp}_D}/${PREFIX}_${file}
-              fi
-              eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file}" > /dev/null 2>&1
-
-              if ( ${ExecutionFail} ) ; then
-                IGCM_sys_Cp ${file} ${SUBMIT_DIR}/Debug/${PREFIX}_${file}
-              fi
-            done
-          fi
-        else
-          if ( [ -f ${file_in}_0000 ] || [ -f ${file_in}0 ] ) ; then
-            eval IGCM_sys_Mv ${file_in}* ${file_in}
-          fi
-          if [ X${Pack} = Xtrue ] ; then
-            eval IGCM_sys_PutBuffer_Out ${file_in} \${R_BUF_${comp}_D}/${file_out}
-          else
-            eval IGCM_sys_Put_Out ${file_in} \${R_OUT_${comp}_D}/${file_out}
-          fi
-          eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file_in}" > /dev/null 2>&1
-
-          if ( ${ExecutionFail} ) ; then
-            IGCM_sys_Cp ${file_in} ${SUBMIT_DIR}/Debug/${file_out}
-          fi
-        fi
-      done
-    fi
     echo
   done
