source: BOL/Multi_atlas/atlas/atlas.sh @ 3695

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

epository 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.
Corrections.

  • Property svn:executable set to *
File size: 5.4 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# Commande pour soumettre en bash
12submit=qsub
13
14login=aidelkad
15DODSDIR=/prodigfs/ipslfs/dods
16########################################################################################################
17# Environnement
18module list
19which python
20ulimit -s unlimited
21export PYTHONPATH=:/data/aidelkad/climaf:/home/igcmg/prodiguer-client:/home/fabric/users/denvil/climaf
22export PATH=/opt/glite/globus/bin:.:/home/sdipsl/CONFIG_MC2/MAKE_CONF:/opt/anaconda/bin:/opt/nco-4.5.2/bin:/opt/netcdf43/gfortran/bin:/opt/ferret-6.7.2/fast:/opt/ferret-6.7.2/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/aidelkad/bin:/home/fabric/users/denvil/climaf/bin
23STORAGE=/prodigfs/ipslfs/dods/aidelkad/lmdz/STORE
24if [ ! -d /prodigfs/ipslfs/dods/aidelkad/climafCache ] ; then mkdir -p /prodigfs/ipslfs/dods/aidelkad/climafCache ; fi
25export CLIMAF_CACHE=/prodigfs/ipslfs/dods/aidelkad/climafCache
26echo CLIMAF_CACHE
27MULTIDIR=/prodigfs/ipslfs/dods/aidelkad/lmdz/MultiSimu
28DIRATLAS=/prodigfs/ipslfs/dods/aidelkad/lmdz/atlas
29ATLAS_DIR=/prodigfs/ipslfs/dods/aidelkad/lmdz/atlas/Atlas60546
30if [ ! -d /prodigfs/ipslfs/dods/aidelkad/lmdz/atlas/Atlas60546 ] ; then mkdir -p /prodigfs/ipslfs/dods/aidelkad/lmdz/atlas/Atlas60546 ; fi
31########################################################################################################
32local=`pwd -P`
33
34date
35
36vars=""
37vars="sst"
38#runstxt=$local/../runs.txt
39
40if [ $# = 1 ] ; then
41   opts="`echo $1 | sed -e 's/,/ /g'`"
42   for opt in $opts ; do
43       echo $opt
44       key=`echo $opt | cut -d= -f1`
45       val=`echo $opt | cut -d= -f2`
46       echo $key $val
47       if [ "$key" = "RUN" ] ; then sim=$val ; fi
48       if [ "$key" = "REF" ] ; then ref=$val ; fi
49       if [ "$key" = "SEASON" ] ; then seas=$val ; fi
50       if [ "$key" = "PROJ" ] ; then proj=$val ; fi
51       if [ "$key" = "OUTDIR" ] ; then OUT_D=$val ; fi
52       if [ "$key" = "RUNSTXT" ] ; then runstxt=$val ; fi
53       if [ "$key" = "VARS" ] ; then vars="`echo $val | sed -e 's/+/,/g'`" ; fi
54   done
55elif [ $# = 0 ] ; then
56   sim=$RUN
57   ref=OBS
58   seas=$SEASON
59   proj=$PROJ
60   OUT_D=$OUTDIR
61   runstxt=$RUNSTXT
62   vars=`echo $VARS | sed -e 's/+/,/g'`
63else
64  echo USE
65  echo Job mode :
66  echo $submit -v RUN=NPv5.3_1982_1989,SEASON=YEAR,PROJ=GLOB,OUTDIR=$MULTIDIR/V5/ATLAS,VARS=pr+tas atlas.sh
67  echo interactif :
68  echo ./atlas.sh RUN=NPv5.3_1982_1989,SEASON=YEAR,PROJ=GLOB,OUTDIR=$MULTIDIR/V5/ATLAS,VARS=pr+tas
69  exit
70fi
71
72if [ "$vars" = "" ] ; then
73   vars=pr,tas,hurs,hfls,hfss,albt,albtcs,albs,rldscs,rlds,rlus,rsdscs,rsds,rsuscs,rsus,rsutcs,rsut,rlut,rlutcs,psl,prw,sst,pme,tasmax,tasmin
74fi
75
76#,ua850,va850,ta850,ua500,va500,ta500,ua200,va200,ta200
77echo sim $sim
78srun=`echo $sim | sed -e 's/_[0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9]//'`
79echo srun $srun
80simdir=`grep -w "^$srun" $runstxt | awk ' { print $2 } '`
81run=`basename $simdir `
82years=`echo $sim | sed -e 's/'$srun'//' | sed -e 's/_//'`
83sim=${run}_${years}
84echo $run $years $sim $ref
85echo ENTREES : $run, $years, $seas, $vars, $ref
86echo simdir $simdir
87
88echo run $run 
89echo sim $sim
90echo simdir $simdir
91
92keys_strgv=$sim$seas$proj$vars$ref
93keys_strg=$sim$seas$proj$ref
94
95mkdir -p $OUT_D
96if [ -f $OUT_D/$keys_strg.ENCOURS ] ; then 
97   echo $OUT_D/$keys_strg.ENCOURS
98   exit # Si le même atlas est deja en cours de realisation on sort
99else
100   touch $OUT_D/$keys_strg.ENCOURS
101fi
102
103if [ "$OUT_D" = "" ] ; then
104   $OUT_D=$STORAGE/NPV5LRL79/$run/ATLAS/SE_$years/ATM
105fi
106
107cd $ATLAS_DIR
108echo sim $sim seas $seas > atlas.sh.log
109
110###########################################################################
111# Boucle pour construire l'atlas en plusieurs passages
112echo IL FAUT FAIRE L ATLAS EN PLUSIEURS PASSAGE SINON CA PLANTE ...
113###########################################################################
114
115case "$proj" in
116   "SH"|"NH") pyatlas="atlas_SH.py --projection $proj" ;;
117   "GLOB") Var3D=,ua,va,ta,hus,hur ; pyatlas=atlas_none.py ;;
118esac
119
120
121npass=5
122ipass=1
123
124while [ $ipass -le $npass ] ; do
125
126   echo Nettoyage des fichiers corrompus du cache
127   $local/clean_cache.sh $DIRATLAS
128   echo passage $ipass >> atlas.sh.log
129   html=index_example_"$seas"_"$sim".html
130   htmlopt=index_${proj}_"$seas"_"$sim".html
131   rm -f $html
132   echo python $local/$pyatlas -v $vars -s `basename $simdir`_$years -t $ref -p $seas --root $simdir/ATM/Analyse/SE
133   python $local/$pyatlas -v $vars -s `basename $simdir`_$years -t $ref -p $seas --root $simdir/ATM/Analyse/SE
134
135   if [ ! -f "$html"  -o "`wc -l $html | awk ' { print $1 } '`" = "0" ] ; then
136      echo ECHEC ATLAS : $html inexistant ou vide | tee >>  atlas.sh.log
137      echo ECHEC ATLAS : $html inexistant ou vide
138   else
139      echo cp -f $html tmp$$.$passage
140      cp -f $html tmp$$.$passage
141      pwd
142      echo tmp$$.$passage
143      echo LS  LS
144      ls -lrt | tail
145# A ADAPTER en fonction de la machine
146      sed -e "s:/prodigfs/ipslfs/dods/:/thredds/fileServer/IPSLFS/:g" tmp$$.$passage >| $htmlopt
147      \cp -f $htmlopt $OUT_D/
148      PathHtml=`echo $OUT_D/$htmlopt | sed -e 's:/prodigfs/ipslfs/dods/:http\://vesg.ipsl.upmc.fr/thredds/fileServer/IPSLFS/:'`
149      echo NOUVEL ATLAS DISPONIBLE SUR $PathHtml | tee >>  atlas.sh.log
150      echo NOUVEL ATLAS DISPONIBLE SUR $PathHtml
151      echo $keys_strgv >> $OUT_D/atlas_OK
152      echo ${sim}+${seas}+${proj}+$vars >> $OUT_D/atlas_OK
153   fi
154   (( ipass = $ipass + 1 ))
155
156done
157
158\rm -f $OUT_D/$keys_strg.ENCOURS
Note: See TracBrowser for help on using the repository browser.