1 | #!/bin/bash |
---|
2 | ## e.g. # lmdz_check.bash -1:6:3:26 wrfout_d01_1979-12-01_00:00:00 /home/lluis/PY /home/lluis/etudes/WRF_LMDZ/WaquaL/LaTeX/NPv31_hgardfou/figs 0 None 0 |
---|
3 | if test $1 = '-h'; then |
---|
4 | echo "**********************************" |
---|
5 | echo "*** Shell script to analyze ***" |
---|
6 | echo "*** LMDZ runs at a given point ***" |
---|
7 | echo "**********************************" |
---|
8 | echo "lmdz_check.bash [point](as Time:z:y:x, -1 last value) [infile] [pyhome] \ |
---|
9 | (place with pthon scripts) [ofold](output folder) [getvals](0, no; 1: yes, \ |
---|
10 | whether to compute intermediary files) [mapv](None, no; map characteristics:[proj],[res])" |
---|
11 | echo " [point]: as Time:z:y:x, (-1 for last value, python style (0 based))" |
---|
12 | echo " [infile]: file to use" |
---|
13 | echo " [pyhome]: place with pthon scripts" |
---|
14 | echo " [ofold]: output folder" |
---|
15 | echo " [getvals]: 0, no; 1: yes, whether to compute intermediary files" |
---|
16 | echo " [mapv]: None, no; map characteristics:[proj],[res]" |
---|
17 | echo " [visualize]: 0, no; 1: yes, whether to visualize results" |
---|
18 | else |
---|
19 | rootsh=`pwd` |
---|
20 | errmsg='ERROR -- error -- ERROR -- error' |
---|
21 | main='lmdz_check.bash' |
---|
22 | |
---|
23 | point=$1 |
---|
24 | infile=$2 |
---|
25 | PYHOME=$3 |
---|
26 | ofold=$4 |
---|
27 | getvals=$5 |
---|
28 | mapv=$6 |
---|
29 | vis=$7 |
---|
30 | |
---|
31 | # To paint figures |
---|
32 | draw=1 |
---|
33 | |
---|
34 | # To generate Hovmoller graph |
---|
35 | dohov=1 |
---|
36 | |
---|
37 | # To generate point graph |
---|
38 | dopt=1 |
---|
39 | |
---|
40 | # To generate horizontal graph |
---|
41 | dohor=1 |
---|
42 | |
---|
43 | # To generate neighbourghood evol graph |
---|
44 | doneig=1 |
---|
45 | |
---|
46 | # To generate LaTeX |
---|
47 | dolatex=1 |
---|
48 | |
---|
49 | vartypes='dt:st:sfc' |
---|
50 | |
---|
51 | dtvariables='AJS:CON:DYN:EVA:LSCST:LSCTH:LSC:PHY:THE:VDF:WAK' |
---|
52 | stvariables='QVAPOR:QCLOUD:LGEOP:LTEMP:LVITU:LVITV:LVITW:LRHUM:LH2O:LPR_CON_I:' |
---|
53 | stvariables=${stvariables}'LPR_CON_L:LIWCON:LPTCONV' |
---|
54 | sfcvariables='LSNOW:LEVAP:LPRECIP:LPLUC:LPLUL:LRH2M:T2:U10:V10:LCLDL:LCLDM:LCLDH:PSFC' |
---|
55 | |
---|
56 | kvalues='2dh:hovz:tevol' |
---|
57 | |
---|
58 | otex='lmdz_check.tex' |
---|
59 | ####### ###### ##### #### ### ## # |
---|
60 | # Levels to interpolate |
---|
61 | plevels='100000.,97500.,95000.,92500.,90000.,85000.,80000.,75000.,70000.,' |
---|
62 | plevels=${plevels}'65000.,60000.,55000.,50000.,45000.,40000.,35000.,30000.,' |
---|
63 | plevels=${plevels}'25000.,20000.,15000.,10000.,5000.,2500.,1000.,' |
---|
64 | plevels=${plevels}'500.,250.' |
---|
65 | |
---|
66 | tval=`echo ${point} | tr ':' ' ' | awk '{print $1}'` |
---|
67 | zval=`echo ${point} | tr ':' ' ' | awk '{print $2}'` |
---|
68 | yval=`echo ${point} | tr ':' ' ' | awk '{print $3}'` |
---|
69 | xval=`echo ${point} | tr ':' ' ' | awk '{print $4}'` |
---|
70 | |
---|
71 | ####### ####### |
---|
72 | ## MAIN |
---|
73 | ####### |
---|
74 | |
---|
75 | vtypes=`echo ${vartypes} | tr ':' ' '` |
---|
76 | kvals=`echo ${kvalues} | tr ':' ' '` |
---|
77 | |
---|
78 | # All variables |
---|
79 | allvars0='' |
---|
80 | |
---|
81 | for vt in ${vtypes}; do |
---|
82 | case $vt in |
---|
83 | 'dt' ) |
---|
84 | var0s=`echo ${dtvariables} | tr ':' ' '` |
---|
85 | for var0 in $var0s; do |
---|
86 | allvars0=${allvars0}'LDQ'${var0}',LDT'${var0}',' |
---|
87 | if test ${var0} = 'CON' || test ${var0} = 'DYN' || test ${var0} = 'VDF'; then |
---|
88 | allvars0=${allvars0}'LDU'${var0}',LDV'${var0}',' |
---|
89 | fi |
---|
90 | done |
---|
91 | ;; |
---|
92 | 'sfc' ) |
---|
93 | var0s=`echo ${sfcvariables} | tr ':' ' '` |
---|
94 | for var0 in $var0s; do |
---|
95 | allvars0=${allvars0}${var0}',' |
---|
96 | done |
---|
97 | ;; |
---|
98 | 'st' ) |
---|
99 | var0s=`echo ${stvariables} | tr ':' ' '` |
---|
100 | for var0 in $var0s; do |
---|
101 | allvars0=${allvars0}${var0}',' |
---|
102 | done |
---|
103 | ;; |
---|
104 | esac |
---|
105 | done |
---|
106 | Lallvars0=`expr length ${allvars0}` |
---|
107 | Lallvars01=`expr ${Lallvars0} - 1` |
---|
108 | allvars=${allvars0:0:${Lallvars01}} |
---|
109 | echo "all vars: '"${allvars}"'" |
---|
110 | |
---|
111 | if test ${getvals} -eq 1; then |
---|
112 | for kvn in ${kvals}; do |
---|
113 | echo " kind of values: "${kvn} |
---|
114 | case $kvn in |
---|
115 | '2dh') |
---|
116 | pyvls='Time,'${tval}','${tval}',1@bottom_top,'${zval}','${zval}',1' |
---|
117 | ;; |
---|
118 | 'hovz') |
---|
119 | pyvls='south_north,'${yval}','${yval}',1@west_east,'${xval}','${xval}',1' |
---|
120 | ;; |
---|
121 | 'tevol') |
---|
122 | pyvls='bottom_top,'${zval}','${zval}',1@south_north,'${yval}','${yval} |
---|
123 | pyvls=${pyvls}',1@west_east,'${xval}','${xval}',1' |
---|
124 | ;; |
---|
125 | esac |
---|
126 | ofile=`python ${PYHOME}/nc_var.py -o DataSetSection_multidims -f ${infile} \ |
---|
127 | -S ${pyvls} | grep succesfull | awk '{print $6}' | tr '"' ' '` |
---|
128 | if test $? -ne 0; then |
---|
129 | echo ${errmsg} |
---|
130 | echo " "${main}": python failed!" |
---|
131 | echo " python "${HOME}/nc_var.py -o DataSetSection_multidims \ |
---|
132 | -f ${infile} -S ${pyvls} |
---|
133 | exit |
---|
134 | fi |
---|
135 | case $kvn in |
---|
136 | '2dh') |
---|
137 | # Adding CF longitudes and latitudes |
---|
138 | python ${PYHOME}/nc_var.py -f ${ofile} -o WRF_CFlonlat_creation \ |
---|
139 | -S longitude,latitude -v XLONG,XLAT |
---|
140 | ;; |
---|
141 | 'tevol') |
---|
142 | # Adding CF time |
---|
143 | python ${PYHOME}/nc_var.py -f ${ofile} -o WRF_CFtime_creation \ |
---|
144 | -S 19491201000000,hours -v time |
---|
145 | ;; |
---|
146 | 'hovz') |
---|
147 | # Adding CF time |
---|
148 | python ${PYHOME}/nc_var.py -f ${ofile} -o WRF_CFtime_creation \ |
---|
149 | -S 19491201000000,hours -v time |
---|
150 | # Adding variable dimension from 'bottom_top' |
---|
151 | python ${PYHOME}/nc_var.py -f ${ofile} -o dimVar_creation -S bottom_top |
---|
152 | # Vertical interpolation |
---|
153 | # dvals='T:Time,Z:bottom_top,Y:south_north,X:west_east' |
---|
154 | # python ${PYHOME}/vertical_interpolation.py -f ${ofile} -o WRFp \ |
---|
155 | # -i ${plevels} -k 'lin' -v ${allvars} -d ${dvals} \ |
---|
156 | # -D T:Times,Z:ZNU,Y:XLAT,X:XLONG |
---|
157 | # if test $? -ne 0; then |
---|
158 | # echo ${errormsg} |
---|
159 | # echo " "${main}": drawing.py fails!" |
---|
160 | # echo python ${PYHOME}/vertical_interpolation.py -f ${ofile} -o WRFp \ |
---|
161 | # -i ${plevels} -k 'lin' -v ${allvars} -d ${dvals} \ |
---|
162 | # -D T:Times,Z:ZNU,Y:XLAT,X:XLONG |
---|
163 | # exit |
---|
164 | # fi |
---|
165 | # ofilen0=`echo ${ofile} | tr '.' ' ' | awk '{print $1}'` |
---|
166 | # mv vertical_interpolation_WRFp.nc ${ofilen0}_WRFp.nc |
---|
167 | ;; |
---|
168 | esac |
---|
169 | done |
---|
170 | fi |
---|
171 | |
---|
172 | #exit |
---|
173 | if test $draw -eq 1; then |
---|
174 | echo "Drawing..." |
---|
175 | for vt in ${vtypes}; do |
---|
176 | echo "variable type: "${vt} |
---|
177 | case $vt in |
---|
178 | 'dt' ) |
---|
179 | var0s=`echo ${dtvariables} | tr ':' ' '` |
---|
180 | vars='' |
---|
181 | for var0 in $var0s; do |
---|
182 | vars=${vars}'LDQ'${var0}' LDT'${var0}' ' |
---|
183 | if test ${var0} = 'CON' || test ${var0} = 'DYN' || test ${var0} = 'VDF'; then |
---|
184 | vars=${vars0}'LDU'${var0}' LDV'${var0}' ' |
---|
185 | fi |
---|
186 | done |
---|
187 | ;; |
---|
188 | 'sfc' ) |
---|
189 | vars=`echo ${sfcvariables} | tr ':' ' '` |
---|
190 | ;; |
---|
191 | 'st' ) |
---|
192 | vars=`echo ${stvariables} | tr ':' ' '` |
---|
193 | ;; |
---|
194 | esac |
---|
195 | for var in ${vars}; do |
---|
196 | echo " var:"${var} |
---|
197 | varvals=`python ${PYHOME}/drawing.py -o variable_values -S ${var} | grep all_values` |
---|
198 | if test $? -ne 0; then |
---|
199 | echo " "${main}": Variable '"${var}"' not defined !!!!" |
---|
200 | exit |
---|
201 | fi |
---|
202 | stdn=`echo ${varvals} | tr ',' ' ' | awk '{print $3}'` |
---|
203 | cbar=`echo ${varvals} | tr ',' ' ' | awk '{print $9}'` |
---|
204 | min=`echo ${varvals} | tr ',' ' ' | awk '{print $5}'` |
---|
205 | max=`echo ${varvals} | tr ',' ' ' | awk '{print $6}'` |
---|
206 | |
---|
207 | if test $dohov -eq 1 && ! test ${vt} = 'sfc'; then |
---|
208 | # Shadded vertical Hovmoller diagrams |
---|
209 | filetail='south_north_B'${yval}'-E'${yval}'-I1_west_east_B'${xval} |
---|
210 | filetail=${filetail}'-E'${xval}'-I1' |
---|
211 | |
---|
212 | # Let's make it easy |
---|
213 | if test ${vt} = 'st';then |
---|
214 | min='Saroundminmax@0.97' |
---|
215 | max='Saroundminmax@0.97' |
---|
216 | else |
---|
217 | min='Spercentile@1' |
---|
218 | max='Spercentile@1' |
---|
219 | fi |
---|
220 | |
---|
221 | if test ${var} = 'LDQEVA' || test ${var} = 'LDTEVA' || test ${var} = 'LH2O';then |
---|
222 | min='Saroundminmax@0.75' |
---|
223 | max='Saroundminmax@0.75' |
---|
224 | if test ${var} = 'LDQEVA'; then |
---|
225 | cbar='Reds' |
---|
226 | else |
---|
227 | cbar='Blues' |
---|
228 | fi |
---|
229 | fi |
---|
230 | |
---|
231 | echo " min: "${min}" max: "${max} |
---|
232 | |
---|
233 | values=${stdn}':Time|-1,bottom_top|-1:varDIMbottom_top:time:'${cbar}':' |
---|
234 | values=${values}${min}','${max}':vertical|temporal|evolution|:pdf:' |
---|
235 | values=${values}'transpose:time|hours!since!1949-12-01|exct,12,h|' |
---|
236 | values=${values}'$%d^{%H}$|date!($[DD]^{[HH]}$)|x:True' |
---|
237 | |
---|
238 | python ${PYHOME}/drawing.py -o draw_2D_shad_time -f ${infile}_${filetail}.nc \ |
---|
239 | -S ${values} -v ${var},time |
---|
240 | if test $? -ne 0; then |
---|
241 | echo ${errormsg} |
---|
242 | echo " "${main}": drawing.py fails!" |
---|
243 | echo python ${PYHOME}/drawing.py -o draw_2D_shad_time \ |
---|
244 | -f ${infile}_${filetail}.nc -S ${values} -v ${var},time |
---|
245 | exit |
---|
246 | else |
---|
247 | mv 2Dfields_shadow_time.pdf ${ofold}/${stdn}_Hovmoller.pdf |
---|
248 | if test $vis -eq 1; then evince ${ofold}/${stdn}_Hovmoller.pdf & fi |
---|
249 | fi |
---|
250 | fi |
---|
251 | |
---|
252 | if test $dopt -eq 1; then |
---|
253 | # Point evolution |
---|
254 | filetail='bottom_top_B'${zval}'-E'${zval}'-I1_south_north_B'${yval}'-E' |
---|
255 | filetail=${filetail}${yval}'-I1_west_east_B'${xval}'-E'${xval}'-I1' |
---|
256 | |
---|
257 | values=${stdn}':time|($[DD]^{[HH]}$):exct,12,h:$%d^{%H}$:time|evolution|at' |
---|
258 | values=${values}'|(x='${xval}',y='${yval}',z='${zval}'):1:pdf' |
---|
259 | python ${PYHOME}/drawing.py -o draw_timeSeries -f ${infile}_${filetail}.nc \ |
---|
260 | -S ${values} -v ${var},time |
---|
261 | if test $? -ne 0; then |
---|
262 | echo ${errormsg} |
---|
263 | echo " "${main}": drawing.py fails!" |
---|
264 | echo python ${PYHOME}/drawing.py -o draw_timeSeries \ |
---|
265 | -f ${infile}_${filetail}.nc -S ${values} -v ${var},time |
---|
266 | exit |
---|
267 | else |
---|
268 | mv TimeSeries_${stdn}.pdf ${ofold}/${stdn}_TimeSeries.pdf |
---|
269 | if test $vis -eq 1; then evince ${ofold}/${stdn}_TimeSeries.pdf & fi |
---|
270 | fi |
---|
271 | fi |
---|
272 | |
---|
273 | if test $dohor -eq 1; then |
---|
274 | # Horizontal plot |
---|
275 | filetail='Time_B'${tval}'-E'${tval}'-I1_bottom_top_B'${zval} |
---|
276 | filetail=${filetail}'-E'${zval}'-I1' |
---|
277 | |
---|
278 | min=`echo ${varvals} | tr ',' ' ' | awk '{print $5}'` |
---|
279 | max=`echo ${varvals} | tr ',' ' ' | awk '{print $6}'` |
---|
280 | |
---|
281 | if test ${vt} = 'dt'; then |
---|
282 | min='Spercentile@1' |
---|
283 | max='Spercentile@1' |
---|
284 | elif test ${vt} = 'st'; then |
---|
285 | min='Saroundminmax@0.97' |
---|
286 | max='Saroundminmax@0.97' |
---|
287 | fi |
---|
288 | |
---|
289 | if test ${var} = 'LRH2M'; then |
---|
290 | max='100.' |
---|
291 | elif test ${var} = 'T2'; then |
---|
292 | min='270' |
---|
293 | max='300.' |
---|
294 | fi |
---|
295 | |
---|
296 | echo " min: "${min}" max: "${max} |
---|
297 | |
---|
298 | values=${stdn}':south_north|-1,west_east|-1:longitude:latitude:'${cbar}':' |
---|
299 | values=${values}${min}','${max}':horizontal|section|at|(t='${tval} |
---|
300 | values=${values}',z='${zval}'):pdf:None:'${mapv}':True' |
---|
301 | |
---|
302 | python ${PYHOME}/drawing.py -o draw_2D_shad -f ${infile}_${filetail}.nc \ |
---|
303 | -S ${values} -v ${var} |
---|
304 | if test $? -ne 0; then |
---|
305 | echo ${errormsg} |
---|
306 | echo " "${main}": drawing.py fails!" |
---|
307 | echo python ${PYHOME}/drawing.py -o draw_2D_shad \ |
---|
308 | -f ${infile}_${filetail}.nc -S ${values} -v ${var} |
---|
309 | exit |
---|
310 | else |
---|
311 | mv 2Dfields_shadow.pdf ${ofold}/${stdn}_hor.pdf |
---|
312 | if test $vis -eq 1; then evince ${ofold}/${stdn}_hor.pdf & fi |
---|
313 | fi |
---|
314 | fi |
---|
315 | |
---|
316 | if test $doneig -eq 1; then |
---|
317 | # Neighbourghood plot |
---|
318 | filetail='' |
---|
319 | |
---|
320 | min=`echo ${varvals} | tr ',' ' ' | awk '{print $5}'` |
---|
321 | max=`echo ${varvals} | tr ',' ' ' | awk '{print $6}'` |
---|
322 | |
---|
323 | if test ${vt} = 'dt'; then |
---|
324 | min='Spercentile@1' |
---|
325 | max='Spercentile@1' |
---|
326 | elif test ${vt} = 'st'; then |
---|
327 | min='Saroundminmax@0.97' |
---|
328 | max='Saroundminmax@0.97' |
---|
329 | fi |
---|
330 | |
---|
331 | if test ${var} = 'LRH2M'; then |
---|
332 | max='100.' |
---|
333 | elif test ${var} = 'T2'; then |
---|
334 | min='270' |
---|
335 | max='300.' |
---|
336 | fi |
---|
337 | |
---|
338 | echo " min: "${min}" max: "${max} |
---|
339 | |
---|
340 | values=${stdn}':Time|-1|Times,bottom_top|'${zval}'|ZNU,south_north|'${yval} |
---|
341 | values=${values}'|XLAT,west_east|'${xval}'|XLONG:south_north,west_east:5:auto:' |
---|
342 | values=${values}'time|($[DD]^{[HH]}$),time|($[DD]^{[HH]}$):exct,2,h|exct,1,d:' |
---|
343 | values=${values}'$%d^{%H}$,$%d^{%H}$:5|pts|neighbourghood|temporal|evolution:' |
---|
344 | values=${values}${min}','${max}':'${cbar}':pdf:False' |
---|
345 | |
---|
346 | python ${PYHOME}/drawing.py -o draw_Neighbourghood_evol -f ${infile} \ |
---|
347 | -S ${values} -v ${var} |
---|
348 | if test $? -ne 0; then |
---|
349 | echo ${errormsg} |
---|
350 | echo " "${main}": drawing.py fails!" |
---|
351 | echo python ${PYHOME}/drawing.py -o draw_Neighbourghood_evol \ |
---|
352 | -f ${infile} -S ${values} -v ${var} |
---|
353 | exit |
---|
354 | else |
---|
355 | mv Neighbourghood_evol.pdf ${ofold}/${stdn}_Neighbourghood_evol.pdf |
---|
356 | if test $vis -eq 1; then evince ${ofold}/${stdn}_Neighbourghood_evol.pdf & fi |
---|
357 | fi |
---|
358 | fi |
---|
359 | |
---|
360 | # exit |
---|
361 | done |
---|
362 | done |
---|
363 | fi |
---|
364 | |
---|
365 | # LaTeX file generation |
---|
366 | ## |
---|
367 | # |
---|
368 | if test $dolatex -eq 1; then |
---|
369 | echo " LaTeX file '"${otex}"' generation..." |
---|
370 | if test ${tval} -eq -1; then tvalS='last'; fi |
---|
371 | |
---|
372 | cat << EOF > ${otex} |
---|
373 | \\documentclass{article} |
---|
374 | \\usepackage{graphicx} |
---|
375 | |
---|
376 | \\textwidth=18cm |
---|
377 | \\textheight=23cm |
---|
378 | \\oddsidemargin=-1cm |
---|
379 | \\evensidemargin=-1cm |
---|
380 | \\topmargin=-1cm |
---|
381 | |
---|
382 | \\begin{document} |
---|
383 | |
---|
384 | \\title{checking LMDZ at time=${tval}, z=${zval}, y=${yval}, x=${xval}} |
---|
385 | \\author{} |
---|
386 | |
---|
387 | \\maketitle |
---|
388 | EOF |
---|
389 | for vt in ${vtypes}; do |
---|
390 | echo "variable type: "${vt} |
---|
391 | case $vt in |
---|
392 | 'dt' ) |
---|
393 | vars=`echo ${dtvariables} | tr ':' ' '` |
---|
394 | ivar=1 |
---|
395 | for var in ${vars}; do |
---|
396 | varvals=`python ${PYHOME}/drawing.py -o variable_values -S LDQ${var} \ |
---|
397 | | grep all_values` |
---|
398 | # varn=`echo ${varvals} | tr ',' ' ' | awk '{print $3}'` |
---|
399 | varn=`echo ${var} | tr '[:upper:]' '[:lower:]'` |
---|
400 | ln=`echo ${varvals} | tr ',' ' ' | awk '{print $7}'` |
---|
401 | echo " var: "${varn} |
---|
402 | |
---|
403 | cat << EOF >> ${otex} |
---|
404 | % d[q/t]_${varn} |
---|
405 | %% |
---|
406 | |
---|
407 | \\begin{figure} |
---|
408 | \\begin{center} |
---|
409 | \\begin{tabular}{cc} |
---|
410 | \\includegraphics[height=0.2\\textheight]{${ofold}/dq${varn}_hor} |
---|
411 | & |
---|
412 | \\includegraphics[height=0.2\\textheight]{${ofold}/dt${varn}_hor} |
---|
413 | \\\\ |
---|
414 | \\includegraphics[height=0.2\\textheight]{${ofold}/dq${varn}_Hovmoller} |
---|
415 | & |
---|
416 | \\includegraphics[height=0.2\\textheight]{${ofold}/dt${varn}_Hovmoller} |
---|
417 | \\\\ |
---|
418 | \\includegraphics[height=0.2\\textheight]{${ofold}/dq${varn}_TimeSeries} |
---|
419 | & |
---|
420 | \\includegraphics[height=0.2\\textheight]{${ofold}/dt${varn}_TimeSeries} |
---|
421 | \\\\ |
---|
422 | \\includegraphics[height=0.2\\textheight]{${ofold}/dq${varn}_Neighbourghood_evol} |
---|
423 | & |
---|
424 | \\includegraphics[height=0.2\\textheight]{${ofold}/dt${varn}_Neighbourghood_evol} |
---|
425 | \\end{tabular} |
---|
426 | EOF |
---|
427 | if test ${ivar} -eq 1; then |
---|
428 | firstvar=${varn} |
---|
429 | caption='\caption{Instantaneaous value at time='${tvalS}', z='${zval} |
---|
430 | caption=${caption}' level of humidity tendency due to '${varn}' (top left)' |
---|
431 | caption=${caption}', thermal tendency (top right), temporal evolution of ' |
---|
432 | caption=${caption}'the vertical profile at yval='${yval}', xval='${xval} |
---|
433 | caption=${caption}'humidity tendency (2nd row left), thermal tendency ' |
---|
434 | caption=${caption}'(2nd row right), temporal evolution at the given point' |
---|
435 | caption=${caption}' (3rd row), evolution of a box of 5x5 centered on the ' |
---|
436 | caption=${caption}'point (bottom)}' |
---|
437 | else |
---|
438 | caption='\caption{As in figure \ref{fig:d_qt_'${firstvar}'}, but for ' |
---|
439 | caption=${caption}${varn}'}' |
---|
440 | fi |
---|
441 | cat << EOF >> ${otex} |
---|
442 | ${caption} |
---|
443 | \\label{fig:d_qt_${varn}} |
---|
444 | \\end{center} |
---|
445 | \\end{figure} |
---|
446 | EOF |
---|
447 | # LD[U/V] |
---|
448 | ## |
---|
449 | if test ${var} = 'CON' || test ${var} = 'DYN' || test ${var} = 'VDF'; then |
---|
450 | varvals=`python ${PYHOME}/drawing.py -o variable_values -S LDU${var} \ |
---|
451 | | grep all_values` |
---|
452 | # varn=`echo ${varvals} | tr ',' ' ' | awk '{print $3}'` |
---|
453 | varn=`echo ${var} | tr '[:upper:]' '[:lower:]'` |
---|
454 | ln=`echo ${varvals} | tr ',' ' ' | awk '{print $7}'` |
---|
455 | echo " var: "${varn} |
---|
456 | |
---|
457 | cat << EOF >> ${otex} |
---|
458 | % d[u/v]_${varn} |
---|
459 | %% |
---|
460 | |
---|
461 | \\begin{figure} |
---|
462 | \\begin{center} |
---|
463 | \\begin{tabular}{cc} |
---|
464 | \\includegraphics[height=0.2\\textheight]{${ofold}/du${varn}_hor} |
---|
465 | & |
---|
466 | \\includegraphics[height=0.2\\textheight]{${ofold}/dv${varn}_hor} |
---|
467 | \\\\ |
---|
468 | \\includegraphics[height=0.2\\textheight]{${ofold}/du${varn}_Hovmoller} |
---|
469 | & |
---|
470 | \\includegraphics[height=0.2\\textheight]{${ofold}/dv${varn}_Hovmoller} |
---|
471 | \\\\ |
---|
472 | \\includegraphics[height=0.2\\textheight]{${ofold}/du${varn}_TimeSeries} |
---|
473 | & |
---|
474 | \\includegraphics[height=0.2\\textheight]{${ofold}/dv${varn}_TimeSeries} |
---|
475 | \\\\ |
---|
476 | \\includegraphics[height=0.2\\textheight]{${ofold}/du${varn}_Neighbourghood_evol} |
---|
477 | & |
---|
478 | \\includegraphics[height=0.2\\textheight]{${ofold}/dv${varn}_Neighbourghood_evol} |
---|
479 | \\end{tabular} |
---|
480 | EOF |
---|
481 | caption='\caption{As in figure \ref{fig:d_qt_'${firstvar}'}, but for ' |
---|
482 | caption=${caption}${varn}'}' |
---|
483 | cat << EOF >> ${otex} |
---|
484 | ${caption} |
---|
485 | \\label{fig:d_qu_${varn}} |
---|
486 | \\end{center} |
---|
487 | \\end{figure} |
---|
488 | EOF |
---|
489 | fi |
---|
490 | ivar=`expr ${ivar} + 1` |
---|
491 | done |
---|
492 | cat << EOF >> ${otex} |
---|
493 | \\clearpage |
---|
494 | EOF |
---|
495 | ;; |
---|
496 | 'sfc' ) |
---|
497 | vars=`echo ${sfcvariables} | tr ':' ' '` |
---|
498 | ivar=1 |
---|
499 | for var in ${vars}; do |
---|
500 | varvals=`python ${PYHOME}/drawing.py -o variable_values -S ${var} \ |
---|
501 | | grep all_values` |
---|
502 | varn=`echo ${varvals} | tr ',' ' ' | awk '{print $3}'` |
---|
503 | ln=`echo ${varvals} | tr ',' ' ' | awk '{print $7}'` |
---|
504 | cat << EOF >> ${otex} |
---|
505 | % ${varn} |
---|
506 | %% |
---|
507 | |
---|
508 | \\begin{figure} |
---|
509 | \\begin{center} |
---|
510 | \\begin{tabular}{ccc} |
---|
511 | \\includegraphics[width=0.33\\textwidth]{${ofold}/${varn}_hor} |
---|
512 | & |
---|
513 | \\includegraphics[width=0.33\\textwidth]{${ofold}/${varn}_TimeSeries} |
---|
514 | & |
---|
515 | \\includegraphics[width=0.33\\textwidth]{${ofold}/${varn}_Neighbourghood_evol} |
---|
516 | \\end{tabular} |
---|
517 | EOF |
---|
518 | if test ${ivar} -eq 1; then |
---|
519 | firstvar=${varn} |
---|
520 | caption='\caption{Instantaneaous value at time='${tvalS}' of '${varn} |
---|
521 | caption=${caption}' (left), temporal evolution at the given point' |
---|
522 | caption=${caption}' (middle), evolution of a box of 5x5 centered on the ' |
---|
523 | caption=${caption}'point (right)}' |
---|
524 | else |
---|
525 | caption='\caption{As in figure \ref{fig:state_'${firstvar}'}, but for ' |
---|
526 | caption=${caption}${varn}'}' |
---|
527 | fi |
---|
528 | cat << EOF >> ${otex} |
---|
529 | ${caption} |
---|
530 | \\label{fig:state_${varn}} |
---|
531 | \\end{center} |
---|
532 | \\end{figure} |
---|
533 | EOF |
---|
534 | ivar=`expr ${ivar} + 1` |
---|
535 | done |
---|
536 | cat << EOF >> ${otex} |
---|
537 | \\clearpage |
---|
538 | EOF |
---|
539 | ;; |
---|
540 | 'st' ) |
---|
541 | vars=`echo ${stvariables} | tr ':' ' '` |
---|
542 | ivar=1 |
---|
543 | for var in ${vars}; do |
---|
544 | varvals=`python ${PYHOME}/drawing.py -o variable_values -S ${var} \ |
---|
545 | | grep all_values` |
---|
546 | varn=`echo ${varvals} | tr ',' ' ' | awk '{print $3}'` |
---|
547 | ln=`echo ${varvals} | tr ',' ' ' | awk '{print $7}'` |
---|
548 | cat << EOF >> ${otex} |
---|
549 | % ${varn} |
---|
550 | %% |
---|
551 | |
---|
552 | \\begin{figure} |
---|
553 | \\begin{center} |
---|
554 | \\begin{tabular}{cc} |
---|
555 | \\includegraphics[width=0.5\\textwidth]{${ofold}/${varn}_hor} |
---|
556 | & |
---|
557 | \\includegraphics[width=0.5\\textwidth]{${ofold}/${varn}_Hovmoller} |
---|
558 | \\\\ |
---|
559 | \\includegraphics[width=0.5\\textwidth]{${ofold}/${varn}_TimeSeries} |
---|
560 | & |
---|
561 | \\includegraphics[width=0.5\\textwidth]{${ofold}/${varn}_Neighbourghood_evol} |
---|
562 | \\end{tabular} |
---|
563 | EOF |
---|
564 | if test ${ivar} -eq 1; then |
---|
565 | firstvar=${varn} |
---|
566 | caption='\caption{Instantaneaous value at time='${tvalS}', z='${zval} |
---|
567 | caption=${caption}' level of '${varn}' (top left), temporal evolution of the' |
---|
568 | caption=${caption}' vertical profile at yval='${yval}', xval='${xval} |
---|
569 | caption=${caption}' (top right), temporal evolution at the given point ' |
---|
570 | caption=${caption}' (bottom left), evolution of a box of 5x5 centered on the ' |
---|
571 | caption=${caption}'point (bottom right)}' |
---|
572 | else |
---|
573 | caption='\caption{As in figure \ref{fig:state_'${firstvar}'}, but for ' |
---|
574 | caption=${caption}${varn}'}' |
---|
575 | fi |
---|
576 | cat << EOF >> ${otex} |
---|
577 | ${caption} |
---|
578 | \\label{fig:state_${varn}} |
---|
579 | \\end{center} |
---|
580 | \\end{figure} |
---|
581 | EOF |
---|
582 | ivar=`expr ${ivar} + 1` |
---|
583 | done |
---|
584 | cat << EOF >> ${otex} |
---|
585 | \\clearpage |
---|
586 | EOF |
---|
587 | ;; |
---|
588 | esac |
---|
589 | done |
---|
590 | cat << EOF >> ${otex} |
---|
591 | \\end{document} |
---|
592 | EOF |
---|
593 | otexn=`echo ${otex} | tr '.' ' ' | awk '{print $1}'` |
---|
594 | pdflatex ${otexn} |
---|
595 | pdflatex ${otexn} |
---|
596 | evince ${otexn}.pdf & |
---|
597 | fi |
---|
598 | fi |
---|
599 | |
---|