Changeset 1002 in lmdz_wrf for trunk


Ignore:
Timestamp:
Aug 11, 2016, 10:46:00 AM (9 years ago)
Author:
lfita
Message:

On `ModelChar?':

  • Adding new attribute 'name' with the abbreviation of the name of the model
  • exception when no existing model name
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r998 r1002  
    1602716027        if model == 'WRF' or model == 'WRF_LMDZ':
    1602816028            if model == 'WRF':
     16029                self.name = 'WRF'
    1602916030                self.model = 'Weather Research and Forecasting'
    1603016031            else:
    16031                 self.model= 'LMDZ physics coupled to Weather Research and Forecasting'
     16032                self.name = 'WRF_LMDZ'
     16033                self.model= 'Laboratoire de M' + unichr(233) + 't' + unichr(233) +   \
     16034                  'orologie Dynamique Zoom physics coupled to Weather Research ' +   \
     16035                  'and Forecasting'
    1603216036
    1603316037            self.dimxn = 'west_east'
     
    1604916053                self.version = attrv.split(' ')[4]
    1605016054
    16051         elif model == 'LMD':
    16052             self.model = 'LMDZ'
     16055        elif model == 'LMDZ':
     16056            self.name = 'LMDZ'
     16057            self.model = 'Laboratoire de M' + unichr(233) + 't' + unichr(233) +      \
     16058              'orologie Dynamique Zoom'
    1605316059            self.dimxn = 'lon'
    1605416060            self.dimyn = 'lat'
     
    1606416070            if ncfile is not None:
    1606516071                self.version = None
     16072        else:
     16073            print errormsg
     16074            print '  ' + fname + ": model '" + model + "' not ready !!"
     16075            quit(-1)
     16076
    1606616077        self.dimensions = [self.dimxn, self.dimyn, self.dimzn, self.dimtn, self.dimsn]
    1606716078        self.vardimensions = [self.vardxn, self.vardyn, self.vardzn, self.vardtn, self.vardsn]
Note: See TracChangeset for help on using the changeset viewer.