Changeset 429 for trunk/UTIL


Ignore:
Timestamp:
Nov 30, 2011, 11:59:14 AM (13 years ago)
Author:
aslmd
Message:

GRAPHICS: previous commit by acolmd is actually useful for all idealized mesoscale simulations. corrected pp.py so that vert interp with those files is possible. some purely cosmetic changes. changed typefile='les' to 'mesoideal'

Location:
trunk/UTIL/PYTHON
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/README.PP

    r424 r429  
    7474pp.py -f wrfout**** -v TSURF --time -4 -- time -7
    7575
     76Goal: The classic mountain GW plot
     77pp.py -f wrfout_d01_9999-09-09_09:00:00 -v W,tpot --lat 60 --time 15 -i 4 -l 30,130,100 --div 50
     78
    7679***********************************************************************************
    7780Simple 2D plot: Zonal mean.
  • trunk/UTIL/PYTHON/myplot.py

    r428 r429  
    3737## Author: AS, AC
    3838def whatkindfile (nc):
    39     if 'controle' in nc.variables:     typefile = 'gcm'
    40     elif 'phisinit' in nc.variables:   typefile = 'gcm'
    41     elif '9999' in getattr(nc,'START_DATE') : typefile = 'les'
    42     elif 'vert' in nc.variables:       typefile = 'mesoapi'
    43     elif 'U' in nc.variables:          typefile = 'meso'
    44     elif 'HGT_M' in nc.variables:      typefile = 'geo'
     39    if 'controle' in nc.variables:             typefile = 'gcm'
     40    elif 'phisinit' in nc.variables:           typefile = 'gcm'
     41    elif '9999' in getattr(nc,'START_DATE') :  typefile = 'mesoideal'
     42    elif 'vert' in nc.variables:               typefile = 'mesoapi'
     43    elif 'U' in nc.variables:                  typefile = 'meso'
     44    elif 'HGT_M' in nc.variables:              typefile = 'geo'
    4545    #else:                            errormess("whatkindfile: typefile not supported.")
    46     else:                            typefile = 'gcm' # for lslin-ed files from gcm
     46    else:                                      typefile = 'gcm' # for lslin-ed files from gcm
    4747    return typefile
    4848
     
    395395    elif typefile in ['geo']:
    396396        [lon2d,lat2d] = getcoord2d(nc,nlat='XLAT_M',nlon='XLONG_M')
    397     elif typefile in ['les']:
     397    elif typefile in ['mesoideal']:
    398398        nx=getattr(nc,'WEST-EAST_GRID_DIMENSION')
    399399        ny=getattr(nc,'SOUTH-NORTH_GRID_DIMENSION')
     
    490490    typefile = whatkindfile(nc)
    491491    ###
    492     if typefile is 'mesoapi':    [uchar,vchar] = ['Um','Vm']
    493     elif typefile is 'gcm':      [uchar,vchar] = ['u','v']
    494     elif typefile in ['meso','les']:     [uchar,vchar] = ['U','V']
    495     else:                        [uchar,vchar] = ['not found','not found']
     492    if typefile is 'mesoapi':                  [uchar,vchar] = ['Um','Vm']
     493    elif typefile is 'gcm':                    [uchar,vchar] = ['u','v']
     494    elif typefile in ['meso','mesoideal']:     [uchar,vchar] = ['U','V']
     495    else:                                      [uchar,vchar] = ['not found','not found']
    496496    ###
    497497    if typefile in ['meso']:     metwind = False ## geometrical (wrt grid)
  • trunk/UTIL/PYTHON/planetoplot.py

    r428 r429  
    115115      ### ... TYPEFILE
    116116      typefile = whatkindfile(nc)                                 
    117       if typefile in ['les']:
    118           mapmode=0
    119           winds=False
     117      if typefile in ['mesoideal']:   mapmode=0;winds=False
    120118      if firstfile: print "********** MAPMODE: ", mapmode
    121119      if firstfile:                 typefile0 = typefile
     
    133131      [lon2d,lat2d] = getcoorddef(nc)
    134132      ### ... PROJECTION
    135       if ((proj == None) and (typefile not in ['les'])):   proj = getproj(nc)                 
     133      if ((proj == None) and (typefile not in ['mesoideal'])):   proj = getproj(nc)                 
    136134
    137135##########################################################
     
    142140          else:                           errormess("no time axis found.")
    143141          vert = nc.variables["altitude"][:]
    144       elif typefile in ['meso','mesoapi','geo','les']:
     142      elif typefile in ['meso','mesoapi','geo','mesoideal']:
    145143          if vlon is not None or vlat is not None:   indices = bidimfind(lon2d,lat2d,vlon,vlat) ; print '********** INDICES: ', indices
    146144          if slon is not None: slon[0][0] = indices[0] ; slon[0][1] = indices[0]
  • trunk/UTIL/PYTHON/pp.py

    r426 r429  
    4141
    4242      typefile = whatkindfile(Dataset(zefiles[0])) ; stralt = None
    43       if typefile in ["meso","mesoapi"]:         
     43      if typefile in ["meso","mesoapi","mesoideal"]:         
    4444          [lschar,zehour,zehourin] = getlschar ( zefiles[0] )
    4545          if opt.var is None:  opt.var = ["HGT"] ; opt.clb = "nobar"
    46       elif typefile == "geo":
     46      elif typefile in ["geo"]:
    4747          [lschar,zehour,zehourin] = ["",0,0]
    4848          if opt.var is None:  opt.var = ["HGT_M"] ; opt.clb = "nobar"
     
    7878          ##### MESOSCALE : written by AS
    7979          #####
    80           if typefile == "meso":
     80          if typefile in ["meso","mesoideal"]:
    8181            if zelevel == 0. and opt.itp == 4:  zelevel = 0.010
    8282            ### winds or no winds
     
    120120               reffile=interpolated_ref[0]
    121121          else:
    122             print "not supported"
     122            print "type not supported"
    123123            exit()
    124124
Note: See TracChangeset for help on using the changeset viewer.