source: tags/libIGCM_v2.0/AA_SaveSourceModifications @ 1132

Last change on this file since 1132 was 832, checked in by sdipsl, 11 years ago
  • Trivial changes to accomodate new_libIGCM function defined here /ccc/cont003/home/dsm/p86mart/.bash_alias (ksh-->bash)

She transforms every cp and rm by IGCM_sys_Cp and IGCM_sys_Rm within IGCM_debug_Check. So we need to source sys before calling it.

  • Property svn:executable set to *
File size: 4.4 KB
Line 
1#-Q- sx9mercure #!/bin/ksh
2#-Q- sx9mercure #####################
3#-Q- sx9mercure ## SX9MERCURE  CEA ##
4#-Q- sx9mercure #####################
5#-Q- sx9mercure #PBS -N SaveSource           # Nom du job
6#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
7#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
8#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
9#-Q- sx9mercure #PBS -l elapstim_req=0:10:00   # Limite temps a 1 heures
10#-Q- sx9mercure #PBS -q scalaire
11#-Q- sx9mercure #PBS -r n
12#-Q- titane #!/bin/ksh
13#-Q- titane ######################
14#-Q- titane ## TITANE   CEA ##
15#-Q- titane ######################
16#-Q- titane #MSUB -r SaveSource     # Nom du job               
17#-Q- titane #MSUB -n 1              # Reservation du processus
18#-Q- titane #MSUB -T 1800           # Limite de temps elapsed du job
19#-Q- titane #MSUB -E "-eo"
20#-Q- titane #MSUB -E "-L /bin/ksh"
21#-Q- titane #MSUB -E "-Ep "${ExeOutDateMax}
22#-Q- titane #MSUB -E "-Ep "${R_OUT_EXE}
23#-Q- titane #MSUB -E "-Ep "${PREFIX}
24#-Q- titane #MSUB -E "-Ep "${SUBMIT_DIR}
25#-Q- titane #MSUB -q testext
26#-Q- titane #MSUB -E '-rn'
27#-Q- lxiv8 ###################### ???
28#-Q- lxiv8 ## OBELIX      LSCE ##
29#-Q- lxiv8 ######################
30#-Q- lxiv8 #PBS -N SaveSource
31#-Q- lxiv8 #PBS -m a
32#-Q- lxiv8 #PBS -j oe
33#-Q- lxiv8 #PBS -q test 
34#-Q- lxiv8 #PBS -o SaveSource.$$
35#-Q- lxiv8 #PBS -S /bin/ksh
36#-Q- default #!/bin/ksh
37#-Q- default ##################
38#-Q- default ## DEFAULT HOST ##
39#-Q- default ##################
40
41#**************************************************************
42# Author: Martial Mancip
43# Contact: Martial.Mancip__at__ipsl.jussieu.fr
44# $Revision::                                          $ Revision of last commit
45# $Author::                                            $ Author of last commit
46# $Date::                                              $ Date of last commit
47# IPSL (2006)
48#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
49#
50#**************************************************************
51
52#set -eu
53#set -vx
54
55date
56
57#-Q- sx8brodie export OMP_NUM_THREADS=1
58#-Q- aix6 export OMP_NUM_THREADS=1
59
60#D- Task type (computing or post-processing)
61TaskType=post-processing
62
63MODIPSL=::modipsl::
64
65#D- Path to libIGCM
66#D- Default : value from AA_job if any
67# WARNING For StandAlone use : To run this script on some machine (ulam and cesium)
68# WARNING you must check MirrorlibIGCM variable in sys library.
69# WARNING If this variable is true, you must use libIGCM_POST path instead
70# WARNING of your running libIGCM directory.
71libIGCM=${libIGCM:=::modipsl::/libIGCM}
72
73. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
74#-------
75. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
76. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
77#-------
78( ${DEBUG_debug} ) && IGCM_debug_Check
79
80IGCM_sys_MkdirWork ${RUN_DIR_PATH}
81IGCM_sys_Cd ${RUN_DIR_PATH}
82
83ExeOutDateMax=${ExeOutDateMax:=$1}
84R_OUT_EXE=${R_OUT_EXE:=$2}
85PREFIX=${PREFIX:=$3}
86SUBMIT_DIR=${SUBMIT_DIR:=$4}
87
88cd ${MODIPSL};
89${MODIPSL}/util/script_diff_model ${SUBMIT_DIR} > ${RUN_DIR_PATH}/out_script_diff_model 2>&1
90echo "script_diff_model return" $? >> ${RUN_DIR_PATH}/out_script_diff_model 2>&1
91cd ${RUN_DIR_PATH}
92
93ERR_script_diff_model=$( cat out_script_diff_model | grep "script_diff_model return [0-9]*" | sed -e "s&script_diff_model return *\([0-9]*\)&\1&" )
94
95if [ ! X${ERR_script_diff_model} = X0 ] ; then
96    echo 'Error in script_diff_model :' ${ERR_script_diff_model}
97    exit ${ERR_script_diff_model}
98fi
99
100MODIPSL_SAVE_NAME=$( cat out_script_diff_model | grep "SAVE directory in" | sed -e "s&SAVE directory in  &&" )
101MODIPSL_SAVE=${MODIPSL}/tmp/${MODIPSL_SAVE_NAME}
102if ( [ X${MODIPSL_SAVE_NAME} = X ] || [ ! -d ${MODIPSL_SAVE} ] ) ; then
103    echo 'Error in SaveSourceModifications: no MODIPSL_SAVE_NAME avaible. We STOP'
104    exit 1
105fi
106
107MaxModifiedDate=$( tail -1 ${MODIPSL_SAVE}/Last_log )
108
109cd ${MODIPSL}/tmp
110IGCM_sys_Tar ${RUN_DIR_PATH}/${MODIPSL_SAVE_NAME}.tar ${MODIPSL_SAVE_NAME}
111cd -
112if ( ! ${DEBUG_debug} ) ; then
113    IGCM_sys_Rm -rf ${MODIPSL_SAVE}
114fi
115
116if [ ${MaxModifiedDate} -lt ${ExeOutDateMax} ] ; then
117    IGCM_sys_Put_Out ${MODIPSL_SAVE_NAME}.tar ${R_OUT_EXE}/${PREFIX}_${MODIPSL_SAVE_NAME}_certified.tar
118else
119    IGCM_sys_Put_Out ${MODIPSL_SAVE_NAME}.tar ${R_OUT_EXE}/${PREFIX}_${MODIPSL_SAVE_NAME}_NOTcertified.tar
120fi
121if ( ! ${DEBUG_debug} ) ; then
122    IGCM_sys_Rm ${MODIPSL_SAVE_NAME}.tar
123fi
124
125# Clean RUN_DIR_PATH (necessary for cesium and titane only)
126if ( ! ${DEBUG_debug} ) ; then
127    IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
128fi
Note: See TracBrowser for help on using the repository browser.