source: tags/libIGCM_v1_6/AA_rebuild_fromWorkdir @ 1456

Last change on this file since 1456 was 281, checked in by mmaipsl, 14 years ago

Add obelix headers.

File size: 9.3 KB
Line 
1#-Q- platine #!/usr/bin/ksh
2#-Q- platine ###################
3#-Q- platine ## PLATINE   CEA ##
4#-Q- platine ###################
5#-Q- platine #BSUB -J REBUILDWRK             # Nom du job
6#-Q- platine #BSUB -N                        # message a la fin du job
7#-Q- platine #BSUB -n 1                      # reservation des processeurs pour le job
8#-Q- platine #BSUB -W 4:00                   # Limite temps
9#-Q- platine #BSUB -q post                   # Passage en queue post
10#-Q- sx8brodie #!/bin/ksh
11#-Q- sx8brodie #######################
12#-Q- sx8brodie ## SX8BRODIE   IDRIS ##
13#-Q- sx8brodie #######################
14#-Q- sx8brodie # Temps Elapsed max. d'une requete hh:mm:ss
15#-Q- sx8brodie # @ wall_clock_limit = 20:00:00
16#-Q- sx8brodie # Nom du travail LoadLeveler
17#-Q- sx8brodie # @ job_name   = REBUILDWRK
18#-Q- sx8brodie # Fichier de sortie standard du travail       
19#-Q- sx8brodie # @ output     = $(job_name).$(jobid)
20#-Q- sx8brodie # Fichier de sortie d'erreur du travail
21#-Q- sx8brodie # @ error      =  $(job_name).$(jobid)
22#-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
23#-Q- sx8brodie # @ notification = error
24#-Q- sx8brodie # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; $RebuildFromArchive ; $config_UserChoices_JobName ; $R_SAVE
25#-Q- sx8brodie # @ queue
26#-Q- aix6 #!/bin/ksh
27#-Q- aix6 #######################
28#-Q- aix6 ##   VARGAS   IDRIS  ##
29#-Q- aix6 #######################
30#-Q- aix6 # @ class = archive
31#-Q- aix6 # Temps Elapsed max. d'une requete hh:mm:ss
32#-Q- aix6 # @ wall_clock_limit = 20:00:00
33#-Q- aix6 # Nom du travail LoadLeveler
34#-Q- aix6 # @ job_name   = REBUILDWRK
35#-Q- aix6 # Fichier de sortie standard du travail
36#-Q- aix6 # @ output     = $(job_name).$(jobid)
37#-Q- aix6 # Fichier de sortie d'erreur du travail
38#-Q- aix6 # @ error      =  $(job_name).$(jobid)
39#-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
40#-Q- aix6 # @ notification = error
41#-Q- aix6 # @ environment  = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER ; $RebuildFromArchive ; $config_UserChoices_JobName ; $R_SAVE
42#-Q- aix6 # @ queue
43#-Q- sx8mercure #!/bin/ksh
44#-Q- sx8mercure ######################
45#-Q- sx8mercure ## SX8MERCURE   CEA ##
46#-Q- sx8mercure ######################
47#-Q- sx8mercure #PBS -N REBUILDWRK           # Nom du job
48#-Q- sx8mercure #PBS -j o                    # regroupement des stdout et stderr
49#-Q- sx8mercure #PBS -S /usr/bin/ksh         # shell de soumission
50#-Q- sx8mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
51#-Q- sx8mercure #PBS -l cputim_job=24:00:00  # Limite temps a 1 heures
52#-Q- sx8mercure #PBS -q scalaire
53#-Q- sx9mercure #!/bin/ksh
54#-Q- sx9mercure ######################
55#-Q- sx9mercure ## SX9MERCURE   CEA ##
56#-Q- sx9mercure ######################
57#-Q- sx9mercure #PBS -N REBUILDWRK           # Nom du job
58#-Q- sx9mercure #PBS -j o                    # regroupement des stdout et stderr
59#-Q- sx9mercure #PBS -S /usr/bin/ksh         # shell de soumission
60#-Q- sx9mercure #PBS -l memsz_job=1gb        # Limite memoire a 1 Go
61#-Q- sx9mercure #PBS -l cputim_job=24:00:00  # Limite temps a 1 heures
62#-Q- sx9mercure #PBS -q scal-new
63#-Q- titane #!/bin/ksh
64#-Q- titane ######################
65#-Q- titane ## TITANE   CEA ##
66#-Q- titane ######################
67#-Q- titane #MSUB -r REBUILDWRK     # Nom du job               
68#-Q- titane #MSUB -N 1              # Reservation du noeud
69#-Q- titane #MSUB -n 1              # Reservation du processus
70#-Q- titane #MSUB -T 86400          # Limite de temps elapsed du job
71#-Q- titane #MSUB -E "-j o"
72#-Q- titane #MSUB -E "-S /bin/ksh"
73#-Q- titane ##MSUB -e nco.out        # Sortie standard
74#-Q- titane ##MSUB -o nco.out        # Sortie standard
75#-Q- lxiv8 ######################
76#-Q- lxiv8 ## OBELIX      LSCE ##
77#-Q- lxiv8 ######################
78#-Q- lxiv8 #PBS -N REBUILDWRK
79#-Q- lxiv8 #PBS -m a
80#-Q- lxiv8 #PBS -j oe
81#-Q- lxiv8 #PBS -q medium
82#-Q- lxiv8 #PBS -o REBUILDWRK.$$
83#-Q- lxiv8 #PBS -S /bin/ksh
84#-Q- default #!/bin/ksh
85#-Q- default ##################
86#-Q- default ## DEFAULT HOST ##
87#-Q- default ##################
88
89# $Date: $
90# $Author: $
91# $Revision: $
92# IPSL (2006)
93#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
94
95#set -eu
96#set -vx
97
98date
99
100#-Q- sx8brodie export OMP_NUM_THREADS=1
101#-Q- aix6 export OMP_NUM_THREADS=1
102
103########################################################################
104
105#D- Flag to determine if this job in a standalone mode
106#D- Default : value from AA_job if any
107StandAlone=${StandAlone:=true}
108
109#D- Low level debug : to bypass lib test checks and stack construction
110#D- Default : value from AA_job if any
111libIGCM=${libIGCM:=::modipsl::/libIGCM}
112# WARNING for StandAlone used : To run this script on some machine,
113# you must check MirrorlibIGCM variable in sys library.
114# If this variable is true, you must use libIGCM_POST path instead
115# of your running libIGCM directory.
116
117#D- Do we rebuild parallel output from archive or from ${BIGDIR}
118#D- Default : value from AA_job if any
119RebuildFromArchive=${RebuildFromArchive:=false}
120
121#D- Directory where files we need to rebuild are store
122#D- Default : value from AA_job if any
123#D- if RebuildFromArchive=true REBUILD_DIR=${DMFDIR}/IGCM_OUT/.../JobName/TMP
124#D- example : /dmnfs09/cont003/p86denv/IGCM_OUT/IPSLCM5/CM5PIRC7/TMP
125#D- if RebuildFromArchive=false REBUILD_DIR=${BIGDIR}/REBUILD/TagName/JobName/
126#D- example : /scratch/cont003/p86denv/REBUILD/IPSLCM5/SCAL-NEW
127REBUILD_DIR=${REBUILD_DIR:=/path/to/your/TMP/REBUILD/FILES}
128
129#D- How many directory to rebuild we have to consider
130#D- Default : value from AA_job if any
131NbRebuildDir=${NbRebuildDir:=1000}
132
133#D- Suffix date we will use to determine which directory to rebuild
134#D- We will rebuild NbRebuildDir before and including PeriodDateBegin
135#D- Default : value from AA_job if any
136LastPeriodForRebuild=${PeriodDateBegin:=18901201}
137
138#D- Name of the job to work in a standalone mode (needed for mask patch)
139#D- Default : value from config.card if any
140config_UserChoices_JobName=${config_UserChoices_JobName:=name_of_the_job}
141
142#D- Directory where output data are stored (needed in standalone mode for mask patch)
143#D- Default : value from AA_job if any
144R_SAVE=${R_SAVE:=/path/to/your/ARCHIVE/FILES}
145
146#D- Flag to determine atlas job's output directory
147#D- Default : value from libIGCM_post.ksh if any
148POST_DIR=${POST_DIR:=${PBS_O_WORKDIR}}
149
150#D- Increased verbosity (1, 2, 3)
151#D- Default : value from AA_job if any
152Verbosity=${Verbosity:=3}
153
154#D- Low level debug : to bypass lib test checks and stack construction
155#D- Default : value from AA_job if any
156DEBUG_debug=${DEBUG_debug:=false}
157
158#D- TEMPORARY Flag to determine atmospheric resolution
159#D- Default : value from atmospheric driver if any
160RESOL_ATM=${RESOL_ATM:=ALL}
161
162#D- TEMPORARY Flag to determine ocean resolution
163#D- Default : value from ocean driver if any
164RESOL_OCE=${RESOL_OCE:=ORCA2}
165
166#D- TEMPORARY Flag to determine ice resolution
167#D- Default : value from ice driver if any
168RESOL_ICE=${RESOL_ICE:=ORCA2}
169
170#D- TEMPORARY Flag to determine biogeochemistry resolution
171#D- Default : value from ice driver if any
172RESOL_MBG=${RESOL_MBG:=ORCA2}
173
174#D- Flag to determine surface resolution
175#D- Default : value from surface driver if any
176RESOL_SRF=ALL
177
178#D- Flag to determine surface resolution
179#D- Default : value from surface driver if any
180RESOL_SBG=ALL
181
182########################################################################
183
184. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
185      ( ${DEBUG_debug} ) && IGCM_debug_Check
186. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
187     ( ${DEBUG_debug} ) && IGCM_card_Check
188. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
189     ( ${DEBUG_debug} ) && IGCM_date_Check
190#-------
191. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
192. ${libIGCM}/libIGCM_post/libIGCM_post.ksh
193
194########################################################################
195
196#set -vx
197
198RUN_DIR=${RUN_DIR_PATH}
199IGCM_sys_MkdirWork ${RUN_DIR}
200IGCM_sys_Cd ${RUN_DIR}
201#
202if [ ${RebuildFromArchive} = true ] ; then
203    ListAllRebuildDir=$( IGCM_sys_RshArchive ls -d ${REBUILD_DIR}/REBUILD_* | grep -B $(( ${NbRebuildDir} -1 )) ${LastPeriodForRebuild} )
204else
205    ListAllRebuildDir=$( IGCM_sys_RshMaster ls -d ${REBUILD_DIR}/REBUILD_* | grep -B $(( ${NbRebuildDir} -1 )) ${LastPeriodForRebuild} )
206fi
207#
208
209for directory in ${ListAllRebuildDir} ; do
210    #
211    if [ ${RebuildFromArchive} = true ] ; then
212        IGCM_sys_Get_Dir ${directory} ${RUN_DIR}
213    else
214        IGCM_sys_Get_Master ${directory} ${RUN_DIR}
215    fi
216    #
217    IGCM_sys_Cd ${RUN_DIR}/$( basename ${directory} )
218
219    # --------------------------------------------------------------------
220    # Source function include in the REBUILD ksh and rebuild
221    # --------------------------------------------------------------------
222    . ${RUN_DIR}/$( basename ${directory} )/rebuild.ksh
223    IGCM_FlushRebuild
224    #
225    IGCM_sys_Cd ${RUN_DIR}
226    # Clean Up
227    if [ ${RebuildFromArchive} = true ] ; then
228        IGCM_sys_RshArchive rm -rf ${directory}
229    else
230        IGCM_sys_Rm -rf ${directory}
231    fi
232done
233
234# Clean RUN_DIR_PATH (necessary for cesium only)
235IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
Note: See TracBrowser for help on using the repository browser.