source: lmdz_wrf/trunk/tools/lmdz_check.bash @ 222

Last change on this file since 222 was 211, checked in by lfita, 10 years ago

Adding 'ofolder' automatic creation

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