source: BOL/Multi_atlas/multi_ZONE.sh @ 3730

Last change on this file since 3730 was 3700, 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: 5.3 KB
RevLine 
[3684]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
[3700]9 SEAS=$1
10 comp=$2
11 ZONE=$3
12
[3684]13login=`whoami`
14hostname=`hostname`
15if [ ${hostname:0:5} = cicla ] ; then
16DODSDIR=/prodigfs/ipslfs/dods
17fi
18if [ ${hostname:0:5} = camel ] ; then
19DODSDIR=/prodigfs/ipslfs/dods
20fi
21if [ ${hostname:0:5} = irene ] ; then
22DODSDIR=
23fi
24if [ ${hostname:0:5} = jean- ] ; then
25DODSDIR=
26fi
27
28MAINDIR=$DODSDIR/$login/lmdz
29
30runstxt=/home/fabric/LMDZ/MultiSimu/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
58#sims="OBS " ; for ss in `awk ' {print $1"_"$2 } ' $DEF_FILE` ; do sims="$sims $ss" ; done
59#echo sims $sims
60#exit
61listsims=""  ; for s  in `awk ' {print $1} ' $DEF_FILE`          ; do listsims="$listsims $s"    ; done
62echo listsims $listsims
63sims="OBS "
64for s in $listsims ; do
65simdir=`grep -w "^$s "  $runstxt | awk ' { print $2 } '`
66ss=`basename $simdir `
67#year=`grep -w "^$s " $DEF_FILE | awk ' { print $2 } '`
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"
78#vars=$4
79#vars="eva"
80echo $vars
81
82for var in $vars; do 
83
84echo TRAITEMENT DE LA VARIABLE $var
85
86if [ $force_create = 1 ] ; then \rm -f $outd/${var}zon.p* ; fi
87
88if [ ! -f $outd/${var}zon.pdf -o ! -f $outd/${var}zon.png ] ; then
89
90echo zon var=$var
91echo zon GR=$GR 
92echo zon SEAS=$SEAS
93echo zon sims=$sims
94
95nsims=$#
96echo NSIMS $nsims
97
98
99#line=`grep  "$var," $local/description.zon`
100line=`grep  "$var," $local/description${SEAS}.zon`
101if [ "$line" = "" ] ; then echo $var non prevue dans description ; exit ; fi
102name=`echo $line | awk -F, ' { print $2 } '`
103unit=`echo $line | awk -F, ' { print $3 } '`
104 min=`echo $line | awk -F, ' { print $4 } '`
105 max=`echo $line | awk -F, ' { print $5 } '`
106
107echo $line $name $unit $min $max
108GR=VLR
109
110
111WRK=`pwd`/WORK/XMGR$$/$var
112
113mkdir -p $outd
114cd $outd
115pwd
116
117pwd
118echo OK0 $sims
119for sim in $sims ; do
120   if [ $sim = OBS ] ; then MAINDIR=$DODSDIR/fabric/lmdz ; fi
121   ZONDIR=$MAINDIR/$GR/$SEAS/$sim/$ZONE
122   echo $ZONDIR
123   pwd
124   file=`echo $sim | sed -e 's/_[0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9]//'`
125   echo ln -sf $ZONDIR/$var $file
126   ln -sf $ZONDIR/$var $file
127done
128
129
130    #yaxis  tick major 5
131    #yaxis  tick minor 1
132
133#if [ $nsims = 2 ] ; then
134#    view="0.15, 0.15, 1, 0.6"
135#    legend="0.15,0.7"
136if [ $var == "prl" ] || [ $var == "prc" ] ; then
137    legend="0.72,0.7"
138elif [ $var == "pr" ] || [ $var == "clmcalipso" ] || [ $var == "eva" ] ; then
139    legend="0.72,0.7"
140elif [ $var == "clhcalipso" ] || [ $var == "crelt" ] ; then
141    legend="0.72,0.7"
142elif [ $var == "crest" ] ; then
143    view="0.15, 0.15, 1, 0.6"
144    legend="0.25,0.25"
145elif [ $var == "hfls" ] || [ $var == "prw" ] ; then
146    view="0.15, 0.15, 1, 0.6"
147    legend="0.72,0.7"
148elif [ $var == "hfns" ] ; then
149    view="0.15, 0.15, 1, 0.6"
150    legend="0.72,0.7"
151elif [ $var == "rstt" ] && [ $SEAS == "YEAR" ]; then
152    legend="0.42,0.45"
153else
154    #view="0.15, 0.15, 0.7, 0.45"
155    #legend="0.72,0.45"
156    legend="0.72,0.25"
157fi
158view="0.15, 0.15, 1, 0.6"
159legend="1.02,0.6"
160
161
162\rm tmp.param
163cat <<eod>| tmp.param
164world $latmin, $min, $latmax, $max
165stack world 0, 0, 0, 0
166xaxis label "Latitude"
167yaxis label "$name ($unit)"
168view $view
169legend $legend
170s0 linewidth 10
171s0 color 7
172eod
173
174ii=0
175for style in 1 3 2 ; do
176for color in 1 2 3 4 9 8 10 ; do
177(( ii = $ii + 1 ))
178cat <<eod>> tmp.param
179s$ii linewidth 2
180s$ii color $color
181s$ii linestyle $style
182eod
183done
184done
185
186#cat tmp.param
187pwd
188
189if [ $var == "rstt" -o 0 = 0 ] ; then
190 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
191else
192 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
193fi
194
195echo 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
196
197echo xmgrace $sims -param tmp.param -legend load  -hardcopy -hdevice EPS -printfile tmp.eps
198
199epstopdf tmp.eps
200mv -f tmp.pdf ${var}zon.pdf
201convert ${var}zon.pdf ${var}zon.png
202
203fi # sur existence de ${var}zon.p*
204
205done
206
207pwd
208ls
Note: See TracBrowser for help on using the repository browser.