Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 622)
+++ trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 623)
@@ -14,13 +14,13 @@
 #=========================================================
 # The documentation of this file can be automatically generated
-# if you use the prefix #D- for comments to be extracted. 
+# if you use the prefix #D- for comments to be extracted.
 # Extract with command: cat lib* | grep "^#D-" | cut -c "4-"
 #=========================================================
 
 #D-#==================================================
-#D-LibIGCM_sys for Titane
-#D-#==================================================
-#D-
-#D- This ksh library if a layer under some usefull 
+#D-LibIGCM_sys for Curie
+#D-#==================================================
+#D-
+#D- This ksh library if a layer under some usefull
 #D-environment variables and shell commands.
 #D-All those definitions depend on host particularities.
@@ -80,5 +80,5 @@
 typeset -r RSYNC_opt="-va"
 # ie storage filesystem
-typeset -r RHOST=curie
+typeset -r STOREHOST=${MASTER}
 
 #====================================================
@@ -101,4 +101,34 @@
 #====================================================
 
+# ============ CESIUM START ============ #
+
+#====================================================
+#- Mirror libIGCM from titane to cesium if needed
+#ROOTSYS=$( echo ${libIGCM} | gawk -F"/" '{print $3}' )
+#if [ ! ${ROOTSYS} = "home" ] ; then
+#  typeset -r MirrorlibIGCM=${MirrorlibIGCM:=true}
+#else
+#  typeset -r MirrorlibIGCM=${MirrorlibIGCM:=false}
+#fi
+
+#====================================================
+#- libIGCM_POST
+#if ( ${MirrorlibIGCM} ) ; then
+#  PATHlibIGCM=$( echo ${libIGCM} | gawk -F"${LOGIN}/" '{print $2}' | sed -e "s&/libIGCM&&" )
+#  typeset -r libIGCM_POST=${HOME}/MIRROR/${PATHlibIGCM}/libIGCM
+#else
+#  typeset -r libIGCM_POST=${libIGCM}
+#fi
+
+# ============ CESIUM  END  ============ #
+
+#====================================================
+#- MirrorlibIGCM for frontend
+typeset -r MirrorlibIGCM=${MirrorlibIGCM:=false}
+
+#====================================================
+#- libIGCM_POST for frontend
+typeset -r libIGCM_POST=${libIGCM}
+
 #====================================================
 #- R_EXE   (==> BIN_DIR = ${MODIPSL}/bin )
@@ -110,13 +140,9 @@
 
 #====================================================
-#- ARCHIVE
+#- ARCHIVE (dedicated to large files)
 typeset -r ARCHIVE=${CCCSTOREDIR}
 
-#====================================================
-typeset -r MirrorlibIGCM=${MirrorlibIGCM:=false}
-
-#====================================================
-#- libIGCM_POST
-typeset -r libIGCM_POST=${libIGCM}
+#- ARCHIVE (dedicated to small/medium files)
+typeset -r STORAGE=${CCCWORKDIR}
 
 #====================================================
@@ -126,26 +152,30 @@
 
 #====================================================
-#- OUT
+#- R_OUT
 typeset -r R_OUT=${ARCHIVE}/IGCM_OUT
 
 #====================================================
-#- OUT_SCR (ONLY FOR double copy an scratch)
-typeset -r R_OUT_SCR=${SCRATCHDIR}/IGCM_OUT
+#- R_FIG (hosting figures : monitoring and atlas, and/or small files)
+typeset -r R_FIG=${STORAGE}/IGCM_OUT
+
+#====================================================
+#- R_BUF (ONLY FOR double copy an scratch)
+typeset -r R_BUF=${SCRATCHDIR}/IGCM_OUT
+
+#====================================================
+#- BIG_DIR : BIG_DIR to store files waiting for rebuild
+typeset -r BIG_DIR=${BIG_DIR:=${SCRATCHDIR}/REBUILD}
 
 #====================================================
 #- OUT_POST
-typeset -r R_OUT_POST=${SCRATCHDIR}/IGCM_OUT_POST
+typeset -r R_OUT_POST=${SCRATCHDIR}/IGCM_OUT
 
 #====================================================
 #- RUN_DIR_PATH : Temporary working directory (=> TMP)
 if [ ! X${BRIDGE_MSUB_NPROC} = X1 ] ; then
-    typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${SCRATCHDIR}/RUN_DIR/${BRIDGE_MSUB_JOBID}}
+  typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${SCRATCHDIR}/RUN_DIR/${BRIDGE_MSUB_JOBID}}
 else
-    typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${SCRATCHDIR}/TMPDIR_IGCM/${BRIDGE_MSUB_JOBID}}
+  typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${SCRATCHDIR}/TMPDIR_IGCM/${BRIDGE_MSUB_JOBID}}
 fi
-
-#====================================================
-#- BIG_DIR : BIG_DIR to store files waiting for rebuild
-typeset -r BIG_DIR=${BIG_DIR:=${SCRATCHDIR}/REBUILD}
 
 #====================================================
@@ -157,19 +187,27 @@
 UNIX_MAX_LIMIT=360
 
+#====================================================
+#- set PackDefault true on curie
+PackDefault=true
+
 NUM_COREPERNODE=8
-	
+
+#====================================================
+#- Default number of MPI task for IPSL coupled model
+#- required for backward compatibility
+#-
+DEFAULT_NUM_PROC_OCE=5
+DEFAULT_NUM_PROC_CPL=1
+DEFAULT_NUM_PROC_ATM=26
+DEFAULT_NUM_PROC_TOTAL=32
 
 #D-#==================================================
 #D-function IGCM_sys_RshMaster
-#D-* Purpose: Just a fake command to wrapp
-#D-           IGCM_card call in post-treatment
-#D-           Ulam do not see brodie filesystem
-#D-           Cesium do not see all mercure filesystem
-#D-           That's why we need this hack.
+#D-* Purpose: Connection to frontend machine.
 #D-* Examples:
 #D-
 function IGCM_sys_RshMaster {
-    IGCM_debug_PushStack "IGCM_sys_RshMaster" $@
-    /bin/ksh <<-EOF
+  IGCM_debug_PushStack "IGCM_sys_RshMaster" $@
+  /bin/ksh <<-EOF
     export libIGCM=${libIGCM}
     export DEBUG_debug=${DEBUG_debug}
@@ -178,9 +216,9 @@
     ${@}
 EOF
-    if [ $? -gt 0 ] ; then
-	echo "IGCM_sys_RshMaster : erreur."
-	IGCM_debug_Exit "IGCM_sys_RshMaster"
-    fi
-    IGCM_debug_PopStack "IGCM_sys_RshMaster"
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_RshMaster : erreur."
+    IGCM_debug_Exit "IGCM_sys_RshMaster"
+  fi
+  IGCM_debug_PopStack "IGCM_sys_RshMaster"
 }
 
@@ -191,13 +229,13 @@
 #D-
 function IGCM_sys_RshArchive {
-    IGCM_debug_PushStack "IGCM_sys_RshArchive" $@
-    /bin/ksh <<-EOF
+  IGCM_debug_PushStack "IGCM_sys_RshArchive" $@
+  /bin/ksh <<-EOF
     ${@}
 EOF
-    if [ $? -gt 0 ] ; then
-	echo "IGCM_sys_RshArchive : erreur."
-	IGCM_debug_Exit "IGCM_sys_RshArchive"
-    fi
-    IGCM_debug_PopStack "IGCM_sys_RshArchive"
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_RshArchive : erreur."
+    IGCM_debug_Exit "IGCM_sys_RshArchive"
+  fi
+  IGCM_debug_PopStack "IGCM_sys_RshArchive"
 }
 
@@ -208,15 +246,79 @@
 #D-
 function IGCM_sys_RshPost {
-    IGCM_debug_PushStack "IGCM_sys_RshPost" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_RshPost :" $@
-    fi
-
-	/bin/ksh ${@}
-	if [ $? -gt 0 ] ; then
-	    echo "IGCM_sys_RshPost : erreur."
-	    IGCM_debug_Exit "IGCM_sys_RshPost"
-	fi
-    IGCM_debug_PopStack "IGCM_sys_RshPost"
+  IGCM_debug_PushStack "IGCM_sys_RshPost" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_RshPost :" $@
+  fi
+
+  #echo cat tmp_IGCM_sys_RshPost_$$ INITIAL
+  #cat tmp_IGCM_sys_RshPost_$$
+  # keep standard input (stdin) for the loop onto temporary file
+  cat >tmp_IGCM_sys_RshPost_$$
+
+# ============ FRONTEND START ============ #
+
+  /bin/ksh <tmp_IGCM_sys_RshPost_$$
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_RshPost : erreur."
+    IGCM_debug_Exit "IGCM_sys_RshPost"
+  fi
+  # delete temporary file
+  \rm tmp_IGCM_sys_RshPost_$$
+
+# ============ FRONTEND  END  ============ #
+
+# ============ CESIUM START ============ #
+#  typeset NB_ESSAI DELAI status i
+#  if [ "X$( grep rebuild_from tmp_IGCM_sys_RshPost_$$ )" != "X" ] ; then
+#    #little hack so that rebuild submission is done on titane not an cesium
+#
+#    libIGCM_POST_sed=$( echo $libIGCM_POST | sed 's/\//\\\//g' )
+#    POST_DIR_sed=$( echo ${POST_DIR} | sed 's/\//\\\//g' )
+#    sed "s/IGCM_sys_QsubPost/IGCM_sys_Qsub/g" tmp_IGCM_sys_RshPost_$$ > tmp.txt
+#    sed "s/ rebuild_fromWorkdir/ ${libIGCM_POST_sed}\/rebuild_fromWorkdir.job/g" tmp.txt > tmp_IGCM_sys_RshPost_$$
+#    sed "s/ rebuild_fromArchive/ ${libIGCM_POST_sed}\/rebuild_fromArchive.job/g" tmp_IGCM_sys_RshPost_$$ > tmp.txt
+#    sed "s/Script_Post_Output=/Script_Output=${POST_DIR_sed}\//g" tmp.txt > tmp_IGCM_sys_RshPost_$$
+#    \mv tmp.txt tmp_IGCM_sys_RshPost_$$
+#
+#    echo cat tmp_IGCM_sys_RshPost_$$ AFTER
+#    cat tmp_IGCM_sys_RshPost_$$
+#
+#    /bin/ksh <tmp_IGCM_sys_RshPost_$$
+#    if [ $? -gt 0 ] ; then
+#      echo "IGCM_sys_RshPost : erreur."
+#      IGCM_debug_Exit "IGCM_sys_RshPost"
+#    fi
+#    # delete temporary file
+#    \rm tmp_IGCM_sys_RshPost_$$
+#
+#  else
+#    # number of tentative
+#    NB_ESSAI=10
+#    # time delay between tentative
+#    DELAI=10
+#    i=0
+#    while [ $i -ne $NB_ESSAI ] ; do
+#      ssh -t titane996 ssh cesium /bin/ksh <tmp_IGCM_sys_RshPost_$$
+#      status=$?
+#      if [ ${status} -ne 0 ];
+#      then
+#	sleep $DELAI
+#      else
+#	break
+#      fi
+#      let i=$i+1
+#    done
+#    # delete temporary file
+#    \rm tmp_IGCM_sys_RshPost_$$
+#
+#    if [ ${status} -gt 0 ] ; then
+#      echo "IGCM_sys_RshPost : erreur."
+#      IGCM_debug_Exit "IGCM_sys_RshPost"
+#    fi
+#  fi
+
+# ============ CESIUM  END  ============ #
+
+  IGCM_debug_PopStack "IGCM_sys_RshPost"
 }
 
@@ -227,16 +329,16 @@
 #D-
 function IGCM_sys_SendMail {
-    IGCM_debug_PushStack "IGCM_sys_SendMail" $@
-    if ( $DEBUG_sys ) ; then
-       echo "IGCM_sys_SendMail :" $@
-    fi
-
-    if ( ${ExitFlag} ) ; then
-	status=failed
-    else
-	status=completed
-    fi
-
-    cat  << END_MAIL > job_end.mail
+  IGCM_debug_PushStack "IGCM_sys_SendMail" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_SendMail :" $@
+  fi
+
+  if ( ${ExitFlag} ) ; then
+    status=failed
+  else
+    status=completed
+  fi
+
+  cat  << END_MAIL > job_end.mail
 Dear ${LOGIN},
 
@@ -245,20 +347,22 @@
   Job ended   : ${DateEnd}
   Output files are available in ${R_SAVE}
+  Files to be rebuild are temporarily available in ${REBUILD_DIR}
+  Pre-packed files are temporarily available in ${R_BUFR}
   Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR}
 END_MAIL
 
     if [ ! -z ${config_UserChoices_MailName} ] ; then
-	mail -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < job_end.mail
+        mail -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < job_end.mail
     elif [ -f ~/.forward ] ; then
-	mail -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
-    else
-    mail -s "${config_UserChoices_JobName} ${status}" ${USER} < job_end.mail
-    fi
-
-    if [ $? -gt 0 ] ; then
-	echo "IGCM_sys_SendMail : erreur."
-	IGCM_debug_Exit "IGCM_sys_SendMail"
-    fi
-    IGCM_debug_PopStack "IGCM_sys_SendMail"
+        mail -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
+    fi
+    sleep 10
+    rm -f job_end.mail
+
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_SendMail : erreur."
+    IGCM_debug_Exit "IGCM_sys_SendMail"
+  fi
+  IGCM_debug_PopStack "IGCM_sys_SendMail"
 }
 
@@ -269,21 +373,21 @@
 #D-
 function IGCM_sys_Mkdir {
-    IGCM_debug_PushStack "IGCM_sys_Mkdir" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_Mkdir :" $@
-    fi
-    if [ ! -d ${1} ]; then
-	\mkdir -p $1
-	if [ $? -gt 0 ] ; then
-	    echo "IGCM_sys_Mkdir : erreur."
-	    IGCM_debug_Exit "IGCM_sys_Mkdir"
-	fi
-    fi
-    # verification :
-    if [ ! -d ${1} ] ; then
-	echo "IGCM_sys_Mkdir : erreur."
-	IGCM_debug_Exit "IGCM_sys_Mkdir"
-    fi
-    IGCM_debug_PopStack "IGCM_sys_Mkdir"
+  IGCM_debug_PushStack "IGCM_sys_Mkdir" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Mkdir :" $@
+  fi
+  if [ ! -d ${1} ]; then
+    \mkdir -p $1
+    if [ $? -gt 0 ] ; then
+      echo "IGCM_sys_Mkdir : erreur."
+      IGCM_debug_Exit "IGCM_sys_Mkdir"
+    fi
+  fi
+  # vérification :
+  if [ ! -d ${1} ] ; then
+    echo "IGCM_sys_Mkdir : erreur."
+    IGCM_debug_Exit "IGCM_sys_Mkdir"
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Mkdir"
 }
 
