Changeset 24621
- Timestamp:
- 02/28/20 13:12:16 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/m/classes/dsl.py ¶
r24472 r24621 15 15 16 16 def __init__(self): # {{{ 17 self.global_average_thermosteric_sea_level_change = float('NaN')#corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable global rate (mm/yr)17 self.global_average_thermosteric_sea_level_change = 0 #corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable global rate (mm/yr) 18 18 self.sea_surface_height_change_above_geoid = float('NaN') #corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr) 19 19 self.sea_water_pressure_change_at_sea_floor = float('NaN') #corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable rate (in Pa/yr) 20 self.compute_fingerprints = 0; #do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid 20 21 #}}} 21 22 22 23 def __repr__(self): # {{{ 23 24 string = " dsl parameters:" 24 string = "%s\n%s" % (string, fielddisplay(self, 'global_average_thermosteric_sea_level_change','corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable global rate (mm/yr)'))25 string = "%s\n%s" % (string, fielddisplay(self, 'sea_surface_height_change_above_geoid','corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr)'))26 string = "%s\n%s" % (string, fielddisplay(self, 'sea_water_pressure_change_at_sea_floor','corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable rate (in Pa/yr)'))27 25 string = "%s\n%s" % (string, fielddisplay(self, 'global_average_thermosteric_sea_level_change', 'corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable global rate (mm/yr)')) 26 string = "%s\n%s" % (string, fielddisplay(self, 'sea_surface_height_change_above_geoid', 'corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr)')) 27 string = "%s\n%s" % (string, fielddisplay(self, 'sea_water_pressure_change_at_sea_floor', 'corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable rate (in Pa/yr)')) 28 string = "%s\n%s" % (string, fielddisplay(self, 'compute_fingerprints', 'do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid')) 28 29 return string 29 30 #}}} 30 31 31 32 def extrude(self, md): # {{{ 32 33 33 self.sea_surface_height_change_above_geoid = project3d(md, 'vector', self.sea_surface_height_change_above_geoid, 'type', 'node') 34 34 self.sea_water_pressure_change_at_sea_floor = project3d(md, 'vector', self.sea_water_pressure_change_at_sea_floor, 'type', 'node') … … 41 41 42 42 def checkconsistency(self, md, solution, analyses): # {{{ 43 if 'SealevelriseAnalysis' in analyses: 44 md = checkfield(md, 'fieldname', 'dsl.sea_surface_height_change_above_geoid', 'timeseries', 1, 'NaN', 1, 'Inf', 1) 45 md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_change_at_sea_floor', 'timeseries', 1, 'NaN', 1, 'Inf', 1) 43 # Early retun 44 if not 'SealevelriseAnalysis' in analyses: 45 return md 46 47 if solution == 'TransientSolution' and md.transient.isslr == 0: 48 return md 49 50 md = checkfield(md, 'fieldname', 'dsl.global_average_thermosteric_sea_level_change', 'NaN', 1, 'Inf', 1) 51 md = checkfield(md, 'fieldname', 'dsl.sea_surface_height_change_above_geoid', 'NaN', 1, 'Inf', 1, 'timeseries', 1) 52 md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_change_at_sea_floor', 'NaN', 1, 'Inf', 1, 'timeseries', 1) 53 md = checkfield(md, 'fieldname', 'dsl.compute_fingerprints', 'NaN', 1, 'Inf', 1, 'values', [0, 1]) 54 55 if self.compute_fingerprints: 56 #check geodetic flag of slr is on: 57 if md.slr.geodetic == 0: 58 raise RuntimeError('DSL checkconsistency error message: if bottom pressure fingerprints computations are requested, slr class should have geodetic flag on') 46 59 return md 47 60 # }}} … … 50 63 yts = md.constants.yts 51 64 WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 1, 'format', 'Integer') 52 WriteData(fid,prefix,'object',self,'class','dsl','fieldname','global_average_thermosteric_sea_level_change','format','DoubleMat','mattype',1,'timeserieslength',1+1,'yts',md.constants.yts,'scale',1e-3/md.constants.yts) 53 WriteData(fid,prefix,'object',self,'class','dsl','fieldname','sea_water_pressure_change_at_sea_floor','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1e-3/md.constants.yts) 54 WriteData(fid,prefix,'object',self,'class','dsl','fieldname','sea_surface_height_change_above_geoid','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts) 65 WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'compute_fingerprints', 'format', 'Integer') 66 WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'global_average_thermosteric_sea_level_change', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 1+1, 'yts', md.constants.yts, 'scale', 1e-3/md.constants.yts) 67 WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'sea_water_pressure_change_at_sea_floor', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices+1, 'yts', md.constants.yts, 'scale', 1e-3/md.constants.yts) 68 WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'sea_surface_height_change_above_geoid', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices+1, 'yts', md.constants.yts) 55 69 # }}}
Note:
See TracChangeset
for help on using the changeset viewer.