Index: /trunk/libIGCM/AA_job
===================================================================
--- /trunk/libIGCM/AA_job	(revision 127)
+++ /trunk/libIGCM/AA_job	(revision 128)
@@ -99,4 +99,5 @@
 #D-                      - Job Verbosity
 #D-                      - PeriodNb
+#D-                      - Experience type : DEB(ug), DEV(elopment), RUN 
 #D--------------------------------------------------------------------==
 
@@ -118,4 +119,7 @@
 #D- Default=true
 #DEBUG_sys=false
+
+#D- Experience type : DEB(ug), DEV(elopment), RUN (default)
+JobType=RUN
 
 #D- Define running directory
Index: /trunk/libIGCM/libIGCM_config/libIGCM_config.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_config/libIGCM_config.ksh	(revision 127)
+++ /trunk/libIGCM/libIGCM_config/libIGCM_config.ksh	(revision 128)
@@ -19,8 +19,4 @@
     IGCM_debug_PushStack "IGCM_config_Initialize"
 
-    echo
-    # Where do we run ?
-    uname -a
-
     # Debug Print :
     echo
@@ -198,4 +194,24 @@
     R_OUT_EXE=${R_SAVE}/Exe
 
+    #====================================================
+    # Experience type : DEB(ug), DEV(elopment), RUN 
+    if [ X${JobType} != XRUN ] ; then
+	echo
+        echo "===================================================="
+	echo "libIGCM JOB is NOT in RUN type mode."
+	echo "!! OUTPUT files will NOT be PROTECTED !!"
+        echo "Be carefull : you can ERASE the result of this job !"
+
+	case ${JobType} in
+	    DEB)
+		echo "DEBUG mode : activation of 'set -vx' mode.";;
+	    DEV)
+		echo "DEVelopment mode : no protection for output files."
+		;;
+	esac	
+        echo "===================================================="
+	echo
+    fi
+
     IGCM_debug_PopStack "IGCM_config_Initialize"
 }
@@ -206,6 +222,4 @@
     IGCM_debug_PushStack "IGCM_config_Analyse_PeriodLength"
 
-    echo "config_UserChoices_PeriodLength : " ${config_UserChoices_PeriodLength} ${month} ${year}
-
     typeset i
 
@@ -213,7 +227,5 @@
     case ${config_UserChoices_PeriodLength} in
 	*Y|*y)
-#MM a enlever apres les tests 
-	    echo " ${config_UserChoices_PeriodLength} | gawk -F '[yY]' " '{print $1}' 
-	    PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | gawk -F '[yY]' '{print $1}' ) 
+	    PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | sed -e 's/[yY]//' ) 
 	    IGCM_debug_Print 1 "Number of years for PeriodLength : ${PeriodLengthInYears}"
 	    PeriodLengthInDays=0
@@ -225,5 +237,5 @@
 	    ;;
 	*M|*m)
-	    PeriodLengthInMonths=$( echo ${config_UserChoices_PeriodLength} | gawk -F '[mM]' '{print $1}' ) 
+	    PeriodLengthInMonths=$( echo ${config_UserChoices_PeriodLength} | sed -e 's/[mM]//' ) 
 	    IGCM_debug_Print 1 "Number of months for PeriodLength : ${PeriodLengthInMonths}"
 	    PeriodLengthInDays=0
@@ -239,5 +251,6 @@
  	    ;;
 	*D|*d)  
-	    PeriodLengthInDays=$( echo ${config_UserChoices_PeriodLength} | gawk -F '[dD]' '{print $1}' ) ;;
+	    PeriodLengthInMonths=0
+	    PeriodLengthInDays=$( echo ${config_UserChoices_PeriodLength} | sed -e 's/[dD]//' );;
 	*) 
 	    IGCM_debug_Exit "IGCM_config_Analyse_PeriodLength " ${config_UserChoices_PeriodLength} " invalid period length : choose in *Y, *M, *D."
@@ -371,13 +384,20 @@
 
     # Test if the same run as already been saved :
-    if [ ${DRYRUN} -le 0 ] ; then
+    if [ X${JobType} = XRUN ] ; then
+	if [ ${DRYRUN} -le 0 ] ; then
+	    if ( IGCM_sys_TestFileArchive ${R_OUT_KSH}/${PREFIX}_${Exe_Output} ) ; then
+		IGCM_debug_Exit "IGCM_config_PeriodStart" "RErun an old job."
+		IGCM_debug_Print 1 "Because of readonly permissions, you can't RErun a job when saved files"
+		IGCM_debug_Print 1 " are still in the ARCHIVE directory. You must deleted those files, or "
+		IGCM_debug_Print 1 " the whole ${R_SAVE} tree."
+		IGCM_debug_Verif_Exit
+	    fi
+	fi
+    else
 	if ( IGCM_sys_TestFileArchive ${R_OUT_KSH}/${PREFIX}_${Exe_Output} ) ; then
