Index: trunk/libIGCM/AA_SaveSourceModifications
===================================================================
--- trunk/libIGCM/AA_SaveSourceModifications	(revision 524)
+++ trunk/libIGCM/AA_SaveSourceModifications	(revision 524)
@@ -0,0 +1,139 @@
+#-Q- platine #!/usr/bin/ksh
+#-Q- platine ###################
+#-Q- platine ## PLATINE   CEA ##
+#-Q- platine ###################
+#-Q- platine #BSUB -J SaveSource                     # Nom du job
+#-Q- platine #BSUB -N                        # message a la fin du job
+#-Q- platine #BSUB -n 1                      # reservation des processeurs pour le job
+#-Q- platine #BSUB -W 0:10                   # Limite temps
+#-Q- platine #BSUB -q post              # Passage en queue post
+#-Q- platine #BSUB -L /bin/ksh
+#-Q- sx8brodie #!/bin/ksh
+#-Q- sx8brodie #######################
+#-Q- sx8brodie ## SX8BRODIE   IDRIS ##
+#-Q- sx8brodie #######################
+#-Q- sx8brodie # Temps Elapsed max. d'une requete hh:mm:ss
+#-Q- sx8brodie # @ wall_clock_limit = 00:10:00
+#-Q- sx8brodie # Nom du travail LoadLeveler
+#-Q- sx8brodie # @ job_name   = SaveSource
+#-Q- sx8brodie # Fichier de sortie standard du travail       
+#-Q- sx8brodie # @ output     = $(job_name).$(jobid)
+#-Q- sx8brodie # Fichier de sortie d'erreur du travail
+#-Q- sx8brodie # @ error      =  $(job_name).$(jobid)
+#-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
+#-Q- sx8brodie # @ notification = error
+#-Q- sx8brodie # @ environment  = $MODIPSL ; $ExeOutDateMax ; $R_OUT_EXE ; $PREFIX ; $SUBMIT_DIR
+#-Q- sx8brodie # @ queue
+#-Q- aix6 #!/bin/ksh
+#-Q- aix6 #######################
+#-Q- aix6 ##   VARGAS   IDRIS  ##
+#-Q- aix6 #######################
+#-Q- aix6 # Temps Elapsed max. d'une requete hh:mm:ss
+#-Q- aix6 # @ wall_clock_limit = 00:10:00
+#-Q- aix6 # Nom du travail LoadLeveler
+#-Q- aix6 # @ job_name   = SaveSource
+#-Q- aix6 # Fichier de sortie standard du travail       
+#-Q- aix6 # @ output     = $(job_name).$(jobid)
+#-Q- aix6 # Fichier de sortie d'erreur du travail
+#-Q- aix6 # @ error      =  $(job_name).$(jobid)
+#-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
+#-Q- aix6 # @ notification = error
+#-Q- aix6 # @ environment  = $MODIPSL ; $ExeOutDateMax ; $R_OUT_EXE ; $PREFIX ; $SUBMIT_DIR
+#-Q- aix6 # @ queue
+#-Q- sx8mercure #!/bin/ksh
+#-Q- sx8mercure ######################
+#-Q- sx8mercure ## SX8MERCURE   CEA ##
+#-Q- sx8mercure ######################
+#-Q- sx8mercure #PBS -N SaveSource           # Nom du job
+#-Q- sx8mercure #PBS -j o                    # regroupement des stdout et stderr
+#-Q- sx8mercure #PBS -S /usr/bin/ksh         # shell de soumission
+#-Q- sx8mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
+#-Q- sx8mercure #PBS -l cputim_job=0:10:00   # Limite temps a 1 heures
+#-Q- sx8mercure #PBS -q scalaire
+#-Q- sx9mercure #!/bin/ksh
+#-Q- sx9mercure #########################
+#-Q- sx9mercure ## CESIUM FOR SX9  CEA ##
+#-Q- sx9mercure #########################
+#-Q- sx9mercure #PBS -N SaveSource           # Nom du job
+#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
+#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
+#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
+#-Q- sx9mercure #PBS -l cputim_job=0:10:00   # Limite temps a 1 heures
+#-Q- sx9mercure #PBS -q scalaire
+#-Q- titane #!/bin/ksh
+#-Q- titane ######################
+#-Q- titane ## TITANE   CEA ##
+#-Q- titane ######################
+#-Q- titane #MSUB -r SaveSource     # Nom du job                
+#-Q- titane #MSUB -N 1              # Reservation du noeud
+#-Q- titane #MSUB -n 1              # Reservation du processus
+#-Q- titane #MSUB -T 1800           # Limite de temps elapsed du job
+#-Q- titane #MSUB -E "-j o"
+#-Q- titane #MSUB -E "-S /bin/ksh"
+#-Q- lxiv8 ###################### ???
+#-Q- lxiv8 ## OBELIX      LSCE ##
+#-Q- lxiv8 ######################
+#-Q- lxiv8 #PBS -N SaveSource
+#-Q- lxiv8 #PBS -m a
+#-Q- lxiv8 #PBS -j oe
+#-Q- lxiv8 #PBS -q test  
+#-Q- lxiv8 #PBS -o SaveSource.$$
+#-Q- lxiv8 #PBS -S /bin/ksh
+#-Q- default #!/bin/ksh
+#-Q- default ##################
+#-Q- default ## DEFAULT HOST ##
+#-Q- default ##################
+
+#**************************************************************
+# Author: Martial Mancip
+# Contact: Martial.Mancip__at__ipsl.jussieu.fr
+# $Revision::                                          $ Revision of last commit
+# $Author::                                            $ Author of last commit
+# $Date::                                              $ Date of last commit
+# IPSL (2006)
+#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
+#
+#**************************************************************
+
+#set -eu
+#set -vx
+
+date
+
+#-Q- sx8brodie export OMP_NUM_THREADS=1
+#-Q- aix6 export OMP_NUM_THREADS=1
+
+#D- Low level debug : to bypass lib test checks and stack construction
+#D- Default : value from AA_job if any
+libIGCM=${libIGCM:=::modipsl::/libIGCM}
+# WARNING for StandAlone used : To run this script on some machine,
+# you must check MirrorlibIGCM variable in sys library.
+# If this variable is true, you must use libIGCM_POST path instead
+# of your running libIGCM directory.
+
+. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
+      ( ${DEBUG_debug} ) && IGCM_debug_Check
+#-------
+. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
+. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
+
+#set -vx
+
+
+cd ${MODIPSL}
+#    set > set_before_script_diff_model 2>&1
+. ${MODIPSL}/util/script_diff_model ${SUBMIT_DIR}
+#    set > set_after_script_diff_model 2>&1
+MaxModifiedDate=$( tail -1 ${MODIPSL_SAVE}/Last_log )
+
+tar cf ${MODIPSL_SAVE_NAME}.tar ${MODIPSL_SAVE_NAME}
+if ( [ -d ${MODIPSL_SAVE_NAME} ] && [ X"${MODIPSL_SAVE_NAME}" != X${MODIPSL} ] ) ; then 
+    IGCM_sys_Rm -rf ${MODIPSL_SAVE_NAME}
+fi
+
+if [ ${MaxModifiedDate} -lt ${ExeOutDateMax} ] ; then
+    eval IGCM_sys_Put_Out ${MODIPSL_SAVE}.tar ${R_OUT_EXE}/${PREFIX}_${MODIPSL_SAVE_NAME}_certified.tar
+else
+    eval IGCM_sys_Put_Out ${MODIPSL_SAVE}.tar ${R_OUT_EXE}/${PREFIX}_${MODIPSL_SAVE_NAME}_NOTcertified.tar
+fi
+IGCM_sys_Rm ${MODIPSL_SAVE}.tar
