Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 772)
+++ trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 773)
@@ -713,5 +713,5 @@
     echo "IGCM_sys_QsubPost :" $@
   fi
-  MY_PROJECT=$(echo ${BRIDGE_MSUB_PROJECT} | cut -d@ -f1 ) 
+  MY_PROJECT=$(echo ${BRIDGE_MSUB_PROJECT} | cut -d@ -f1 )
   /usr/bin/ccc_msub -Q normal -A ${MY_PROJECT} -o ${POST_DIR}/${Script_Post_Output}.out -e ${POST_DIR}/${Script_Post_Output}.out ${libIGCM_POST}/$1.job
   if [ $? -gt 0 ] ; then
@@ -848,5 +848,5 @@
   fi
 
-  typeset status DEST
+  typeset status
 
   mkdir -p ${HOME}/MIRROR/${PATHlibIGCM}
@@ -1365,5 +1365,5 @@
   fi
 
-  typeset NB_ESSAI DELAI status i exist skip 
+  typeset NB_ESSAI DELAI status i exist skip
 
   # number of tentative
@@ -1451,5 +1451,5 @@
   IGCM_debug_PushStack "IGCM_sys_Get" $@
 
-  typeset DEST dm_liste ifile target file_work
+  typeset DEST dm_liste target file_work
   typeset NB_ESSAI DELAI status i
 
@@ -1602,5 +1602,5 @@
   IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@
 
-  typeset DEST buf_liste ifile target file_work
+  typeset DEST buf_liste target file_work
   typeset NB_ESSAI DELAI status i
 
@@ -1692,5 +1692,5 @@
   eval ${2}=${dateF[5]}
 
-    # donne la date filesys d'un fichier sur la machine work
+  # donne la date filesys d'un fichier sur la machine work
   IGCM_debug_PopStack "IGCM_sys_FichWork"
 }
@@ -1867,5 +1867,5 @@
 
   if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_rebuild : rebuild error"
+    echo "IGCM_sys_rebuild : rebuild error code is ${status}"
     IGCM_debug_Exit "rebuild"
   fi
@@ -1882,5 +1882,5 @@
   list_opt=$@
 
-  # Invert Axis : t,x -> x,t 
+  # Invert Axis : t,x -> x,t
   #               t,pres,x -> x,t,pres
   # So that we can concatenate along x
@@ -1945,5 +1945,5 @@
 #      j3=${proc_stn[${iStation}]}
       # Extract station
-      # Invert Axis : t,x -> x,t 
+      # Invert Axis : t,x -> x,t
       #               t,pres,x -> x,t,pres
       # So that we can concatenate along x
@@ -2028,5 +2028,5 @@
       eval ExeNameOut=\${config_Executable_${comp}[1]}
 
-        # for CPL component only
+      # for CPL component only
       if [ "X${comp}" = "XCPL" ] ; then
 
@@ -2044,5 +2044,5 @@
       eval ExeNameOut=\${config_Executable_${comp}[1]}
 
-        # Only if we really have an executable for the component and not the coupler ie oasis:
+      # Only if we really have an executable for the component and not the coupler ie oasis:
       if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${comp}" != "XCPL" ] ) ; then
 
@@ -2123,4 +2123,27 @@
 }
 
+#D-#==================================================
+#D-function IGCM_sys_CountJobInQueue
+#D-* Purpose: Check if job_name is currently
+#D-  running or in queue
+#D-* Examples: IGCM_sys_CountJobInQueue ${JobName} NbRun
+#D-
+
+function IGCM_sys_CountJobInQueue {
+  IGCM_debug_PushStack "IGCM_sys_CountJobInQueue"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_CountJobInQueue"
+  fi
+
+  #NbRun=$( ccc_mstat -f | grep -c ${JobName} )
+
+  # With -f option, the full job name is given in the last column
+  NbRun=$( ccc_mstat -f | gawk -v JobName=$1 'BEGIN { x=0 } ($NF~String) { x=x+1 } END { print x }' )
+
+  eval ${2}=${NbRun}
+
+  IGCM_debug_PopStack "IGCM_sys_CountJobInQueue"
+}
+
 ##############################################################
 # NCO OPERATOR
@@ -2643,26 +2666,2 @@
   IGCM_debug_PopStack "IGCM_sys_cdo"
 }
-
-#D-#==================================================
-#D-function IGCM_sys_CountJobInQueue
-#D-* Purpose: Check if job_name is currently 
-#D-  running or in queue
-#D-* Examples: IGCM_sys_CountJobInQueue ${JobName} NbRun
-#D-
-
-function IGCM_sys_CountJobInQueue {
-  IGCM_debug_PushStack "IGCM_sys_CountJobInQueue"
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_CountJobInQueue"
-  fi
-
-  #NbRun=$( ccc_mstat -f | grep -c ${JobName} )
-
-  # With -f option, the full job name is given in the last column
-  NbRun=$( ccc_mstat -f | gawk -v JobName=$1 'BEGIN { x=0 } ($NF~String) { x=x+1 } END { print x }' )
-
-  eval ${2}=${NbRun}
-
-  IGCM_debug_PopStack "IGCM_sys_CountJobInQueue"
-}
-
