source: BOL/Multi_atlas/multi_ZONE.sh @ 4304

Last change on this file since 4304 was 3882, checked in by musat, 4 years ago

Changements PATHS ciclad, runs.txt et sed HTML
Ajout possibilite acces simulations sur l espace "SE" dans cmor.sh
Ajout acces OBS a partir de l espace fabric multi_ZONE.sh
IM

  • Property svn:executable set to *
File size: 5.0 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='psl'
75#vars="pr rstt rlut rtt crelt crest crett hfns hfls tas sst tauu tauv psl zg500 rsts rsut rlutcs albs albt cress crels crets rts rah rahcs rahcre rlah rlahcs rlahcre rsah rsahcs rsahcre cltcalipso clhcalipso clmcalipso cllcalipso hurs hfss rldscs rlds rlus rsdscs rsds rsus rsuscs rsutcs prw"
76#vars="pr prw rstt rlut rtt crelt crest crett hfns hfls 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"
77vars="pr prw rstt rlut rtt crelt crest crett hfns hfls 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"
78echo $vars
79
80for var in $vars; do 
81
82echo TRAITEMENT DE LA VARIABLE $var
83
84if [ $force_create = 1 ] ; then \rm -f $outd/${var}zon.p* ; fi
85
86if [ ! -f $outd/${var}zon.pdf -o ! -f $outd/${var}zon.png ] ; then
87
88echo zon var=$var
89echo zon GR=$GR 
90echo zon SEAS=$SEAS
91echo zon sims=$sims
92
93nsims=$#
94echo NSIMS $nsims
95
96
97line=`grep  "$var," $local/description${SEAS}.zon`
98if [ "$line" = "" ] ; then echo $var non prevue dans description ; exit ; fi
99name=`echo $line | awk -F, ' { print $2 } '`
100unit=`echo $line | awk -F, ' { print $3 } '`
101 min=`echo $line | awk -F, ' { print $4 } '`
102 max=`echo $line | awk -F, ' { print $5 } '`
103
104echo $line $name $unit $min $max
105GR=VLR
106
107
108WRK=`pwd`/WORK/XMGR$$/$var
109
110mkdir -p $outd
111cd $outd
112pwd
113
114pwd
115echo OK0 $sims
116for sim in $sims ; do
117   MAINDIR=$DODSDIR/$login/lmdz
118   if [ "$sim" = "OBS" ] ; then 
119     MAINDIR=$DODSDIR/fabric/lmdz ; 
120   fi
121   echo sim is= $sim
122   ZONDIR=$MAINDIR/$GR/$SEAS/$sim/$ZONE
123   echo $ZONDIR
124   pwd
125   file=`echo $sim | sed -e 's/_[0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9]//'`
126   echo ln -sf $ZONDIR/$var $file
127   ln -sf $ZONDIR/$var $file
128done
129
130if [ $var == "prl" ] || [ $var == "prc" ] ; then
131    legend="0.72,0.7"
132elif [ $var == "pr" ] || [ $var == "clmcalipso" ] || [ $var == "eva" ] ; then
133    legend="0.72,0.7"
134elif [ $var == "clhcalipso" ] || [ $var == "crelt" ] ; then
135    legend="0.72,0.7"
136elif [ $var == "crest" ] ; then
137    view="0.15, 0.15, 1, 0.6"
138    legend="0.25,0.25"
139elif [ $var == "hfls" ] || [ $var == "prw" ] ; then
140    view="0.15, 0.15, 1, 0.6"
141    legend="0.72,0.7"
142elif [ $var == "hfns" ] ; then
143    view="0.15, 0.15, 1, 0.6"
144    legend="0.72,0.7"
145elif [ $var == "rstt" ] && [ $SEAS == "YEAR" ]; then
146    legend="0.42,0.45"
147else
148    #view="0.15, 0.15, 0.7, 0.45"
149    #legend="0.72,0.45"
150    legend="0.72,0.25"
151fi
152view="0.15, 0.15, 1, 0.6"
153legend="1.02,0.6"
154
155
156\rm tmp.param
157cat <<eod>| tmp.param
158world $latmin, $min, $latmax, $max
159stack world 0, 0, 0, 0
160xaxis label "Latitude"
161yaxis label "$name ($unit)"
162view $view
163legend $legend
164s0 linewidth 10
165s0 color 7
166eod
167
168ii=0
169for style in 1 3 2 ; do
170for color in 1 2 3 4 9 8 10 ; do
171(( ii = $ii + 1 ))
172cat <<eod>> tmp.param
173s$ii linewidth 2
174s$ii color $color
175s$ii linestyle $style
176eod
177done
178done
179
180#cat tmp.param
181pwd
182
183if [ $var == "rstt" -o 0 = 0 ] ; then
184 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
185else
186 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
187fi
188
189echo 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
190
191echo xmgrace $sims -param tmp.param -legend load  -hardcopy -hdevice EPS -printfile tmp.eps
192
193epstopdf tmp.eps
194mv -f tmp.pdf ${var}zon.pdf
195convert ${var}zon.pdf ${var}zon.png
196
197fi # sur existence de ${var}zon.p*
198
199done
200
201pwd
202ls
Note: See TracBrowser for help on using the repository browser.