Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 281)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 282)
@@ -69,6 +69,4 @@
 # $username ou whoami
 typeset  LOGIN=${LOGIN:=$( whoami )}
-# $hostname of the MASTER job
-typeset -r MASTER=obelix
 
 #D-
@@ -80,5 +78,5 @@
 typeset -r RSYNC=/usr/bin/rsync
 # RSYNC_opt args to rsync
-typeset -r RSYNC_opt="-Lt -v"
+typeset -r RSYNC_opt="-va"
 
 #====================================================
@@ -93,8 +91,4 @@
 #- R_EXE   (==> BIN_DIR = ${MODIPSL}/bin )
 typeset -r R_EXE="${MODIPSL}/bin"
-
-#====================================================
-#- libIGCM_POST
-typeset -r libIGCM_POST=${libIGCM}
 
 #====================================================
@@ -122,4 +116,8 @@
 
 #====================================================
+#- libIGCM_POST
+typeset -r libIGCM_POST=${libIGCM}
+
+#====================================================
 #- IN
 typeset -r R_IN=${R_IN:=/home/orchidee01/mmancip/IGCM}
@@ -127,5 +125,5 @@
 #====================================================
 #- OUT
-typeset -r R_OUT=${ARCHIVE}/${LOGIN}/IGCM_OUT
+typeset -r R_OUT=${ARCHIVE}/IGCM_OUT
 
 #====================================================
@@ -156,10 +154,15 @@
 #D-#==================================================
 #D-function IGCM_sys_RshMaster
-#D-* Purpose: Master rsh command
+#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-* Examples:
 #D-
 function IGCM_sys_RshMaster {
     IGCM_debug_PushStack "IGCM_sys_RshMaster" $@
-    ssh ${HOST} /bin/ksh  <<-EOF
+
+    ssh ${HOST} exec /bin/ksh  <<-EOF
     export libIGCM=${libIGCM}
     export DEBUG_debug=${DEBUG_debug}
@@ -194,5 +197,5 @@
 #D-#==================================================
 #D-function IGCM_sys_RshPost
-#D-* Purpose: Master rsh command
+#D-* Purpose: Post-process rsh command
 #D-* Examples:
 #D-
@@ -203,5 +206,4 @@
 	echo "IGCM_sys_RshPost :" $@
     fi
-    #ssh ${HOST} exec /bin/ksh -vx $@ > out_RshPost.${RshPNum}
     ssh obelix2 exec /bin/ksh $@ > out_RshPost.${RshPNum}
     if [ $? -gt 0 ] ; then
@@ -289,9 +291,4 @@
 	fi
     fi
-#    vérification ?? :
-    if [ ! -d ${1} ] ; then
-	echo "IGCM_sys_MkdirArchive : erreur."
-	IGCM_debug_Exit "IGCM_sys_MkdirArchive"
-    fi
     IGCM_debug_PopStack "IGCM_sys_MkdirArchive"
 }
@@ -315,13 +312,6 @@
 	fi
     fi
-    # vérification ?? :
-    if [ ! -d ${1} ] ; then
-	echo "IGCM_sys_MkdirWork : erreur."
-	IGCM_debug_Exit "IGCM_sys_MkdirWork"
-    fi
     IGCM_debug_PopStack "IGCM_sys_MkdirWork"
 }
-IGCM_sys_MkdirWork ${RUN_DIR_PATH}
-echo "RUN_DIR_PATH ${RUN_DIR_PATH} ok."
 
 #D-#==================================================
@@ -349,5 +339,5 @@
 #D-
 function IGCM_sys_Chmod {
-    IGCM_debug_PushStack "IGCM_sys_Chmod" $@
+    IGCM_debug_PushStack "IGCM_sys_Chmod" -- $@
     if ( $DEBUG_sys ) ; then
 	echo "IGCM_sys_Chmod :" $@
@@ -514,7 +504,6 @@
 #    /usr/local/bin/qsub -q short -o ${Script_Output} -N ${config_UserChoices_JobName}.${CumulPeriod} < $1
     /usr/local/bin/qsub -q medium -o ${Script_Output} -N ${config_UserChoices_JobName}.${CumulPeriod} < $1
-#    /usr/local/bin/qsub -o ${Script_Output} -N ${config_UserChoices_JobName}.${CumulPeriod} < $1
-    if [ $? -gt 0 ] ; then
-	echo "IGCM_sys_Qsub : erreur -o ${Script_Output} -N ${config_UserChoices_JobName}.${CumulPeriod} $@."
+    if [ $? -gt 0 ] ; then
+	echo "IGCM_sys_Qsub : erreur."
 	IGCM_debug_Exit "IGCM_sys_Qsub"
     fi
@@ -686,5 +675,5 @@
 #D-
 function IGCM_sys_Rm {
-    IGCM_debug_PushStack "IGCM_sys_Rm" $@
+    IGCM_debug_PushStack "IGCM_sys_Rm" -- $@
     if ( $DEBUG_sys ) ; then
 	echo "IGCM_sys_Rm :" $@
@@ -715,7 +704,18 @@
     if ( $DEBUG_sys ) ; then
 	echo "IGCM_sys_RmRunDir :" $@
-	echo "Dummy call, let the scheduler do that."
-#	IGCM_sys_Rm -rf ${RUN_DIR}
-    fi
+    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"
+    fi
+
     IGCM_debug_PopStack "IGCM_sys_RmRunDir"
 }
@@ -860,6 +860,6 @@
 #D-#==================================================
 #D-function IGCM_sys_Put_Rest
-#D-* Purpose: commande de transfert des restarts $(ARCHIVE).
-#D-           Quitte si le fichier ou si le répertoire d'arriver n'existe pas.
+#D-* Purpose: Put computied restarts on $(ARCHIVE).
+#D-           File and target directory must exist.
 #D-* Examples:
 #D-
@@ -877,4 +877,5 @@
 	    IGCM_debug_Exit "IGCM_sys_Put_Rest"
 	fi
+
 	if [ X${JobType} = XRUN ] ; then
 	    IGCM_sys_Chmod 444 ${1}
@@ -1019,6 +1020,6 @@
     fi
     if [ $DRYRUN = 0 ]; then
-	if [ ! -f ${1} ] ; then
-	    echo "WARNING : IGCM_sys_Put_Dods ${1} DOES NOT EXIST ."
+	if [ ! -d ${R_SAVE}/${1} ] ; then
+	    echo "WARNING : IGCM_sys_Put_Dods ${R_SAVE}/${1} DOES NOT EXIST ."
 	    IGCM_debug_PopStack "IGCM_sys_Put_Dods"
 	    return
@@ -1059,5 +1060,4 @@
     IGCM_debug_PopStack "IGCM_sys_FichArchive"
 }
-
 
 ##############################################################
@@ -1291,5 +1291,5 @@
 
 function IGCM_sys_build_run_file {
-    IGCM_debug_PushStack "IGCM_sys_build_run_file"
+    IGCM_debug_PushStack "IGCM_sys_build_run_file" $@
     if ( $DEBUG_sys ) ; then
 	echo "IGCM_sys_build_run_file"
