1 | #-Q- sxnec ################## |
---|
2 | #-Q- sxnec ## SXNEC IDRIS ## |
---|
3 | #-Q- sxnec ################## |
---|
4 | #-Q- sxnec #@$-r :XXX:XXX:XXX: # job name |
---|
5 | #-Q- sxnec #@$-me # send a mail when execution ends |
---|
6 | #-Q- sxnec #@$-eo # glue standard error and output |
---|
7 | #-Q- sxnec #@$-lT 1:00:00 # total time limit |
---|
8 | #-Q- sxnec #@$-lt 1:00:00 # processor time limit |
---|
9 | #-Q- sxnec #@$-lM 3Gb # memory limit |
---|
10 | #-Q- sxnec #@$-o sortie_XXXXXXX.1 # output file name |
---|
11 | #-Q- sxnec #@$-jo # sum up performances |
---|
12 | #-Q- sx6nec ################## |
---|
13 | #-Q- sx6nec ## SX6NEC CEA ## |
---|
14 | #-Q- sx6nec ################## |
---|
15 | #-Q- sx6nec #PBS -N :XXX:XXX:XXX: # job name |
---|
16 | #-Q- sx6nec #PBS -j o # glue standard error and output |
---|
17 | #-Q- sx6nec #PBS -o sortie_XXXXXXX.1 # output file name |
---|
18 | #-Q- sx6nec #PBS -S /usr/bin/ksh # shell type |
---|
19 | #-Q- sx6nec #PBS -l memsz_job=3gb # memory limit |
---|
20 | #-Q- sx6nec #PBS -l cputim_job=1:00:00 # time limit |
---|
21 | #-Q- fjvpp #################### |
---|
22 | #-Q- fjvpp ## FJVPP 5000 CEA ## |
---|
23 | #-Q- fjvpp #################### |
---|
24 | #-Q- fjvpp #@$-r :XXX:XXX:XXX: # job name |
---|
25 | #-Q- fjvpp #@$-me # send a mail when execution ends |
---|
26 | #-Q- fjvpp #@$-eo # glue standard error and output |
---|
27 | #-Q- fjvpp #@$-lT 1:00:00 # total time limit |
---|
28 | #-Q- fjvpp #@$-lt 1:00:00 # processor time limit |
---|
29 | #-Q- fjvpp #@$-lM 3Gb # memory limit |
---|
30 | #-Q- fjvpp #@$-o RRRRRRR/sortie_XXXXXXX.1 # output file name |
---|
31 | #-Q- fjvpp #@$-ko # output listing on the disk |
---|
32 | #-Q- fjvpp #@$-s /bin/ksh # shell type |
---|
33 | # |
---|
34 | # |
---|
35 | ######################################################################## |
---|
36 | ## |
---|
37 | ## Execution script for ORCHIDEE OFFLINE |
---|
38 | ## $Header: /home/ssipsl/CVSREP/ORCHIDEE_OL/EXP00/AA_job,v 1.5 2004/11/29 16:46:35 ssipsl Exp $ |
---|
39 | ## |
---|
40 | ## Rachid BENSHILA & Patricia CADULE |
---|
41 | ## Original ressources : |
---|
42 | ## Lancement Coupleur : Oasis team |
---|
43 | ## Lancement ORCA : Olivier Marti |
---|
44 | ## Lancement LMDZ : Laurent Fairhead |
---|
45 | ## Systeme de relances : Olivier Marti |
---|
46 | ## Atlas : Sebastien Denvil |
---|
47 | ## And inspiration from Gerhard Krinner |
---|
48 | ######################################################################### |
---|
49 | ##-- print the commands before and after their interpretation by |
---|
50 | ##-- the shell |
---|
51 | date |
---|
52 | set -vx |
---|
53 | ## |
---|
54 | |
---|
55 | #=============================================# |
---|
56 | # BEGINNING OF USER MODIFICATIONS # |
---|
57 | #=============================================# |
---|
58 | |
---|
59 | ######################################################################### |
---|
60 | ## |
---|
61 | ## 1. Current Modifications |
---|
62 | ## |
---|
63 | ######################################################################### |
---|
64 | ## |
---|
65 | ###-- Experience name |
---|
66 | # |
---|
67 | CEXPER=XXXXXXX |
---|
68 | # |
---|
69 | ###-- Forcing File (omitting .nc) |
---|
70 | # |
---|
71 | F_FILE=WG_cru |
---|
72 | # |
---|
73 | ###-- Run.def (omitting .def) |
---|
74 | # |
---|
75 | F_RUN=orchidee |
---|
76 | # |
---|
77 | ###-- Simulation length |
---|
78 | # |
---|
79 | units=Y # time unit |
---|
80 | |
---|
81 | duree_nostomate=0 # orchidee |
---|
82 | duree_offlineini=0 # teststomate |
---|
83 | duree_inistomate=0 # orchidee with stomate |
---|
84 | |
---|
85 | n_iter=0 # iteration |
---|
86 | duree_sechiba=0 # orchidee |
---|
87 | duree_stomate=0 # teststomate |
---|
88 | |
---|
89 | duree_carbonsol=0 # forcesoil |
---|
90 | duree_final=1 # orchidee |
---|
91 | # |
---|
92 | ###-- Postprocessing |
---|
93 | # |
---|
94 | OK_DIAG=n |
---|
95 | # |
---|
96 | ###-- Vegetation flags |
---|
97 | # |
---|
98 | ok_co2=y |
---|
99 | ok_stomate=n |
---|
100 | ok_dgvm=n |
---|
101 | # |
---|
102 | ###-- Restart if necessary (absolute pathname) |
---|
103 | # |
---|
104 | no_restart=y |
---|
105 | RESTART_SECH= |
---|
106 | RESTART_STOM= |
---|
107 | RESTART_DRI= |
---|
108 | # |
---|
109 | ###-- Some current flags |
---|
110 | # |
---|
111 | OK_WEATHER=y |
---|
112 | resolution_LON=1 |
---|
113 | resolution_LAT=1 |
---|
114 | limit_west=-180 |
---|
115 | limit_east=180 |
---|
116 | limit_north=90 |
---|
117 | limit_south=-90 |
---|
118 | |
---|
119 | sechistlev=5 |
---|
120 | sechistdt=2592000 |
---|
121 | stohistlev_sto=2 |
---|
122 | stohistlev_sec=10 |
---|
123 | stohistdt_sto=60 |
---|
124 | stohistdt_sec=15 |
---|
125 | |
---|
126 | sechiba_hist=sechiba_history.nc |
---|
127 | stomate_hist=stomate_history.nc |
---|
128 | |
---|
129 | moteur_dem=driver_start.nc |
---|
130 | moteur_redem=driver_restart.nc |
---|
131 | sechiba_dem=sechiba_start.nc |
---|
132 | sechiba_redem=sechiba_restart.nc |
---|
133 | stomate_dem=stomate_start.nc |
---|
134 | stomate_redem=stomate_restart.nc |
---|
135 | # |
---|
136 | ######################################################################### |
---|
137 | ## |
---|
138 | ## 2. Advanced modifications |
---|
139 | ## |
---|
140 | ######################################################################### |
---|
141 | ## |
---|
142 | ###-- Forcing and other files are stored together in this repository, you can specify yours |
---|
143 | # |
---|
144 | #-Q- sxnec R_STOCKAGE="gaya:/u/rech/ces/rces803/FORCAGE_OL" |
---|
145 | #-Q- sx6nec R_STOCKAGE="/dmnfs/p86bensh/FORCAGE_OL" |
---|
146 | #-Q- fjvpp R_STOCKAGE="/G/nymphea0/dmnfs/p86bensh/FORCAGE_OL" |
---|
147 | #-- Original files : //dods.idris.fr/rpsl003 |
---|
148 | # |
---|
149 | ###-- Flags you should not touch |
---|
150 | # |
---|
151 | OK_SITE=n |
---|
152 | # |
---|
153 | ###-- Execution repository |
---|
154 | # |
---|
155 | MODIPSL=MMMMMMM |
---|
156 | R_EXE=${MODIPSL}/bin |
---|
157 | R_UTILITAIRES=${MODIPSL}/modeles/ORCHIDEE_OL/Utilitaire |
---|
158 | JOB=${CEXPER} |
---|
159 | # |
---|
160 | ###-- A flag to add a level in your output repository |
---|
161 | ###-- for example for different experiences with the same Job |
---|
162 | # |
---|
163 | #FLAG= |
---|
164 | # |
---|
165 | ###-- Flag you should not touch (automatically set) |
---|
166 | # |
---|
167 | OK_SITE=n |
---|
168 | # |
---|
169 | |
---|
170 | #=============================================# |
---|
171 | # END OF USER MODIFICATIONS # |
---|
172 | #=============================================# |
---|
173 | |
---|
174 | |
---|
175 | ######################################################################### |
---|
176 | ## |
---|
177 | ## 3. Repositories definition |
---|
178 | ## |
---|
179 | ######################################################################### |
---|
180 | ###-- Data repository for input/output |
---|
181 | # |
---|
182 | R_DONNEES=/tmp/DATA/${CEXPER} |
---|
183 | #-Q- sxnec R_DONNEES=${WORKDIR}/DATA/${CEXPER} |
---|
184 | #-Q- sx6nec R_DONNEES=${SCRATCHDIR}/DATA/${CEXPER} |
---|
185 | #-Q- fjvpp R_DONNEES=${SCRATCHDIR}/DATA/${CEXPER} |
---|
186 | R_FICHIERS=SORTIES_CPL_IPSL/${CEXPER} |
---|
187 | # |
---|
188 | R_ENTREE_ORCHIDEE_OL=${R_DONNEES}/Entree/ORCHIDEE_OL |
---|
189 | R_SORTIE_ORCHIDEE_OL=${R_DONNEES}/Sortie/ORCHIDEE_OL |
---|
190 | R_FIC_ORCHIDEE_OL=${R_FICHIERS}/ORCHIDEE_OL |
---|
191 | # |
---|
192 | R_FIC_MORE=${R_FICHIERS}/More |
---|
193 | R_FIC_OUT=${R_FICHIERS}/Out |
---|
194 | R_FIC_EXE=${R_FICHIERS}/Exe |
---|
195 | R_FIC_MORE_U=${R_FIC_MORE}/Util |
---|
196 | |
---|
197 | # |
---|
198 | if [ ! -d ${R_DONNEES} ]; then |
---|
199 | mkdir -p ${R_ENTREE_ORCHIDEE_OL} |
---|
200 | mkdir -p ${R_SORTIE_ORCHIDEE_OL} |
---|
201 | fi |
---|
202 | # |
---|
203 | #-Q- sxnec mkdir -p ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG} |
---|
204 | #-Q- sx6nec mkdir -p ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG} |
---|
205 | |
---|
206 | ###-- Some shell functions |
---|
207 | #- function to change the run.def |
---|
208 | remplace() |
---|
209 | { |
---|
210 | sed "/$1/D" run.def > r2 |
---|
211 | cat <<END >>r2 |
---|
212 | $1=$2 |
---|
213 | END |
---|
214 | mv r2 run.def |
---|
215 | } |
---|
216 | |
---|
217 | #- commands for files transfers |
---|
218 | PUT="echo PUT" |
---|
219 | GET="echo GET" |
---|
220 | #-Q- sxnec PUT=mfput |
---|
221 | #-Q- sx6nec PUT=putfer |
---|
222 | #-Q- fjvpp PUT=putcosmos |
---|
223 | #-Q- sxnec GET=mfget |
---|
224 | #-Q- sx6nec GET=getfer |
---|
225 | #-Q- fjvpp GET=getcosmos |
---|
226 | #-Q- sxnec RSH='rsh rhodes exec /bin/ksh' |
---|
227 | #-Q- sx6nec RSH='rsh mercure exec /bin/ksh' |
---|
228 | #-Q- fjvpp RSH='remsh ixia exec /bin/ksh' |
---|
229 | # |
---|
230 | demigr="echo demigr" |
---|
231 | #-Q- fjvpp demigr="/usr/local/bin/dmget" |
---|
232 | #-Q- sxnec demigr="/usr/local/bin/mfget" |
---|
233 | #-Q- sx6nec demigr="dmget" |
---|
234 | |
---|
235 | MKDIR="mkdir" |
---|
236 | #-Q- fjvpp MKDIR="/usr/X11R6/bin/mkdirhier" |
---|
237 | #- creation de repertoire sur le serveur fichier sur Fujitsu seulement |
---|
238 | #-Q- fjvpp RMKDIR="mkdir -p ${DMFDIR}/" |
---|
239 | #-Q- fjvpp ${RMKDIR}/${R_FIC_ORCHIDEE_OL} |
---|
240 | #-Q- fjvpp DPUT () { ( [ -d "AAAAAAA/$2" ] || ${RMKDIR}/$2 ) & ( ${PUT} $1 $2/$3 ) } |
---|
241 | #-Q- sxnec DPUT () { ( ${PUT} $1 $2/$3 ) } |
---|
242 | #-Q- sx6nec RMKDIR="mkdir -p AAAAAAA" |
---|
243 | #-Q- sx6nec DPUT () { ( [ -d "AAAAAAA/$2" ] || ${RMKDIR}/$2 ) && ( ${PUT} $1 AAAAAAA/$2/$3 ) } |
---|
244 | #-Q- fjvpp DGET () { ( ${GET} $2/$1 $3/$1 ) } |
---|
245 | #-Q- sxnec DGET () { ( ${GET} $2/$1 $3/$1 ) } |
---|
246 | #-Q- sx6nec DGET () { ( ${GET} $2/$1 $3/$1 ) } |
---|
247 | |
---|
248 | #-Q- fjvpp ${RMKDIR}/${R_FIC_ORCHIDEE_OL} |
---|
249 | #-Q- fjvpp ${RMKDIR}/${R_FIC_EXE} |
---|
250 | #-Q- fjvpp ${RMKDIR}/${R_FIC_MORE} |
---|
251 | #-Q- fjvpp ${RMKDIR}/${R_FIC_MORE}"/"${FLAG} |
---|
252 | #-Q- fjvpp ${RMKDIR}/${R_FIC_OUT} |
---|
253 | #-Q- fjvpp ${RMKDIR}/${R_FIC_OUT"/"${FLAG}} |
---|
254 | #-Q- fjvpp ${RMKDIR}/${R_FIC_MORE_U} |
---|
255 | # |
---|
256 | |
---|
257 | ###-- Work space (temporary) |
---|
258 | TMP=/tmp/${CEXPER} |
---|
259 | #-Q- sxnec TMP=${TMPDIR}/${CEXPER} |
---|
260 | #-Q- sx6nec ${MKDIR} ${SCRATCHDIR}/${CEXPER} |
---|
261 | #-Q- sx6nec TMP=${SCRATCHDIR}/${CEXPER}/${FLAG} |
---|
262 | #-Q- fjvpp ${MKDIR} ${SCRATCHDIR}/${CEXPER} |
---|
263 | #-Q- fjvpp TMP=${SCRATCHDIR}/${CEXPER}/${FLAG} |
---|
264 | # |
---|
265 | #-- Ceation if needed |
---|
266 | [ -d ${TMP} ] || ${MKDIR} ${TMP} |
---|
267 | # |
---|
268 | ######################################################################### |
---|
269 | ## |
---|
270 | ## 4. Get initial files |
---|
271 | ## |
---|
272 | ######################################################################### |
---|
273 | ## |
---|
274 | #-- Check if they are present |
---|
275 | #-- |
---|
276 | #-Q- sxnec Rapatrie () { [ -f $1/$2 ] || ( rcp ${R_STOCKAGE}/$2 $1 ;) } |
---|
277 | #-Q- sx6nec Rapatrie () { [ -f $1/$2 ] || ( getfer ${R_STOCKAGE}/$2 $1 ;) } |
---|
278 | #-Q- fjvpp Rapatrie () { [ -f $1/$2 ] || ( cp ${R_STOCKAGE}/$2 $1 ;) } |
---|
279 | # |
---|
280 | Rapatrie ${R_ENTREE_ORCHIDEE_OL} carteveg5km.nc || exit 1 |
---|
281 | Rapatrie ${R_ENTREE_ORCHIDEE_OL} irrigated.nc |
---|
282 | Rapatrie ${R_ENTREE_ORCHIDEE_OL} routing.nc || exit 1 |
---|
283 | Rapatrie ${R_ENTREE_ORCHIDEE_OL} soils_param.nc || exit 1 |
---|
284 | Rapatrie ${R_ENTREE_ORCHIDEE_OL} reftemp.nc || exit 1 |
---|
285 | Rapatrie ${R_ENTREE_ORCHIDEE_OL} lai2D.nc || exit 1 |
---|
286 | # |
---|
287 | ## |
---|
288 | #-- We get the restart files if needed |
---|
289 | if [ "${no_restart}" = "n" ] |
---|
290 | then |
---|
291 | #-Q- sxnec rcp $RESTART_SECH ${R_ENTREE_ORCHIDEE_OL}/$sechiba_dem |
---|
292 | #-Q- sxnec rcp $RESTART_STOM ${R_ENTREE_ORCHIDEE_OL}/$stomate_dem |
---|
293 | #-Q- sxnec rcp RESTART_DRI ${R_ENTREE_ORCHIDEE_OL}/$moteur_dem |
---|
294 | #-Q- sx6nec getfer $RESTART_SECH ${R_ENTREE_ORCHIDEE_OL}/$sechiba_dem |
---|
295 | #-Q- sx6nec getfer $RESTART_STOM ${R_ENTREE_ORCHIDEE_OL}/$stomate_dem |
---|
296 | #-Q- sx6nec getfer $RESTART_DRI ${R_ENTREE_ORCHIDEE_OL}/$moteur_dem |
---|
297 | #-Q- fjvpp cp $RESTART_SECH ${R_ENTREE_ORCHIDEE_OL}/$sechiba_dem |
---|
298 | #-Q- fjvpp cp $RESTART_STOM ${R_ENTREE_ORCHIDEE_OL}/$stomate_dem |
---|
299 | #-Q- fjvpp cp $RESTART_DRI ${R_ENTREE_ORCHIDEE_OL}/$moteur_dem |
---|
300 | fi |
---|
301 | |
---|
302 | ######################################################################### |
---|
303 | ## |
---|
304 | ## 5. Initialisations from the forcing file |
---|
305 | ## |
---|
306 | ######################################################################### |
---|
307 | ## |
---|
308 | |
---|
309 | Rapatrie ${R_ENTREE_ORCHIDEE_OL} ${F_FILE}.nc || exit 1 |
---|
310 | |
---|
311 | #-- If it is not a weather generator, we ask for the dates |
---|
312 | if [ -z "${JOUR_DEBUT_EXP}" ] && [ -z "${MOIS_DEBUT_EXP}" ] && [ -z "${AN_DEBUT_EXP}" ] && [ -z "${JOURS}" ] && [ -z "${MOIS}" } ] && [ -z "${ANS}" ] && [ -z "${JOUR_FINAL_EXP}" ] && [ -z "${MOIS_FINAL_EXP}" ] && [ -z "${AN_FINAL_EXP}" ] && [ "${OK_WEATHER}" = "n" ] |
---|
313 | |
---|
314 | then |
---|
315 | [ -f ${R_UTILITAIRES}/recup_date.py ] && cp ${R_UTILITAIRES}/recup_date.py . |
---|
316 | #-Q- sxnec rcp rhodes:${R_UTILITAIRES}/recup_date.py . |
---|
317 | chmod +rx recup_date.py |
---|
318 | [ -f ${R_UTILITAIRES}/calend365.py ] && cp ${R_UTILITAIRES}/calend365.py . |
---|
319 | #-Q- sxnec rcp rhodes:${R_UTILITAIRES}/calend365.py . |
---|
320 | chmod +rx calend365.py |
---|
321 | [ -f ${R_UTILITAIRES}/sortie_date.py ] && cp ${R_UTILITAIRES}/sortie_date.py . |
---|
322 | #-Q- sxnec rcp rhodes:${R_UTILITAIRES}/sortie_date.py . |
---|
323 | chmod +rx sortie_date.py |
---|
324 | |
---|
325 | DPUT recup_date.py ${R_FIC_MORE_U} recup_date.py |
---|
326 | DPUT calend365.py ${R_FIC_MORE_U} calend365.py |
---|
327 | DPUT sortie_date.py ${R_FIC_MORE_U} sortie_date.py |
---|
328 | |
---|
329 | ${RSH}<<EOL |
---|
330 | export R_FIC_MORE_U=${R_FIC_MORE_U} |
---|
331 | export F_FILE=${F_FILE} |
---|
332 | export R_STOCKAGE=${R_STOCKAGE} |
---|
333 | cd AAAAAAA/${R_FIC_MORE_U} |
---|
334 | #-Q- fjvpp . /home/p86cadul/CDAT/cdat.login_ksh |
---|
335 | #-Q- fjvpp /home/p86jype/CDAT/versions/CDAT_3.3_15_alpha/bin/python sortie_date.py ${R_STOCKAGE}/${F_FILE}.nc > fic.date |
---|
336 | #-Q- sxnec . /home/rech/ces/rces803/cdat.login_ksh |
---|
337 | #-Q- sxnec /home_b/rech/ces/rces599/PYTHON/CDAT/bin/python sortie_date.py ${R_STOCKAGE}/${F_FILE}.nc > fic.date |
---|
338 | #-Q- sx6nec export PATH=/workdir/p25jype/CDAT/versions/CDAT_4.0b1_16_ia64/bin:$PATH |
---|
339 | #-Q- sx6nec/workdir/p25jype/CDAT/versions/CDAT_4.0b1_16_ia64/bin/python sortie_date.py$ {R_STOCKAGE}/${F_FILE}.nc > fic.date |
---|
340 | EOL |
---|
341 | |
---|
342 | R_EXPER=${QSUB_WORKDIR:-${PWD}} |
---|
343 | DGET fic.date ${R_FIC_MORE_U} ${R_EXPER} |
---|
344 | AN_DEBUT_EXP=`awk '{print $1}' ${R_EXPER}/fic.date` |
---|
345 | MOIS_DEBUT_EXP=`awk '{print $2}' ${R_EXPER}/fic.date` |
---|
346 | JOUR_DEBUT_EXP=`awk '{print $3}' ${R_EXPER}/fic.date` |
---|
347 | STEP_SEC=`awk '{print $4}' ${R_EXPER}/fic.date` |
---|
348 | TSTEP=`awk '{print $5}' ${R_EXPER}/fic.date` |
---|
349 | D_JOB_JOUR=`awk '{print $6}' ${R_EXPER}/fic.date` |
---|
350 | AN_FINAL_EXP=`awk '{print $7}' ${R_EXPER}/fic.date` |
---|
351 | MOIS_FINAL_EXP=`awk '{print $8}' ${R_EXPER}/fic.date` |
---|
352 | JOUR_FINAL_EXP=`awk '{print $9}' ${R_EXPER}/fic.date` |
---|
353 | fi |
---|
354 | DATE_DEBUT_EXP=$( printf "%04s%02s%02s\n" ${AN_DEBUT_EXP} ${MOIS_DEBUT_EXP} ${JOUR_DEBUT_EXP} ) |
---|
355 | DATE_FINAL_EXP=$( printf "%04s%02s%02s\n" ${AN_FINAL_EXP} ${MOIS_FINAL_EXP} ${JOUR_FINAL_EXP} ) |
---|
356 | |
---|
357 | # DATES is empty but could be used for future run |
---|
358 | DATES= |
---|
359 | if [ "${OK_SITE}" = "y" ] |
---|
360 | then DATES=${DATE_DEBUT_EXP}_${DATE_FINAL_EXP}_ |
---|
361 | fi |
---|
362 | ######################################################################### |
---|
363 | ## |
---|
364 | ## 6. Pre-Processing |
---|
365 | ## |
---|
366 | ######################################################################### |
---|
367 | |
---|
368 | # ============================================================================== |
---|
369 | # Copy the atlas files if necessary |
---|
370 | # ============================================================================== |
---|
371 | if [ "${OK_DIAG}" = "y" ] |
---|
372 | then |
---|
373 | #-Q- sxnec rcp rhodes:${R_UTILITAIRES}/AA_atlas . |
---|
374 | #-Q- sx6nec cp ${R_UTILITAIRES}/AA_atlas . |
---|
375 | #-Q- fjvpp cp ${R_UTILITAIRES}/AA_atlas . |
---|
376 | #-Q- sxnec sed -e "s,^#-Q- sxnec *,," AA_atlas | grep -v '^#-Q- ' > Job_atlas |
---|
377 | #-Q- sx6nec sed -e "s,^#-Q- sx6nec *,," AA_atlas | grep -v '^#-Q- ' > Job_atlas |
---|
378 | #-Q- fjvpp sed -e "s,^#-Q- fjvpp *,," AA_atlas | grep -v '^#-Q- ' > Job_atlas |
---|
379 | rm -f AA_atlas |
---|
380 | DPUT Job_atlas ${R_FIC_MORE_U} Job_atlas |
---|
381 | fi |
---|
382 | |
---|
383 | if [ "${OK_SITE}" = "y" ] |
---|
384 | then |
---|
385 | #-Q- sxnec rcp rhodes:${R_UTILITAIRES}/Job_atlas . |
---|
386 | #-Q- sx6nec cp ${R_UTILITAIRES}/Job_atlas . |
---|
387 | #-Q- fjvpp cp ${R_UTILITAIRES}/Job_atlas . |
---|
388 | DPUT Job_atlas ${R_FIC_MORE_U} Job_atlas |
---|
389 | #-Q- sxnec rcp rhodes:${R_UTILITAIRES}/Cabauw.cfg . |
---|
390 | #-Q- sx6nec cp ${R_UTILITAIRES}/Cabauw.cfg . |
---|
391 | #-Q- fjvpp cp ${R_UTILITAIRES}/Cabauw.cfg . |
---|
392 | DPUT Cabauw.cfg ${R_FIC_MORE_U} Cabauw.cfg |
---|
393 | fi |
---|
394 | |
---|
395 | # ============================================================================= |
---|
396 | # Time loop : this part should be useful to built a job following IPSL_CM4_v1 |
---|
397 | # ============================================================================= |
---|
398 | ##-- repertoire de controle des enchainements |
---|
399 | #-Q- sxnec R_EXPER=${QSUB_WORKDIR:-${PWD}} |
---|
400 | #-Q- sx6nec R_EXPER=${MODIPSL}/modeles/ORCHIDEE_OL/EXP00 |
---|
401 | #cd ${R_EXPER} |
---|
402 | ## |
---|
403 | ##- creation de ${JOB}.suivi qui contient la date du run en cours ou du run |
---|
404 | ##- en attente et de ${JOB}.log qui contient la trace des exeutions |
---|
405 | ## |
---|
406 | #DATE_DEBUT_EXP=$( printf "%04s%02s%02s\n" ${AN_DEBUT_EXP} ${MOIS_DEBUT_EXP} ${JOUR_DEBUT_EXP} ) |
---|
407 | #DATE_FIN_EXP=$( printf "%04s%02s%02s\n" ${AN_FINAL_EXP} ${MOIS_FINAL_EXP} ${JOUR_FINAL_EXP} ) |
---|
408 | # |
---|
409 | #if [ ! -f "${JOB}.suivi" ] |
---|
410 | #then |
---|
411 | # JOUR_DEB_JOB=${JOUR_DEBUT_EXP} ; MOIS_DEB_JOB=${MOIS_DEBUT_EXP} ; AN_DEB_JOB=${AN_DEBUT_EXP} |
---|
412 | # NUMERO=1 |
---|
413 | #cat <<EOF >${JOB}.suivi |
---|
414 | #${AN_DEB_JOB} ${MOIS_DEB_JOB} ${JOUR_DEB_JOB} ${NUMERO} |
---|
415 | #EOF |
---|
416 | #echo `date` " Begining of Experience : " ${JOB} " in directory :" ${R_EXPER} > ${JOB}.log |
---|
417 | #fi |
---|
418 | # |
---|
419 | #cat ${JOB}.suivi | read AN_DEB_JOB MOIS_DEB_JOB JOUR_DEB_JOB NUMERO |
---|
420 | #echo ${AN_DEB_JOB} ${MOIS_DEB_JOB} ${JOUR_DEB_JOB} |
---|
421 | #echo "`date` $AN_DEB_JOB $MOIS_DEB_JOB $JOUR_DEB_JOB begin" >> ${JOB}.log |
---|
422 | ##-- |
---|
423 | |
---|
424 | # ============================================================================== |
---|
425 | # Copy thz binary files |
---|
426 | # ============================================================================== |
---|
427 | if [ -z ${TMP} ]; then |
---|
428 | echo " the variable TMP is empty !!!" |
---|
429 | exit |
---|
430 | fi |
---|
431 | cd ${TMP} || exit |
---|
432 | #- Clean the work space |
---|
433 | rm -f * |
---|
434 | # ----------------- ORCHIDEE_OL --------------------- |
---|
435 | [ -f ${R_EXE}/orchidee_ol ] && cp ${R_EXE}/orchidee_ol orchidee.e |
---|
436 | [ -f ${R_EXE}/teststomate ] && cp ${R_EXE}/teststomate teststomate.e |
---|
437 | [ -f ${R_EXE}/forcesoil ] && cp ${R_EXE}/forcesoil forcesoil.e |
---|
438 | #-Q- sxnec rcp rhodes:${R_EXE}/orchidee_ol orchidee.e && chmod +x orchidee.e |
---|
439 | #-Q- sxnec rcp rhodes:${R_EXE}/teststomate teststomate.e && chmod +x teststomate.e |
---|
440 | #-Q- sxnec rcp rhodes:${R_EXE}/forcesoil forcesoil.e && chmod +x forcesoil.e |
---|
441 | DPUT orchidee.e ${R_FIC_EXE}/${FLAG} ${CEXPER}_"${DATES}"orchidee.e |
---|
442 | DPUT teststomate.e ${R_FIC_EXE}/${FLAG} ${CEXPER}_"${DATES}"teststomate.e |
---|
443 | DPUT forcesoil.e ${R_FIC_EXE}/${FLAG} ${CEXPER}_"${DATES}"forcesoil.e |
---|
444 | # ============================================================================== |
---|
445 | # Copy the map |
---|
446 | # ============================================================================== |
---|
447 | cp ${R_ENTREE_ORCHIDEE_OL}/lai2D.nc . |
---|
448 | cp ${R_ENTREE_ORCHIDEE_OL}/carteveg5km.nc . |
---|
449 | cp ${R_ENTREE_ORCHIDEE_OL}/irrigated.nc . |
---|
450 | cp ${R_ENTREE_ORCHIDEE_OL}/routing.nc . |
---|
451 | cp ${R_ENTREE_ORCHIDEE_OL}/soils_param.nc . |
---|
452 | cp ${R_ENTREE_ORCHIDEE_OL}/reftemp.nc . |
---|
453 | cp ${R_ENTREE_ORCHIDEE_OL}/${F_FILE}.nc . |
---|
454 | if [ "${no_restart}" = "n" ] |
---|
455 | then |
---|
456 | cp ${R_ENTREE_ORCHIDEE_OL}/$sechiba_dem . |
---|
457 | cp ${R_ENTREE_ORCHIDEE_OL}/$stomate_dem . |
---|
458 | cp ${R_ENTREE_ORCHIDEE_OL}/$moteur_dem . |
---|
459 | fi |
---|
460 | |
---|
461 | # Copy the run.def |
---|
462 | # ============================================================================== |
---|
463 | cp ${R_EXPER}/${F_RUN}.def run.def |
---|
464 | |
---|
465 | remplace OUTPUT_FILE $sechiba_hist |
---|
466 | remplace STOMATE_OUTPUT_FILE $stomate_hist |
---|
467 | |
---|
468 | # change the flags in the run.def |
---|
469 | remplace RESTART_FILEIN $moteur_dem |
---|
470 | remplace RESTART_FILEOUT $moteur_redem |
---|
471 | remplace SECHIBA_restart_in $sechiba_dem |
---|
472 | remplace SECHIBA_rest_out $sechiba_redem |
---|
473 | remplace STOMATE_RESTART_FILEIN $stomate_dem |
---|
474 | remplace STOMATE_RESTART_FILEOUT $stomate_redem |
---|
475 | |
---|
476 | if [ "${OK_SITE}" = "n" ] |
---|
477 | then |
---|
478 | remplace FORCING_FILE ${F_FILE}.nc |
---|
479 | remplace SECHIBA_HISTLEVEL $sechistlev |
---|
480 | remplace WRITE_STEP $sechistdt |
---|
481 | remplace ALLOW_WEATHERGEN $OK_WEATHER |
---|
482 | remplace MERID_RES $resolution_LON |
---|
483 | remplace ZONAL_RES $resolution_LAT |
---|
484 | remplace LIMIT_WEST $limit_west |
---|
485 | remplace LIMIT_EAST $limit_east |
---|
486 | remplace LIMIT_NORTH $limit_north |
---|
487 | remplace LIMIT_SOUTH $limit_south |
---|
488 | |
---|
489 | fi |
---|
490 | |
---|
491 | ls -alF |
---|
492 | |
---|
493 | # loop counter |
---|
494 | let annee=0 |
---|
495 | |
---|
496 | ######################################################################### |
---|
497 | ## |
---|
498 | ## 7. Here comes the run |
---|
499 | ## |
---|
500 | ######################################################################### |
---|
501 | # |
---|
502 | #-Q- sxnec # nb d erreurs admises sur le NEC |
---|
503 | #-Q- sxnec export F_ERRCNT=999999 |
---|
504 | #-Q- sx6nec # nb d erreurs admises sur le NEC |
---|
505 | #-Q- sx6nec export F_ERRCNT=999999 |
---|
506 | #-Q- sx6nec export MPIPROGINF=all |
---|
507 | #-Q- sx6nec # nb max de caracteres par ligne dans le fichier d'output |
---|
508 | #-Q- sx6nec export F_SYSLEN=5000 |
---|
509 | #-Q- sxnec unset F_PROGINF |
---|
510 | #-Q- sx6nec unset MPIPROGINF |
---|
511 | ls -alF |
---|
512 | ls -lrt |
---|
513 | |
---|
514 | # when we do not have any restart file |
---|
515 | # |
---|
516 | if [ $no_restart = 'y' ] ; then |
---|
517 | |
---|
518 | let annee=0 |
---|
519 | |
---|
520 | let iter=0 |
---|
521 | |
---|
522 | remplace RESTART_FILEIN NONE |
---|
523 | remplace SECHIBA_restart_in NONE |
---|
524 | remplace STOMATE_RESTART_FILEIN NONE |
---|
525 | |
---|
526 | if [ $duree_nostomate -ne 0 ] ; then |
---|
527 | |
---|
528 | let annee=$annee+$duree_nostomate |
---|
529 | |
---|
530 | echo "we do "$duree_nostomate "year(s) without stomate to create a restart file" |
---|
531 | |
---|
532 | remplace STOMATE_OK_CO2 $ok_co2 |
---|
533 | remplace STOMATE_OK_STOMATE n |
---|
534 | remplace STOMATE_OK_DGVM n |
---|
535 | remplace STOMATE_WATCHOUT y |
---|
536 | |
---|
537 | remplace TIME_LENGTH $duree_nostomate$units |
---|
538 | |
---|
539 | time ./orchidee.e > out_orchidee"${annee}" |
---|
540 | |
---|
541 | # save the job output file |
---|
542 | DPUT out_orchidee"${annee}" ${R_FIC_OUT}"/"${FLAG} . |
---|
543 | # save the run.def |
---|
544 | cp used_run.def ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_used_run.def |
---|
545 | DPUT used_run.def ${R_FIC_MORE}"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_used_run.def |
---|
546 | cp run.def ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_run.def |
---|
547 | DPUT run.def ${R_FIC_MORE}"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_run.def |
---|
548 | # save history files |
---|
549 | DPUT $sechiba_hist ${R_FIC_ORCHIDEE_OL}"/"Output"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_sechiba_history.nc |
---|
550 | mv $sechiba_hist ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_sechiba_history.nc |
---|
551 | [ -f $stomate_hist ] && DPUT $stomate_hist ${R_FIC_ORCHIDEE_OL}"/"Output"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_stomate_history.nc |
---|
552 | [ -f $stomate_hist ] && mv $stomate_hist ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_stomate_history.nc |
---|
553 | # rename restart files |
---|
554 | mv $moteur_redem $moteur_dem |
---|
555 | mv $sechiba_redem $sechiba_dem |
---|
556 | [ -f $stomate_redem ] && mv $stomate_redem $stomate_dem |
---|
557 | # save restart files |
---|
558 | DPUT $moteur_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${moteur_dem} |
---|
559 | DPUT $sechiba_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${sechiba_dem} |
---|
560 | [ -f $stomate_dem ] && DPUT $stomate_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${stomate_dem} |
---|
561 | |
---|
562 | if [ "${OK_WEATHER}" = "y" ] ; then |
---|
563 | remplace RESTART_FILEIN $moteur_dem |
---|
564 | fi |
---|
565 | remplace SECHIBA_restart_in $sechiba_dem |
---|
566 | remplace STOMATE_RESTART_FILEIN $stomate_dem |
---|
567 | |
---|
568 | fi # duree_nostomate |
---|
569 | |
---|
570 | remplace STOMATE_WATCHOUT n |
---|
571 | |
---|
572 | if [ $duree_offlineini -ne 0 ] ; then |
---|
573 | |
---|
574 | let annee=$annee+$duree_offlineini |
---|
575 | |
---|
576 | remplace STOMATE_OK_STOMATE y |
---|
577 | remplace STOMATE_OK_DGVM n |
---|
578 | remplace STOMATE_HISTLEVEL $stohistlev_sto |
---|
579 | remplace STOMATE_HIST_DT $stohistdt_sto |
---|
580 | |
---|
581 | echo "We do "$duree_offlineini "year(s) with teststomate, without DGVM, for spinup." |
---|
582 | |
---|
583 | remplace TIME_LENGTH $duree_offlineini$units |
---|
584 | |
---|
585 | time ./teststomate.e > out_testomate"${annee}" |
---|
586 | |
---|
587 | # save job output file |
---|
588 | DPUT out_testomate"${annee}" ${R_FIC_OUT}"/"${FLAG} . |
---|
589 | # save the run.def |
---|
590 | cp used_run.def ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_used_run.def |
---|
591 | DPUT used_run.def ${R_FIC_MORE}"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_used_run.def |
---|
592 | cp run.def ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_run.def |
---|
593 | DPUT run.def ${R_FIC_MORE}"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_run.def |
---|
594 | # save history files |
---|
595 | DPUT $stomate_hist ${R_FIC_ORCHIDEE_OL}"/"Output"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_stomate_history.nc |
---|
596 | mv $stomate_hist ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_stomate_history.nc |
---|
597 | # rename restart files |
---|
598 | mv $moteur_redem $moteur_dem |
---|
599 | mv $sechiba_redem $sechiba_dem |
---|
600 | mv $stomate_redem $stomate_dem |
---|
601 | # save restart files |
---|
602 | DPUT $moteur_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${moteur_dem} |
---|
603 | DPUT $sechiba_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${sechiba_dem} |
---|
604 | DPUT $stomate_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${stomate_dem} |
---|
605 | |
---|
606 | if [ "${OK_WEATHER}" = "y" ] ; then |
---|
607 | remplace RESTART_FILEIN $moteur_dem |
---|
608 | fi |
---|
609 | remplace SECHIBA_restart_in $sechiba_dem |
---|
610 | remplace STOMATE_RESTART_FILEIN $stomate_dem |
---|
611 | |
---|
612 | fi # duree_offlineini |
---|
613 | |
---|
614 | if [ $duree_inistomate -ne 0 ] ; then |
---|
615 | |
---|
616 | let annee=$annee+$duree_inistomate |
---|
617 | |
---|
618 | remplace STOMATE_OK_STOMATE y |
---|
619 | remplace STOMATE_OK_DGVM n |
---|
620 | remplace STOMATE_HISTLEVEL $stohistlev_sec |
---|
621 | remplace STOMATE_HIST_DT $stohistdt_sec |
---|
622 | |
---|
623 | echo "We do "$duree_inistomate "year(s) with stomate, without DGVM, for spinup." |
---|
624 | |
---|
625 | remplace TIME_LENGTH $duree_inistomate$units |
---|
626 | |
---|
627 | time ./orchidee.e > out_orchidee"${annee}" |
---|
628 | |
---|
629 | # save job output file |
---|
630 | DPUT out_orchidee"${annee}" ${R_FIC_OUT}"/"${FLAG} . |
---|
631 | # save the run.def |
---|
632 | cp used_run.def ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_used_run.def |
---|
633 | DPUT used_run.def ${R_FIC_MORE}"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_used_run.def |
---|
634 | cp run.def ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_run.def |
---|
635 | DPUT run.def ${R_FIC_MORE}"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_run.def |
---|
636 | # save history files |
---|
637 | DPUT $sechiba_hist ${R_FIC_ORCHIDEE_OL}"/"Output"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_sechiba_history.nc |
---|
638 | mv $sechiba_hist ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_sechiba_history.nc |
---|
639 | [ -f $stomate_hist ] && DPUT $stomate_hist ${R_FIC_ORCHIDEE_OL}"/"Output"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_stomate_history.nc |
---|
640 | [ -f $stomate_hist ] && mv $stomate_hist ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_stomate_history.nc |
---|
641 | # rename restart files |
---|
642 | mv $moteur_redem $moteur_dem |
---|
643 | mv $sechiba_redem $sechiba_dem |
---|
644 | [ -f $stomate_redem ] && mv $stomate_redem $stomate_dem |
---|
645 | # save restart files |
---|
646 | DPUT $moteur_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${moteur_dem} |
---|
647 | DPUT $sechiba_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${sechiba_dem} |
---|
648 | [ -f $stomate_dem ] && DPUT $stomate_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${stomate_dem} |
---|
649 | |
---|
650 | if [ "${OK_WEATHER}" = "y" ] ; then |
---|
651 | remplace RESTART_FILEIN $moteur_dem |
---|
652 | fi |
---|
653 | remplace SECHIBA_restart_in $sechiba_dem |
---|
654 | remplace STOMATE_RESTART_FILEIN $stomate_dem |
---|
655 | |
---|
656 | fi # duree_inistomate |
---|
657 | |
---|
658 | fi # no_restart |
---|
659 | |
---|
660 | # after the restart part |
---|
661 | # |
---|
662 | if [ "${OK_SITE}" = "n" ] |
---|
663 | then |
---|
664 | remplace STOMATE_OK_STOMATE $ok_stomate |
---|
665 | remplace STOMATE_OK_DGVM $ok_dgvm |
---|
666 | fi |
---|
667 | |
---|
668 | # iteration counter |
---|
669 | let i=0 |
---|
670 | |
---|
671 | while [ $i -lt $n_iter ] ; do |
---|
672 | |
---|
673 | let i=i+1 |
---|
674 | |
---|
675 | echo |
---|
676 | echo ===================== |
---|
677 | echo ITERATION : $i |
---|
678 | echo ===================== |
---|
679 | |
---|
680 | if [ $duree_sechiba -ne 0 ] ; then |
---|
681 | |
---|
682 | # start with orchidee_ol |
---|
683 | |
---|
684 | echo |
---|
685 | echo orchidee_ol |
---|
686 | echo |
---|
687 | |
---|
688 | let annee=$annee+$duree_sechiba |
---|
689 | |
---|
690 | if [ "${OK_SITE}" = "n" ] |
---|
691 | then |
---|
692 | remplace TIME_LENGTH $duree_sechiba$units |
---|
693 | else |
---|
694 | remplace TIME_LENGTH 1Y |
---|
695 | remplace WRITE_STEP 86400 |
---|
696 | fi |
---|
697 | remplace STOMATE_HISTLEVEL $stohistlev_sec |
---|
698 | remplace STOMATE_HIST_DT $stohistdt_sec |
---|
699 | |
---|
700 | time ./orchidee.e > out_orchidee"${annee}" |
---|
701 | |
---|
702 | # save job output file |
---|
703 | DPUT out_orchidee"${annee}" ${R_FIC_OUT}"/"${FLAG} . |
---|
704 | # save the run.def |
---|
705 | cp used_run.def ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_used_run.def |
---|
706 | DPUT used_run.def ${R_FIC_MORE}"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_used_run.def |
---|
707 | cp run.def ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_run.def |
---|
708 | DPUT run.def ${R_FIC_MORE}"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_run.def |
---|
709 | # on sauvegarde les fichiers d'histoire |
---|
710 | DPUT $sechiba_hist ${R_FIC_ORCHIDEE_OL}"/"Output"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_sechiba_history.nc |
---|
711 | mv $sechiba_hist ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_sechiba_history.nc |
---|
712 | [ -f $stomate_hist ] && DPUT $stomate_hist ${R_FIC_ORCHIDEE_OL}"/"Output"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_stomate_history.nc |
---|
713 | [ -f $stomate_hist ] && mv $stomate_hist ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_stomate_history.nc |
---|
714 | # rename restart files |
---|
715 | mv $moteur_redem $moteur_dem |
---|
716 | mv $sechiba_redem $sechiba_dem |
---|
717 | [ -f $stomate_redem ] && mv $stomate_redem $stomate_dem |
---|
718 | # save restart files |
---|
719 | DPUT $moteur_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${moteur_dem} |
---|
720 | DPUT $sechiba_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${sechiba_dem} |
---|
721 | [ -f $stomate_dem ] && DPUT $stomate_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${stomate_dem} |
---|
722 | |
---|
723 | fi #duree_sechiba |
---|
724 | |
---|
725 | # at least now |
---|
726 | remplace STOMATE_RESTART_FILEIN $stomate_dem |
---|
727 | remplace SECHIBA_restart_in $sechiba_dem |
---|
728 | |
---|
729 | if [ $duree_stomate -ne 0 ] ; then |
---|
730 | |
---|
731 | # follow with teststomate |
---|
732 | |
---|
733 | echo |
---|
734 | echo teststomate |
---|
735 | echo |
---|
736 | |
---|
737 | let annee=$annee+$duree_stomate |
---|
738 | |
---|
739 | remplace TIME_LENGTH $duree_stomate$units |
---|
740 | |
---|
741 | remplace STOMATE_HISTLEVEL $stohistlev_sto |
---|
742 | remplace STOMATE_HIST_DT $stohistdt_sto |
---|
743 | |
---|
744 | time ./teststomate.e > out_teststomate"${annee}" |
---|
745 | |
---|
746 | # save job output file |
---|
747 | DPUT out_teststomate"${annee}" ${R_FIC_OUT}"/"${FLAG} . |
---|
748 | # save the run.def |
---|
749 | cp used_run.def ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_used_run.def |
---|
750 | DPUT used_run.def ${R_FIC_MORE}"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_used_run.def |
---|
751 | cp run.def ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_run.def |
---|
752 | DPUT run.def ${R_FIC_MORE}"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_run.def |
---|
753 | # save history files |
---|
754 | DPUT $stomate_hist ${R_FIC_ORCHIDEE_OL}"/"Output"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_stomate_history.nc |
---|
755 | mv $stomate_hist ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_stomate_history.nc |
---|
756 | # rename restart files |
---|
757 | mv $moteur_redem $moteur_dem |
---|
758 | mv $sechiba_redem $sechiba_dem |
---|
759 | mv $stomate_redem $stomate_dem |
---|
760 | # save restart files |
---|
761 | DPUT $moteur_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${moteur_dem} |
---|
762 | DPUT $sechiba_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${sechiba_dem} |
---|
763 | DPUT $stomate_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${stomate_dem} |
---|
764 | |
---|
765 | fi # duree_stomate |
---|
766 | done #n_iter |
---|
767 | |
---|
768 | if [ $duree_carbonsol -ne 0 ] ; then |
---|
769 | |
---|
770 | # end with forcesoil |
---|
771 | |
---|
772 | echo |
---|
773 | echo forcesoil |
---|
774 | echo |
---|
775 | |
---|
776 | let annee=$annee+$duree_carbonsol |
---|
777 | |
---|
778 | remplace TIME_LENGTH $duree_carbonsol$units |
---|
779 | |
---|
780 | time ./forcesoil.e > out_forcesoil"${annee}" |
---|
781 | |
---|
782 | # save job output file |
---|
783 | DPUT out_forcesoil"${annee}" ${R_FIC_OUT}"/"${FLAG} . |
---|
784 | # save the run.def |
---|
785 | cp used_run.def ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_used_run.def |
---|
786 | DPUT used_run.def ${R_FIC_MORE}"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_used_run.def |
---|
787 | cp run.def ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_run.def |
---|
788 | DPUT run.def ${R_FIC_MORE}"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_run.def |
---|
789 | # rename restart file for stomate |
---|
790 | mv $stomate_redem $stomate_dem |
---|
791 | # save restart file for stomate |
---|
792 | DPUT $stomate_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${stomate_dem} |
---|
793 | |
---|
794 | fi # duree_carbonsol |
---|
795 | |
---|
796 | |
---|
797 | if [ $duree_final -ne 0 ] ; then |
---|
798 | |
---|
799 | # on finit avec orchidee_ol |
---|
800 | |
---|
801 | echo |
---|
802 | echo "We do "$duree_final "year(s) to have a happy end" |
---|
803 | echo |
---|
804 | |
---|
805 | let annee=$annee+$duree_final |
---|
806 | |
---|
807 | echo |
---|
808 | echo orchidee_ol |
---|
809 | echo |
---|
810 | |
---|
811 | if [ "${OK_SITE}" = "n" ] |
---|
812 | then |
---|
813 | remplace TIME_LENGTH $duree_final$units |
---|
814 | else |
---|
815 | remplace TIME_LENGTH default |
---|
816 | remplace WRITE_STEP 1800 |
---|
817 | fi |
---|
818 | remplace STOMATE_HISTLEVEL $stohistlev_sec |
---|
819 | remplace STOMATE_HIST_DT $stohistdt_sec |
---|
820 | |
---|
821 | time ./orchidee.e > out_orchidee"${annee}" |
---|
822 | |
---|
823 | # save job output file |
---|
824 | DPUT out_orchidee"${annee}" ${R_FIC_OUT}"/"${FLAG} . |
---|
825 | # save the run.def |
---|
826 | cp used_run.def ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_used_run.def |
---|
827 | DPUT used_run.def ${R_FIC_MORE}"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_used_run.def |
---|
828 | cp run.def ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_run.def |
---|
829 | DPUT run.def ${R_FIC_MORE}"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_run.def |
---|
830 | # save history files |
---|
831 | DPUT $sechiba_hist ${R_FIC_ORCHIDEE_OL}"/"Output"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_sechiba_history.nc |
---|
832 | mv $sechiba_hist ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_sechiba_history.nc |
---|
833 | [ -f $stomate_hist ] && DPUT $stomate_hist ${R_FIC_ORCHIDEE_OL}"/"Output"/"${FLAG} ${CEXPER}_${DATES}${annee}_stomate_history.nc |
---|
834 | [ -f $stomate_hist ] && mv $stomate_hist ${R_SORTIE_ORCHIDEE_OL}"/"${FLAG}/${CEXPER}_"${DATES}"${annee}_stomate_history.nc |
---|
835 | # rename restart files |
---|
836 | mv $moteur_redem $moteur_dem |
---|
837 | mv $sechiba_redem $sechiba_dem |
---|
838 | [ -f $stomate_redem ] && mv $stomate_redem $stomate_dem |
---|
839 | # on sauvegarde les fichiers de redemarrage |
---|
840 | DPUT $moteur_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${moteur_dem} |
---|
841 | DPUT $sechiba_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${sechiba_dem} |
---|
842 | [ -f $stomate_dem ] && DPUT $stomate_dem ${R_FIC_ORCHIDEE_OL}"/"Restart"/"${FLAG} ${CEXPER}_"${DATES}"${annee}_${stomate_dem} |
---|
843 | |
---|
844 | fi #duree_final |
---|
845 | |
---|
846 | ######################################################################### |
---|
847 | ## |
---|
848 | ## 9. Output |
---|
849 | ## |
---|
850 | ######################################################################### |
---|
851 | |
---|
852 | #-Q- sxnec qcat -o ${QSUB_REQID} > ${CEXPER}"${DATES}"_${FLAG}_job_output |
---|
853 | #-Q- fjvpp qcat -o ${QSUB_REQID} > ${CEXPER}"${DATES}"${FLAG}_job_output |
---|
854 | #-Q- sx6nec VAR=$(echo ${PBS_JOBID} | sed -e "s@.*:\(.*\)\..*@\1@") |
---|
855 | #-Q- sx6nec rsh mercure -n "export TMP=${TMP} ; cd ${TMP} ; /usr/local/TX7/bin/qcat ${VAR} > ${CEXPER}"${DATES}"${FLAG}_job_output" |
---|
856 | DPUT ${CEXPER}"${DATES}"${FLAG}_job_output ${R_FIC_OUT} ${CEXPER}"${DATES}"${FLAG}_job_output |
---|
857 | |
---|
858 | ######################################################################### |
---|
859 | ## |
---|
860 | ## 10. Post Processing |
---|
861 | ## |
---|
862 | ######################################################################### |
---|
863 | # |
---|
864 | |
---|
865 | if [ "${OK_SITE}" = "y" ] || [ "${OK_DIAG}" = "y" ] |
---|
866 | then |
---|
867 | ${RSH}<<EOL |
---|
868 | export R_FIC_ORCHIDEE_OL=${R_FIC_ORCHIDEE_OL} |
---|
869 | export R_FIC_MORE_U=${R_FIC_MORE_U} |
---|
870 | export FLAG=${FLAG} |
---|
871 | export CEXPER=${CEXPER} |
---|
872 | export F_FILE=${F_FILE} |
---|
873 | export DATES=${DATES} |
---|
874 | export AN_DEBUT_EXP=${AN_DEBUT_EXP} |
---|
875 | export AN_FINAL_EXP=${AN_FINAL_EXP} |
---|
876 | export CEXPER=${CEXPER} |
---|
877 | export NITER_MAX=${annee} |
---|
878 | export OK_SITE=${OK_SITE} |
---|
879 | cd AAAAAAA/${R_FIC_MORE_U} |
---|
880 | #-Q- sxnec /usr/local/bin/qsub -x Job_atlas |
---|
881 | #-Q- sx6nec /usr/bin/nqsII/qsub -q scalaire -V Job_atlas |
---|
882 | #-Q- fjvpp /usr/local/bin/qsub -x Job_atlas |
---|
883 | EOL |
---|
884 | fi |
---|