@@ -294,17 +398,17 @@
 #D-
 function IGCM_sys_MkdirArchive {
-    IGCM_debug_PushStack "IGCM_sys_MkdirArchive" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_MkdirArchive :" $@
-    fi
-    #- creation de repertoire sur le serveur fichier
-    if [ ! -d ${1} ]; then 
-	\mkdir -p $1
-	if [ $? -gt 0 ] ; then
-	    echo "IGCM_sys_MkdirArchive : erreur."
-	    IGCM_debug_Exit "IGCM_sys_MkdirArchive"
-	fi
-    fi
-    IGCM_debug_PopStack "IGCM_sys_MkdirArchive"
+  IGCM_debug_PushStack "IGCM_sys_MkdirArchive" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_MkdirArchive :" $@
+  fi
+  #- creation de repertoire sur le serveur fichier
+  if [ ! -d ${1} ]; then
+    \mkdir -p $1
+    if [ $? -gt 0 ] ; then
+      echo "IGCM_sys_MkdirArchive : erreur."
+      IGCM_debug_Exit "IGCM_sys_MkdirArchive"
+    fi
+  fi
+  IGCM_debug_PopStack "IGCM_sys_MkdirArchive"
 }
 
@@ -315,17 +419,17 @@
 #D-
 function IGCM_sys_MkdirWork {
-    IGCM_debug_PushStack "IGCM_sys_MkdirWork" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_MkdirWork :" $@
-    fi
-    #- creation de repertoire sur le serveur fichier
-    if [ ! -d ${1} ]; then 
-	\mkdir -p $1
-	if [ $? -gt 0 ] ; then
-	    echo "IGCM_sys_MkdirWork : erreur."
-	    IGCM_debug_Exit "IGCM_sys_MkdirWork"
-	fi
-    fi
-    IGCM_debug_PopStack "IGCM_sys_MkdirWork"
+  IGCM_debug_PushStack "IGCM_sys_MkdirWork" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_MkdirWork :" $@
+  fi
+  #- creation de repertoire sur le serveur fichier
+  if [ ! -d ${1} ]; then
+    \mkdir -p $1
+    if [ $? -gt 0 ] ; then
+      echo "IGCM_sys_MkdirWork : erreur."
+      IGCM_debug_Exit "IGCM_sys_MkdirWork"
+    fi
+  fi
+  IGCM_debug_PopStack "IGCM_sys_MkdirWork"
 }
 
@@ -336,14 +440,14 @@
 #D-
 function IGCM_sys_Cd {
-    IGCM_debug_PushStack "IGCM_sys_Cd" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_Cd :" $@
-    fi
-    \cd $1
-    if [ $? -gt 0 ] ; then
-	echo "IGCM_sys_Cd : erreur."
-	IGCM_debug_Exit "IGCM_sys_Cd"
-    fi
-    IGCM_debug_PopStack "IGCM_sys_Cd"
+  IGCM_debug_PushStack "IGCM_sys_Cd" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Cd :" $@
+  fi
+  \cd $1
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_Cd : erreur."
+    IGCM_debug_Exit "IGCM_sys_Cd"
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Cd"
 }
 
@@ -354,18 +458,18 @@
 #D-
 function IGCM_sys_Chmod {
-    IGCM_debug_PushStack "IGCM_sys_Chmod" -- $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_Chmod :" $@
-    fi
-    if [ $DRYRUN -le 1 ]; then
-	\chmod $@
-	if [ $? -gt 0 ] ; then
-	    echo "IGCM_sys_Chmod : erreur."
-	    IGCM_debug_Exit "IGCM_sys_Chmod"
-	fi
-    else
-	( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-    fi
-    IGCM_debug_PopStack "IGCM_sys_Chmod"
+  IGCM_debug_PushStack "IGCM_sys_Chmod" -- $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Chmod :" $@
+  fi
+  if [ $DRYRUN -le 1 ]; then
+    \chmod $@
+    if [ $? -gt 0 ] ; then
+      echo "IGCM_sys_Chmod : erreur."
+      IGCM_debug_Exit "IGCM_sys_Chmod"
+    fi
+  else
+    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Chmod"
 }
 
@@ -376,14 +480,14 @@
 #D-
 function IGCM_sys_FileSize {
-    IGCM_debug_PushStack "IGCM_sys_FileSize" $@
-
-    typeset sizeF
-    set +A sizeF -- $( ls -la ${1} )
-    if [ $? -gt 0 ] ; then
-	IGCM_debug_Exit "IGCM_sys_FileSize"
-    fi
-    eval ${2}=${sizeF[4]}
-
-    IGCM_debug_PopStack "IGCM_sys_FileSize"
+  IGCM_debug_PushStack "IGCM_sys_FileSize" $@
+
+  typeset sizeF
+  set +A sizeF -- $( ls -la ${1} )
+  if [ $? -gt 0 ] ; then
+    IGCM_debug_Exit "IGCM_sys_FileSize"
+  fi
+  eval ${2}=${sizeF[4]}
+
+  IGCM_debug_PopStack "IGCM_sys_FileSize"
 }
 
@@ -394,13 +498,13 @@
 #D-
 function IGCM_sys_TestDir {
-    IGCM_debug_PushStack "IGCM_sys_TestDir" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_TestDir :" $@
-    fi
-    typeset ExistFlag
-    ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
-    IGCM_debug_PopStack "IGCM_sys_TestDir"
-
-    return ${ExistFlag}
+  IGCM_debug_PushStack "IGCM_sys_TestDir" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_TestDir :" $@
+  fi
+  typeset ExistFlag
+  ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
+  IGCM_debug_PopStack "IGCM_sys_TestDir"
+
+  return ${ExistFlag}
 }
 
@@ -411,13 +515,30 @@
 #D-
 function IGCM_sys_TestDirArchive {
-    IGCM_debug_PushStack "IGCM_sys_TestDirArchive" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_TestDirArchive :" $@
-    fi
-    typeset ExistFlag
-    ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
-    IGCM_debug_PopStack "IGCM_sys_TestDirArchive"
-
-    return ${ExistFlag}
+  IGCM_debug_PushStack "IGCM_sys_TestDirArchive" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_TestDirArchive :" $@
+  fi
+  typeset ExistFlag
+  ExistFlag=$( [ -d $1 ] && echo 0 || echo 1 )
+  IGCM_debug_PopStack "IGCM_sys_TestDirArchive"
+
+  return ${ExistFlag}
+}
+
+#D-#==================================================
+#D-function IGCM_sys_IsFileArchived
+#D-* Purpose: Test file that must NOT EXISTS on Archive
+#D-* Examples:
+#D-
+function IGCM_sys_IsFileArchived {
+  IGCM_debug_PushStack "IGCM_sys_IsFileArchived" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_IsFileArchived :" $@
+  fi
+  typeset IsArchivedFlag
+  IsArchivedFlag=$( [ X$( echo $1 | grep ^\/ccc\/store ) != X ] && echo 0 || echo 1 )
+  IGCM_debug_PopStack "IGCM_sys_IsFileArchived"
+
+  return ${IsArchivedFlag}
 }
 
@@ -428,10 +549,27 @@
 #D-
 function IGCM_sys_TestFileArchive {
-    IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@
-    typeset ExistFlag
-    ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
-    IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
-
-    return ${ExistFlag}
+  IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_TestFileArchive :" $@
+  fi
+  typeset ExistFlag
+  ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
+  IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
+
+  return ${ExistFlag}
+}
+
+#D-#==================================================
+#D-function IGCM_sys_TestFileBuffer
+#D-* Purpose: Test file that must NOT EXISTS on Buffer
+#D-* Examples:
+#D-
+function IGCM_sys_TestFileBuffer {
+  IGCM_debug_PushStack "IGCM_sys_TestFileBuffer" $@
+  typeset ExistFlag
+  ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
+  IGCM_debug_PopStack "IGCM_sys_TestFileBuffer"
+
+  return ${ExistFlag}
 }
 
@@ -442,10 +580,24 @@
 #D-
 function IGCM_sys_CountFileArchive {
-    IGCM_debug_PushStack "IGCM_sys_CountFileArchive" $@
-    ls ${@} 2>/dev/null | wc -l
-    if [ $? -gt 0 ] ; then
-	echo "IGCM_sys_CountFileArchive : erreur."
-    fi
-    IGCM_debug_PopStack "IGCM_sys_CountFileArchive"
+  IGCM_debug_PushStack "IGCM_sys_CountFileArchive" $@
+  ls ${@} 2>/dev/null | wc -l
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_CountFileArchive : erreur."
+  fi
+  IGCM_debug_PopStack "IGCM_sys_CountFileArchive"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_CountFileBuffer
+#D-* Purpose: Count files on Scratch filesystem
+#D-* Examples:
+#D-
+function IGCM_sys_CountFileBuffer {
+  IGCM_debug_PushStack "IGCM_sys_CountFileBuffer" $@
+  ls ${@} 2>/dev/null | wc -l
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_CountFileBuffer : erreur."
+  fi
+  IGCM_debug_PopStack "IGCM_sys_CountFileBuffer"
 }
 
@@ -456,30 +608,30 @@
 #D-
 function IGCM_sys_Tree {
-    IGCM_debug_PushStack "IGCM_sys_Tree" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_Tree :" $@
-    fi
-
-    \ls -lR ${@}
-
-    IGCM_debug_PopStack "IGCM_sys_Tree"
+  IGCM_debug_PushStack "IGCM_sys_Tree" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Tree :" $@
+  fi
+
+  \ls -lR ${@}
+
+  IGCM_debug_PopStack "IGCM_sys_Tree"
 }
 
 #D-#==================================================
 #D-function IGCM_sys_Tar
-#D-* Purpose: master un-tar command
+#D-* Purpose: master tar command
 #D-* Examples:
 #D-
 function IGCM_sys_Tar {
-    IGCM_debug_PushStack "IGCM_sys_Tar" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_Tar :" $@
-    fi
-    \tar xvf $1
-    if [ $? -gt 0 ] ; then
-	echo "IGCM_sys_Tar : erreur."
-	IGCM_debug_Exit "IGCM_sys_Tar"
-    fi
-    IGCM_debug_PopStack "IGCM_sys_Tar"
+  IGCM_debug_PushStack "IGCM_sys_Tar" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Tar :" $@
+  fi
+  \tar cf $@
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_Tar : erreur."
+    IGCM_debug_Exit "IGCM_sys_Tar"
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Tar"
 }
 
@@ -490,14 +642,14 @@
 #D-
 function IGCM_sys_UnTar {
-    IGCM_debug_PushStack "IGCM_sys_UnTar" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_UnTar :" $@
-    fi
-    \tar xvf $1
-    if [ $? -gt 0 ] ; then
-	echo "IGCM_sys_UnTar : erreur."
-	IGCM_debug_Exit "IGCM_sys_UnTar"
-    fi
-    IGCM_debug_PopStack "IGCM_sys_UnTar"
+  IGCM_debug_PushStack "IGCM_sys_UnTar" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_UnTar :" $@
+  fi
+  \tar xvf $1
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_UnTar : erreur."
+    IGCM_debug_Exit "IGCM_sys_UnTar"
+  fi
+  IGCM_debug_PopStack "IGCM_sys_UnTar"
 }
 
@@ -508,20 +660,21 @@
 #D-
 function IGCM_sys_Qsub {
-    IGCM_debug_PushStack "IGCM_sys_Qsub" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_Qsub :" $@
-    fi
-
-    if [ ${config_UserChoices_JobName}.${CumulPeriod} = "." ] ; then
-        /usr/bin/ccc_msub -o ${Script_Output} -e ${Script_Output} < $1
-    else
-        /usr/bin/ccc_msub -o ${Script_Output} -e ${Script_Output} -r ${config_UserChoices_JobName}.${CumulPeriod} < $1
-    fi
-
-    if [ $? -gt 0 ] ; then
-	echo "IGCM_sys_Qsub : erreur " $@
-	IGCM_debug_Exit "IGCM_sys_Qsub"
-    fi
-    IGCM_debug_PopStack "IGCM_sys_Qsub"
+  IGCM_debug_PushStack "IGCM_sys_Qsub" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Qsub :" $@
+  fi
+  typeset options
+  if [ ${config_UserChoices_JobName}.${CumulPeriod} = "." ] ; then
+    options=" -o ${Script_Output} -e ${Script_Output}"
+  else
+    options=" -o ${Script_Output} -e ${Script_Output} -r ${config_UserChoices_JobName}.${CumulPeriod}"
+  fi
+
+  /usr/local/bin/ccc_msub ${options} < $1
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_Qsub : erreur ${options} $1"
+    IGCM_debug_Exit "IGCM_sys_Qsub"
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Qsub"
 }
 
@@ -532,18 +685,18 @@
 #D-
 function IGCM_sys_QsubPost {
-    IGCM_debug_PushStack "IGCM_sys_QsubPost" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_QsubPost :" $@
-    fi
-    /usr/bin/ccc_msub -o ${POST_DIR}/${Script_Post_Output}.out -e ${POST_DIR}/${Script_Post_Output}.out ${libIGCM_POST}/$1.job
-    if [ $? -gt 0 ] ; then
-	echo "IGCM_sys_QsubPost : erreur " $@
-	IGCM_debug_Exit "IGCM_sys_QsubPost"
-    fi
-    IGCM_debug_PopStack "IGCM_sys_QsubPost"
+  IGCM_debug_PushStack "IGCM_sys_QsubPost" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_QsubPost :" $@
+  fi
+  /usr/bin/ccc_msub -o ${POST_DIR}/${Script_Post_Output}.out -e ${POST_DIR}/${Script_Post_Output}.out ${libIGCM_POST}/$1.job
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_QsubPost : erreur " $@
+    IGCM_debug_Exit "IGCM_sys_QsubPost"
+  fi
+  IGCM_debug_PopStack "IGCM_sys_QsubPost"
 }
 
 #D-*************************
-#D- File transfer functions 
+#D- File transfer functions
 #D-*************************
 #D-
@@ -555,108 +708,107 @@
 #D-  Error values and explanations can depend on your system version.
 function IGCM_sys_Rsync_out {
-    RET=$1
-    if [ ! $RET ] ; then
-	echo "rsync error !"
-    fi
-
-    if [ $MYLANG = "fr" ]; then
-	case $RET in
-	    0)  return ;;
-	    1)  echo "Erreur de rsync ; RERR_SYNTAX : "
-		echo "Erreur de syntaxe ou d'utilisation."
-		return;;
-	    2)  echo "Erreur de rsync ; RERR_PROTOCOL : "
-		echo "Incompatibilité de protocole."
-		return;;
-	    3)  echo "Erreur de rsync ; RERR_FILESELECT 3"
-		echo "Erreurs  lors  de  la  sélection des fichiers d'entrée sortie et"
-		echo "répertoires"
-		return;;
-	    4)  echo "Erreur de rsync ; RERR_UNSUPPORTED"
-		echo "Action demandée non supportée : une tentative de manipulation de"
-		echo "fichiers  64-bits  sur une plate-forme qui ne les supporte pas a"
-		echo "été faite ; ou une option qui est supportée par le  client  mais"
-		echo "pas par le serveur a été spécifiée."
-		return;;
-	    10) echo "Erreur de rsync ; RERR_SOCKETIO"
-		echo "Erreur dans le socket d'entrée sortie"
-		return;;
-	    11) echo "Erreur de rsync ; RERR_FILEIO"
-		echo "Erreur d'entrée sortie fichier"
-		return;;
-	    12) echo "Erreur de rsync ; RERR_STREAMIO"
-		echo "Erreur dans flux de donnée du protocole rsync"
-		return;;
-	    13) echo "Erreur de rsync ; RERR_MESSAGEIO"
-		echo "Erreur avec les diagnostics du programme"
-		return;;
-	    14) echo "Erreur de rsync ; RERR_IPC"
-		echo "Erreur dans le code IPC"
-		return;;
-	    20) echo "Erreur de rsync ; RERR_SIGNAL"
-		echo "SIGUSR1 ou SIGINT reçu"
-		return;;
-	    21) echo "Erreur de rsync ; RERR_WAITCHILD"
-		echo "Une erreur retournée par waitpid()"
-		return;;
-	    22) echo "Erreur de rsync ; RERR_MALLOC"
-		echo "Erreur lors de l'allocation des tampons de mémoire de coeur"
-		return;;
-	    23) echo ""
-                echo "Erreur fichier inexistant"
-		return;;
-	    30) echo "Erreur de rsync ; RERR_TIMEOUT"
-		echo "Temps d'attente écoulé dans l'envoi/réception de données"
-		return;;
-	    *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $RET
-		return;;
-	esac
-    elif [ $MYLANG = "en" ] ; then
-	case $RET in
-	    0)  return;;		
-	    1)  echo "rsync error : Syntax or usage error "
-		return;;
-	    2)  echo "rsync error : Protocol incompatibility "
-		return;;
-	    3)  echo "rsync error : Errors selecting input/output files, dirs"
-		return;;
-	    4)  echo "rsync error : Requested action not supported: an attempt"
-		echo "was made to manipulate 64-bit files on a platform that cannot support"
-		echo "them; or an option was specified that is supported by the client and"
-		echo "not by the server."
-		return;;
-	    5)  echo "rsync error : Error starting client-server protocol"
-		return;;
-	    10) echo "rsync error : Error in socket I/O "
-		return;;
-	    11) echo "rsync error : Error in file I/O "
-		return;;
-	    12) echo "rsync error : Error in rsync protocol data stream "
-		return;;
-	    13) echo "rsync error : Errors with program diagnostics "
-		return;;
-	    14) echo "rsync error : Error in IPC code "
-		return;;
-	    20) echo "rsync error : Received SIGUSR1 or SIGINT "
-		return;;
-	    21) echo "rsync error : Some error returned by waitpid() "
-		return;;
-	    22) echo "rsync error : Error allocating core memory buffers "
-		return;;
-	    23) echo "rsync error : Partial transfer due to error"
-		return;;
-	    24) echo "rsync error : Partial transfer due to vanished source files"
-		return;;
-	    30) echo "rsync error : Timeout in data send/receive "
-		return;;
-	    *)  echo "rsync error : return code of rsync unknown :" $RET
-		return;;
-	esac
-    else
-	echo "unknown language $MYLANG."
-	return
-    fi
-}
-    
+  RET=$1
+  if [ ! $RET ] ; then
+    echo "rsync error !"
+  fi
+
+  if [ $MYLANG = "fr" ]; then
+    case $RET in
+    0)  return ;;
+    1)  echo "Erreur de rsync ; RERR_SYNTAX : "
+      echo "Erreur de syntaxe ou d'utilisation."
+      return;;
+    2)  echo "Erreur de rsync ; RERR_PROTOCOL : "
+      echo "Incompatibilité de protocole."
+      return;;
+    3)  echo "Erreur de rsync ; RERR_FILESELECT 3"
+      echo "Erreurs  lors  de  la  sélection des fichiers d'entrée sortie et"
+      echo "répertoires"
+      return;;
+    4)  echo "Erreur de rsync ; RERR_UNSUPPORTED"
+      echo "Action demandée non supportée : une tentative de manipulation de"
+      echo "fichiers  64-bits  sur une plate-forme qui ne les supporte pas a"
+      echo "été faite ; ou une option qui est supportée par le  client  mais"
+      echo "pas par le serveur a été spécifiée."
+      return;;
+    10) echo "Erreur de rsync ; RERR_SOCKETIO"
+      echo "Erreur dans le socket d'entrée sortie"
+      return;;
+    11) echo "Erreur de rsync ; RERR_FILEIO"
+      echo "Erreur d'entrée sortie fichier"
+      return;;
+    12) echo "Erreur de rsync ; RERR_STREAMIO"
+      echo "Erreur dans flux de donnée du protocole rsync"
+      return;;
+    13) echo "Erreur de rsync ; RERR_MESSAGEIO"
+      echo "Erreur avec les diagnostics du programme"
+      return;;
+    14) echo "Erreur de rsync ; RERR_IPC"
+      echo "Erreur dans le code IPC"
+      return;;
+    20) echo "Erreur de rsync ; RERR_SIGNAL"
+      echo "SIGUSR1 ou SIGINT reçu"
+      return;;
+    21) echo "Erreur de rsync ; RERR_WAITCHILD"
+      echo "Une erreur retournée par waitpid()"
+      return;;
+    22) echo "Erreur de rsync ; RERR_MALLOC"
+      echo "Erreur lors de l'allocation des tampons de mémoire de coeur"
+      return;;
+    23) echo ""
+      echo "Erreur fichier inexistant"
+      return;;
+    30) echo "Erreur de rsync ; RERR_TIMEOUT"
+      echo "Temps d'attente écoulé dans l'envoi/réception de données"
+      return;;
+    *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $RET
+      return;;
+    esac
+  elif [ $MYLANG = "en" ] ; then
+    case $RET in
+    0)  return;;
+    1)  echo "rsync error : Syntax or usage error "
+      return;;
+    2)  echo "rsync error : Protocol incompatibility "
+      return;;
+    3)  echo "rsync error : Errors selecting input/output files, dirs"
+      return;;
+    4)  echo "rsync error : Requested action not supported: an attempt"
+      echo "was made to manipulate 64-bit files on a platform that cannot support"
+      echo "them; or an option was specified that is supported by the client and"
+      echo "not by the server."
+      return;;
+    5)  echo "rsync error : Error starting client-server protocol"
+      return;;
+    10) echo "rsync error : Error in socket I/O "
+      return;;
+    11) echo "rsync error : Error in file I/O "
+      return;;
+    12) echo "rsync error : Error in rsync protocol data stream "
+      return;;
+    13) echo "rsync error : Errors with program diagnostics "
+      return;;
+    14) echo "rsync error : Error in IPC code "
+      return;;
+    20) echo "rsync error : Received SIGUSR1 or SIGINT "
+      return;;
+    21) echo "rsync error : Some error returned by waitpid() "
+      return;;
+    22) echo "rsync error : Error allocating core memory buffers "
+      return;;
+    23) echo "rsync error : Partial transfer due to error"
+      return;;
+    24) echo "rsync error : Partial transfer due to vanished source files"
+      return;;
+    30) echo "rsync error : Timeout in data send/receive "
+      return;;
+    *)  echo "rsync error : return code of rsync unknown :" $RET
+      return;;
+    esac
+  else
+    echo "unknown language $MYLANG."
+    return
+  fi
+}
 
 #D-#==================================================
