Changeset 26319
- Timestamp:
- 06/11/21 05:43:04 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/dsl.py
r26317 r26319 14 14 """ 15 15 16 def __init__(self, *args): #{{{17 self.global_average_thermosteric_sea_level = np.nan # Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).18 self.sea_surface_height_above_geoid = np.nan# Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).19 self.sea_water_pressure_at_sea_floor = np.nan #Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).16 def __init__(self, *args): #{{{ 17 self.global_average_thermosteric_sea_level = np.nan # Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m). 18 self.sea_surface_height_above_geoid = np.nan # Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m). 19 self.sea_water_pressure_at_sea_floor = np.nan # Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!). 20 20 21 21 if len(args) == 0: … … 25 25 #}}} 26 26 27 def __repr__(self): #{{{27 def __repr__(self): #{{{ 28 28 s = ' dsl parameters:\n' 29 29 s += '{}\n'.format(fielddisplay(self, 'global_average_thermosteric_sea_level', 'Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).')) … … 33 33 #}}} 34 34 35 def setdefaultparameters(self): #{{{35 def setdefaultparameters(self): #{{{ 36 36 self.global_average_thermosteric_sea_level = np.nan 37 self.sea_surface_height_above_geoid 38 self.sea_water_pressure_at_sea_floor 37 self.sea_surface_height_above_geoid = np.nan 38 self.sea_water_pressure_at_sea_floor = np.nan 39 39 #}}} 40 40 41 def checkconsistency(self, md, solution, analyses): #{{{41 def checkconsistency(self, md, solution, analyses): #{{{ 42 42 # Early return 43 if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc) :43 if ('SealevelchangeAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc) or (md.transient.isoceantransport == 0): 44 44 return md 45 46 45 md = checkfield(md, 'fieldname', 'dsl.global_average_thermosteric_sea_level', 'NaN', 1, 'Inf', 1) 47 46 md = checkfield(md, 'fieldname', 'dsl.sea_surface_height_above_geoid', 'NaN', 1, 'Inf', 1, 'timeseries', 1) … … 57 56 yts = md.constants.yts 58 57 WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 1, 'format', 'Integer') 59 WriteData(fid, prefix, 'object', self, 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'DoubleMat', 'mattype', 2, 'timeseries', 1, 'yts', yts) # mattype 2, because we are sending a GMSL value identical everywhere on each element.60 WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_surface_height_above_geoid', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts) # mattype 1 because we specify DSL at vertex locations.61 WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts) # mattype 1 because we specify bottom pressure at vertex locations.58 WriteData(fid, prefix, 'object', self, 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'DoubleMat', 'mattype', 2, 'timeseries', 1, 'yts', yts) # mattype 2, because we are sending a GMSL value identical everywhere on each element. 59 WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_surface_height_above_geoid', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts) # mattype 1 because we specify DSL at vertex locations. 60 WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', yts) # mattype 1 because we specify bottom pressure at vertex locations. 62 61 # }}} 63 62 64 def extrude(self, md): #{{{63 def extrude(self, md): #{{{ 65 64 self.sea_surface_height_above_geoid = project3d(md, 'vector', self.sea_surface_height_above_geoid, 'type', 'node', 'layer', 1) 66 65 self.sea_water_pressure_at_sea_floor = project3d(md, 'vector', self.sea_water_pressure_at_sea_floor, 'type', 'node', 'layer', 1) … … 68 67 #}}} 69 68 70 71 def initialize(self, md): #{{{ 69 def initialize(self, md): #{{{ 72 70 if np.isnan(self.global_average_thermosteric_sea_level): 73 71 self.global_average_thermosteric_sea_level = np.array([0, 0]).reshape(-1, 1)
Note:
See TracChangeset
for help on using the changeset viewer.