source: tags/libIGCM_v1_7/AA_rebuild_fromArchive @ 302

Last change on this file since 302 was 299, checked in by mafoipsl, 14 years ago

Use mercure (scalaire) new front end for SX8 post-processing.

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