source: tags/libIGCM_v2.0_rc3/AA_rebuild_fromWorkdir @ 1170

Last change on this file since 1170 was 785, checked in by labetoulle, 11 years ago

Cosmetics :

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