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'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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)
Note: See TracChangeset for help on using the changeset viewer.