@@ -666,22 +818,22 @@
 #D-
 function IGCM_sys_Mirror_libIGCM {
-    IGCM_debug_PushStack "IGCM_sys_Mirror_libIGCM"
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_Mirror_libIGCM"
-    fi
-
-    typeset RET DEST
-
-    mkdir -p ${HOME}/MIRROR/${PATHlibIGCM}
-
-    echo ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} > out_rsync 2>&1
-    ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} >> out_rsync 2>&1
-    RET=$?
-
-    if [ ${RET} -gt 0 ] ; then
-	echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on cesium."
-	cat out_rsync
-    fi
-    IGCM_debug_PopStack "IGCM_sys_Mirror_libIGCM"
+  IGCM_debug_PushStack "IGCM_sys_Mirror_libIGCM"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Mirror_libIGCM"
+  fi
+
+  typeset RET DEST
+
+  mkdir -p ${HOME}/MIRROR/${PATHlibIGCM}
+
+  echo ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} > out_rsync 2>&1
+  ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} >> out_rsync 2>&1
+  RET=$?
+
+  if [ ${RET} -gt 0 ] ; then
+    echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on cesium."
+    cat out_rsync
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Mirror_libIGCM"
 }
 
@@ -689,5 +841,5 @@
 #- Call IGCM_sys_Mirror_libIGCM now !
 if ( $MirrorlibIGCM ) ; then
-    IGCM_sys_Mirror_libIGCM
+  IGCM_sys_Mirror_libIGCM
 fi
 
@@ -698,23 +850,23 @@
 #D-
 function IGCM_sys_Cp {
-    IGCM_debug_PushStack "IGCM_sys_Cp" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_Cp :" $@
-    fi
-
-    typeset RET
-
-    echo cp $@ > out_rsync 2>&1
-    \cp $@ >> out_rsync 2>&1
-    RET=$?
-
-    if [ ${RET} -gt 0 ] ; then
-	echo "IGCM_sys_Cp : error."
-	cat out_rsync
-	IGCM_debug_Exit "IGCM_sys_Cp"
-     else
-	 \rm out_rsync
-    fi
-    IGCM_debug_PopStack "IGCM_sys_Cp"
+  IGCM_debug_PushStack "IGCM_sys_Cp" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Cp :" $@
+  fi
+
+  typeset RET
+
+  echo cp $@ > out_rsync 2>&1
+  \cp $@ >> out_rsync 2>&1
+  RET=$?
+
+  if [ ${RET} -gt 0 ] ; then
+    echo "IGCM_sys_Cp : error."
+    cat out_rsync
+    IGCM_debug_Exit "IGCM_sys_Cp"
+  else
+    \rm out_rsync
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Cp"
 }
 
@@ -725,23 +877,23 @@
 #D-
 function IGCM_sys_Rm {
-    IGCM_debug_PushStack "IGCM_sys_Rm" -- $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_Rm :" $@
-    fi
-
-    typeset RET
-
-    echo rm $@ > out_rsync 2>&1
-    \rm $@ >> out_rsync 2>&1
-    RET=$?
-
-    if [ ${RET} -gt 0 ] ; then
-	echo "IGCM_sys_Rm : error."
-	cat out_rsync
-	IGCM_debug_Exit "IGCM_sys_Rm"
-    else
-	\rm out_rsync
-    fi
-    IGCM_debug_PopStack "IGCM_sys_Rm"
+  IGCM_debug_PushStack "IGCM_sys_Rm" -- $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Rm :" $@
+  fi
+
+  typeset RET
+
+  echo rm $@ > out_rsync 2>&1
+  \rm $@ >> out_rsync 2>&1
+  RET=$?
+
+  if [ ${RET} -gt 0 ] ; then
+    echo "IGCM_sys_Rm : error."
+    cat out_rsync
+    IGCM_debug_Exit "IGCM_sys_Rm"
+  else
+    \rm out_rsync
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Rm"
 }
 
@@ -753,24 +905,23 @@
 #D-
 function IGCM_sys_RmRunDir {
-    IGCM_debug_PushStack "IGCM_sys_RmRunDir" -- $@
-    if ( $DEBUG_sys ) ; then
-        echo "IGCM_sys_RmRunDir :" $@
-    fi
-
-    typeset RET
-
-    echo rm $@ > out_rsync 2>&1
-    \rm $@ >> out_rsync 2>&1
-    RET=$?
-
-    if [ ${RET} -gt 0 ] ; then
-        echo "IGCM_sys_RmRunDir : error."
-        cat out_rsync
-        IGCM_debug_Exit "IGCM_sys_RmRunDir"
-    else
-        \rm out_rsync
-    fi
-
-    IGCM_debug_PopStack "IGCM_sys_RmRunDir"
+  IGCM_debug_PushStack "IGCM_sys_RmRunDir" -- $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_RmRunDir :" $@
+  fi
+
+  typeset RET
+
+  echo rm $@ > out_rsync 2>&1
+  \rm $@ >> out_rsync 2>&1
+  RET=$?
+
+  if [ ${RET} -gt 0 ] ; then
+    echo "IGCM_sys_RmRunDir : error."
+    cat out_rsync
+    IGCM_debug_Exit "IGCM_sys_RmRunDir"
+  else
+    \rm out_rsync
+  fi
+  IGCM_debug_PopStack "IGCM_sys_RmRunDir"
 }
 
