1 | #PBS -N atlas |
---|
2 | #PBS -m a |
---|
3 | #PBS -j oe |
---|
4 | #PBS -q h12 |
---|
5 | #PBS -o atlasNOMSIMULATION.out |
---|
6 | #PBS -S /bin/bash |
---|
7 | #PBS -l nodes=1:ppn=1 |
---|
8 | #PBS -l mem=30gb |
---|
9 | #PBS -l vmem=30gb |
---|
10 | |
---|
11 | |
---|
12 | #set -vx |
---|
13 | |
---|
14 | if [ 1 == 0 ] ; then ! le test ci dessous plante |
---|
15 | if [ ! -d /ccc/store/cont003/thredds/p86mign/IPSLCM6/DEVT/pdControl/CM607R-LR-pdCtrl-SnwCnd05-2I ] ; then |
---|
16 | echo Acces direct au CCRT suspendu |
---|
17 | echo exit |
---|
18 | fi |
---|
19 | fi |
---|
20 | |
---|
21 | # En attendant d'avoir une gestion plus propre des chemins : |
---|
22 | local=~/LMDZ/multi |
---|
23 | cd $local |
---|
24 | |
---|
25 | echo '############################################################' |
---|
26 | echo 0/ gestion des options |
---|
27 | echo '############################################################' |
---|
28 | pcmdi_metrics=0 |
---|
29 | tuning_metrics=1 |
---|
30 | und=0 |
---|
31 | zon=1 |
---|
32 | html=1 |
---|
33 | atlas=1 |
---|
34 | atlas_cesmep=1 |
---|
35 | get=0 |
---|
36 | cmor=1 |
---|
37 | regdyn=0 |
---|
38 | lma=1 |
---|
39 | trmm=0 |
---|
40 | axe2=1 |
---|
41 | axe4=1 |
---|
42 | esmval2=0 |
---|
43 | refld_histo=0 |
---|
44 | vertcld_calipso=0 |
---|
45 | stations_day=0 |
---|
46 | stations_mth=0 |
---|
47 | qsub=1 |
---|
48 | mjo=0 |
---|
49 | river=0 |
---|
50 | |
---|
51 | # ./job_multi.sh -1D 0 -get 0 -atlas 0 -pcmdi 0 -tuning 0 -lma 0 -trmm 0 |
---|
52 | runstxt=/home/fabric/LMDZ/multi/runs.txt |
---|
53 | |
---|
54 | while test -n "${1}"; do |
---|
55 | case $1 in |
---|
56 | -1D) und=$2 ; shift ;; |
---|
57 | -get) get=$2 ; shift ;; |
---|
58 | -cmor) cmor=$2 ; shift ;; |
---|
59 | -zon) zon=$2 ; shift ;; |
---|
60 | -atlas) atlas=$2 ; shift ;; |
---|
61 | -atlas_cesmep) atlas_cesmep=$2 ; shift ;; |
---|
62 | -pcmdi) pcmdi_metrics=$2 ; shift ;; |
---|
63 | -tuning) tuning_metrics=$2 ; shift ;; |
---|
64 | -runstxt) runstxt=$2 ; shift ;; |
---|
65 | -lma) lma=$2 ; shift ;; |
---|
66 | -trmm) trmm=$2 ; shift ;; |
---|
67 | -axe4) axe4=$2 ; shift ;; |
---|
68 | -axe2) axe2=$2 ; shift ;; |
---|
69 | -regdyn) regdyn=$2 ; shift ;; |
---|
70 | -esmval2) esmval2=$2 ; shift ;; |
---|
71 | -stations_day) stations_day=$2 ; shift ;; |
---|
72 | -stations_mth) stations_mth=$2 ; shift ;; |
---|
73 | -refld_histo) refld_histo=$2 ; shift ;; |
---|
74 | -vertcld_calipso) vertcld_calipso=$2 ; shift ;; |
---|
75 | -mjo) mjo=$2 ; shift ;; |
---|
76 | -river) river=$2 ; shift ;; |
---|
77 | *) comp=$1 ;; |
---|
78 | esac |
---|
79 | shift |
---|
80 | done |
---|
81 | |
---|
82 | rm -f out.com$$ |
---|
83 | MAIN_SE=/prodigfs/ipslfs/dods/fabric/lmdz/SE |
---|
84 | TS_DA=/prodigfs/ipslfs/dods/fabric/lmdz/TS_DA |
---|
85 | TS_MO=/prodigfs/ipslfs/dods/fabric/lmdz/TS_MO |
---|
86 | MULTIDIR=/prodigfs/ipslfs/dods/fabric/lmdz/MultiSimu |
---|
87 | COMP_D=$MULTIDIR/$comp |
---|
88 | DEF_FILE=$COMP_D/def.txt ; if [ ! -f $DEF_FILE ] ; then echo renseigner $DEF_FILE ; exit ; fi |
---|
89 | |
---|
90 | listsims="" ; for s in `awk ' {print $1} ' $DEF_FILE | uniq` ; do listsims="$listsims $s" ; done |
---|
91 | echo listsims $listsims |
---|
92 | |
---|
93 | echo ### On supprime dans def.txt les lignes vides ######## |
---|
94 | sed -i "/^[ \t]*$/d" $DEF_FILE |
---|
95 | |
---|
96 | echo ### On teste d abord la coherence des noms des simulations dans def.txt et $runstxt ################ |
---|
97 | echo MULTI-ATLAS "$comp" |
---|
98 | for s in $listsims ; do |
---|
99 | srun=`grep -w "^$s " $runstxt | awk ' { print $1 } '` |
---|
100 | echo 's='"$s" ' srun=' "$srun" |
---|
101 | if [ "$s" = "$srun" ] ; then |
---|
102 | echo Meme nom de la simulation dans def.txt et $runstxt 's=' "$s" ' srun=' "$srun" |
---|
103 | else |
---|
104 | echo ATTENTION : la simulation "$s" de votre def.txt n est pas repertoriee dans $runstxt |
---|
105 | echo ou le meme nom est attribue a plusieures simulations |
---|
106 | echo Il faut la rajouter dans $runstxt |
---|
107 | echo avec le chemin vers les SE et TS dans ciclad : /prodigfs/fabric/IGCM_OUT |
---|
108 | echo ou renomer votre simulation |
---|
109 | exit |
---|
110 | fi |
---|
111 | done |
---|
112 | #exit |
---|
113 | listruns="" |
---|
114 | listrunss="" |
---|
115 | listrunse="" |
---|
116 | for s in $listsims ; do |
---|
117 | simdir=`grep -w "^$s " $runstxt | awk ' { print $2 } '` |
---|
118 | echo $simdir |
---|
119 | ( cd /prodigfs/ipslfs/dods/fabric/lmdz/SE/ORIG ; ln -sf $simdir/ATM/Analyse/SE/*mth*nc . ) > /dev/null 2>&1 |
---|
120 | echo $simdir |
---|
121 | ss=`basename $simdir ` |
---|
122 | listruns="$listruns $ss" |
---|
123 | for year in `grep -w "^$s" $DEF_FILE | awk ' { print $2 } '` ; do |
---|
124 | listrunss="$listrunss ${ss}_$year" |
---|
125 | listrune="$listrune ${ss}_SE_$year" |
---|
126 | done |
---|
127 | done |
---|
128 | echo listruns = $listruns |
---|
129 | echo listrunss= $listrunss |
---|
130 | echo listrune= $listrune |
---|
131 | ls -lrt /prodigfs/ipslfs/dods/fabric/lmdz/SE/ORIG |
---|
132 | listsimss="" ; for ss in `awk ' {print $1"_"$2 } ' $DEF_FILE` ; do listsimss="$listsimss $ss" ; done |
---|
133 | listsimse="" ; for se in `awk ' {print $1"_SE_"$2 } ' $DEF_FILE` ; do listsimse="$listsimse $se" ; done |
---|
134 | echo listsims $listsims |
---|
135 | echo listsimss $listsimss |
---|
136 | echo listsimse $listsimse |
---|
137 | |
---|
138 | echo SIMULATIONS: $listsims |
---|
139 | |
---|
140 | echo '########################################################################' |
---|
141 | echo 1/ Rapatriement des simulations manquantes |
---|
142 | echo '########################################################################' |
---|
143 | |
---|
144 | if [ $get = 1 ] ; then |
---|
145 | |
---|
146 | cd $MAIN_SE |
---|
147 | for sim in $listsimss ; do echo ./getun.sh ${sim} >> $local/out.com$$ ; ./getun.sh ${sim} ; done |
---|
148 | |
---|
149 | cd $TS_DA ; pwd |
---|
150 | for sim in $listsimss ; do echo ./getun.sh ${sim} >> $local/out.com$$ ; ./getun.sh ${sim} ; done |
---|
151 | |
---|
152 | cd $TS_MO ; pwd |
---|
153 | for sim in $listsimss ; do echo ./getun.sh ${sim} >> $local/out.com$$ ; ./getun.sh ${sim} ; done |
---|
154 | |
---|
155 | fi |
---|
156 | |
---|
157 | if [ $cmor = 1 ] ; then |
---|
158 | cd /prodigfs/ipslfs/dods/fabric/lmdz/SE |
---|
159 | |
---|
160 | ######################################################################### |
---|
161 | # 1.2 "Cmorisation des fichiers mensuels : traduction au format CMIP |
---|
162 | ######################################################################### |
---|
163 | # Deux lignes suivantes modif FH 2016/11/09 |
---|
164 | # Files are taken from /prodigfs/ipslfs/dods/fabric/lmdz/SE/ORIG and |
---|
165 | # results are in /prodigfs/ipslfs/dods/fabric/lmdz/SE/CMOR |
---|
166 | ######################################################################### |
---|
167 | |
---|
168 | ./cmor.sh -runsfile $runstxt $comp |
---|
169 | if [ $? != 0 ] ; then exit ; fi # Probleme de histmth non present. On arrete tout |
---|
170 | |
---|
171 | ######################################################################### |
---|
172 | # 1.3 Interpolate fields on a common horizontal grid (VLR) and |
---|
173 | ######################################################################### |
---|
174 | # average in time "YEAR", "JJA" ... |
---|
175 | # Results are put on |
---|
176 | # /prodigfs/ipslfs/dods/fabric/lmdz/VLR/YEAR/[SIMU_NAME]_[period]/NC |
---|
177 | # If wanting to rerun season.sh for observations : |
---|
178 | # ./season.sh -s OBS |
---|
179 | ######################################################################### |
---|
180 | |
---|
181 | ./season.sh -comp $comp |
---|
182 | cd $local |
---|
183 | |
---|
184 | fi |
---|
185 | |
---|
186 | echo '########################################################################' |
---|
187 | echo 2/ Lancement des atlas manquant |
---|
188 | echo '########################################################################' |
---|
189 | |
---|
190 | natlas=`wc -l $COMP_D/atlas-def | awk ' { print $1 } '` |
---|
191 | count_atlas=0 |
---|
192 | |
---|
193 | if [ $atlas = 1 ] ; then |
---|
194 | for sim in $listsimss ; do |
---|
195 | il=1 |
---|
196 | if [ ! -f $COMP_D/atlas-def ] ; then |
---|
197 | echo Definir les atlas a construire dans $COMP_D/atlas-def |
---|
198 | echo Example : |
---|
199 | cat $COMP_D/../CMIP5to6/atlas-def |
---|
200 | fi |
---|
201 | while [ $il -le $natlas ] ; do |
---|
202 | line=`sed -n -e ${il}p $COMP_D/atlas-def` |
---|
203 | seas=`echo $line | awk ' { print $1 } '` |
---|
204 | proj=`echo $line | awk ' { print $2 } '` |
---|
205 | vars=`echo $line | awk ' { print $3 } '` |
---|
206 | atlas=${sim}+${seas}+${proj}+$vars |
---|
207 | echo AAAAAAAAAAAAAAAAAAAAAAAA $atlas |
---|
208 | grep $atlas $COMP_D/ATLAS/atlas_OK |
---|
209 | echo BBBBBB |
---|
210 | if [ "`grep $atlas $COMP_D/ATLAS/atlas_OK`" = "" ] ; then |
---|
211 | cd ~/LMDZ/atlas ; pwd ; ls -l atlas.sh |
---|
212 | varg=`echo $vars | sed -e 's/,/+/g'` |
---|
213 | echo Atlas $atlas a creer |
---|
214 | if [ $qsub = 0 ] ; then |
---|
215 | ./atlas.sh RUN=$sim,SEASON=$seas,PROJ=$proj,OUTDIR=$COMP_D/ATLAS,REF=OBS,VARS="$varg",RUNSTXT=$runstxt |
---|
216 | else |
---|
217 | qsub -v RUN=$sim,SEASON=$seas,PROJ=$proj,OUTDIR=$COMP_D/ATLAS,REF=OBS,VARS="$varg",RUNSTXT=$runstxt atlas.sh |
---|
218 | fi |
---|
219 | echo qsub -v RUN=$sim,SEASON=$seas,PROJ=$proj,OUTDIR=$COMP_D/ATLAS,REF=OBS,VARS="$varg" atlas.sh >> out.com$$ |
---|
220 | echo qsub -v RUN=$sim,SEASON=$seas,PROJ=$proj,OUTDIR=$COMP_D/ATLAS,REF=OBS,VARS="$varg" atlas.sh |
---|
221 | (( count_atlas = $count_atlas + 1 )) |
---|
222 | else |
---|
223 | echo Atlas $atlas existant |
---|
224 | fi |
---|
225 | (( il = $il + 1 )) |
---|
226 | done |
---|
227 | done |
---|
228 | if [ $count_atlas != 0 ] ; then |
---|
229 | echo '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' |
---|
230 | echo Les atlas manquant ont ete lances. Attendre leur |
---|
231 | echo creation pour relancer job_multi.sh |
---|
232 | echo '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' |
---|
233 | # exit |
---|
234 | fi |
---|
235 | fi |
---|
236 | |
---|
237 | # atlas_cesmep : cles pour activer les nouveau atlas (C-ESM-EP) |
---|
238 | if [ $atlas_cesmep = 1 ] ; then |
---|
239 | cd ~/LMDZ/C-ESM-EP |
---|
240 | ./AtlasLMDZ.sh -runsfile $runstxt $comp |
---|
241 | fi # atlas_cesmep |
---|
242 | |
---|
243 | echo '########################################################################' |
---|
244 | echo 3/ Calcul des moyennes zonales nco |
---|
245 | echo '########################################################################' |
---|
246 | |
---|
247 | |
---|
248 | #trace moy.zonale OBS + multi-simulations |
---|
249 | if [ $zon = 1 ] ; then |
---|
250 | cd $local |
---|
251 | mkdir -p $COMP_D/ZON |
---|
252 | for sim in $listsimse OBS ; do |
---|
253 | years=`echo $sim | sed -e 's/_SE_/ /' | awk ' { print $2 } '` |
---|
254 | run=`echo $sim | sed -e 's/_SE_/ /' | awk ' { print $1 } '` |
---|
255 | ./make_MOY.sh "$years" YEAR "$run" GLOB |
---|
256 | ./make_MOY.sh "$years" YEAR "$run" ZON |
---|
257 | ./make_MOY.sh "$years" JJA "$run" ZON |
---|
258 | ./make_MOY.sh "$years" DJF "$run" ZON |
---|
259 | ./make_MOY.sh "$years" JJAS "$run" AMMACROSS |
---|
260 | done |
---|
261 | cd $local |
---|
262 | ### ajout nuages LMDZ dans la compa et doit faire des liens symbol. sur |
---|
263 | #### les OBS calipso toujurs pour le moment |
---|
264 | ./mk_clouds_NOcalipso.sh YEAR ZON |
---|
265 | ./mk_clouds_NOcalipso.sh DJF ZON |
---|
266 | ./mk_clouds_NOcalipso.sh JJA ZON |
---|
267 | ./mk_clouds_NOcalipso.sh JJAS AMMACROSS |
---|
268 | # |
---|
269 | pwd |
---|
270 | ./multi_ZONE.sh -runsfile $runstxt YEAR $comp ZON |
---|
271 | ./multi_ZONE.sh -runsfile $runstxt JJA $comp ZON |
---|
272 | ./multi_ZONE.sh -runsfile $runstxt DJF $comp ZON |
---|
273 | ./multi_ZONE.sh -runsfile $runstxt JJAS $comp AMMACROSS |
---|
274 | fi |
---|
275 | |
---|
276 | echo '########################################################################' |
---|
277 | echo 4/ Lancement du 1D si necessaire |
---|
278 | echo '########################################################################' |
---|
279 | if [ ! -f $COMP_D/1D/1D.html -a $und = 1 ] ; then |
---|
280 | cd $COMP_D |
---|
281 | ~/LMDZ/1D/serie1d.sh $comp |
---|
282 | cd $local |
---|
283 | fi |
---|
284 | |
---|
285 | echo '########################################################################' |
---|
286 | echo 5/ Métriques |
---|
287 | echo '########################################################################' |
---|
288 | if [ $tuning_metrics = 1 -a ! -d $COMP_D/METRICS ] ; then |
---|
289 | echo metrics.sh |
---|
290 | cd $local/../METRICS |
---|
291 | #./metrics.sh -runsfile $runstxt $comp |
---|
292 | ./metrics.sh $comp |
---|
293 | fi |
---|
294 | |
---|
295 | if [ $regdyn = 1 ]; then |
---|
296 | cd ~/users/musat/regdyn/clean_regdyn |
---|
297 | ./mk_all_regdyn.sh $comp 0 |
---|
298 | cd $local |
---|
299 | fi |
---|
300 | |
---|
301 | if [ $esmval2 = 1 ]; then |
---|
302 | cd $local |
---|
303 | ./cvdp4atlas.sh $comp |
---|
304 | ./perfm4atlas.sh $comp |
---|
305 | fi |
---|
306 | |
---|
307 | if [ $mjo = 1 ]; then |
---|
308 | cd ~/users/idelkadi/MJO |
---|
309 | ./make_diagnosMJO.sh $comp |
---|
310 | fi |
---|
311 | |
---|
312 | if [ $river = 1 ]; then |
---|
313 | cd ~/users/idelkadi/AXE1/River |
---|
314 | ./make_diagnoRiver.sh $comp |
---|
315 | fi |
---|
316 | |
---|
317 | if [ $lma = 1 ]; then |
---|
318 | cd $local |
---|
319 | ./make_lma.sh $comp |
---|
320 | fi |
---|
321 | if [ $axe2 = 1 ]; then |
---|
322 | cd $local |
---|
323 | ./make_axe2.sh -runstxt $runstxt $comp |
---|
324 | fi |
---|
325 | if [ $trmm = 1 ]; then |
---|
326 | cd ~/users/mbonaz/ |
---|
327 | ./Axe2_Marine.sh $comp |
---|
328 | cd $local |
---|
329 | fi |
---|
330 | cd $local |
---|
331 | if [ $pcmdi_metrics = 1 ] ; then |
---|
332 | ./make_pcmdi.sh $comp |
---|
333 | fi |
---|
334 | if [ $axe4 = 1 ]; then |
---|
335 | cd $local |
---|
336 | ./make_axe4.sh $comp |
---|
337 | fi |
---|
338 | |
---|
339 | if [ "$reflcld_histo" = "1" ] ; then |
---|
340 | cd ~/users/idelkadi/AXE3/ |
---|
341 | ./make_scatReflCld.sh $comp |
---|
342 | cd $local |
---|
343 | fi |
---|
344 | |
---|
345 | if [ $vertcld_calipso = 1 ] ; then |
---|
346 | cd ~/users/idelkadi/AXE3/Calipso/CoupeVerticale/DJF |
---|
347 | ./make_VerticalMzCldCalipso.sh $comp |
---|
348 | cd ~/users/idelkadi/AXE3/Calipso/CoupeVerticale/JJA |
---|
349 | ./make_VerticalMzCldCalipso.sh $comp |
---|
350 | cd ~/users/idelkadi/AXE3/Calipso/Stratos |
---|
351 | ./make_StratosCalipso.sh $comp |
---|
352 | fi |
---|
353 | |
---|
354 | |
---|
355 | echo '########################################################################' |
---|
356 | echo 6/ Stations |
---|
357 | echo '########################################################################' |
---|
358 | |
---|
359 | if [ $stations_day = 1 ] ; then |
---|
360 | ~/users/Binta/bibi.sh $comp |
---|
361 | ~/users/cheruy/bibi.sh $comp |
---|
362 | fi |
---|
363 | |
---|
364 | if [ $stations_mth = 1 ] ; then |
---|
365 | ~/users/traore/SE_buoy.sh $comp |
---|
366 | fi |
---|
367 | |
---|
368 | echo '########################################################################' |
---|
369 | echo 7/ generation des pages html |
---|
370 | echo '########################################################################' |
---|
371 | |
---|
372 | if [ $html = 1 ] ; then |
---|
373 | echo ./make_html_libigcm_ai.sh --comp $comp |
---|
374 | ./make_html_libigcm.sh --comp $comp |
---|
375 | cd $local |
---|
376 | ./html_entete.sh $comp |
---|
377 | ./html_tuning.sh $comp |
---|
378 | ./html_tuning_min.sh $comp |
---|
379 | ./html_accueil.sh $comp |
---|
380 | ./html_1D.sh $comp |
---|
381 | ./html_lma.sh $comp |
---|
382 | ./html_pcmdi.sh $comp |
---|
383 | ./html_all.sh >| $MULTIDIR/all.html |
---|
384 | |
---|
385 | # html pour les métriques |
---|
386 | # cat $COMP_D/entete.html doc_pcmdi.html >| $COMP_D/PCMDI.html |
---|
387 | # ref=`echo $listsimss | awk ' { print $1 } '` |
---|
388 | # echo "<h1> Metrics with respect to $ref </h1>" >> $COMP_D/PCMDI.html |
---|
389 | # cat $COMP_D/pcmdi_metrics.html >> $COMP_D/PCMDI.html |
---|
390 | # echo "<h1> Metrics with respect to AR4.00 </h1>" >> $COMP_D/PCMDI.html |
---|
391 | # cat $COMP_D/metrics-AR4-as-ref.html >> $COMP_D/PCMDI.html |
---|
392 | # echo "<h1> Metrics with respect to CMIP5/AMIP multi model </h1>" >> $COMP_D/PCMDI.html |
---|
393 | # cat $COMP_D/metrics-CMIP5-AMIP-as-ref.html >> $COMP_D/PCMDI.html |
---|
394 | for i in 1 2 3 4 5 6 7 ; do |
---|
395 | ./html_axe$i.sh $comp |
---|
396 | done |
---|
397 | for proj in GLOB SH NH ; do |
---|
398 | for bias in BIAS MAPS ; do |
---|
399 | for season in YEAR DJF JJA ; do |
---|
400 | echo ./multi_atlas.sh $comp $bias $season $proj $listrunss |
---|
401 | ./multi_atlas.sh $comp $bias $season $proj $listrunss >> out.com$$ |
---|
402 | done |
---|
403 | done |
---|
404 | done |
---|
405 | exit |
---|
406 | cd $COMP_D |
---|
407 | # ln -sf BIASYEAR.html $comp.html |
---|
408 | ln -sf ACCUEIL.html $comp.html |
---|
409 | fi |
---|
410 | |
---|
411 | echo UN NOVEL MULTI ATLAS EST DISPONIBLE sur $COMP_D/ACCUEIL.html |
---|