source: trunk/libIGCM/AA_rebuild_fromWorkdir @ 278

Last change on this file since 278 was 258, checked in by sdipsl, 14 years ago
  • Do not specify scalaire on the command line, it's in the header
  • RebuildFromArchive? is false by default in AA_rebuild_fromWorkdir
File size: 9.1 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- default #!/bin/ksh
76#-Q- default ##################
77#-Q- default ## DEFAULT HOST ##
78#-Q- default ##################
79
80# $Date: $
81# $Author: $
82# $Revision: $
83# IPSL (2006)
84#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
85
86#set -eu
87#set -vx
88
89date
90
91#-Q- sx8brodie export OMP_NUM_THREADS=1
92#-Q- aix6 export OMP_NUM_THREADS=1
93
94########################################################################
95
96#D- Flag to determine if this job in a standalone mode
97#D- Default : value from AA_job if any
98StandAlone=${StandAlone:=true}
99
100#D- Low level debug : to bypass lib test checks and stack construction
101#D- Default : value from AA_job if any
102libIGCM=${libIGCM:=::modipsl::/libIGCM}
103# WARNING for StandAlone used : To run this script on some machine,
104# you must check MirrorlibIGCM variable in sys library.
105# If this variable is true, you must use libIGCM_POST path instead
106# of your running libIGCM directory.
107
108#D- Do we rebuild parallel output from archive or from ${BIGDIR}
109#D- Default : value from AA_job if any
110RebuildFromArchive=${RebuildFromArchive:=false}
111
112#D- Directory where files we need to rebuild are store
113#D- Default : value from AA_job if any
114#D- if RebuildFromArchive=true REBUILD_DIR=${DMFDIR}/IGCM_OUT/.../JobName/TMP
115#D- example : /dmnfs09/cont003/p86denv/IGCM_OUT/IPSLCM5/CM5PIRC7/TMP
116#D- if RebuildFromArchive=false REBUILD_DIR=${BIGDIR}/REBUILD/TagName/JobName/
117#D- example : /scratch/cont003/p86denv/REBUILD/IPSLCM5/SCAL-NEW
118REBUILD_DIR=${REBUILD_DIR:=/path/to/your/TMP/REBUILD/FILES}
119
120#D- How many directory to rebuild we have to consider
121#D- Default : value from AA_job if any
122NbRebuildDir=${NbRebuildDir:=1000}
123
124#D- Suffix date we will use to determine which directory to rebuild
125#D- We will rebuild NbRebuildDir before and including PeriodDateBegin
126#D- Default : value from AA_job if any
127LastPeriodForRebuild=${PeriodDateBegin:=18901201}
128
129#D- Name of the job to work in a standalone mode (needed for mask patch)
130#D- Default : value from config.card if any
131config_UserChoices_JobName=${config_UserChoices_JobName:=name_of_the_job}
132
133#D- Directory where output data are stored (needed in standalone mode for mask patch)
134#D- Default : value from AA_job if any
135R_SAVE=${R_SAVE:=/path/to/your/ARCHIVE/FILES}
136
137#D- Flag to determine atlas job's output directory
138#D- Default : value from libIGCM_post.ksh if any
139POST_DIR=${POST_DIR:=${PBS_O_WORKDIR}}
140
141#D- Increased verbosity (1, 2, 3)
142#D- Default : value from AA_job if any
143Verbosity=${Verbosity:=3}
144
145#D- Low level debug : to bypass lib test checks and stack construction
146#D- Default : value from AA_job if any
147DEBUG_debug=${DEBUG_debug:=false}
148
149#D- TEMPORARY Flag to determine atmospheric resolution
150#D- Default : value from atmospheric driver if any
151RESOL_ATM=${RESOL_ATM:=ALL}
152
153#D- TEMPORARY Flag to determine ocean resolution
154#D- Default : value from ocean driver if any
155RESOL_OCE=${RESOL_OCE:=ORCA2}
156
157#D- TEMPORARY Flag to determine ice resolution
158#D- Default : value from ice driver if any
159RESOL_ICE=${RESOL_ICE:=ORCA2}
160
161#D- TEMPORARY Flag to determine biogeochemistry resolution
162#D- Default : value from ice driver if any
163RESOL_MBG=${RESOL_MBG:=ORCA2}
164
165#D- Flag to determine surface resolution
166#D- Default : value from surface driver if any
167RESOL_SRF=ALL
168
169#D- Flag to determine surface resolution
170#D- Default : value from surface driver if any
171RESOL_SBG=ALL
172
173########################################################################
174
175. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
176      ( ${DEBUG_debug} ) && IGCM_debug_Check
177. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
178     ( ${DEBUG_debug} ) && IGCM_card_Check
179. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
180     ( ${DEBUG_debug} ) && IGCM_date_Check
181#-------
182. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
183. ${libIGCM}/libIGCM_post/libIGCM_post.ksh
184
185########################################################################
186
187#set -vx
188
189RUN_DIR=${RUN_DIR_PATH}
190IGCM_sys_MkdirWork ${RUN_DIR}
191IGCM_sys_Cd ${RUN_DIR}
192#
193if [ ${RebuildFromArchive} = true ] ; then
194    ListAllRebuildDir=$( IGCM_sys_RshArchive ls -d ${REBUILD_DIR}/REBUILD_* | grep -B $(( ${NbRebuildDir} -1 )) ${LastPeriodForRebuild} )
195else
196    ListAllRebuildDir=$( IGCM_sys_RshMaster ls -d ${REBUILD_DIR}/REBUILD_* | grep -B $(( ${NbRebuildDir} -1 )) ${LastPeriodForRebuild} )
197fi
198#
199
200for directory in ${ListAllRebuildDir} ; do
201    #
202    if [ ${RebuildFromArchive} = true ] ; then
203        IGCM_sys_Get_Dir ${directory} ${RUN_DIR}
204    else
205        IGCM_sys_Get_Master ${directory} ${RUN_DIR}
206    fi
207    #
208    IGCM_sys_Cd ${RUN_DIR}/$( basename ${directory} )
209
210    # --------------------------------------------------------------------
211    # Source function include in the REBUILD ksh and rebuild
212    # --------------------------------------------------------------------
213    . ${RUN_DIR}/$( basename ${directory} )/rebuild.ksh
214    IGCM_FlushRebuild
215    #
216    IGCM_sys_Cd ${RUN_DIR}
217    # Clean Up
218    if [ ${RebuildFromArchive} = true ] ; then
219        IGCM_sys_RshArchive rm -rf ${directory}
220    else
221        IGCM_sys_Rm -rf ${directory}
222    fi
223done
224
225# Clean RUN_DIR_PATH (necessary for cesium only)
226IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
Note: See TracBrowser for help on using the repository browser.