Changeset 1041 in lmdz_wrf for trunk


Ignore:
Timestamp:
Aug 22, 2016, 12:00:16 PM (9 years ago)
Author:
lfita
Message:

Addding `tstd': temporal standard deviation

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/model_graphics.py

    r1039 r1041  
    2929    mandatorykeys = ['pyHOME', 'cdoHOME', 'scratch', 'filescratch', 'figscratch',    \
    3030      'diffscratch', 'figdiffscratch', 'addfiles', 'addfigures', 'adddiffs',         \
    31       'debug', 'models', 'ifold', 'ofold', 'warnmsg', 'errmsg', 'titleoperations',   \
    32       'kindfig', 'CFreftime', 'CFunitstime', 'mapval', 'timekind', 'timefmt',        \
    33       'timelabel' ]
     31      'adddifffigures', 'debug', 'models', 'ifold', 'ofold', 'warnmsg', 'errmsg',    \
     32      'titleoperations', 'kindfig', 'CFreftime', 'CFunitstime', 'mapval',            \
     33      'timekind', 'timefmt', 'timelabel' ]
    3434
    3535    # List with the optional keys
     
    148148        adddiffs = False
    149149
     150    if config['adddifffigures'] == 'true':
     151        adddifffigs = True
     152    else:
     153        adddifffigs = False
     154
    150155    if config['debug'] == 'true':
    151156        debug = True
     
    153158        debug = False
    154159
    155     return scr, filescr, figscr, difscr, figdifscr, addfils, addfigs, adddiffs, debug
     160    return scr, filescr, figscr, difscr, figdifscr, addfils, addfigs, adddiffs, adddifffigs, debug
    156161
    157162def exp_headers(mod,config):
     
    675680        pinterp: pressure interpolation (to the given $plevels)
    676681        tmean: temporal mean values
     682        tstd: temporal standard deviation values
    677683        turb: Taylor's turbulence decomposition value
    678684        xmean: x-axis mean values
     
    915921            varkeep.append('timestats')
    916922
     923        elif op == 'tstd':
     924            # temporal standard deviation values
     925            vals='time|-1,time,std,' + ':'.join(varnCFs) + ':' + vdnz
     926            dims = gen.dictvar_listS(varnCFs,CFdimvardict,',','@') + dnz+'@'+vdnz
     927            if dofile:
     928                try:
     929                    with gen.Capturing() as output:
     930                        ncvar.file_oper_alongdims(vals,prevfile,CFvarnp)
     931                except:
     932                    print errmsg
     933                    print 'file_oper_alongdims('+vals+',', prevfile, ','+CFvarnp+')'
     934                    for sout in output: print sout
     935                    quit(-1)
     936
     937                if db:
     938                    for sout in output: print sout
     939
     940                sout = sub.call('mv file_oper_alongdims_std.nc '+fileon, shell=True)
     941
     942                # Keeping the operations
     943                pyins=pyH + "/nc_var.py -o file_oper_alongdims -S '" + vals +        \
     944                  "' -f " + prevfile + " -v " + CFvarnp
     945                otrackf.write("\n")
     946                otrackf.write("# " + CFvarn + " " + Fopers + "\n")
     947                otrackf.write(pyins + "\n")
     948
     949            # removing dimension variable-dimension 'time'
     950            varnCFs.remove('time')
     951
     952            varkeep.append('timestats')
     953
    917954#        elif op == 'turb':
    918955#            # turbulence values
     
    20072044        pinterp: pressure interpolation (to the given $plevels)
    20082045        tmean: temporal mean values
     2046        tstd: temporal standard deviation values
    20092047        turb: Taylor's turbulence decomposition value
    20102048        xmean: x-axis mean values
     
    21672205            varkeep.append('timestats')
    21682206
     2207        elif op == 'tstd':
     2208            # temporal standard deviation values
     2209            vals='time|-1,time,std,' + ':'.join(varnCFs) + ':' + vdnz
     2210            dims = gen.dictvar_listS(varnCFs,CFdimvardict,',','@') + dnz+'@'+vdnz
     2211            if dofile:
     2212                try:
     2213                    with gen.Capturing() as output:
     2214                        ncvar.file_oper_alongdims(vals,prevfile,CFvarnp)
     2215                except:
     2216                    print errmsg
     2217                    print 'file_oper_alongdims('+vals+',', prevfile, ','+CFvarnp+')'
     2218                    for sout in output: print sout
     2219                    quit(-1)
     2220
     2221                if db:
     2222                    for sout in output: print sout
     2223
     2224                sout = sub.call('mv file_oper_alongdims_std.nc '+fileon, shell=True)
     2225
     2226                # Keeping the operations
     2227                pyins=pyH + "/nc_var.py -o file_oper_alongdims -S '" + vals +        \
     2228                  "' -f " + prevfile + " -v " + CFvarnp
     2229                otrackf.write("\n")
     2230                otrackf.write("# " + varn + " " + Fopers + "\n")
     2231                otrackf.write(pyins + "\n")
     2232
     2233            # removing dimension variable-dimension 'time'
     2234            varnCFs.remove('time')
     2235
     2236            varkeep.append('timestats')
     2237
    21692238#        elif op == 'turb':
    21702239#            # turbulence values
     
    26802749# scratches
    26812750scratch, filescratch, figscratch, diffscratch, figdiffscratch, addfiles, addfigures, \
    2682   adddiffs, dbg = scratches(cnf)
     2751  adddiffs, adddifffigures, dbg = scratches(cnf)
    26832752
    26842753# Getting models
     
    29212990            objf.close()
    29222991
    2923         if addfigures:
     2992        if adddifffigures:
    29242993            sout = sub.call('rm ' + dirfigf + ' >& /dev/null', shell=True)
    29252994
  • trunk/tools/model_graphics_template.dat

    r1039 r1041  
    3636
    3737# Have new files been added and do they need to be processed?
    38 addfiles = false
     38addfiles = true
    3939
    4040# Have new figures been added and do they need to be drawn?
    41 addfigures = false
     41addfigures = true
    4242
    4343# Have new differences been added and do they need to be processed and drawn?
    44 adddiffs = false
     44adddiffs = true
     45
     46# Have new difference figures been added and do they need to be drawn?
     47adddifffigures = true
    4548
    4649# Debug
     
    8891#   pinterp: pressure interpolation (to the given $plevels, see below)
    8992#   tmean: temporal mean values
     93#   tstd: temporal standard deviation values
    9094#   turb: Taylor's turbulence decomposition value
    9195#   xmean: x-axis mean values
     
    101105VAR_last = uas:vas:hfss:hfls
    102106VAR_tmean = uas:vas:hfss:hfls
     107VAR_tstd = tas:wss
    103108VAR_xmean = uas:vas:hfss:hfls
    104109#VAR_last+pinterp+xmean = ua:va:hur:hus:turb
     
    122127DIFFOP_xmean = uas:vas
    123128DIFFOP_tmean = hfss:hfls
     129DIFFOP_tstd = tas:wss
    124130DIFFOP_pinterp+tmean+xmean = ua:va
    125131
     
    127133DIFFVAR_xmean = uas:vas
    128134DIFFVAR_tmean = hfss:hfls
     135DIFFVAR_tstd = tas:wss
    129136DIFFVAR_pinterp+tmean+xmean = ua:va
    130137
     
    134141#      once 'tmean', or 'xmean' are computed, variable [varn] will become [varn]mean
    135142opsur_mean = Lmean:lmean:tmean:xmean:ymean
     143opsur_std = tstd
    136144
    137145# Text as title for each operation
    138146#   as ':' separated list of [op]|[explanation '!' as spaces]
    139 titleoperations = acc|tacc:diff|diff:direct|!:last|last:Lmean|latmean:Lsec|latsec:lmean|lonmean:lsec|lonsec:pinterp|pinterp:tmean|tmean:turb|turbulence:xmean|xmean:ymean|ymean:zsum|zsum
     147titleoperations = acc|tacc:diff|diff:direct|!:last|last:Lmean|latmean:Lsec|latsec:lmean|lonmean:lsec|lonsec:pinterp|pinterp:tmean|tmean:tstd|tstd:turb|turbulence:xmean|xmean:ymean|ymean:zsum|zsum
    140148
    141149# Pressure levels
     
    162170# DIRPLT_: Figures which can be made directly without another model/experiment output
    163171
    164 DIRPLT_shadcont2Dsfc = uas|last#vas|last:hfls|last#hfss|last
     172DIRPLT_shadcont2Dsfc = uas|last#vas|last:hfls|last#hfss|last:tas|tstd#wss|tstd
    165173DIRPLT_shadconthovmsfc = hfls|xmean#hfss|xmean
    166174DIRPLT_shadcont2Dzsec = ua|pinterp+tmean+xmean#va|pinterp+tmean+xmean
     
    170178#pltshadcont2Dzsec = ua|pinterp@last@xmean#va|pinterp@last@xmean:hur|pinterp@last@xmean#ta|pinterp@last@xmean:ws|pinterp@turb@xmean#hus|pinterp@turb@xmean
    171179
    172 PLOTDIFFOP_shadcont2Dsfc = hfls|last#hfss|last:hfss|tmean#hfls|tmean
     180PLOTDIFFOP_shadcont2Dsfc = hfls|last#hfss|last:hfss|tmean#hfls|tmean:tas|tstd#wss|tstd
    173181PLOTDIFFOP_shadconthovmsfc = uas|xmean#vas|xmean
    174182PLOTDIFFOP_shadcont2Dzsec = ua|pinterp+tmean+xmean#va|pinterp+tmean+xmean
    175183
    176 PLOTDIFFVAR_shadcont2Dsfc = hfls|last#hfss|last:hfss|tmean#hfls|tmean
     184PLOTDIFFVAR_shadcont2Dsfc = hfls|last#hfss|last:hfss|tmean#hfls|tmean:tas|tstd#wss|tstd
    177185PLOTDIFFVAR_shadconthovmsfc = uas|xmean#vas|xmean
    178186PLOTDIFFVAR_shadcont2Dzsec = ua|pinterp+tmean+xmean#va|pinterp+tmean+xmean
     
    189197#        [cntformat]: format of the contour labels
    190198#        [colorcnt]: color for the countor lines
    191 specificvarplot = 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
    192 specificdiffopplot = hfls|tmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:hfss|tmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:hfls|last|shadcont2Dsfc|-800.|0.|seismic|%g|black:hfss|last|shadcont2Dsfc|-400.|10.|seismic|%g|black:uas|xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:vas|xmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:ua|pinterp+tmean+xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:va|pinterp+tmean+xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black
    193 specificdiffvarplot = hfls|tmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:hfss|tmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:hfls|last|shadcont2Dsfc|-800.|0.|seismic|%g|black:hfss|last|shadcont2Dsfc|-400.|10.|seismic|%g|black:uas|xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:vas|xmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:ua|pinterp+tmean+xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:va|pinterp+tmean+xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black
     199specificvarplot = 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:tas|tstd|shadcont2Dsfc|0.|10.|Reds|%g|black:wss|tstd|shadcont2Dsfc|0.|10.|Blues|%g|black
     200specificdiffopplot = hfls|tmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:hfss|tmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:hfls|last|shadcont2Dsfc|-800.|0.|seismic|%g|black:hfss|last|shadcont2Dsfc|-400.|10.|seismic|%g|black:uas|xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:vas|xmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:ua|pinterp+tmean+xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:va|pinterp+tmean+xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:tas|tstd|shadcont2Dsfc|0.|10.|Reds|%g|black:wss|tstd|shadcont2Dsfc|0.|10.|Blues|%g|black
     201specificdiffvarplot = hfls|tmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:hfss|tmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:hfls|last|shadcont2Dsfc|-800.|0.|seismic|%g|black:hfss|last|shadcont2Dsfc|-400.|10.|seismic|%g|black:uas|xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:vas|xmean|shadcont2Dsfc|-30.|30.|seismic|%g|black:ua|pinterp+tmean+xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:va|pinterp+tmean+xmean|shadcont2Dsfc|-20.|20.|seismic|%g|black:tas|tstd|shadcont2Dsfc|0.|10.|Reds|%g|black:wss|tstd|shadcont2Dsfc|0.|10.|Blues|%g|black
    194202
    195203# Figures output kind
Note: See TracChangeset for help on using the changeset viewer.