Changeset 25764 for issm/trunk-jpl/src/m/classes/solidearth.py
- Timestamp:
- 11/16/20 19:47:06 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/solidearth.py
r25758 r25764 20 20 21 21 def __init__(self, *args): #{{{ 22 self. sealevel= np.nan22 self.initialsealevel = np.nan 23 23 self.settings = solidearthsettings() 24 self.external = [] 24 25 self.surfaceload = surfaceload() 25 26 self.lovenumbers = lovenumbers() … … 41 42 def __repr__(self): # {{{ 42 43 s = ' solidearthinputs, forcings and settings:\n' 43 s += '{}\n'.format(fielddisplay(self, ' sealevel', 'current sea level (prior to computation)[m]'))44 s += '{}\n'.format(fielddisplay(self, 'initialsealevel', 'sea level at the start of computation [m]')) 44 45 s += '{}\n'.format(fielddisplay(self, 'planetradius', 'planet radius [m]')) 45 46 s += '{}\n'.format(fielddisplay(self, 'transitions', 'indices into parts of the mesh that will be icecaps')) 46 47 s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested')) 47 s += '{}\n'.format(self.settings) 48 s += '{}\n'.format(self.surfaceload) 49 s += '{}\n'.format(self.lovenumbers) 50 s += '{}\n'.format(self.rotational) 48 s += '{}\n'.format(fielddisplay(self, 'partitionice', 'ice partition vector for barystatic contribution')) 49 s += '{}\n'.format(fielddisplay(self, 'partitionhydro', 'hydro partition vector for barystatic contribution')) 50 if not self.external: 51 s += '{}\n'.format(fielddisplay(self, 'external', 'external solution, of the type solidearthsolution')) 52 print(self.settings) 53 print(self.surfaceload) 54 print(self.lovenumbers) 55 print(self.rotational) 56 if self.external: 57 print(self.external) 51 58 return s 52 59 #}}} … … 63 70 self.partitionhydro = [] 64 71 72 # No external solutions by defalt 73 self.external = [] 74 65 75 # Earth radius 66 76 self.planetradius = planetradius('earth') … … 70 80 if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslr): 71 81 return md 72 md = checkfield(md, 'fieldname', 'solidearth. sealevel', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices])82 md = checkfield(md, 'fieldname', 'solidearth.initialsealevel', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) 73 83 md = checkfield(md, 'fieldname', 'solidearth.requested_outputs', 'stringrow', 1) 74 84 … … 77 87 self.lovenumbers.checkconsistency(md, solution, analyses) 78 88 self.rotational.checkconsistency(md, solution, analyses) 89 if self.external: 90 if not isinstance(self.external,'solidearthsolution'): 91 raise Exception('solidearth consistency check: external field should be a solidearthsolution') 92 end 93 self.external.checkconsistency(md,solution,analyses) 79 94 return md 80 95 #}}} … … 85 100 86 101 def marshall(self, prefix, md, fid): #{{{ 87 WriteData(fid, prefix, 'object', self, 'fieldname', ' sealevel', 'mattype', 1, 'format', 'DoubleMat', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)102 WriteData(fid, prefix, 'object', self, 'fieldname', 'initialsealevel', 'mattype', 1, 'format', 'DoubleMat', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts) 88 103 WriteData(fid, prefix, 'object', self, 'fieldname', 'planetradius', 'format', 'Double') 89 104 WriteData(fid, prefix, 'object', self, 'fieldname', 'transitions', 'format', 'MatArray') … … 108 123 self.lovenumbers.marshall(prefix, md, fid) 109 124 self.rotational.marshall(prefix, md, fid) 125 if self.external: 126 self.external.marshall(prefix, md, fid) 110 127 111 128 #process requested outputs … … 119 136 120 137 def extrude(self, md): #{{{ 121 self. sealevel = project3d(md, 'vector', self.sealevel, 'type', 'node')138 self.initialsealevel = project3d(md, 'vector', self.initialsealevel, 'type', 'node') 122 139 return self 123 140 #}}}
Note:
See TracChangeset
for help on using the changeset viewer.