source: BOL/Multi_atlas/multi_ZONE.sh @ 4323

Last change on this file since 4323 was 4307, checked in by musat, 2 years ago

Fusion entre la version commune (compte fabric) et la version perso
du multi-atlas incluant

  • la fiabilisation de la realisation des cartes
  • la correction des coupes (latitude,altitude) pour les biais
  • l'ajout d'une option pour des multi-atlas par rapport a une simulation de reference
  • l'ajout d'options pour un multi-atlas regional
  • la mise a jour des thredds (repertoire & html) pour ciclad

IonelaMusat?

  • Property svn:executable set to *
File size: 4.5 KB
Line 
1#!/bin/bash
2
3###################################################
4# remplace l'ancien multi_ZON.sh
5# Trace les moyennes zonales multi-simulations
6# a partir de fichiers ascii deja traités.
7###################################################
8
9 SEAS=$1
10 comp=$2
11 ZONE=$3
12
13login=`whoami`
14hostname=`hostname`
15if [ ${hostname:0:5} = cicla ] ; then
16DODSDIR=/thredds/ipsl
17fi
18if [ ${hostname:0:5} = camel ] ; then
19DODSDIR=/thredds/ipsl
20fi
21if [ ${hostname:0:5} = irene ] ; then
22DODSDIR=
23fi
24if [ ${hostname:0:5} = jean- ] ; then
25DODSDIR=
26fi
27
28MAINDIR=$DODSDIR/$login/lmdz
29
30runstxt=`pwd`/runs.txt
31
32while test -n "${1}"; do
33    case $1 in
34       "-runsfile") runstxt=$2 ; shift ;;
35    esac
36    shift
37done
38
39
40GR=VLR
41force_create=1
42
43local=`pwd`
44
45latmin=-90.
46latmax=90.
47if [ $ZONE = AMMACROSS ] ; then
48   latmin=-5.
49   latmax=25.
50fi
51
52COMP_D=$MAINDIR/MultiSimu/$comp
53outd=$COMP_D/$ZONE/$SEAS
54
55DEF_FILE=$COMP_D/def.txt
56echo $COMP_D
57
58listsims=""  ; for s  in `awk ' {print $1} ' $DEF_FILE`          ; do listsims="$listsims $s"    ; done
59echo listsims $listsims
60
61sims="OBS "
62
63echo listsims= $listsims
64
65for s in $listsims ; do
66simdir=`grep -w "^$s "  $runstxt | awk ' { print $2 } '`
67ss=`basename $simdir `
68year=`grep -w "^$s" $DEF_FILE | awk ' { print $2 } '`
69sims="$sims ${s}_$year"
70done
71
72echo $SEAS $outd "$sims"
73
74vars="pr prw rstt rlut rtt crelt crest crett hfns hfls eva tas sst tauu tauv psl zg500 rsts rsut rlutcs albs albt cress crels crets rts rah rahcs rahcre rlah rlahcs rlahcre rsah rsahcs rsahcre hurs hfss rldscs rlds rlus rsdscs rsds rsus rsuscs rsutcs prw rttcs rsttcs cllcalipso clmcalipso clhcalipso cll clm clh"
75echo $vars
76
77for var in $vars; do 
78
79echo TRAITEMENT DE LA VARIABLE $var
80
81if [ $force_create = 1 ] ; then \rm -f $outd/${var}zon.p* ; fi
82
83if [ ! -f $outd/${var}zon.pdf -o ! -f $outd/${var}zon.png ] ; then
84
85echo zon var=$var
86echo zon GR=$GR 
87echo zon SEAS=$SEAS
88echo zon sims=$sims
89
90nsims=$#
91echo NSIMS $nsims
92
93
94line=`grep  "$var," $local/description${SEAS}.zon`
95if [ "$line" = "" ] ; then echo $var non prevue dans description ; exit ; fi
96name=`echo $line | awk -F, ' { print $2 } '`
97unit=`echo $line | awk -F, ' { print $3 } '`
98 min=`echo $line | awk -F, ' { print $4 } '`
99 max=`echo $line | awk -F, ' { print $5 } '`
100
101echo $line $name $unit $min $max
102GR=VLR
103
104
105WRK=`pwd`/WORK/XMGR$$/$var
106
107mkdir -p $outd
108cd $outd
109pwd
110
111pwd
112echo OK0 $sims
113for sim in $sims ; do
114   MAINDIR=$DODSDIR/$login/lmdz
115   if [ "$sim" = "OBS" ] ; then 
116     MAINDIR=$DODSDIR/fabric/lmdz ; 
117   fi
118   echo sim is= $sim
119   ZONDIR=$MAINDIR/$GR/$SEAS/$sim/$ZONE
120   echo $ZONDIR
121   pwd
122   file=`echo $sim | sed -e 's/_[0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9]//'`
123   echo ln -sf $ZONDIR/$var $file
124   ln -sf $ZONDIR/$var $file
125done
126
127if [ $var == "prl" ] || [ $var == "prc" ] ; then
128    legend="0.72,0.7"
129elif [ $var == "pr" ] || [ $var == "clmcalipso" ] || [ $var == "eva" ] ; then
130    legend="0.72,0.7"
131elif [ $var == "clhcalipso" ] || [ $var == "crelt" ] ; then
132    legend="0.72,0.7"
133elif [ $var == "crest" ] ; then
134    view="0.15, 0.15, 1, 0.6"
135    legend="0.25,0.25"
136elif [ $var == "hfls" ] || [ $var == "prw" ] ; then
137    view="0.15, 0.15, 1, 0.6"
138    legend="0.72,0.7"
139elif [ $var == "hfns" ] ; then
140    view="0.15, 0.15, 1, 0.6"
141    legend="0.72,0.7"
142elif [ $var == "rstt" ] && [ $SEAS == "YEAR" ]; then
143    legend="0.42,0.45"
144else
145    #view="0.15, 0.15, 0.7, 0.45"
146    #legend="0.72,0.45"
147    legend="0.72,0.25"
148fi
149view="0.15, 0.15, 1, 0.6"
150legend="1.02,0.6"
151
152
153\rm tmp.param
154cat <<eod>| tmp.param
155world $latmin, $min, $latmax, $max
156stack world 0, 0, 0, 0
157xaxis label "Latitude"
158yaxis label "$name ($unit)"
159view $view
160legend $legend
161s0 linewidth 10
162s0 color 7
163eod
164
165ii=0
166for style in 1 3 2 ; do
167for color in 1 2 3 4 9 8 10 11 12 5 6 ; do
168(( ii = $ii + 1 ))
169cat <<eod>> tmp.param
170s$ii linewidth 2
171s$ii color $color
172s$ii linestyle $style
173eod
174done
175done
176
177#cat tmp.param
178pwd
179
180if [ $var == "rstt" -o 0 = 0 ] ; then
181 xmgrace `echo $sims | sed -e 's/_[0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9]//g'` -param tmp.param -legend load  -hardcopy -hdevice EPS -printfile tmp.eps
182else
183 xmgrace `echo $sims | sed -e 's/_[0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9]//g'` -param tmp.param  -hardcopy -hdevice EPS -printfile tmp.eps
184fi
185
186echo xmgrace `echo $sims | sed -e 's/_[0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9]//g'` -param tmp.param -legend load  -hardcopy -hdevice EPS -printfile tmp.eps
187
188echo xmgrace $sims -param tmp.param -legend load  -hardcopy -hdevice EPS -printfile tmp.eps
189
190epstopdf tmp.eps
191mv -f tmp.pdf ${var}zon.pdf
192convert ${var}zon.pdf ${var}zon.png
193
194fi # sur existence de ${var}zon.p*
195
196done
197
198pwd
199ls
Note: See TracBrowser for help on using the repository browser.