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