Changeset 962 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Jun 27, 2016, 12:08:22 PM (8 years ago)
Author:
lfita
Message:

On the correct use of shadcont2Dzsec' and speciffic' when plotting

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/model_graphics.bash

    r956 r962  
    575575#        pinterp: pressure interpolation (to the given $plevels)
    576576#        tmean: temporal mean values
     577#        turb: Taylor's turbulence decomposition value
    577578#        xmean: x-axis mean values
    578579#        ymean: y-axis mean values
     
    731732
    732733        varkeep=':'${CFvarn}'mean:timestats'
     734      ;;
     735      # turbulence values
     736      'turb')
     737        vals='turbulence|'${CFvarn}
     738        dims='time@time,'${dnz}'@'${vdnz}',lat@lat,lon@lon,pres@pres'
     739
     740        pyout=`python ${pyHOME}/diagnostics.py -d ${dims} -v ${vals} -f ${cfiles}`
     741        pyn=$?
     742        Spyout=`echo ${pyout} | tr '\n' '#' | tr ' ' '!'`
     743        ferrmsg ${pyn} ${fname} "python!'diagnostics'!'turbulence'!failed#"${Spyout}
     744        mv diagnostics.nc ${filen}
     745
     746        # Keeping the operations
     747        pyins="python "${pyHOME}"/diagnostics.py -d "${dims}" -v '"${vals}
     748        pyins=${pyins}"' -f ${cfiles}"
     749        echo " " >> ${odir}/all_statsvars.inf
     750        echo "# ${CFvarn}" "${vark}" >> ${odir}/all_statsvars.inf
     751        echo ${pyins} >> ${odir}/all_statsvars.inf
     752
     753        varkeep=':'${CFvarn}'turb'
    733754      ;;
    734755      # x-axis mean values
     
    807828  fname='draw_plot'
    808829
    809   set -x
    810 
    811830  plot=$1
    812831  odir=$2
     
    854873          vn=${varn}
    855874        fi
     875        if test ${op} = 'turb'; then
     876          vn=${vn}'turb'
     877        fi         
    856878      else
    857879        oprs=`echo ${kind} | tr '@' ' '`
     880        vn=${varn}
    858881        for op in ${oprs}; do
    859882          if $(isInlist ${varmeanname} ${op}); then
    860             vn=${varn}'mean'
    861             break
    862           else
    863             vn=${varn}
     883            vn=${vn}'mean'
    864884          fi
     885          if test ${op} = 'turb'; then
     886            vn=${vn}'turb'
     887          fi         
    865888        done
    866889      fi
     
    897920      figname=${figname}'_'${vn}'-'$(echo ${kind} | tr '@' '-')
    898921
    899       # Getting plot variable configuration
     922      # Getting plot variable configuration (using variable name inside the file?)
    900923      specific=false
    901       if $(isInlist ${specificvarplot} ${varn}); then
    902         vals=`listfilter ${specificvarplot} ${varn}`
    903         kvals=`listfilter ${specificvarplot} ${kind}`
     924#      if $(isInlist ${specificvarplot} ${varn}); then
     925      if test $(index_string ${specificvarplot} ${vn}) -ne -1; then
     926        vals=`list_filter ${specificvarplot} ${vn}`
     927        kvals=`list_filter ${specificvarplot} ${kind}`
    904928        Lkvals=`expr length ${kvals}'0'`
    905929        if test ${Lkvals} -gt 1; then
    906           fkvals=`listfilter ${kvals} ${kplot}`
     930          fkvals=`list_filter ${kvals} ${kplot}`
    907931          Lfkvals=`expr length ${fkvals}'0'`
    908932          if test ${Lfkvals} -gt 1; then
     
    14381462            echo "  "${main}": differences will be calculated when all the "         \
    14391463              "model/experiments will be done !"
    1440           elif test ${vark} = 'diff'; then
     1464          elif test ${vark} = 'combo'; then
    14411465            echo "  "${main}": combos will be calculated later when all the "        \
    14421466              "variables will be done !"
     
    14661490        diagv=`echo ${cvar} | tr '|' ' ' | awk '{print $5}'`
    14671491
     1492#        if $(index_string ${vark} 'pinterp') -ne -1; then
     1493#          fhead=${fileh}'p'
     1494#        else
     1495#          fhead=${fileh}
     1496#        fi
    14681497        combs=`echo ${vco} | tr ';' ' ' | awk '{print $2}' | tr '@' ' '`
    14691498        ifile=${CFv}_${fhead}
    14701499        for comb in ${combs}; do
    1471           combcvar=${CFv}'|'${comb}'|'${fileh}'|'${modv}'|'${diagv}
     1500          combcvar=${CFv}'|'${comb}'|'${fhead}'|'${modv}'|'${diagv}
    14721501          compute_statistics ${iwdir} ${ifile}.nc ${owdir} ${combcvar} ${moddims}    \
    14731502            ${modvdims} ${filescratch} ${ifile}.nc
    14741503          ifile=${ifile}_${comb}
     1504
     1505          # Adding 'surnames' to the variable's name
     1506          if test ${comb} = 'turb'; then
     1507            CFv=${CFv}'turb'
     1508          fi
     1509          if $(isInlist ${varmeanname} ${comb}); then
     1510            CFv=${CFv}'mean'
     1511          fi
     1512
    14751513          isc=`expr ${isc} + 1`
    14761514        # End of combo
  • trunk/tools/model_graphics_template.dat

    r956 r962  
    2828
    2929# Have new files been added and do they need to be processed?
    30 addfiles = false
     30addfiles = true
    3131
    3232# Have new figures been added and do they need to be drawn?
     
    7272#   pinterp: pressure interpolation (to the given $plevels, see below)
    7373#   tmean: temporal mean values
     74#   turb: Taylor's turbulence decomposition value
    7475#   xmean: x-axis mean values
    7576#   ymean: y-axis mean values
     
    8586varxmean = ta:ua:va:hur:hurs:tas:wss:ps
    8687vardiff = ualmean:valmean:talmean:huslmean:uas:vas:ps:pr
    87 varpinterp = ta:ua:va:hur
    88 varcombo = ta;pinterp@last@xmean:ua;pinterp@last@xmean:va;pinterp@last@xmean:hur;pinterp@last@xmean
     88varpinterp = ta:ua:va:hur:ws:hus
     89varcombo = ta;pinterp@last@xmean:ua;pinterp@last@xmean:va;pinterp@last@xmean:hur;pinterp@last@xmean:ws;pinterp@turb@xmean:hus;pinterp@turb@xmean
    8990
    9091# Operations which attach 'mean' at the end of the variable name
     
    113114pltshadcont2Dsfc = huss|tmean#tas|tmean:vas|tmean#uas|tmean:ps|tmean#wss|tmean:pr|tmean#rsds|tmean:prw|tmean#clt|tmean:hfls|tmean#hfss|tmean:evspsbl|tmean#bils|tmean:zmaxth|tmean#stherm|tmean:wakeh|tmean#wakes|tmean:zmaxth|tmean#stherm|tmean:prls|tmean#prc|tmean:clt|tmean#cll|tmean:clm|tmean#clh|tmean:hurs|tmean#zmla|tmean:huss|last#tas|last:vas|last#uas|last:ps|last#wss|tmean:pr|last#rsds|last:prw|last#clt|last:hfls|last#hfss|last:evspsbl|last#bils|last:zmaxth|last#stherm|last:wakeh|last#wakes|last:zmaxth|last#stherm|last:prls|last#prc|last:clt|last#cll|last:clm|last#clh|last:hurs|last#zmla|last
    114115pltshadconthovmsfc = hurs|xmean#tas|xmean:wss|xmean#ps|xmean
    115 pltshadcont2Dzsec=ua|pinterp@last@xmean#va|pinterp@last@xmean:hur|pinterp@last@xmean#ta|pinterp@last@xmean
     116pltshadcont2Dzsec=ua|pinterp@last@xmean#va|pinterp@last@xmean:hur|pinterp@last@xmean#ta|pinterp@last@xmean:ws|pinterp@turb@xmean#hus|pinterp@turb@xmean
    116117
    117118pltdiffmap2Dz = uapxmean:vapxmean:tapxmean:huspxmean
     
    128129#        [cntformat]: format of the contour labels
    129130#        [colorcnt]: color for the countor lines
    130 specificvarplot = cll|last|shadcount2Dsfc|0.|1.|gist_gray|black:clh|last|shadcount2Dsfc|0.|1.|gist_gray|black
     131specificvarplot = cll|last|shadcont2Dsfc|0.|1.|gist_gray|%g|black:clh|last|shadcont2Dsfc|0.|1.|gist_gray|%g|black:husturbmean|pinterp@turb@xmean|shadcont2Dzsec|0.|1.e-6|Blues|%g|black
    131132
    132133# Figures output kind
Note: See TracChangeset for help on using the changeset viewer.