source: BOL/Multi_atlas/Utils/atlas0.sh @ 3694

Last change on this file since 3694 was 3694, 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.
Corrections.

  • Property svn:executable set to *
File size: 3.9 KB
Line 
1local=`pwd -P`
2
3date
4
5vars=""
6vars="sst"
7#runstxt=$local/../runs.txt
8
9if [ $# = 1 ] ; then
10   opts="`echo $1 | sed -e 's/,/ /g'`"
11   for opt in $opts ; do
12       echo $opt
13       key=`echo $opt | cut -d= -f1`
14       val=`echo $opt | cut -d= -f2`
15       echo $key $val
16       if [ "$key" = "RUN" ] ; then sim=$val ; fi
17       if [ "$key" = "REF" ] ; then ref=$val ; fi
18       if [ "$key" = "SEASON" ] ; then seas=$val ; fi
19       if [ "$key" = "PROJ" ] ; then proj=$val ; fi
20       if [ "$key" = "OUTDIR" ] ; then OUT_D=$val ; fi
21       if [ "$key" = "RUNSTXT" ] ; then runstxt=$val ; fi
22       if [ "$key" = "VARS" ] ; then vars="`echo $val | sed -e 's/+/,/g'`" ; fi
23   done
24elif [ $# = 0 ] ; then
25   sim=$RUN
26   ref=OBS
27   seas=$SEASON
28   proj=$PROJ
29   OUT_D=$OUTDIR
30   runstxt=$RUNSTXT
31   vars=`echo $VARS | sed -e 's/+/,/g'`
32else
33  echo USE
34  echo Job mode :
35  echo $submit -v RUN=NPv5.3_1982_1989,SEASON=YEAR,PROJ=GLOB,OUTDIR=$MULTIDIR/V5/ATLAS,VARS=pr+tas atlas.sh
36  echo interactif :
37  echo ./atlas.sh RUN=NPv5.3_1982_1989,SEASON=YEAR,PROJ=GLOB,OUTDIR=$MULTIDIR/V5/ATLAS,VARS=pr+tas
38  exit
39fi
40
41if [ "$vars" = "" ] ; then
42   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
43fi
44
45#,ua850,va850,ta850,ua500,va500,ta500,ua200,va200,ta200
46echo sim $sim
47srun=`echo $sim | sed -e 's/_[0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9]//'`
48echo srun $srun
49simdir=`grep -w "^$srun" $runstxt | awk ' { print $2 } '`
50run=`basename $simdir `
51years=`echo $sim | sed -e 's/'$srun'//' | sed -e 's/_//'`
52sim=${run}_${years}
53echo $run $years $sim $ref
54echo ENTREES : $run, $years, $seas, $vars, $ref
55echo simdir $simdir
56
57echo run $run 
58echo sim $sim
59echo simdir $simdir
60
61keys_strgv=$sim$seas$proj$vars$ref
62keys_strg=$sim$seas$proj$ref
63
64mkdir -p $OUT_D
65if [ -f $OUT_D/$keys_strg.ENCOURS ] ; then 
66   echo $OUT_D/$keys_strg.ENCOURS
67   exit # Si le même atlas est deja en cours de realisation on sort
68else
69   touch $OUT_D/$keys_strg.ENCOURS
70fi
71
72if [ "$OUT_D" = "" ] ; then
73   $OUT_D=$STORAGE/NPV5LRL79/$run/ATLAS/SE_$years/ATM
74fi
75
76cd $ATLAS_DIR
77echo sim $sim seas $seas > atlas.sh.log
78
79###########################################################################
80# Boucle pour construire l'atlas en plusieurs passages
81echo IL FAUT FAIRE L ATLAS EN PLUSIEURS PASSAGE SINON CA PLANTE ...
82###########################################################################
83
84case "$proj" in
85   "SH"|"NH") pyatlas="atlas_SH.py --projection $proj" ;;
86   "GLOB") Var3D=,ua,va,ta,hus,hur ; pyatlas=atlas_none.py ;;
87esac
88
89
90npass=5
91ipass=1
92
93while [ $ipass -le $npass ] ; do
94
95   echo Nettoyage des fichiers corrompus du cache
96   $local/clean_cache.sh $DIRATLAS
97   echo passage $ipass >> atlas.sh.log
98   html=index_example_"$seas"_"$sim".html
99   htmlopt=index_${proj}_"$seas"_"$sim".html
100   rm -f $html
101   echo python $local/$pyatlas -v $vars -s `basename $simdir`_$years -t $ref -p $seas --root $simdir/ATM/Analyse/SE
102   python $local/$pyatlas -v $vars -s `basename $simdir`_$years -t $ref -p $seas --root $simdir/ATM/Analyse/SE
103
104   if [ ! -f "$html"  -o "`wc -l $html | awk ' { print $1 } '`" = "0" ] ; then
105      echo ECHEC ATLAS : $html inexistant ou vide | tee >>  atlas.sh.log
106      echo ECHEC ATLAS : $html inexistant ou vide
107   else
108      echo cp -f $html tmp$$.$passage
109      cp -f $html tmp$$.$passage
110      pwd
111      echo tmp$$.$passage
112      echo LS  LS
113      ls -lrt | tail
114# A ADAPTER en fonction de la machine
115      sed -e "s:/prodigfs/ipslfs/dods/:/thredds/fileServer/IPSLFS/:g" tmp$$.$passage >| $htmlopt
116      \cp -f $htmlopt $OUT_D/
117      PathHtml=`echo $OUT_D/$htmlopt | sed -e 's:/prodigfs/ipslfs/dods/:http\://vesg.ipsl.upmc.fr/thredds/fileServer/IPSLFS/:'`
118      echo NOUVEL ATLAS DISPONIBLE SUR $PathHtml | tee >>  atlas.sh.log
119      echo NOUVEL ATLAS DISPONIBLE SUR $PathHtml
120      echo $keys_strgv >> $OUT_D/atlas_OK
121      echo ${sim}+${seas}+${proj}+$vars >> $OUT_D/atlas_OK
122   fi
123   (( ipass = $ipass + 1 ))
124
125done
126
127\rm -f $OUT_D/$keys_strg.ENCOURS
Note: See TracBrowser for help on using the repository browser.