source: BOL/Multi_atlas/Save/job_multi.sh.or.01042020 @ 3883

Last change on this file since 3883 was 3684, checked in by idelkadi, 4 years ago

Repository under svn of a first version of Multiatlas diagnostics for LMDZ. This version is adapted to be able to run a LMDZ multiatlas on an individual account on the ciclad machine of the IPSL. In this version, the parts to be modified are identified so as to subsequently adapt it to other machines.
This version is still under development.

  • Property svn:executable set to *
File size: 12.7 KB
Line 
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
14if [ 1 == 0 ] ; then ! le test ci dessous plante
15if [ ! -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
18fi
19fi
20
21# En attendant d'avoir une gestion plus propre des chemins :
22local=~/LMDZ/multi
23cd $local
24
25echo '############################################################'
26echo  0/ gestion des options
27echo '############################################################'
28pcmdi_metrics=0
29tuning_metrics=1
30und=0
31zon=1
32html=1
33atlas=1
34atlas_cesmep=1
35get=0
36cmor=1
37regdyn=0
38lma=1
39trmm=0
40axe2=1
41axe4=1
42esmval2=0
43refld_histo=0
44vertcld_calipso=0
45stations_day=0
46stations_mth=0
47qsub=1
48mjo=0
49river=0
50
51# ./job_multi.sh -1D 0 -get 0 -atlas 0 -pcmdi 0 -tuning 0 -lma 0 -trmm 0
52runstxt=/home/fabric/LMDZ/multi/runs.txt
53
54while 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
80done
81
82rm -f out.com$$
83MAIN_SE=/prodigfs/ipslfs/dods/fabric/lmdz/SE
84TS_DA=/prodigfs/ipslfs/dods/fabric/lmdz/TS_DA
85TS_MO=/prodigfs/ipslfs/dods/fabric/lmdz/TS_MO
86MULTIDIR=/prodigfs/ipslfs/dods/fabric/lmdz/MultiSimu
87COMP_D=$MULTIDIR/$comp
88DEF_FILE=$COMP_D/def.txt ; if [ ! -f $DEF_FILE ] ; then echo renseigner $DEF_FILE ; exit ; fi
89
90listsims=""  ; for s  in `awk ' {print $1} ' $DEF_FILE | uniq`          ; do listsims="$listsims $s"    ; done
91echo listsims $listsims
92
93echo ### On supprime dans def.txt les lignes vides ########
94sed -i "/^[ \t]*$/d" $DEF_FILE
95
96echo ### On teste d abord la coherence des noms des simulations dans def.txt et $runstxt ################
97echo MULTI-ATLAS "$comp"
98for s in $listsims ; do
99srun=`grep -w "^$s "  $runstxt | awk ' { print $1 } '`
100echo 's='"$s" '    srun='  "$srun"
101if [ "$s" = "$srun" ] ; then
102   echo Meme nom de la simulation dans def.txt et $runstxt 's=' "$s" '    srun='  "$srun"
103else
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
109exit
110fi
111done
112#exit
113listruns=""
114listrunss=""
115listrunse=""
116for s in $listsims ; do
117simdir=`grep -w "^$s "  $runstxt | awk ' { print $2 } '`
118echo $simdir
119( cd /prodigfs/ipslfs/dods/fabric/lmdz/SE/ORIG ; ln -sf $simdir/ATM/Analyse/SE/*mth*nc . ) > /dev/null 2>&1
120echo $simdir
121ss=`basename $simdir `
122listruns="$listruns $ss"
123for year in `grep -w "^$s" $DEF_FILE | awk ' { print $2 } '` ; do
124listrunss="$listrunss ${ss}_$year"
125listrune="$listrune ${ss}_SE_$year"
126done
127done
128echo listruns = $listruns
129echo listrunss= $listrunss
130echo listrune= $listrune
131ls -lrt /prodigfs/ipslfs/dods/fabric/lmdz/SE/ORIG
132listsimss="" ; for ss in `awk ' {print $1"_"$2 } ' $DEF_FILE`    ; do listsimss="$listsimss $ss" ; done
133listsimse="" ; for se in `awk ' {print $1"_SE_"$2 } ' $DEF_FILE` ; do listsimse="$listsimse $se" ; done
134echo listsims $listsims
135echo listsimss $listsimss
136echo listsimse $listsimse
137
138echo SIMULATIONS: $listsims
139
140echo '########################################################################'
141echo  1/ Rapatriement des simulations manquantes
142echo '########################################################################'
143
144if [ $get = 1 ] ; then
145
146cd $MAIN_SE
147for sim in $listsimss ; do echo ./getun.sh ${sim} >> $local/out.com$$ ; ./getun.sh ${sim} ; done
148
149cd $TS_DA ; pwd
150for sim in $listsimss ; do echo ./getun.sh ${sim} >> $local/out.com$$ ; ./getun.sh ${sim} ; done
151
152cd $TS_MO ; pwd
153for sim in $listsimss ; do echo ./getun.sh ${sim} >> $local/out.com$$ ; ./getun.sh ${sim} ; done
154
155fi
156
157if [ $cmor = 1 ] ; then
158cd /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
169if [ $? != 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
182cd $local
183
184fi
185
186echo '########################################################################'
187echo  2/ Lancement des atlas manquant
188echo '########################################################################'
189
190natlas=`wc -l $COMP_D/atlas-def | awk ' { print $1 } '`
191count_atlas=0
192
193if [ $atlas = 1 ] ; then
194for 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
227done
228if [ $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
234fi
235fi
236
237# atlas_cesmep : cles pour activer les nouveau atlas (C-ESM-EP)
238if [ $atlas_cesmep = 1 ] ; then
239   cd ~/LMDZ/C-ESM-EP
240   ./AtlasLMDZ.sh -runsfile $runstxt $comp
241fi # atlas_cesmep
242
243echo '########################################################################'
244echo  3/ Calcul des moyennes zonales nco
245echo '########################################################################'
246
247
248#trace moy.zonale OBS + multi-simulations
249if [ $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
274fi
275
276echo '########################################################################'
277echo 4/ Lancement du 1D si necessaire
278echo '########################################################################'
279if [ ! -f $COMP_D/1D/1D.html -a $und = 1  ] ; then
280    cd $COMP_D
281    ~/LMDZ/1D/serie1d.sh $comp
282    cd $local
283fi
284
285echo '########################################################################'
286echo 5/ Métriques
287echo '########################################################################'
288if [ $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
293fi
294
295if [ $regdyn = 1 ]; then
296   cd ~/users/musat/regdyn/clean_regdyn
297   ./mk_all_regdyn.sh $comp 0
298   cd $local
299fi
300
301if [ $esmval2 = 1 ]; then
302   cd $local
303   ./cvdp4atlas.sh $comp
304   ./perfm4atlas.sh $comp
305fi   
306
307if [ $mjo = 1 ]; then
308   cd ~/users/idelkadi/MJO
309   ./make_diagnosMJO.sh $comp
310fi
311
312if [ $river = 1 ]; then
313   cd ~/users/idelkadi/AXE1/River
314   ./make_diagnoRiver.sh $comp
315fi 
316
317if [ $lma = 1 ]; then
318   cd $local
319   ./make_lma.sh $comp
320fi
321if [ $axe2 = 1 ]; then
322   cd $local
323   ./make_axe2.sh -runstxt $runstxt $comp
324fi
325if [ $trmm = 1 ]; then
326   cd ~/users/mbonaz/
327   ./Axe2_Marine.sh $comp
328   cd $local
329fi
330cd $local
331if [ $pcmdi_metrics = 1 ] ; then
332   ./make_pcmdi.sh $comp
333fi
334if [ $axe4 = 1 ]; then
335  cd $local
336   ./make_axe4.sh $comp
337fi
338
339if [ "$reflcld_histo" = "1" ] ; then
340   cd ~/users/idelkadi/AXE3/
341   ./make_scatReflCld.sh $comp
342   cd $local
343fi
344
345if [ $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
352fi
353
354
355echo '########################################################################'
356echo 6/ Stations
357echo '########################################################################'
358
359if [ $stations_day = 1 ] ; then
360   ~/users/Binta/bibi.sh $comp
361   ~/users/cheruy/bibi.sh $comp
362fi
363
364if [ $stations_mth = 1 ] ; then
365   ~/users/traore/SE_buoy.sh $comp
366fi
367
368echo '########################################################################'
369echo 7/ generation des pages html
370echo '########################################################################'
371
372if [ $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
405exit
406   cd $COMP_D
407#   ln -sf BIASYEAR.html  $comp.html
408   ln -sf ACCUEIL.html  $comp.html
409fi
410
411echo UN NOVEL MULTI ATLAS EST DISPONIBLE sur $COMP_D/ACCUEIL.html
Note: See TracBrowser for help on using the repository browser.