-	    IGCM_debug_Exit "IGCM_config_PeriodStart" "RErun an old job."
-	    IGCM_debug_Print 1 "Because of readonly permissions, you can't RErun a job when saved files"
-	    IGCM_debug_Print 1 " are still in the ARCHIVE directory. You must deleted those files, or "
-	    IGCM_debug_Print 1 " the whole ${R_SAVE} tree."
-	    IGCM_debug_Verif_Exit
-	fi
-    fi
+	    IGCM_debug_Print 1 "IGCM_config_PeriodStart" "RErun an old job. DEBUG of DEV mode."
+	fi
+    fi
+
     IGCM_debug_PopStack "IGCM_config_PeriodStart"
 }
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys.ksh	(revision 127)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys.ksh	(revision 128)
@@ -10,5 +10,5 @@
 #  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
 # History:
-# Modification:
+# Modification: JobType ( Protect output datas )
 #
 #**************************************************************
@@ -16,4 +16,24 @@
 # bypass specific internationalization (for awk)
 export LC_ALL="C"
+
+# By default, all libIGCM_sys save functions will protect output datas (RUN execution mode) 
+# other values : DEB(ug), DEV(elopment).
+JobType=${JobType:=RUN}
+
+echo
+echo "===================================================="
+echo "Where do we run ?"
+uname -a
+echo "===================================================="
+echo
+
+
+if [ X${JobType} == XDEB ] ; then
+    echo "DEBUG mode : activation of 'set -vx' mode."
+    set -vx
+    DEBUG_debug=true
+    DEBUG_sys=true
+    echo "===================================================="
+fi
 
 case $( hostname -s ) in
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_brodie.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_brodie.ksh	(revision 127)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_brodie.ksh	(revision 128)
@@ -781,5 +781,7 @@
 	typeset RET
 	#
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 	#
 	# Only if we use rsync
@@ -834,5 +836,7 @@
 	typeset RET
 	#
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 	#
 	# Only if we use rsync
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_calculo.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_calculo.ksh	(revision 127)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_calculo.ksh	(revision 128)
@@ -808,6 +808,7 @@
 	    IGCM_debug_Exit "IGCM_sys_Put_Rest"
 	fi
-	IGCM_sys_Chmod 444 ${1}
-
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 	typeset RET
 
@@ -854,5 +855,7 @@
 	typeset RET
 	#
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 	#
 
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_claude.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_claude.ksh	(revision 127)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_claude.ksh	(revision 128)
@@ -825,5 +825,7 @@
 	    IGCM_debug_Exit "IGCM_sys_Put_Rest"
 	fi
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 
 	typeset RET
@@ -871,5 +873,7 @@
 	typeset RET
 	#
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 	#
 
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh	(revision 127)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh	(revision 128)
@@ -811,5 +811,7 @@
 	    IGCM_debug_Exit "IGCM_sys_Put_Rest"
 	fi
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 
 	typeset RET
@@ -857,5 +859,7 @@
 	typeset RET
 	#
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 	#
 
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh	(revision 127)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh	(revision 128)
@@ -743,5 +743,7 @@
 	typeset RET
 	#
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 	#
 	IGCM_sys_TestDirArchive $( dirname $2 )
@@ -811,5 +813,7 @@
 	#fi
 
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 	#
         # USUAL WAY
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercureTX.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercureTX.ksh	(revision 127)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercureTX.ksh	(revision 128)
@@ -796,5 +796,7 @@
 	typeset RET
 	#
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 	#
         # USUAL WAY
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex9.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex9.ksh	(revision 127)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex9.ksh	(revision 128)
@@ -743,5 +743,7 @@
 	typeset RET
 	#
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 	#
 	IGCM_sys_TestDirArchive $( dirname $2 )
@@ -811,5 +813,7 @@
 	#fi
 
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 	#
         # USUAL WAY
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 127)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 128)
@@ -806,5 +806,7 @@
 	    IGCM_debug_Exit "IGCM_sys_Put_Rest"
 	fi
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 
 	typeset RET
@@ -852,5 +854,7 @@
 	typeset RET
 	#
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 	#
 
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_platine.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_platine.ksh	(revision 127)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_platine.ksh	(revision 128)
@@ -740,5 +740,7 @@
 	typeset RET
 	#
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 	#
 	IGCM_sys_TestDirArchive $( dirname $2 )
@@ -902,5 +904,7 @@
 	typeset RET
         #
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 	#
         # USUAL WAY
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_ulam.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_ulam.ksh	(revision 127)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_ulam.ksh	(revision 128)
@@ -796,5 +796,7 @@
 	typeset RET
 	#
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 	#
 	# Only if we use rsync
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_vargas.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_vargas.ksh	(revision 127)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_vargas.ksh	(revision 128)
@@ -786,5 +786,7 @@
 	typeset RET
 	#
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 	#
 	# Only if we use rsync
@@ -839,5 +841,7 @@
 	typeset RET
 	#
-	IGCM_sys_Chmod 444 ${1}
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
 	#
 	# Only if we use rsync