@@ -781,29 +932,29 @@
 #D-
 function IGCM_sys_Mv {
-    IGCM_debug_PushStack "IGCM_sys_Mv" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_Mv :" $@
-    fi
-
-    if [ $DRYRUN = 0 ]; then
-
-        typeset RET
-            
-        echo mv $@ > out_rsync 2>&1
-        \mv $@ >> out_rsync 2>&1
-        RET=$?
-    
-        if [ ${RET} -gt 0 ] ; then
-            echo "IGCM_sys_Mv : error in mv."
-            cat out_rsync
-            IGCM_debug_Exit "IGCM_sys_Mv"
-	else
-	    \rm out_rsync
-        fi
+  IGCM_debug_PushStack "IGCM_sys_Mv" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Mv :" $@
+  fi
+
+  if [ $DRYRUN = 0 ]; then
+
+    typeset RET
+
+    echo mv $@ > out_rsync 2>&1
+    \mv $@ >> out_rsync 2>&1
+    RET=$?
+
+    if [ ${RET} -gt 0 ] ; then
+      echo "IGCM_sys_Mv : error in mv."
+      cat out_rsync
+      IGCM_debug_Exit "IGCM_sys_Mv"
     else
-        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-    fi
-
-    IGCM_debug_PopStack "IGCM_sys_Mv"
+      \rm out_rsync
+    fi
+  else
+    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
+  fi
+
+  IGCM_debug_PopStack "IGCM_sys_Mv"
 }
 
