source: tags/libIGCM_v1_5/AA_rebuild_fromArchive @ 293

Last change on this file since 293 was 229, checked in by mmaipsl, 14 years ago

Littles modifications in StandAlone? mode for post-treatment scripts.

Change libIGCM default path for StandAlone? :
Now ins_job will give libIGCM path on host for run
(add a warning for blind system that require mirroring).
In rebuild jobs :
1) change NbRebuildDir? default value to 1000

(ie "all" old rebuild that haven't been done).

2) Change name of internal 'PeriodDateBegin?' for "LastPeriodForRebuild?".

File size: 8.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 ; $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 ; $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 #MSUB -r REBUILDARCH    # Nom du job               
57#-Q- sx9mercure #MSUB -N 1              # Reservation du noeud
58#-Q- sx9mercure #MSUB -n 1              # Reservation du processus
59#-Q- sx9mercure #MSUB -T 86400          # Limite de temps elapsed du job
60#-Q- sx9mercure #MSUB -E "-j o"
61#-Q- sx9mercure #MSUB -E "-S /bin/ksh"
62#-Q- sx9mercure ##MSUB -e nco.out        # Sortie standard
63#-Q- sx9mercure ##MSUB -o nco.out        # Sortie standard
64#-Q- titane #!/bin/ksh
65#-Q- titane ######################
66#-Q- titane ## TITANE   CEA ##
67#-Q- titane ######################
68#-Q- titane #MSUB -r REBUILDARCH    # Nom du job               
69#-Q- titane #MSUB -N 1              # Reservation du noeud
70#-Q- titane #MSUB -n 1              # Reservation du processus
71#-Q- titane #MSUB -T 86400          # Limite de temps elapsed du job
72#-Q- titane #MSUB -E "-j o"
73#-Q- titane #MSUB -E "-S /bin/ksh"
74#-Q- titane ##MSUB -e nco.out        # Sortie standard
75#-Q- titane ##MSUB -o nco.out        # Sortie standard
76#-Q- default #!/bin/ksh
77#-Q- default ##################
78#-Q- default ## DEFAULT HOST ##
79#-Q- default ##################
80
81# $Date: $
82# $Author: $
83# $Revision: $
84# IPSL (2006)
85#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
86
87#set -eu
88#set -vx
89
90date
91
92#-Q- sx8brodie export OMP_NUM_THREADS=1
93#-Q- aix6 export OMP_NUM_THREADS=1
94
95########################################################################
96
97#D- Flag to determine if this job in a standalone mode
98#D- Default : value from AA_job if any
99StandAlone=${StandAlone:=true}
100
101#D- Low level debug : to bypass lib test checks and stack construction
102#D- Default : value from AA_job if any
103libIGCM=${libIGCM:=::modipsl::/libIGCM}
104# WARNING for StandAlone used : To run this script on some machine,
105# you must check MirrorlibIGCM variable in sys library.
106# If this variable is true, you must use libIGCM_POST path instead
107# of your running libIGCM directory.
108
109#D- Directory where files we need to rebuild are store
110#D- Default : value from AA_job if any
111REBUILD_DIR=${REBUILD_DIR:=/path/to/your/TMP/REBUILD/FILES}
112
113#D- How many directory to rebuild we have to consider
114#D- Default : value from AA_job if any
115NbRebuildDir=${NbRebuildDir:=1000}
116
117#D- Suffix date we will use to determine which directory to rebuild
118#D- We will rebuild NbRebuildDir before and including PeriodDateBegin
119#D- Default : value from AA_job if any
120LastPeriodForRebuild=${PeriodDateBegin:=18901201}
121
122#D- Name of the job to work in a standalone mode (needed for mask patch)
123#D- Default : value from config.card if any
124config_UserChoices_JobName=${config_UserChoices_JobName:=name_of_the_job}
125
126#D- Directory where output data are stored (needed in standalone mode for mask patch )
127#D- Default : value from AA_job if any
128R_SAVE=${R_SAVE:=/path/to/your/ARCHIVE/FILES}
129
130#D- Flag to determine atlas job's output directory
131#D- Default : value from libIGCM_post.ksh if any
132POST_DIR=${POST_DIR:=${PBS_O_WORKDIR}}
133
134#D- Increased verbosity (1, 2, 3)
135#D- Default : value from AA_job if any
136Verbosity=${Verbosity:=3}
137
138#D- Low level debug : to bypass lib test checks and stack construction
139#D- Default : value from AA_job if any
140DEBUG_debug=${DEBUG_debug:=false}
141
142#D- TEMPORARY Flag to determine atmospheric resolution
143#D- Default : value from atmospheric driver if any
144RESOL_ATM=${RESOL_ATM:=ALL}
145
146#D- TEMPORARY Flag to determine ocean resolution
147#D- Default : value from ocean driver if any
148RESOL_OCE=${RESOL_OCE:=ORCA2}
149
150#D- TEMPORARY Flag to determine ice resolution
151#D- Default : value from ice driver if any
152RESOL_ICE=${RESOL_ICE:=ORCA2}
153
154#D- TEMPORARY Flag to determine biogeochemistry resolution
155#D- Default : value from ice driver if any
156RESOL_MBG=${RESOL_MBG:=ORCA2}
157
158#D- Flag to determine surface resolution
159#D- Default : value from surface driver if any
160RESOL_SRF=ALL
161
162#D- Flag to determine surface resolution
163#D- Default : value from surface driver if any
164RESOL_SBG=ALL
165
166########################################################################
167
168. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
169      ( ${DEBUG_debug} ) && IGCM_debug_Check
170. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
171     ( ${DEBUG_debug} ) && IGCM_card_Check
172. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
173     ( ${DEBUG_debug} ) && IGCM_date_Check
174#-------
175. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
176. ${libIGCM}/libIGCM_post/libIGCM_post.ksh
177
178########################################################################
179
180#set -vx
181
182RUN_DIR=${RUN_DIR_PATH}
183IGCM_sys_MkdirWork ${RUN_DIR}
184IGCM_sys_Cd ${RUN_DIR}
185#
186ListAllRebuildDir=$( IGCM_sys_RshArchive ls -d ${REBUILD_DIR}/REBUILD_* | grep -B $(( ${NbRebuildDir} -1 )) ${LastPeriodForRebuild} )
187#
188
189for directory in ${ListAllRebuildDir} ; do
190    #
191    IGCM_sys_Get_Dir ${directory} ${RUN_DIR}
192    #
193    IGCM_sys_Cd ${RUN_DIR}/$( basename ${directory} )
194
195    # --------------------------------------------------------------------
196    # Source function include in the REBUILD ksh and rebuild
197    # --------------------------------------------------------------------
198    . ${RUN_DIR}/$( basename ${directory} )/rebuild.ksh
199    IGCM_FlushRebuild
200    #
201    IGCM_sys_Cd ${RUN_DIR}
202    # Clean Up
203    IGCM_sys_RshArchive rm -rf ${directory}
204done
205
206# Clean RUN_DIR_PATH (necessary for cesium)
207IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
Note: See TracBrowser for help on using the repository browser.