Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh	(revision 1147)
+++ trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh	(revision 1148)
@@ -567,42 +567,42 @@
 #D-* Examples:
 #D-
+function IGCM_sys_TestFileArchive {
+  IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@
+  typeset ExistFlag TempCommandFile
+  TempCommandFile="[ -f $1 ] && echo 0 || echo 1"
+  #Command depends on targeted file system
+  #We want it quiet
+  DEBUG_sys=false IGCM_sys_IsFileArchived $1
+  if [ $? = 0 ] ; then
+    ExistFlag=$( IGCM_sys_RshArchive ${TempCommandFile} )
+  else
+    ExistFlag=$( ${TempCommandFile} )
+  fi
+  IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
+
+  return ${ExistFlag}
+}
+
+#D-#==================================================
+#D-function IGCM_sys_TestFileArchive
+#D-* Purpose: Test file that must NOT EXISTS on Archive
+#D-* Examples:
+#D-
 #function IGCM_sys_TestFileArchive {
 #  IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@
-#  typeset ExistFlag TempCommandFile
-#  TempCommandFile="[ -f $1 ] && echo 0 || echo 1"
-#  #Command depends on targeted file system
-#  #We want it quiet
+#  typeset ExistFlag finalPosition
+#
 #  DEBUG_sys=false IGCM_sys_IsFileArchived $1
 #  if [ $? = 0 ] ; then
-#    ExistFlag=$( IGCM_sys_RshArchive ${TempCommandFile} )
+#    finalPosition=$( mfls $1 2>/dev/null | wc -l )
+#    [ ${finalPosition} -eq 4 ] && ExistFlag=1 || ExistFlag=0
 #  else
-#    ExistFlag=$( ${TempCommandFile} )
+#    ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
 #  fi
+#
 #  IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
 #
 #  return ${ExistFlag}
 #}
-
-#D-#==================================================
-#D-function IGCM_sys_TestFileArchive
-#D-* Purpose: Test file that must NOT EXISTS on Archive
-#D-* Examples:
-#D-
-function IGCM_sys_TestFileArchive {
-  IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@
-  typeset ExistFlag finalPosition
-
-  DEBUG_sys=false IGCM_sys_IsFileArchived $1
-  if [ $? = 0 ] ; then
-    finalPosition=$( mfls $1 2>/dev/null | wc -l )
-    [ ${finalPosition} -eq 4 ] && ExistFlag=1 || ExistFlag=0
-  else
-    ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
-  fi
-
-  IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
-
-  return ${ExistFlag}
-}
 
 #D-#==================================================
@@ -625,11 +625,49 @@
 ##D-* Examples:
 ##D-
+function IGCM_sys_CountFileArchive {
+  IGCM_debug_PushStack "IGCM_sys_CountFileArchive" $@
+  #Command depends on targeted file system
+  DEBUG_sys=false IGCM_sys_IsFileArchived $1
+  if [ $? = 0 ] ; then
+    IGCM_sys_RshArchive "ls ${@} 2>/dev/null | wc -l"
+    status=$?
+  else
+    ls ${@} 2>/dev/null | wc -l
+    status=$?
+  fi
+  if [ ${status} -gt 0 ] ; then
+    echo "IGCM_sys_CountFileArchive : erreur."
+  fi
+  IGCM_debug_PopStack "IGCM_sys_CountFileArchive"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_CountFileArchive
+#D-* Purpose: Count files on Archive filesystem
+#D-* Examples:
+#D-
 #function IGCM_sys_CountFileArchive {
 #  IGCM_debug_PushStack "IGCM_sys_CountFileArchive" $@
+#  typeset status gayaPosition ergonPosition finalPosition gayaCount ergonCount
 #  #Command depends on targeted file system
 #  DEBUG_sys=false IGCM_sys_IsFileArchived $1
 #  if [ $? = 0 ] ; then
-#    IGCM_sys_RshArchive "ls ${@} 2>/dev/null | wc -l"
-#    status=$?
+#    status=0
+#    gayaPosition=$(  mfls ${@} 2>/dev/null | grep -n "++ Gaya"  | awk -F\: {'print $1'} )
+#    (( status=status + $? ))
+#    ergonPosition=$( mfls ${@} 2>/dev/null | grep -n "++ Ergon" | awk -F\: {'print $1'} )
+#    (( status=status + $? ))
+#    finalPosition=$( mfls ${@} 2>/dev/null | wc -l )
+#    (( status=status + $? ))
+
+#    (( gayaCount  = ergonPosition - gayaPosition - 2 ))
+#    (( ergonCount = finalPosition - ergonPosition ))
+
+#    # return number of files found. greater the better
+#    [ ${ergonCount} -ge ${gayaCount} ] && echo ${ergonCount} || echo ${gayaCount}
+
+#    # "Ergon only" case
+#    #IGCM_sys_RshArchive "ls ${@} 2>/dev/null | wc -l"
+#    #status=$?
 #  else
 #    ls ${@} 2>/dev/null | wc -l
@@ -641,42 +679,4 @@
 #  IGCM_debug_PopStack "IGCM_sys_CountFileArchive"
 #}
-
-#D-#==================================================
-#D-function IGCM_sys_CountFileArchive
-#D-* Purpose: Count files on Archive filesystem
-#D-* Examples:
-#D-
-function IGCM_sys_CountFileArchive {
-  IGCM_debug_PushStack "IGCM_sys_CountFileArchive" $@
-  typeset status gayaPosition ergonPosition finalPosition gayaCount ergonCount
-  #Command depends on targeted file system
-  DEBUG_sys=false IGCM_sys_IsFileArchived $1
-  if [ $? = 0 ] ; then
-    status=0
-    gayaPosition=$(  mfls ${@} 2>/dev/null | grep -n "++ Gaya"  | awk -F\: {'print $1'} )
-    (( status=status + $? ))
-    ergonPosition=$( mfls ${@} 2>/dev/null | grep -n "++ Ergon" | awk -F\: {'print $1'} )
-    (( status=status + $? ))
-    finalPosition=$( mfls ${@} 2>/dev/null | wc -l )
-    (( status=status + $? ))
-
-    (( gayaCount  = ergonPosition - gayaPosition - 2 ))
-    (( ergonCount = finalPosition - ergonPosition ))
-
-    # return number of files found. greater the better
-    [ ${ergonCount} -ge ${gayaCount} ] && echo ${ergonCount} || echo ${gayaCount}
-
-    # "Ergon only" case
-    #IGCM_sys_RshArchive "ls ${@} 2>/dev/null | wc -l"
-    #status=$?
-  else
-    ls ${@} 2>/dev/null | wc -l
-    status=$?
-  fi
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_CountFileArchive : erreur."
-  fi
-  IGCM_debug_PopStack "IGCM_sys_CountFileArchive"
-}
 
 #D-#==================================================