@@ -814,76 +965,76 @@
 #D-
 function IGCM_sys_Put_Dir {
-    IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_Put_Dir :" $@
-    fi
-    if [ $DRYRUN = 0 ]; then
-	if [ ! -d ${1} ] ; then
-	    echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ."
-	    IGCM_debug_PopStack "IGCM_sys_Put_Dir"
-	    return
-	fi
-
-	typeset RET
-
-	# Only if we use rsync
-	#IGCM_sys_TestDirArchive $( dirname $2 )
-	#
-	#USUAL WAY
-	\cp -r $1 $2 > out_rsync 2>&1
-  	RET=$?
-
-	if [ ${RET} -gt 0 ] ; then
-	    echo "IGCM_sys_Put_Dir : error."
-	    cat out_rsync
-	    IGCM_debug_Exit "IGCM_sys_Put_Dir"
-	else
-	    \rm out_rsync
-	fi
+  IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Put_Dir :" $@
+  fi
+  if [ $DRYRUN = 0 ]; then
+    if [ ! -d ${1} ] ; then
+      echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ."
+      IGCM_debug_PopStack "IGCM_sys_Put_Dir"
+      return
+    fi
+
+    typeset RET
+
+    # Only if we use rsync
+    #IGCM_sys_TestDirArchive $( dirname $2 )
+    #
+    #USUAL WAY
+    \cp -r $1 $2 > out_rsync 2>&1
+    RET=$?
+
+    if [ ${RET} -gt 0 ] ; then
+      echo "IGCM_sys_Put_Dir : error."
+      cat out_rsync
+      IGCM_debug_Exit "IGCM_sys_Put_Dir"
     else
-	( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-    fi
-    IGCM_debug_PopStack "IGCM_sys_Put_Dir"
+      \rm out_rsync
+    fi
+  else
+    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Put_Dir"
 }
 
 #D-#==================================================
 #D-function IGCM_sys_Get_Dir
-#D-* Purpose: Copy a complete directory from $(ARCHIVE)
+#D-* Purpose: Copy a complete directory from ${ARCHIVE}
 #D-* Examples:
 #D-
 function IGCM_sys_Get_Dir {
-    IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_Get_Dir :" $@
-    fi
-    if [ $DRYRUN = 0 ]; then
-#	if [ ! -d ${1} ] ; then
-#	    echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
-#	    IGCM_debug_PopStack "IGCM_sys_Get_Dir"
-#	    return
-#	fi
-
-	typeset RET
-
-	# Only if we use rsync
-	#IGCM_sys_TestDirArchive $( dirname $2 )
-	#
-	#USUAL WAY
+  IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Get_Dir :" $@
+  fi
+  if [ $DRYRUN = 0 ]; then
+#    if [ ! -d ${1} ] ; then
+#      echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
+#      IGCM_debug_PopStack "IGCM_sys_Get_Dir"
+#      return
+#    fi
+
+    typeset RET
+
+        # Only if we use rsync
+        #IGCM_sys_TestDirArchive $( dirname $2 )
+        #
+        #USUAL WAY
         # add get (to demigrate all offline files) to reduce time of this command :
-        ccc_hsm get $1/*
-	\cp -r $1 $2 > out_rsync 2>&1
-  	RET=$?
-
-	if [ ${RET} -gt 0 ] ; then
-	    echo "IGCM_sys_Get_Dir : error."
-	    cat out_rsync
-	    IGCM_debug_Exit "IGCM_sys_Get_Dir"
-	else
-	    \rm out_rsync
-	fi
+    ccc_hsm get $1/*
+    \cp -r $1 $2 > out_rsync 2>&1
+    RET=$?
+
+    if [ ${RET} -gt 0 ] ; then
+      echo "IGCM_sys_Get_Dir : error."
+      cat out_rsync
+      IGCM_debug_Exit "IGCM_sys_Get_Dir"
     else
-	( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-    fi
-    IGCM_debug_PopStack "IGCM_sys_Get_Dir"
+      \rm out_rsync
+    fi
+  else
+    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Get_Dir"
 }
 
@@ -894,159 +1045,246 @@
 #D-
 function IGCM_sys_Get_Master {
-    IGCM_debug_PushStack "IGCM_sys_Get_Master" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_Get_Master :" $@
-    fi
-    if [ $DRYRUN = 0 ]; then
-	if [ ! -d ${1} ] ; then
-	    echo "WARNING : IGCM_sys_Get_Master ${1} DOES NOT EXIST ."
-	    IGCM_debug_PopStack "IGCM_sys_Get_Master"
-	    return
-	fi
-
-	typeset RET
-
-	#USUAL WAY
-	\cp -r $1 $2 > out_rsync 2>&1
-  	RET=$?
-
-	if [ ${RET} -gt 0 ] ; then
-	    echo "IGCM_sys_Get_Master : error."
-	    cat out_rsync
-	    IGCM_debug_Exit "IGCM_sys_Get_Master"
-	fi
+  IGCM_debug_PushStack "IGCM_sys_Get_Master" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Get_Master :" $@
+  fi
+  if [ $DRYRUN = 0 ]; then
+    if [ ! -d ${1} ] ; then
+      echo "WARNING : IGCM_sys_Get_Master ${1} DOES NOT EXIST ."
+      IGCM_debug_PopStack "IGCM_sys_Get_Master"
+      return
+    fi
+
+    typeset RET
+
+    #USUAL WAY
+    \cp -r $1 $2 > out_rsync 2>&1
+    RET=$?
+
+    if [ ${RET} -gt 0 ] ; then
+      echo "IGCM_sys_Get_Master : error."
+      cat out_rsync
+      IGCM_debug_Exit "IGCM_sys_Get_Master"
     else
-	( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-    fi
-    IGCM_debug_PopStack "IGCM_sys_Get_Master"
+      \rm out_rsync
+    fi
+  else
+    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Get_Master"
 }
 
 #D-#==================================================
 #D-function IGCM_sys_Put_Rest
-#D-* Purpose: Put computied restarts on $(ARCHIVE).
+#D-* Purpose: Put computied restarts on ${ARCHIVE}.
 #D-           File and target directory must exist.
 #D-* Examples:
 #D-
 function IGCM_sys_Put_Rest {
-    IGCM_debug_PushStack "IGCM_sys_Put_Rest" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_Put_Rest :" $@
-    fi
-    if [ $DRYRUN = 0 ]; then
-	if [ ! -f ${1} ] ; then
-	    echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ."
-	    IGCM_debug_Exit "IGCM_sys_Put_Rest"
-	fi
-
-	typeset RET
-	#
-	if [ X${JobType} = XRUN ] ; then
-	    IGCM_sys_Chmod 444 ${1}
-	fi
-	#
-	IGCM_sys_TestDirArchive $( dirname $2 )
-	#
-	# USUAL WAY
-	\cp $1 $2 > out_rsync 2>&1
-        RET=$?
-
-# 	#RSYNC WITH NETWORK SSH CALL
-# 	echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} > out_rsync 2>&1
-# 	${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} >> out_rsync 2>&1
-
-#  	#RSYNC WITH NFS USE
-#  	echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
-#  	${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
-
-#  	RET=$?
-#  	IGCM_sys_Rsync_out $RET
-
-#  	${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#  	(( RET=RET+$? ))
-
-	if [ ${RET} -gt 0 ] ; then
-	    echo "IGCM_sys_Put_Rest : error."
-	    cat out_rsync
-	    IGCM_debug_Exit "IGCM_sys_Put_Rest"
-	else
-	    \rm out_rsync
-	fi
+  IGCM_debug_PushStack "IGCM_sys_Put_Rest" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Put_Rest :" $@
+  fi
+  if [ $DRYRUN = 0 ]; then
+    if [ ! -f ${1} ] ; then
+      echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ."
+      IGCM_debug_Exit "IGCM_sys_Put_Rest"
+    fi
+
+    typeset RET
+    #
+    if [ X${JobType} = XRUN ] ; then
+      IGCM_sys_Chmod 444 ${1}
+    fi
+
+    #
+    # USUAL WAY
+    \cp $1 $2 > out_rsync 2>&1
+    RET=$?
+
+#       #RSYNC WITH NETWORK SSH CALL
+#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
+#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
+
+#       #RSYNC WITH NFS USE
+#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
+#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
+
+#       RET=$?
+#       IGCM_sys_Rsync_out $RET
+
+#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
+#       (( RET=RET+$? ))
+
+    if [ ${RET} -gt 0 ] ; then
+      echo "IGCM_sys_Put_Rest : error."
+      cat out_rsync
+      IGCM_debug_Exit "IGCM_sys_Put_Rest"
     else
-	( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-    fi
-    IGCM_debug_PopStack "IGCM_sys_Put_Rest"
+      \rm out_rsync
+    fi
+  else
+    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Put_Rest"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_PutBuffer_Rest
+#D-* Purpose: Put computied restarts on ${SCRATCHDIR}.
+#D-           File and target directory must exist.
+#D-* Examples:
+#D-
+function IGCM_sys_PutBuffer_Rest {
+  IGCM_debug_PushStack "IGCM_sys_PutBuffer_Rest" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_PutBuffer_Rest :" $@
+  fi
+  if [ $DRYRUN = 0 ]; then
+    if [ ! -f ${1} ] ; then
+      echo "ERROR : IGCM_sys_PutBuffer_Rest ${1} DOES NOT EXIST ."
+      IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"
+    fi
+
+    typeset RET
+    #
+    if [ X${JobType} = XRUN ] ; then
+      IGCM_sys_Chmod 444 ${1}
+    fi
+
+    #
+    # USUAL WAY
+    \cp $1 $2 > out_rsync 2>&1
+    RET=$?
+
+    if [ ${RET} -gt 0 ] ; then
+      echo "IGCM_sys_PutBuffer_Rest : error."
+      cat out_rsync
+      IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"
+    else
+      \rm out_rsync
+    fi
+  else
+    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
+  fi
+  IGCM_debug_PopStack "IGCM_sys_PutBuffer_Rest"
 }
 
 #D-#==================================================
 #D-function IGCM_sys_Put_Out
-#D-* Purpose: Copy a file on $(ARCHIVE) after have chmod it in readonly
+#D-* Purpose: Copy a file on ${ARCHIVE} after having chmod it in readonly
 #D-* Examples:
 #D-
 function IGCM_sys_Put_Out {
-    IGCM_debug_PushStack "IGCM_sys_Put_Out" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_Put_Out :" $@
-    fi
-    if [ $DRYRUN = 0 ]; then
-	if [ ! -f ${1} ] ; then
-	    echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ."
-	    IGCM_debug_PopStack "IGCM_sys_Put_Out"
-	    return 1
-	fi
-	#
-	IGCM_sys_MkdirArchive $( dirname $2 )
-        #
-	typeset RET
-
-	#=====================================================
-        #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
-        #=====================================================
-
-	#echo ${2} | grep "${R_OUT}" > /dev/null 2>&1
-	#if [ $? -eq 0 ] ; then
-	#    typeset WORKPATH FILEPATH
-	#    WORKPATH=$( dirname $2 | sed -e "s|${R_OUT}|${R_OUT_SCR}|" )
-	#    IGCM_sys_MkdirWork ${WORKPATH} 
-	#    FILEPATH=${WORKPATH}/$( basename $2 )
-        #    #
-	#    IGCM_sys_Cp ${1} ${FILEPATH}
-	#fi
-
-	if [ X${JobType} = XRUN ] ; then
-	    if [ X${3} = X ] ; then
-		IGCM_sys_Chmod 444 ${1}
-	    fi
-	fi
-	#
-        # USUAL WAY
-	\cp $1 $2 > out_rsync 2>&1
-	RET=$?
-
-# 	#RSYNC WITH NETWORK SSH CALL
-# 	echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} > out_rsync 2>&1
-# 	${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} >> out_rsync 2>&1
-
-#  	#RSYNC WITH NFS USE
-#  	echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
-#  	${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
-
-#  	RET=$?
-#  	IGCM_sys_Rsync_out $RET
-
-#  	${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#  	(( RET=RET+$? ))
-
-	if [ ${RET} -gt 0 ] ; then
-	    echo "IGCM_sys_Put_Out : error."
-	    cat out_rsync
-	    IGCM_debug_Exit "IGCM_sys_Put_Out"
-	else
-	    \rm out_rsync
-	fi
+  IGCM_debug_PushStack "IGCM_sys_Put_Out" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Put_Out :" $@
+  fi
+  if [ $DRYRUN = 0 ]; then
+    if [ ! -f ${1} ] ; then
+      echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ."
+      IGCM_debug_PopStack "IGCM_sys_Put_Out"
+      return 1
+    fi
+    #
+    IGCM_sys_MkdirArchive $( dirname $2 )
+    #
+    typeset RET
+
+    #=====================================================
+    #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
+    #=====================================================
+
+    #echo ${2} | grep "${R_OUT}" > /dev/null 2>&1
+    #if [ $? -eq 0 ] ; then
+    #    typeset WORKPATH FILEPATH
+    #    WORKPATH=$( dirname $2 | sed -e "s|${R_OUT}|${R_BUF}|" )
+    #    IGCM_sys_MkdirWork ${WORKPATH}
+    #    FILEPATH=${WORKPATH}/$( basename $2 )
+    #    #
+    #    IGCM_sys_Cp ${1} ${FILEPATH}
+    #fi
+
+    if [ X${JobType} = XRUN ] ; then
+      if [ X${3} = X ] ; then
+        IGCM_sys_Chmod 444 ${1}
+      fi
+    fi
+    #
+    # USUAL WAY
+    \cp $1 $2 > out_rsync 2>&1
+    RET=$?
+
+#       #RSYNC WITH NETWORK SSH CALL
+#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
+#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
+
+#       #RSYNC WITH NFS USE
+#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
+#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
+
+#       RET=$?
+#       IGCM_sys_Rsync_out $RET
+
+#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
+#       (( RET=RET+$? ))
+
+    if [ ${RET} -gt 0 ] ; then
+      echo "IGCM_sys_Put_Out : error."
+      cat out_rsync
+      IGCM_debug_Exit "IGCM_sys_Put_Out"
     else
-	( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-    fi
-    IGCM_debug_PopStack "IGCM_sys_Put_Out"
-    return 0
+      \rm out_rsync
+    fi
+  else
+    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Put_Out"
+  return 0
+}
+
+#D-#==================================================
+#D-function IGCM_sys_PutBuffer_Out
+#D-* Purpose: Copy a file on ${SCRATCHDIR} after having chmod it in readonly
+#D-* Examples:
+#D-
+function IGCM_sys_PutBuffer_Out {
+  IGCM_debug_PushStack "IGCM_sys_PutBuffer_Out" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_PutBuffer_Out :" $@
+  fi
+  if [ $DRYRUN = 0 ]; then
+    if [ ! -f ${1} ] ; then
+      echo "WARNING : IGCM_sys_PutBuffer_Out ${1} DOES NOT EXIST ."
+      IGCM_debug_PopStack "IGCM_sys_PutBuffer_Out"
+      return 1
+    fi
+    #
+    IGCM_sys_Mkdir $( dirname $2 )
+    #
+    typeset RET
+
+    if [ X${JobType} = XRUN ] ; then
+      if [ X${3} = X ] ; then
+        IGCM_sys_Chmod 444 ${1}
+      fi
+    fi
+    #
+    # USUAL WAY
+    \cp $1 $2 > out_rsync 2>&1
+    RET=$?
+
+    if [ ${RET} -gt 0 ] ; then
+      echo "IGCM_sys_PutBuffer_Out : error."
+      cat out_rsync
+      IGCM_debug_Exit "IGCM_sys_PutBuffer_Out"
+    else
+      \rm out_rsync
+    fi
+  else
+    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
+  fi
+  IGCM_debug_PopStack "IGCM_sys_PutBuffer_Out"
+  return 0
 }
 
@@ -1057,114 +1295,160 @@
 #D-            IGCM_sys_Get /l Array_contain_myfiles /destpath/
 function IGCM_sys_Get {
-    IGCM_debug_PushStack "IGCM_sys_Get" $@
-
-    typeset DEST RET dm_liste ifile target file_work 
-
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_Get :" $@
-    fi
-    if [ $DRYRUN -le 2 ]; then
-	if [ X${1} = X'/l' ] ; then
-            # test if the first file is present in the old computation :
-	    eval set +A dm_liste \${${2}}
-	else
-	    eval set +A dm_liste ${1}
-	fi
-	eval DEST=\${${#}}
-
-	#=====================================================
-        #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
-        #=====================================================
-
-	# Is it an R_OUT file (not R_IN) ?
-	#echo ${dm_liste[0]} | grep "${R_OUT}" > /dev/null 2>&1
-	#if [ $? -eq 0 ] ; then
-	#    # Yes  ? then we try to get it in SCRATCHDIR
-	#    set +A file_work $( echo ${dm_liste[*]} | sed -e "s|${R_OUT}|${R_OUT_SCR}|g" )
-	#    if [ -f ${file_work[0]} ] ; then
-	#	IGCM_sys_Cp ${file_work[*]} ${DEST}
-	#	IGCM_debug_PopStack "IGCM_sys_Get"
-	#	return
-	#    fi
-	#fi
-
-	# test if the (first) file is present in the old computation :
-	IGCM_sys_TestFileArchive ${dm_liste[0]}
-	RET=$?
-        if [ ${RET} -gt 0 ] ; then
-	    echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ."
-	    IGCM_debug_Exit "IGCM_sys_Get"
-	fi
-
-	ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1
-  	RET=$?
-
-  	if [ ${RET} -gt 0 ] ; then
-	    echo "WARNING IGCM_sys_Get : demigration error."
-	    cat out_rsync
-	    echo "WARNING IGCM_sys_Get : will stop later if the cp fails."
-  	fi
-
-	#if [ ${RET} -gt 0 ] ; then
-	#    if [ ! "X$( grep "Lost dmusrcmd connection" out_rsync )" = "X" ] ; then
-	#	cat out_rsync
-	#	echo "WARNING IGCM_sys_Get : Lost dmusrcmd connection : "
-	#	sleep 30
-	#	echo "We try another time"
-	#	dmget ${dm_liste[*]} > out_rsync 2>&1
-	#	RET=$?
-	#	if [ ${RET} -gt 0 ] ; then
-	#	    echo "ERROR IGCM_sys_Get : again demigration error :"
-	#	    cat out_rsync
-	#	    IGCM_debug_Exit "IGCM_sys_Get"
-	#	fi
-	#    else
-	#	echo "ERROR IGCM_sys_Get : demigration error :"
-	#	cat out_rsync
-	#	IGCM_debug_Exit "IGCM_sys_Get"
-	#    fi
-	#fi
-
-        #USUAL WAY
-	if [ X${1} = X'/l' ] ; then
-	    (( RET=0 ))
-	    for target in ${dm_liste[*]} ; do
-		local_file=$( basename ${target} )
-		\cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
-		(( RET = RET + $? ))
-	    done
-	else
-	    \cp ${dm_liste} ${DEST} >> out_rsync 2>&1
-	    RET=$?
-	fi
-
-# 	#RSYNC WITH NETWORK SSH CALL
-# 	echo ${RSYNC} ${RSYNC_opt} -e ssh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
-# 	${RSYNC} ${RSYNC_opt} -e ssh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
-
-#  	#RSYNC WITH NFS USE
-#  	echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
-#  	${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
-
-# 	RET=$?
-#  	IGCM_sys_Rsync_out $RET
-
-#  	${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#  	(( RET=RET+$? ))
-
-	if [ ${RET} -gt 0 ] ; then
-	    echo "IGCM_sys_Get : copy error."
-	    cat out_rsync
-	    IGCM_debug_Exit "IGCM_sys_Get"
-	else
-	    \rm out_rsync
-	fi
+  IGCM_debug_PushStack "IGCM_sys_Get" $@
+
+  typeset DEST RET dm_liste ifile target file_work
+
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Get :" $@
+  fi
+  if [ $DRYRUN -le 2 ]; then
+    if [ X${1} = X'/l' ] ; then
+      # test if the first file is present in the old computation :
+      eval set +A dm_liste \${${2}}
     else
-	( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-    fi
-    IGCM_debug_PopStack "IGCM_sys_Get"
-}
-
-############################################################## A FINIR !!
+      eval set +A dm_liste ${1}
+    fi
+    eval DEST=\${${#}}
+
+    #=====================================================
+    #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
+    #=====================================================
+
+    # Is it an R_OUT file (not R_IN) ?
+    #echo ${dm_liste[0]} | grep "${R_OUT}" > /dev/null 2>&1
+    #if [ $? -eq 0 ] ; then
+    #    # Yes  ? then we try to get it in SCRATCHDIR
+    #    set +A file_work $( echo ${dm_liste[*]} | sed -e "s|${R_OUT}|${R_BUF}|g" )
+    #    if [ -f ${file_work[0]} ] ; then
+    #	IGCM_sys_Cp ${file_work[*]} ${DEST}
+    #	IGCM_debug_PopStack "IGCM_sys_Get"
+    #	return
+    #    fi
+    #fi
+
+    # test if the (first) file is present in the old computation :
+    IGCM_sys_TestFileArchive ${dm_liste[0]}
+    RET=$?
+    if [ ${RET} -gt 0 ] ; then
+      echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ."
+      IGCM_debug_Exit "IGCM_sys_Get"
+    fi
+
+    ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1
+    RET=$?
+    if [ ${RET} -gt 0 ] ; then
+      echo "WARNING IGCM_sys_Get : demigration error."
+      cat out_rsync
+      echo "WARNING IGCM_sys_Get : will stop later if the cp fails."
+    fi
+
+    #if [ ${RET} -gt 0 ] ; then
+    #    if [ ! "X$( grep "Lost dmusrcmd connection" out_rsync )" = "X" ] ; then
+    #	cat out_rsync
+    #	echo "WARNING IGCM_sys_Get : Lost dmusrcmd connection : "
+    #	sleep 30
+    #	echo "We try another time"
+    ##	dmget ${dm_liste[*]} > out_rsync 2>&1
+    #   ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1
+    #	RET=$?
+    #	if [ ${RET} -gt 0 ] ; then
+    #       echo "ERROR IGCM_sys_Get : again demigration error :"
+    #       cat out_rsync
+    #       IGCM_debug_Exit "IGCM_sys_Get"
+    #	fi
+    #    else
+    #	echo "ERROR IGCM_sys_Get : demigration error :"
+    #	cat out_rsync
+    #	IGCM_debug_Exit "IGCM_sys_Get"
+    #    fi
+    #fi
+
+    #USUAL WAY
+    if [ X${1} = X'/l' ] ; then
+      (( RET=0 ))
+      for target in ${dm_liste[*]} ; do
+        local_file=$( basename ${target} )
+        \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
+        (( RET = RET + $? ))
+      done
+    else
+      \cp ${dm_liste} ${DEST} >> out_rsync 2>&1
+      RET=$?
+    fi
+
+#       #RSYNC WITH NETWORK SSH CALL
+#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
+#       ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
+
+#       #RSYNC WITH NFS USE
+#       echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
+#       ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
+
+#       RET=$?
+#       IGCM_sys_Rsync_out $RET
+
+#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
+#       (( RET=RET+$? ))
+
+    if [ ${RET} -gt 0 ] ; then
+      echo "IGCM_sys_Get : copy error."
+      cat out_rsync
+      IGCM_debug_Exit "IGCM_sys_Get"
+    else
+      \rm out_rsync
+    fi
+  else
+    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Get"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_GetBuffer
+#D-* Purpose: Get a file from ${SCRATCHDIR}
+#D-* Examples: IGCM_sys_GetBuffer myfile /destpath/myfile_with_PREFIX
+#D-            IGCM_sys_GetBuffer /l Array_contain_myfiles /destpath/
+function IGCM_sys_GetBuffer {
+  IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@
+
+  typeset DEST RET buf_liste ifile target file_work
+
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_GetBuffer :" $@
+  fi
+  if [ $DRYRUN -le 2 ]; then
+    if [ X${1} = X'/l' ] ; then
+      # test if the first file is present in the old computation :
+      eval set +A buf_liste \${${2}}
+    else
+      eval set +A buf_liste ${1}
+    fi
+    eval DEST=\${${#}}
+
+    #USUAL WAY
+    if [ X${1} = X'/l' ] ; then
+      (( RET=0 ))
+      for target in ${buf_liste[*]} ; do
+        local_file=$( basename ${target} )
+        \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
+        (( RET = RET + $? ))
+      done
+    else
+      \cp ${buf_liste} ${DEST} >> out_rsync 2>&1
+      RET=$?
+    fi
+
+    if [ ${RET} -gt 0 ] ; then
+      echo "IGCM_sys_GetBuffer : copy error."
+      cat out_rsync
+      IGCM_debug_Exit "IGCM_sys_GetBuffer"
+    else
+      \rm out_rsync
+    fi
+  else
+    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
+  fi
+  IGCM_debug_PopStack "IGCM_sys_GetBuffer"
+}
 
 #D-#==================================================
@@ -1174,23 +1458,152 @@
 #D-
 function IGCM_sys_GetDate_FichWork {
-    IGCM_debug_PushStack "IGCM_sys_FichWork" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_GetDate_FichWork :" $@
-    fi
+  IGCM_debug_PushStack "IGCM_sys_FichWork" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_GetDate_FichWork :" $@
+  fi
+  typeset dateF
+  set +A dateF -- $( ls -l --full-time --time-style='+%Y%m%d%H%M%S' ${1} )
+  eval ${2}=${dateF[5]}
+
     # donne la date filesys d'un fichier sur la machine work
-    IGCM_debug_PopStack "IGCM_sys_FichWork"
+  IGCM_debug_PopStack "IGCM_sys_FichWork"
 }
 
 #D-#==================================================
 #D-function IGCM_sys_GetDate_FichArchive
-#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE 
+#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
 #D-* Examples:
 #D-
 function IGCM_sys_GetDate_FichArchive {
-    IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_GetDate_FichArchive :" $@
-    fi
-    IGCM_debug_PopStack "IGCM_sys_FichArchive"
+  IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_GetDate_FichArchive :" $@
+  fi
+  typeset dateF
+  set +A dateF -- $( ls -l --full-time --time-style='+%Y%m%d%H%M%S' ${1} )
+  eval ${2}=${dateF[5]}
+
+  IGCM_debug_PopStack "IGCM_sys_FichArchive"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_Dods_Rm
+#D-* Purpose: DO NOTHING ! Put ${ARCHIVE} files on DODS internet protocole.
+#D-* Examples:
+#D-
+function IGCM_sys_Dods_Rm {
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Dods_Rm :" $@
+  fi
+  typeset RET
+  RET=0
+  if [ $DRYRUN = 0 ]; then
+
+#    if [ ! -d /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} ] ; then
+#      echo "WARNING : IGCM_sys_Dods_Rm /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} DOES NOT EXIST ."
+#      echo "Nothing has been done."
+#      return
+#    fi
+
+    /ccc/cont003/home/dsm/p86maf/bin/dods_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
+    RET=$?
+
+#	if [ ${RET} -gt 0 ] ; then
+#           echo "IGCM_sys_Dods_Rm : error."
+#           cat out_dods_rm
+#           IGCM_debug_Exit "IGCM_sys_Dods_Rm"
+#	else
+#           rm out_dods_rm
+#	fi
+
+  else
+    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
+  fi
+  return $RET
+}
+
+#D-#==================================================
+#D-function IGCM_sys_Dods_Cp
+#D-* Purpose: Copy $(ARCHIVE) files on DODS internet protocole.
+#D-* Examples:
+#D-
+function IGCM_sys_Dods_Cp {
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Dods_Cp :" $@
+  fi
+  typeset RET
+  RET=0
+  if [ $DRYRUN = 0 ]; then
+
+#    if [ ! -d ${R_SAVE}/${1} ] ; then
+#      echo "WARNING : IGCM_sys_Dods_Cp ${R_SAVE}/${1} DOES NOT EXIST ."
+#      echo "Nothing has been done."
+#      return
+#    fi
+
+    /ccc/cont003/home/dsm/p86maf/bin/dods_cp ${1} public/${LOGIN}/${R_DODS} # > out_dods_cp 2>&1
+    RET=$?
+
+#       if [ ${RET} -gt 0 ] ; then
+#           echo "IGCM_sys_Dods_Cp : error."
+#           cat out_dods_cp
+#           IGCM_debug_Exit "IGCM_sys_Dods_Cp"
+#       else
+#           rm out_dods_cp
+#       fi
+
+  else
+    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
+  fi
+  return $RET
+}
+
+#D-#==================================================
+#D-function IGCM_sys_Put_Dods
+#D-* Purpose: Put $(ARCHIVE) files on DODS internet protocole.
+#D-* Examples:
+#D-
+function IGCM_sys_Put_Dods {
+  IGCM_debug_PushStack "IGCM_sys_Put_Dods" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_Put_Dods :" $@
+  fi
+  set -vx
+  typeset RET
+  if [ $DRYRUN = 0 ]; then
+    if ( [ ! -d ${R_SAVE}/${1} ] && [ ! -d ${R_FIGR}/${1} ] ) ; then
+      echo "WARNING IGCM_sys_Put_Dods : None of the following directories exist. Exactly one should."
+      echo "WARNING IGCM_sys_Put_Dods : ${R_SAVE}/${1} DOES NOT EXIST."
+      echo "WARNING IGCM_sys_Put_Dods : ${R_FIGR}/${1} DOES NOT EXIST."
+      IGCM_debug_PopStack "IGCM_sys_Put_Dods"
+      return
+    fi
+
+    if ( [ -d ${R_SAVE}/${1} ] && [ -d ${R_FIGR}/${1} ] ) ; then
+      echo "WARNING IGCM_sys_Put_Dods : Both of the following directories exist. Exactly one should."
+      echo "WARNING IGCM_sys_Put_Dods : ${R_SAVE}/${1} EXISTS."
+      echo "WARNING IGCM_sys_Put_Dods : ${R_FIGR}/${1} EXISTS."
+      IGCM_debug_PopStack "IGCM_sys_Put_Dods"
+      return
+    fi
+    #
+    if [ -d ${R_SAVE}/${1} ] ; then
+      cd ${R_SAVE}
+    elif [ -d ${R_FIGR}/${1} ] ; then
+      cd ${R_FIGR}
+    fi
+
+    IGCM_sys_Dods_Rm ${1}
+    IGCM_sys_Dods_Cp ${1}
+    RET=0
+
+    if [ ${RET} -gt 0 ] ; then
+      echo "IGCM_sys_Put_Dods : error."
+      IGCM_debug_Exit "IGCM_sys_Put_Dods"
+    fi
+  else
+    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Put_Dods"
 }
 
@@ -1199,15 +1612,15 @@
 
 function IGCM_sys_rebuild {
-    IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_rebuild :" $@
-    fi
-    ~p86ipsl/CESIUM/bin/rebuild -f -o $@
-    if [ $? -gt 0 ] ; then
-       echo "IGCM_sys_rebuild : erreur ${@}."
-       IGCM_debug_Exit "rebuild"
-    fi
-
-    IGCM_debug_PopStack "IGCM_sys_rebuild"
+  IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_rebuild :" $@
+  fi
+  ~p86ipsl/CESIUM/bin/rebuild -f -o $@
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_rebuild : erreur ${@}."
+    IGCM_debug_Exit "rebuild"
+  fi
+
+  IGCM_debug_PopStack "IGCM_sys_rebuild"
 }
 
@@ -1216,12 +1629,12 @@
 
 function IGCM_sys_activ_variables {
-    IGCM_debug_PushStack "IGCM_sys_activ_variables"
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_activ_variables"
-    fi
-
-    ulimit -s unlimited
-
-    IGCM_debug_PopStack "IGCM_sys_activ_variables"
+  IGCM_debug_PushStack "IGCM_sys_activ_variables"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_activ_variables"
+  fi
+
+  ulimit -s unlimited
+
+  IGCM_debug_PopStack "IGCM_sys_activ_variables"
 }
 
@@ -1230,17 +1643,17 @@
 
 function IGCM_sys_desactiv_variables {
-    IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_desactiv_variables"
-    fi
-    IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
-}
-
+  IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_desactiv_variables"
+  fi
+  IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
+}
+
+############################################################
+# Build MPI/OMP scripts run file (dummy function)
 
 function IGCM_sys_build_run_file {
-############################################################
-# Build run file
-
- IGCM_debug_Print 1 "Dummy IGCM_sys_build_run_file"
+
+IGCM_debug_Print 3 " dummy function : IGCM_sys_build_run_file "
 
 }
@@ -1248,20 +1661,20 @@
 ############################################################
 # Build MPI/OMP scripts
-function IGCM_sys_build_execution_scripts 
+function IGCM_sys_build_execution_scripts
 {
-    IGCM_debug_PushStack "IGCM_sys_build_execution_scripts" $@
-    if ( $DEBUG_sys ) ; then
-        echo "IGCM_sys_build_execution_scripts " $@
-    fi
+  IGCM_debug_PushStack "IGCM_sys_build_execution_scripts" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_build_execution_scripts " $@
+  fi
 
     # Verification with MSUB parameter
-	EXECUTION=${HOST_MPIRUN_COMMAND}
-
-    if ( ${OK_PARA_MPMD} ) ; then
-
-        if [ -f run_file ] ; then
-            IGCM_sys_Rm -f run_file
-        fi
-        touch run_file
+  EXECUTION=${HOST_MPIRUN_COMMAND}
+
+  if ( ${OK_PARA_MPMD} ) ; then
+
+    if [ -f run_file ] ; then
+      IGCM_sys_Rm -f run_file
+    fi
+    touch run_file
 
 # run_file construction
@@ -1272,14 +1685,14 @@
     for comp in ${config_ListOfComponents[*]} ; do
 
-        eval ExeNameIn=\${config_Executable_${comp}[0]}
-        eval ExeNameOut=\${config_Executable_${comp}[1]}
+      eval ExeNameIn=\${config_Executable_${comp}[0]}
+      eval ExeNameOut=\${config_Executable_${comp}[1]}
 
         # for CPL component only
-        if [ "X${comp}" = "XCPL" ] ; then
-
-            eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
-            eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
-            echo "${comp_proc_mpi_loc} ./${ExeNameOut}" >> run_file
-        fi
+      if [ "X${comp}" = "XCPL" ] ; then
+
+        eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
+        eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
+        echo "${comp_proc_mpi_loc} ./${ExeNameOut}" >> run_file
+      fi
     done
 
@@ -1288,14 +1701,14 @@
     for comp in ${config_ListOfComponents[*]} ; do
 
-        eval ExeNameIn=\${config_Executable_${comp}[0]}
-        eval ExeNameOut=\${config_Executable_${comp}[1]}
+      eval ExeNameIn=\${config_Executable_${comp}[0]}
+      eval ExeNameOut=\${config_Executable_${comp}[1]}
 
         # Only if we really have an executable for the component and not the coupler ie oasis:
-        if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${comp}" != "XCPL" ] ) ; then
-
-            eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
-            eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
-            echo "${comp_proc_mpi_loc} ./${ExeNameOut}" >> run_file
-        fi
+      if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${comp}" != "XCPL" ] ) ; then
+
+        eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
+        eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
+        echo "${comp_proc_mpi_loc} ./${ExeNameOut}" >> run_file
+      fi
     done
 
@@ -1308,205 +1721,238 @@
     fi
 
-else # Only one executable. launch it.
-
-    # 
+  else # Only one executable. launch it.
+
+    #
     for comp in ${config_ListOfComponents[*]} ; do
 
-        eval ExeNameIn=\${config_Executable_${comp}[0]}
-        eval ExeNameOut=\${config_Executable_${comp}[1]}
-
-        if  [ "X${ExeNameOut}" != X\"\" ] ; then
-            if ( ${OK_PARA_MPI} ) ; then
-                eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
-                EXECUTION="${EXECUTION} -n ${comp_proc_mpi_loc} ./${ExeNameOut}"
-            else
-                EXECUTION="${EXECUTION} ./${ExeNameOut}"
-            fi
-            if ( ${OK_PARA_OMP} ) ; then
-                eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
-                EXECUTION="export OMP_NUM_THREADS=${comp_proc_omp_loc} ; ${EXECUTION} "
-            fi
+      eval ExeNameIn=\${config_Executable_${comp}[0]}
+      eval ExeNameOut=\${config_Executable_${comp}[1]}
+
+      if  [ "X${ExeNameOut}" != X\"\" ] ; then
+        if ( ${OK_PARA_MPI} ) ; then
+          eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
+          EXECUTION="${EXECUTION} -n ${comp_proc_mpi_loc} ./${ExeNameOut}"
+        else
+          EXECUTION="${EXECUTION} ./${ExeNameOut}"
         fi
+        if ( ${OK_PARA_OMP} ) ; then
+          eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
+          EXECUTION="export OMP_NUM_THREADS=${comp_proc_omp_loc} ; ${EXECUTION} "
+        fi
+      fi
 
     done
 
-fi
-
-    IGCM_debug_Print 1 "sys Curie : execution command is "
-    IGCM_debug_Print 1 "$EXECUTION"
-
-    IGCM_debug_PopStack "IGCM_sys_build_execution_scripts"
-}
-
-
+  fi
+
+  IGCM_debug_Print 1 "sys Curie : execution command is "
+  IGCM_debug_Print 1 "$EXECUTION"
+
+  IGCM_debug_PopStack "IGCM_sys_build_execution_scripts"
+}
 
 ##############################################################
 # NCO OPERATOR
 
+function IGCM_sys_ncap2 {
+  IGCM_debug_PushStack "IGCM_sys_ncap2" -- $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_ncap2 :" $@
+  fi
+  ncap2 "$@"
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_ncap2 : erreur ${@}."
+    IGCM_debug_Exit "ncap2"
+  fi
+
+  IGCM_debug_PopStack "IGCM_sys_ncap2"
+}
+
 function IGCM_sys_ncatted {
-    IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_ncatted :" $@
-    fi
-    ncatted "$@"
-    if [ $? -gt 0 ] ; then
-       echo "IGCM_sys_ncatted : erreur ${@}."
-       IGCM_debug_Exit "ncatted"
-    fi
-
-    IGCM_debug_PopStack "IGCM_sys_ncatted"
+  IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_ncatted :" $@
+  fi
+  ncatted "$@"
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_ncatted : erreur ${@}."
+    IGCM_debug_Exit "ncatted"
+  fi
+
+  IGCM_debug_PopStack "IGCM_sys_ncatted"
 }
 
 function IGCM_sys_ncbo {
-    IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_ncbo :" $@
-    fi
-    ncbo $@
-    if [ $? -gt 0 ] ; then
-       echo "IGCM_sys_ncbo : erreur ${@}."
-       IGCM_debug_Exit "ncbo"
-    fi
-
-    IGCM_debug_PopStack "IGCM_sys_ncbo"
+  IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_ncbo :" $@
+  fi
+  ncbo $@
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_ncbo : erreur ${@}."
+    IGCM_debug_Exit "ncbo"
+  fi
+
+  IGCM_debug_PopStack "IGCM_sys_ncbo"
 }
 
 function IGCM_sys_ncdiff {
-    IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_ncdiff :" $@
-    fi
-    ncdiff $@
-    if [ $? -gt 0 ] ; then
-       echo "IGCM_sys_ncdiff : erreur ${@}."
-       IGCM_debug_Exit "ncdiff"
-    fi
-
-    IGCM_debug_PopStack "IGCM_sys_ncdiff"
+  IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_ncdiff :" $@
+  fi
+  ncdiff $@
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_ncdiff : erreur ${@}."
+    IGCM_debug_Exit "ncdiff"
+  fi
+
+  IGCM_debug_PopStack "IGCM_sys_ncdiff"
 }
 
 function IGCM_sys_ncea {
-    IGCM_debug_PushStack "IGCM_sys_ncea" -- $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_ncea :" $@
-    fi
-    ncea $@
-    if [ $? -gt 0 ] ; then
-       echo "IGCM_sys_ncea : erreur ${@}."
-       IGCM_debug_Exit "ncea"
-    fi
-
-    IGCM_debug_PopStack "IGCM_sys_ncea"
+  IGCM_debug_PushStack "IGCM_sys_ncea" -- $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_ncea :" $@
+  fi
+  ncea $@
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_ncea : erreur ${@}."
+    IGCM_debug_Exit "ncea"
+  fi
+
+  IGCM_debug_PopStack "IGCM_sys_ncea"
 }
 
 function IGCM_sys_ncecat {
-    IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_ncecat :" $@
-    fi
-    ncecat $@
-    if [ $? -gt 0 ] ; then
-       echo "IGCM_sys_ncecat : erreur ${@}."
-       IGCM_debug_Exit "ncecat"
-    fi
-
-    IGCM_debug_PopStack "IGCM_sys_ncecat"
+  IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_ncecat :" $@
+  fi
+  ncecat $@
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_ncecat : erreur ${@}."
+    IGCM_debug_Exit "ncecat"
+  fi
+
+  IGCM_debug_PopStack "IGCM_sys_ncecat"
 }
 
 function IGCM_sys_ncflint {
-    IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_ncflint :" $@
-    fi
-    ncflint $@
-    if [ $? -gt 0 ] ; then
-       echo "IGCM_sys_ncflint : erreur ${@}."
-       IGCM_debug_Exit "ncflint"
-    fi
-
-    IGCM_debug_PopStack "IGCM_sys_ncflint"
+  IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_ncflint :" $@
+  fi
+  ncflint $@
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_ncflint : erreur ${@}."
+    IGCM_debug_Exit "ncflint"
+  fi
+
+  IGCM_debug_PopStack "IGCM_sys_ncflint"
 }
 
 function IGCM_sys_ncks {
-    IGCM_debug_PushStack "IGCM_sys_ncks" -- $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_ncks :" $@
-    fi
-    ncks $@
-    if [ $? -gt 0 ] ; then
-       echo "IGCM_sys_ncks : erreur ${@}."
-       IGCM_debug_Exit "ncks"
-    fi
-
-    IGCM_debug_PopStack "IGCM_sys_ncks"
+  IGCM_debug_PushStack "IGCM_sys_ncks" -- $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_ncks :" $@
+  fi
+  ncks $@
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_ncks : erreur ${@}."
+    IGCM_debug_Exit "ncks"
+  fi
+
+  IGCM_debug_PopStack "IGCM_sys_ncks"
 }
 
 function IGCM_sys_ncpdq {
-    IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_ncpdq :" $@
-    fi
-    ncpdq $@
-    if [ $? -gt 0 ] ; then
-       echo "IGCM_sys_ncpdq : erreur ${@}."
-       IGCM_debug_Exit "ncpdq"
-    fi
-
-    IGCM_debug_PopStack "IGCM_sys_ncpdq"
+  IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_ncpdq :" $@
+  fi
+  ncpdq $@
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_ncpdq : erreur ${@}."
+    IGCM_debug_Exit "ncpdq"
+  fi
+
+  IGCM_debug_PopStack "IGCM_sys_ncpdq"
 }
 
 function IGCM_sys_ncra {
-    IGCM_debug_PushStack "IGCM_sys_ncra" -- $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_ncra :" $@
-    fi
-    ncra $@
-    if [ $? -gt 0 ] ; then
-       echo "IGCM_sys_ncra : erreur ${@}."
-       IGCM_debug_Exit "ncra"
-    fi
-
-    IGCM_debug_PopStack "IGCM_sys_ncra"
+  IGCM_debug_PushStack "IGCM_sys_ncra" -- $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_ncra :" $@
+  fi
+  ncra $@
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_ncra : erreur ${@}."
+    IGCM_debug_Exit "ncra"
+  fi
+
+  IGCM_debug_PopStack "IGCM_sys_ncra"
 }
 
 function IGCM_sys_ncrcat {
-    IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_ncrcat :" $@
-    fi
-    ncrcat $@
-    if [ $? -gt 0 ] ; then
-       echo "IGCM_sys_ncrcat : erreur ${@}."
+  IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_ncrcat :" $@
+  fi
+  ncrcat $@
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_ncrcat : erreur ${@}."
 #       IGCM_debug_Exit "ncrcat"
-    fi
-
-    IGCM_debug_PopStack "IGCM_sys_ncrcat"
+  fi
+
+  IGCM_debug_PopStack "IGCM_sys_ncrcat"
 }
 
 function IGCM_sys_ncrename {
-    IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_ncrename :" $@
-    fi
-    ncrename $@
-    if [ $? -gt 0 ] ; then
-       echo "IGCM_sys_ncrename : erreur ${@}."
-       IGCM_debug_Exit "ncrename"
-    fi
-
-    IGCM_debug_PopStack "IGCM_sys_ncrename"
+  IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_ncrename :" $@
+  fi
+  ncrename $@
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_ncrename : erreur ${@}."
+    IGCM_debug_Exit "ncrename"
+  fi
+
+  IGCM_debug_PopStack "IGCM_sys_ncrename"
 }
 
 function IGCM_sys_ncwa {
-    IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@
-    if ( $DEBUG_sys ) ; then
-	echo "IGCM_sys_ncwa :" $@
-    fi
-    ncwa $@
-    if [ $? -gt 0 ] ; then
-       echo "IGCM_sys_ncwa : erreur ${@}."
-       IGCM_debug_Exit "ncwa"
-    fi
-
-    IGCM_debug_PopStack "IGCM_sys_ncwa"
-}
+  IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_ncwa :" $@
+  fi
+  ncwa $@
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_ncwa : erreur ${@}."
+    IGCM_debug_Exit "ncwa"
+  fi
+
+  IGCM_debug_PopStack "IGCM_sys_ncwa"
+}
+
+##############################################################
+# CDO OPERATOR
+
+function IGCM_sys_cdo {
+  IGCM_debug_PushStack "IGCM_sys_cdo" -- $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_cdo :" $@
+  fi
+  \cdo $@
+  if [ $? -gt 0 ] ; then
+    echo "IGCM_sys_cdo : erreur ${@}."
+    IGCM_debug_PopStack "IGCM_sys_cdo"
+    return 1
+  else
+    IGCM_debug_PopStack "IGCM_sys_cdo"
+    return 0
+  fi
+
+  IGCM_debug_PopStack "IGCM_sys_cdo"
+}
Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh	(revision 622)
+++ trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh	(revision 623)
@@ -14,5 +14,5 @@
 #=========================================================
 # The documentation of this file can be automatically generated
-# if you use the prefix #D- for comments to be extracted. 
+# if you use the prefix #D- for comments to be extracted.
 # Extract with command: cat lib* | grep "^#D-" | cut -c "4-"
 #=========================================================
@@ -22,5 +22,5 @@
 #D-#==================================================
 #D-
-#D- This ksh library if a layer under some usefull 
+#D- This ksh library if a layer under some usefull
 #D-environment variables and shell commands.
 #D-All those definitions depend on host particularities.
@@ -42,15 +42,15 @@
 # YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
 # -------------------------------------------------------------------------------------
-# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
-# |          |  Cp/Exe param files |            |  Chmod  |                           |
-# |          |      Qsub           |            |         |                           |
+# | DRYRUN=  |	Date computations, | sys_Get	|  Exe    | sys_Put_Out; sys_Put_Rest |
+# |          |	Cp/Exe param files |		|  Chmod  |                           |
+# |          |      Qsub           |		|         |                           |
 # -------------------------------------------------------------------------------------
-# |    0     |       yes           |    yes     |  yes    |      yes                  |
+# |    0     |       yes           |	yes	|  yes    |      yes                  |
 # -------------------------------------------------------------------------------------
-# |    1     |       yes           |    yes     |  yes    |      no                   |
+# |    1     |       yes           |	yes	|  yes    |      no                   |
 # -------------------------------------------------------------------------------------
-# |    2     |       yes           |    yes     |  no     |      no                   |
+# |    2     |       yes           |	yes	|  no     |      no                   |
 # -------------------------------------------------------------------------------------
-# |    3     |       yes           |    no      |  no     |      no                   |
+# |    3     |       yes           |	no	|  no     |      no                   |
 # -------------------------------------------------------------------------------------
 
@@ -194,5 +194,5 @@
 
 NUM_COREPERNODE=8
-	
+
 #====================================================
 #- Default number of MPI task for IPSL coupled model
@@ -274,5 +274,5 @@
 #  if [ "X$( grep rebuild_from tmp_IGCM_sys_RshPost_$$ )" != "X" ] ; then
 #    #little hack so that rebuild submission is done on titane not an cesium
-#    
+#
 #    libIGCM_POST_sed=$( echo $libIGCM_POST | sed 's/\//\\\//g' )
 #    POST_DIR_sed=$( echo ${POST_DIR} | sed 's/\//\\\//g' )
@@ -282,5 +282,5 @@
 #    sed "s/Script_Post_Output=/Script_Output=${POST_DIR_sed}\//g" tmp.txt > tmp_IGCM_sys_RshPost_$$
 #    \mv tmp.txt tmp_IGCM_sys_RshPost_$$
-#    
+#
 #    echo cat tmp_IGCM_sys_RshPost_$$ AFTER
 #    cat tmp_IGCM_sys_RshPost_$$
@@ -355,7 +355,7 @@
 
     if [ ! -z ${config_UserChoices_MailName} ] ; then
-	mail -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < job_end.mail
+        mail -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < job_end.mail
     elif [ -f ~/.forward ] ; then
-	mail -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
+        mail -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
     fi
     sleep 10
@@ -405,5 +405,5 @@
   fi
   #- creation de repertoire sur le serveur fichier
-  if [ ! -d ${1} ]; then 
+  if [ ! -d ${1} ]; then
     \mkdir -p $1
     if [ $? -gt 0 ] ; then
@@ -426,5 +426,5 @@
   fi
   #- creation de repertoire sur le serveur fichier
-  if [ ! -d ${1} ]; then 
+  if [ ! -d ${1} ]; then
     \mkdir -p $1
     if [ $? -gt 0 ] ; then
@@ -716,5 +716,5 @@
 #    fi
 #    (( i = i + 1 ))
-#  done 
+#  done
 # ============ CESIUM  END  ============ #
 
@@ -727,5 +727,5 @@
 
 #D-*************************
-#D- File transfer functions 
+#D- File transfer functions
 #D-*************************
 #D-
@@ -796,5 +796,5 @@
   elif [ $MYLANG = "en" ] ; then
     case $RET in
-    0)  return;;		
+    0)  return;;
     1)  echo "rsync error : Syntax or usage error "
       return;;
@@ -969,9 +969,9 @@
 
     typeset RET
-    
+
     echo mv $@ > out_rsync 2>&1
     \mv $@ >> out_rsync 2>&1
     RET=$?
-    
+
     if [ ${RET} -gt 0 ] ; then
       echo "IGCM_sys_Mv : error in mv."
@@ -1132,17 +1132,17 @@
     RET=$?
 
-# 	#RSYNC WITH NETWORK SSH CALL
-# 	echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
-# 	${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
-
-#  	#RSYNC WITH NFS USE
-#  	echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
-#  	${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
-
-#  	RET=$?
-#  	IGCM_sys_Rsync_out $RET
-
-#  	${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#  	(( RET=RET+$? ))
+#       #RSYNC WITH NETWORK SSH CALL
+#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
+#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
+
+#       #RSYNC WITH NFS USE
+#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
+#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
+
+#       RET=$?
+#       IGCM_sys_Rsync_out $RET
+
+#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
+#       (( RET=RET+$? ))
 
     if [ ${RET} -gt 0 ] ; then
@@ -1229,5 +1229,5 @@
     #    typeset WORKPATH FILEPATH
     #    WORKPATH=$( dirname $2 | sed -e "s|${R_OUT}|${R_BUF}|" )
-    #    IGCM_sys_MkdirWork ${WORKPATH} 
+    #    IGCM_sys_MkdirWork ${WORKPATH}
     #    FILEPATH=${WORKPATH}/$( basename $2 )
     #    #
@@ -1237,5 +1237,5 @@
     if [ X${JobType} = XRUN ] ; then
       if [ X${3} = X ] ; then
-	IGCM_sys_Chmod 444 ${1}
+        IGCM_sys_Chmod 444 ${1}
       fi
     fi
@@ -1245,17 +1245,17 @@
     RET=$?
 
-# 	#RSYNC WITH NETWORK SSH CALL
-# 	echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
-# 	${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
-
-#  	#RSYNC WITH NFS USE
-#  	echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
-#  	${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
-
-#  	RET=$?
-#  	IGCM_sys_Rsync_out $RET
-
-#  	${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#  	(( RET=RET+$? ))
+#       #RSYNC WITH NETWORK SSH CALL
+#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
+#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
+
+#       #RSYNC WITH NFS USE
+#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
+#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
+
+#       RET=$?
+#       IGCM_sys_Rsync_out $RET
+
+#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
+#       (( RET=RET+$? ))
 
     if [ ${RET} -gt 0 ] ; then
@@ -1296,5 +1296,5 @@
     if [ X${JobType} = XRUN ] ; then
       if [ X${3} = X ] ; then
-	IGCM_sys_Chmod 444 ${1}
+        IGCM_sys_Chmod 444 ${1}
       fi
     fi
@@ -1326,5 +1326,5 @@
   IGCM_debug_PushStack "IGCM_sys_Get" $@
 
-  typeset DEST RET dm_liste ifile target file_work 
+  typeset DEST RET dm_liste ifile target file_work
 
   if ( $DEBUG_sys ) ; then
@@ -1383,7 +1383,7 @@
     #	RET=$?
     #	if [ ${RET} -gt 0 ] ; then
-    #	    echo "ERROR IGCM_sys_Get : again demigration error :"
-    #	    cat out_rsync
-    #	    IGCM_debug_Exit "IGCM_sys_Get"
+    #       echo "ERROR IGCM_sys_Get : again demigration error :"
+    #       cat out_rsync
+    #       IGCM_debug_Exit "IGCM_sys_Get"
     #	fi
     #    else
@@ -1398,7 +1398,7 @@
       (( RET=0 ))
       for target in ${dm_liste[*]} ; do
-	local_file=$( basename ${target} )
-	\cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
-	(( RET = RET + $? ))
+        local_file=$( basename ${target} )
+        \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
+        (( RET = RET + $? ))
       done
     else
@@ -1407,17 +1407,17 @@
     fi
 
-# 	#RSYNC WITH NETWORK SSH CALL
-# 	echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
-# 	${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
-
-#  	#RSYNC WITH NFS USE
-#  	echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
-#  	${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
-
-# 	RET=$?
-#  	IGCM_sys_Rsync_out $RET
-
-#  	${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#  	(( RET=RET+$? ))
+#       #RSYNC WITH NETWORK SSH CALL
+#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
+#       ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
+
+#       #RSYNC WITH NFS USE
+#       echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
+#       ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
+
+#       RET=$?
+#       IGCM_sys_Rsync_out $RET
+
+#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
+#       (( RET=RET+$? ))
 
     if [ ${RET} -gt 0 ] ; then
@@ -1442,5 +1442,5 @@
   IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@
 
-  typeset DEST RET buf_liste ifile target file_work 
+  typeset DEST RET buf_liste ifile target file_work
 
   if ( $DEBUG_sys ) ; then
@@ -1460,7 +1460,7 @@
       (( RET=0 ))
       for target in ${buf_liste[*]} ; do
-	local_file=$( basename ${target} )
-	\cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
-	(( RET = RET + $? ))
+        local_file=$( basename ${target} )
+        \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
+        (( RET = RET + $? ))
       done
     else
@@ -1502,5 +1502,5 @@
 #D-#==================================================
 #D-function IGCM_sys_GetDate_FichArchive
-#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE 
+#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
 #D-* Examples:
 #D-
@@ -1538,11 +1538,11 @@
     /ccc/cont003/home/dsm/p86maf/bin/dods_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
     RET=$?
-    
+
 #	if [ ${RET} -gt 0 ] ; then
-#	    echo "IGCM_sys_Dods_Rm : error."
-#	    cat out_dods_rm
-#	    IGCM_debug_Exit "IGCM_sys_Dods_Rm"
+#           echo "IGCM_sys_Dods_Rm : error."
+#           cat out_dods_rm
+#           IGCM_debug_Exit "IGCM_sys_Dods_Rm"
 #	else
-#	    rm out_dods_rm
+#           rm out_dods_rm
 #	fi
 
@@ -1575,11 +1575,11 @@
     RET=$?
 
-# 	if [ ${RET} -gt 0 ] ; then
-# 	    echo "IGCM_sys_Dods_Cp : error."
-# 	    cat out_dods_cp
-# 	    IGCM_debug_Exit "IGCM_sys_Dods_Cp"
-# 	else
-# 	    rm out_dods_cp
-# 	fi
+#       if [ ${RET} -gt 0 ] ; then
+#           echo "IGCM_sys_Dods_Cp : error."
+#           cat out_dods_cp
+#           IGCM_debug_Exit "IGCM_sys_Dods_Cp"
+#       else
+#           rm out_dods_cp
+#       fi
 
   else
@@ -1627,5 +1627,5 @@
     IGCM_sys_Dods_Cp ${1}
     RET=0
-    
+
     if [ ${RET} -gt 0 ] ; then
       echo "IGCM_sys_Put_Dods : error."
@@ -1670,8 +1670,8 @@
   (( max_omp = 0 ))
   for comp in ${config_ListOfComponents[*]} ; do
-	
+
     eval ExeNameIn=\${config_Executable_${comp}[0]}
     eval ExeNameOut=\${config_Executable_${comp}[1]}
-    
+
     # Only if we really have an executable for the component :
     if ( [ "X${ExeNameOut}" != X\"\" ] &&  [ "X${comp}" != "XCPL" ] ) ; then
@@ -1711,5 +1711,5 @@
 ############################################################
 # Build MPI/OMP scripts
-function IGCM_sys_build_execution_scripts 
+function IGCM_sys_build_execution_scripts
 {
   IGCM_debug_PushStack "IGCM_sys_build_execution_scripts" $@
@@ -1717,6 +1717,6 @@
     echo "IGCM_sys_build_execution_scripts " $@
   fi
-  typeset nodes listnodes init_node start_num init_exec comp ExeNameIn ExeNameOut 
-  typeset node_num_current node_current comp_proc_mpi_loc comp_proc_omp_loc 
+  typeset nodes listnodes init_node start_num init_exec comp ExeNameIn ExeNameOut
+  typeset node_num_current node_current comp_proc_mpi_loc comp_proc_omp_loc
   typeset num_corempi nombre_restant_node nombre_restant_comp
 
@@ -1737,5 +1737,5 @@
 
       ${HOST_MPIRUN_COMMAND} hostname | sort | uniq > hosts.tmp
-	
+
       i=0
       rm -f hosts
@@ -1748,9 +1748,9 @@
       done
       rm -f hosts.tmp
-	    
+
       listnodes=${host[*]}
-	    
-      EXECUTION="${HOST_MPIRUN_COMMAND} -hostfile hosts" 
-	
+
+      EXECUTION="${HOST_MPIRUN_COMMAND} -hostfile hosts"
+
       # Initialisation
 
@@ -1761,12 +1761,12 @@
 
       # Test : if oasis is there, we put it at the first position
-	    
+
       for comp in ${config_ListOfComponents[*]} ; do
-		
+
         if [ "X${comp}" = "XCPL" ]  ; then
-		    
+
           eval ExeNameIn=\${config_Executable_${comp}[0]}
           eval ExeNameOut=\${config_Executable_${comp}[1]}
-		    
+
           echo "#!/bin/ksh" > script_${ExeNameOut}.ksh
           echo ""  >> script_${ExeNameOut}.ksh
@@ -1776,27 +1776,27 @@
           echo "./${ExeNameOut} > out_${ExeNameOut}.out 2>out_${ExeNameOut}.err"  >> script_${ExeNameOut}.ksh
           IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh
-		    
+
           init_node=n
-		    
+
           (( nombre_restant_node = NUM_COREPERNODE - 1 ))
           node_num_current=0
           node_current=${host[${node_num_current}]}
-		    
-          EXECUTION="${EXECUTION} -H ${node_current} -np 1 ./script_${ExeNameOut}.ksh" 
-		    
+
+          EXECUTION="${EXECUTION} -H ${node_current} -np 1 ./script_${ExeNameOut}.ksh"
+
           init_exec=y
           start_num=1
-		    
+
         fi
-		
+
       done
-	    
+
       # Then loop on the components (except for oasis)
 
       for comp in ${config_ListOfComponents[*]} ; do
-		
+
         eval ExeNameIn=\${config_Executable_${comp}[0]}
         eval ExeNameOut=\${config_Executable_${comp}[1]}
-		
+
         # Only if we really have an executable for the component :
         if ( [ "X${ExeNameOut}" != X\"\" ] &&  [ "X${comp}" != "XCPL" ] ) ; then
@@ -1804,5 +1804,5 @@
           eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
           eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
-		    
+
           echo "#!/bin/ksh" > script_${ExeNameOut}.ksh
           # echo "set -vx" >> script_${ExeNameOut}.ksh
@@ -1815,11 +1815,11 @@
           echo "./${ExeNameOut} > out_${ExeNameOut}.out.\${MYMPIRANK} 2>out_${ExeNameOut}.err.\${MYMPIRANK}"  >> script_${ExeNameOut}.ksh
           IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh
-		    
+
           node_num=0
-		    
-          # We define the number of MPI process to be assigned for the component 
+
+          # We define the number of MPI process to be assigned for the component
 
           nombre_restant_comp=${comp_proc_mpi_loc}
-		    
+
           # Loop on the allocated nodes
 
@@ -1829,15 +1829,15 @@
             if [ ${node_num} = ${node_num_current} ] ; then
 
-	      node_current=${host[${node_num_current}]}
-
-              # If first time on the node : initialisation 
+              node_current=${host[${node_num_current}]}
+
+              # If first time on the node : initialisation
 
               if [ ${init_node} = y ] ; then
                 nombre_restant_node=${NUM_COREPERNODE}
-	      fi
-			    
+              fi
+
               # Test on the number of OMP threads
 
-	      if [ ${comp_proc_omp_loc} -gt ${nombre_restant_node} ] ; then
+              if [ ${comp_proc_omp_loc} -gt ${nombre_restant_node} ] ; then
                 (( node_num = node_num + 1 ))
                 node_num_current=${node_num}
@@ -1849,15 +1849,15 @@
 
               (( num_corempi = nombre_restant_node / comp_proc_omp_loc ))
-			    
-	      if [ ${num_corempi} -gt ${nombre_restant_comp} ] ; then
+
+              if [ ${num_corempi} -gt ${nombre_restant_comp} ] ; then
                 num_corempi=${nombre_restant_comp}
               fi
 
               (( nombre_restant_node = nombre_restant_node - num_corempi * comp_proc_omp_loc ))
-	      (( nombre_restant_comp = nombre_restant_comp - num_corempi ))
-			    
-	      if [ ${init_exec} = y ] ; then
+              (( nombre_restant_comp = nombre_restant_comp - num_corempi ))
+
+              if [ ${init_exec} = y ] ; then
                 EXECUTION="${EXECUTION} : -H ${node_current} -np ${num_corempi} ./script_${ExeNameOut}.ksh"
-	      else	
+              else
                 EXECUTION="${EXECUTION} -H ${node_current} -np ${num_corempi} ./script_${ExeNameOut}.ksh"
                 init_exec=y
@@ -1865,17 +1865,17 @@
 
               ((  start_num = num_corempi + start_num ))
-			    
+
             else
-			    
-              (( node_num = node_num + 1 )) 
- 	      continue
+
+              (( node_num = node_num + 1 ))
+              continue
             fi
-			
-            # Test on the number of core/process remaining on the node/component 
-			
+
+            # Test on the number of core/process remaining on the node/component
+
             if [ ${nombre_restant_node} = 0 ] ; then
               (( node_num = node_num + 1 ))
-	      node_num_current=${node_num}
-	      init_node=y
+              node_num_current=${node_num}
+              init_node=y
 
               if [ ${nombre_restant_comp} = 0 ] ; then
@@ -1885,14 +1885,14 @@
 
               node_num_current=${node_num}
-	      init_node=n
-			    
-	      if [ ${nombre_restant_comp} = 0 ] ; then
-	        break 1
-	      fi
+              init_node=n
+
+              if [ ${nombre_restant_comp} = 0 ] ; then
+                break 1
+              fi
             fi
           done
         fi
       done
-	    
+
     else
 
@@ -1900,31 +1900,31 @@
 
         ## the coupler ie oasis must be the first one
-	for comp in ${config_ListOfComponents[*]} ; do
-	    
-	    eval ExeNameOut=\${config_Executable_${comp}[1]}
-		
-	# for CPL component only
-	    if [ "X${comp}" = "XCPL" ] ; then
-		eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
-		echo "-np ${comp_proc_mpi_loc} ./${ExeNameOut} " >> run_file 
-	    fi
-	done
+        for comp in ${config_ListOfComponents[*]} ; do
+
+            eval ExeNameOut=\${config_Executable_${comp}[1]}
+
+        # for CPL component only
+            if [ "X${comp}" = "XCPL" ] ; then
+                eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
+                echo "-np ${comp_proc_mpi_loc} ./${ExeNameOut} " >> run_file
+            fi
+        done
 
         # Then second loop on the components
 
-	for comp in ${config_ListOfComponents[*]} ; do
-		
-	    eval ExeNameOut=\${config_Executable_${comp}[1]}
-		
+        for comp in ${config_ListOfComponents[*]} ; do
+
+            eval ExeNameOut=\${config_Executable_${comp}[1]}
+
             # Only if we really have an executable for the component and not the coupler ie oasis:
-	    if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${comp}" != "XCPL" ] ) ; then
-		eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
-		echo "-np ${comp_proc_mpi_loc} ./${ExeNameOut} " >> run_file 
-	    fi
-	done
-	IGCM_sys_Chmod u+x run_file
-
-	EXECUTION="${HOST_MPIRUN_COMMAND} --app ./run_file"
-	  
+            if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${comp}" != "XCPL" ] ) ; then
+                eval comp_proc_mpi_loc=\${${comp}_PROC_MPI}
+                echo "-np ${comp_proc_mpi_loc} ./${ExeNameOut} " >> run_file
+            fi
+        done
+        IGCM_sys_Chmod u+x run_file
+
+        EXECUTION="${HOST_MPIRUN_COMMAND} --app ./run_file"
+
     fi
 
@@ -1934,31 +1934,31 @@
 
           # Only if we really have an executable for the component :
-	  eval ExeNameOut=\${config_Executable_${comp}[1]}
-	  if ( [ "X${ExeNameOut}" != X\"\" ] ) ; then	
-		
-	      echo "#!/bin/ksh" > script_${ExeNameOut}.ksh
-	      echo ""  >> script_${ExeNameOut}.ksh
-	      if ( ${OK_PARA_OMP} ) ; then 
-		  eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
-		  echo "OMP_NUM_THREADS=${comp_proc_omp_loc}" >> script_${ExeNameOut}.ksh	
-	      fi
-	      if  ( ${OK_PARA_MPI} ) ; then 
+          eval ExeNameOut=\${config_Executable_${comp}[1]}
+          if ( [ "X${ExeNameOut}" != X\"\" ] ) ; then
+
+              echo "#!/bin/ksh" > script_${ExeNameOut}.ksh
+              echo ""  >> script_${ExeNameOut}.ksh
+              if ( ${OK_PARA_OMP} ) ; then
+                  eval comp_proc_omp_loc=\${${comp}_PROC_OMP}
+                  echo "OMP_NUM_THREADS=${comp_proc_omp_loc}" >> script_${ExeNameOut}.ksh
+              fi
+              if  ( ${OK_PARA_MPI} ) ; then
                   # Default : mpirun used if nb_proc gt 1
-		  # pour sortie out/err par process
-		  # echo "./${ExeNameOut} > out_${ExeNameOut}.out.\${OMPI_COMM_WORLD_RANK} 2>out_${ExeNameOut}.err.\${OMPI_COMM_WORLD_RANK}"  >> script_${ExeNameOut}.ksh
-		  echo "./${ExeNameOut}" >> script_${ExeNameOut}.ksh
-		  IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh
-		  EXECUTION="${HOST_MPIRUN_COMMAND} ./script_${ExeNameOut}.ksh"
-	      else
-		  # Default : mpirun is NOT used if nb_proc eq 1
-		  # pour sortie out/err par process
-		  # echo "./${ExeNameOut} > out_${ExeNameOut}.out 2>out_${ExeNameOut}.err" >> script_${ExeNameOut}.ksh
-		  echo "./${ExeNameOut}" >> script_${ExeNameOut}.ksh
-		  IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh
-		  EXECUTION="time ./script_${ExeNameOut}.ksh"
-	      fi
-	  fi
+                  # pour sortie out/err par process
+                  # echo "./${ExeNameOut} > out_${ExeNameOut}.out.\${OMPI_COMM_WORLD_RANK} 2>out_${ExeNameOut}.err.\${OMPI_COMM_WORLD_RANK}"  >> script_${ExeNameOut}.ksh
+                  echo "./${ExeNameOut}" >> script_${ExeNameOut}.ksh
+                  IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh
+                  EXECUTION="${HOST_MPIRUN_COMMAND} ./script_${ExeNameOut}.ksh"
+              else
+                  # Default : mpirun is NOT used if nb_proc eq 1
+                  # pour sortie out/err par process
+                  # echo "./${ExeNameOut} > out_${ExeNameOut}.out 2>out_${ExeNameOut}.err" >> script_${ExeNameOut}.ksh
+                  echo "./${ExeNameOut}" >> script_${ExeNameOut}.ksh
+                  IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh
+                  EXECUTION="time ./script_${ExeNameOut}.ksh"
+              fi
+          fi
       done
-      
+
   fi
 
