Changeset 956 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Jun 25, 2016, 7:19:44 PM (8 years ago)
Author:
lfita
Message:

Working version with:

  • shadcont2Dzsec: dual shaow/contour vertical cross sections
  • addfiles: when new files are added
  • addfigures: when new figures add added
Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/model_graphics.bash

    r937 r956  
    713713      # temporal mean values
    714714      'tmean')
    715         vals='time|-1,time,mean,lon:lat:'${vdnz}':time'
     715        vals='time|-1,time,mean,lon:lat:'${vdnz}':time:pres'
    716716        dims='time@time,'${dnz}'@'${vdnz}',lat@lat,lon@lon'
    717717
     
    734734      # x-axis mean values
    735735      'xmean')
    736         vals='lon|-1,lon,mean,lon:lat:'${vdnz}':time'
     736        vals='lon|-1,lon,mean,lon:lat:'${vdnz}':time:pres'
    737737        dims='time@time,'${dnz}'@'${vdnz}',lat@lat,lon@lon'
    738738
     
    755755      # y-axis mean values
    756756      'ymean')
    757         vals='lat|-1,lat,mean,lon:lat:'${vdnz}':time'
     757        vals='lat|-1,lat,mean,lon:lat:'${vdnz}':time:pres'
    758758        dims='time@time,'${dnz}'@'${vdnz}',lat@lat,lon@lon'
    759759
     
    795795#     diffmap2Dsfc: 2D map of surface differences values of 1 variable
    796796#     diffmap2Dz: 2D map of 3D differences values of 1 variable
    797 #     shadconthovmsfc: Hovmoeller diagrams of 2 variable at the surface in shadow and the other in contourn
    798797#     map2Dsfc: 2D map of surface values of 1 variable
    799798#     map3D: 2D map of 3D values of 1 variable
     799#     shadconthovmsfc: Hovmoeller diagrams of 2 variable at the surface in shadow and the other in contourn
    800800#     shadcont2Dsfc: 2D map of shadow (1st variable) and countour (2nd variable) [stvar1]#[stvar2]
     801#     shadcont2Dzsec: 2D map of vertical section of 2 variables one in shadow and the other in contourn
    801802#
    802803#     ':' separated list of statitsics variable values are given as: [var]|[kind(including combo values)]
     
    838839      varn=`echo ${varkind} | tr '|' ' ' | awk '{print $1}'`
    839840      kind=`echo ${varkind} | tr '|' ' ' | awk '{print $2}'`
     841
    840842      # Do we have processed the given variable?
    841843      nfiles=`ls -1 ${odir}/${varn}_${headf}*.nc | wc -l | awk '{print $1}'`
     
    845847      fi
    846848
    847       if $(isInlist ${varmeanname} ${kind}); then
    848         vn=${varn}'mean'
     849      Nopers=`echo ${kind} | tr '@' ' ' | wc -w | awk '{print $1}'`
     850      if test ${Nopers} -eq 1; then
     851        if $(isInlist ${varmeanname} ${kind}); then
     852          vn=${varn}'mean'
     853        else
     854          vn=${varn}
     855        fi
    849856      else
    850         vn=${varn}
     857        oprs=`echo ${kind} | tr '@' ' '`
     858        for op in ${oprs}; do
     859          if $(isInlist ${varmeanname} ${op}); then
     860            vn=${varn}'mean'
     861            break
     862          else
     863            vn=${varn}
     864          fi
     865        done
    851866      fi
    852867      filen=`stats_filename ${varn} ${kind} ${headf}`
     
    855870
    856871      if test ${iv} -eq 1; then
    857         varkinds=${varkind}
     872        if test ${Nopers} -gt 1; then
     873          varkinds=${varn}'|('$(echo ${kind} | tr '@' '|')')'
     874        else
     875          varkinds=${varkind}
     876        fi
    858877        CFvars=${varn}
    859878        varinfilen=${vn}
     
    865884        fi
    866885      else
    867         varkinds=${varkinds}':'${varkind}
     886        if test ${Nopers} -gt 1; then
     887          varkinds=${varkinds}':'${varn}'|('$(echo ${kind} | tr '@' '|')')'
     888        else
     889          varkinds=${varkinds}':'${varkind}
     890        fi
    868891        CFvars=${CFvars}':'${varn}
    869892        varinfilen=${varinfilen}':'${vn}
     
    872895      fi
    873896
    874       figname=${figname}'_'${vn}'-'${kind}
     897      figname=${figname}'_'${vn}'-'$(echo ${kind} | tr '@' '-')
    875898
    876899      # Getting plot variable configuration
     
    905928      fi
    906929
    907       # Graphical paramters for each variable in the plot
     930      # Graphical parameters for each variable in the plot
    908931      if test ${iv} -eq 1; then
    909932        figvarparam=${minval}'|'${maxval}'|'${colorbar}'|'${cntformat}'|'${colorcnt}
     
    968991        # keeping all figures
    969992        plotins="python "${pyHOME}"/drawing.py -f "${figfs}" -o draw_2D_shad_cont "
    970         plotins=${plotins}"-S '"${graphvals}"' -v "$(echo ${varinfileb} | tr ':' ',')
     993        plotins=${plotins}"-S '"${graphvals}"' -v "$(echo ${varinfilen} | tr ':' ',')
    971994        echo " " >> ${odir}/all_figures.inf
    972995        echo "#"$(echo $f{igtit} | tr '|' ' ') >> ${odir}/all_figures.inf
    973996        echo ${plotins} >> ${odir}/all_figures.inf
    974 
    975 #        exit
    976997      ;;
    977998      'shadconthovmsfc')
     
    10081029          awk '{print $4}'`
    10091030
    1010 #        if test ${spacedim} = 'lon'; then
    1011 #          dims='lon|-1,time|-1:lon|-1,time|-1:time:lon'
    1012 #        else
    1013 #          dims='lat|-1,time|-1:lat|-1,time|-1:time:lat'
    1014 #        fi
    1015 
    10161031        graphvals=$(echo ${CFvars} | tr ':' ',')
    10171032        graphvals=${shdstdn}','${cntstdn}';'${dims}';'
     
    10311046        echo "#"$(echo $f{igtit} | tr '|' ' ') >> ${odir}/all_figures.inf
    10321047        echo ${plotins} >> ${odir}/all_figures.inf
    1033 
    1034 #        exit
     1048      ;;
     1049      'shadcont2Dzsec')
     1050        shdstdn=`echo ${CFvars} | tr ':' ' ' | awk '{print $1}'`
     1051        cntstdn=`echo ${CFvars} | tr ':' ' ' | awk '{print $2}'`
     1052        # It is assumed that if the space variable is 'lon': is desired a (lon, pres) plot
     1053        #   it it is 'lat': then (pres, lat) plot
     1054        dimspace='xxx'
     1055        if $( isInlist ${vardims} 'lon'); then
     1056          spacedim='lon'
     1057          figtit=${mod}'|'${exp}'|mean|longitudinal|vertical|cross|section|of|'
     1058          figtit=${figtit}${shdstdn}'|&|'${cntstdn}
     1059        else
     1060          spacedim='lat'
     1061          figtit=${mod}'|'${exp}'|mean|meridional|vertical|cross|section|of|'
     1062          figtit=${figtit}${shdstdn}'|&|'${cntstdn}
     1063        fi
     1064        reverse='flip@y'
     1065        dims=${spacedim}'|-1,pres|-1:'${spacedim}'|-1,pres|-1:'${spacedim}':pres'
     1066
     1067        figtit=${mod}'|'${exp}'|'$(echo ${varkinds} | tr ':' '|')
     1068        figfs=`echo ${figfiles} | tr ':' ','`
     1069        srange=`echo ${figvarparam} | tr ':' ' ' | awk '{print $1}' | tr '|' ' ' |   \
     1070          awk '{print $1","$2}'`
     1071        cbar=`echo ${figvarparam} | tr ':' ' ' | awk '{print $1}' | tr '|' ' ' |     \
     1072          awk '{print $3}'`
     1073        crange=`echo ${figvarparam} | tr ':' ' ' | awk '{print $2}' | tr '|' ' ' |   \
     1074          awk '{print $1","$2}'`
     1075        cline=`echo ${figvarparam} | tr ':' ' ' | awk '{print $2}' | tr '|' ' ' |    \
     1076          awk '{print $5}'`
     1077        cfmt=`echo ${figvarparam} | tr ':' ' ' | awk '{print $2}' | tr '|' ' ' |     \
     1078          awk '{print $4}'`
     1079
     1080        graphvals=$(echo ${CFvars} | tr ':' ',')
     1081        graphvals=${graphvals}':'${dims}':'${cbar}':fixc,'
     1082        graphvals=${graphvals}${cline}':'${cfmt}':'${srange}':'${crange}',9:'
     1083        graphvals=${graphvals}${figtit}':'${kindfig}':'${reverse}':None'
     1084 
     1085        pyout=`python ${pyHOME}/drawing.py -f ${figfs} -o draw_2D_shad_cont          \
     1086          -S ${graphvals} -v $(echo ${varinfilen} | tr ':' ',')`
     1087        pyn=$?
     1088        Spyout=`echo ${pyout} | tr '\n' '#' | tr ' ' '!'`
     1089        ferrmsg ${pyn} ${fname} "python!'draw_2D_shad_cont'!failed#"${Spyout}
     1090        mv 2Dfields_shadow-contour.${kindfig} ${figname}
     1091
     1092        # keeping all figures
     1093        plotins="python "${pyHOME}"/drawing.py -f "${figfs}" -o draw_2D_shad_cont "
     1094        plotins=${plotins}"-S '"${graphvals}"' -v "$(echo ${varinfilen} | tr ':' ',')
     1095        echo " " >> ${odir}/all_figures.inf
     1096        echo "#"$(echo $f{igtit} | tr '|' ' ') >> ${odir}/all_figures.inf
     1097        echo ${plotins} >> ${odir}/all_figures.inf
    10351098      ;;
    10361099      *)
     
    11861249    fi
    11871250
     1251    if ${addfiles}; then
     1252      rm ${owdir}/varcompute.inf >& /dev/null
     1253    fi
    11881254
    11891255    if test ! -f ${owdir}/varcompute.inf; then
     
    14211487    echo "  "${main}": Plotting direct figures ..."
    14221488    if ${figscratch}; then rm directplotsdraw.inf; fi
     1489    if ${addfigures}; then rm directplotsdraw.inf; fi
     1490
    14231491    if test ! -f directplotsdraw.inf; then
    14241492      drwplts=`echo ${drawplots} | tr ':' ' '`
     
    14391507            'shadconthovmsfc')
    14401508              plts=${pltshadconthovmsfc}
     1509            ;;
     1510            'shadcont2Dzsec')
     1511              plts=${pltshadcont2Dzsec}
    14411512            ;;
    14421513            *)
  • trunk/tools/model_graphics_template.dat

    r937 r956  
    3131
    3232# Have new figures been added and do they need to be drawn?
    33 addfiles = false
     33addfigures = true
    3434
    3535# Debug
     
    9898#   diffmap2Dsfc: 2D map of surface differences values of 1 variable
    9999#   diffmap2Dz: 2D map of 3D differences values of 1 variable
    100 #   shadconthovmsfc: Hovmoeller diagrams of 2 variables at the surface in shadow and the other in contourn
    101100#   map2Dsfc: 2D map of surface values of 1 variable
    102 #   map3D: 2D map of 3D values of 1 variable
     101#   shadconthovmsfc: Hovmoeller diagrams of 2 variables at the surface one in shadow and the other in contourn
    103102#   shadcont2Dsfc: 2D map of shadow (1st variable) and countour (2nd variable) [stvar1]#[stvar2]
     103#   shadcont2Dzsec: 2D map of vertical section of 2 variables one in shadow and the other in contourn
    104104#
    105105#   ':' separated list of statitsics variable values are given as: [var]|[kind(including combo values)]
    106106#     in figures with more than 1 variable, use '#' to separate them
    107 drawplots = shadcont2Dsfc:shadconthovmsfc
     107#drawplots = shadcont2Dsfc:shadconthovmsfc:sahdcont2Dzsec
     108drawplots = shadcont2Dzsec
    108109
    109110# Figures which can be made directly without another model/experiment output
    110 directplots = shadconthovmsfc:map2Dsfc:map3D:shadcont2Dsfc
     111directplots = shadconthovmsfc:shadcont2Dsfc:shadcont2Dzsec
    111112
    112113pltshadcont2Dsfc = 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
    113114pltshadconthovmsfc = hurs|xmean#tas|xmean:wss|xmean#ps|xmean
     115pltshadcont2Dzsec=ua|pinterp@last@xmean#va|pinterp@last@xmean:hur|pinterp@last@xmean#ta|pinterp@last@xmean
    114116
    115 pltdiffmap2Dsfc = uas:vas:ps:pr
    116117pltdiffmap2Dz = uapxmean:vapxmean:tapxmean:huspxmean
    117118
Note: See TracChangeset for help on using the changeset viewer.