Changeset 28013 for issm/trunk/src/m/classes/SMBforcing.py
- Timestamp:
- 11/15/23 12:14:04 (16 months ago)
- Location:
- issm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
-
issm/trunk/src
- Property svn:mergeinfo changed
-
issm/trunk/src/m/classes/SMBforcing.py
r26744 r28013 19 19 self.requested_outputs = [] 20 20 self.averaging = 0 21 self.isclimatology = np.nan22 21 23 22 nargs = len(args) 24 23 if nargs == 0: 25 pass 24 self.setdefaultparameters() 25 elif nargs == 1: 26 # TODO: Replace the following with constructor 27 self.setdefaultparameters() 26 28 else: 27 29 raise Exception('constructor not supported') 28 # }}}30 # }}} 29 31 30 32 def __repr__(self): # {{{ … … 32 34 s += '{}\n'.format(fielddisplay(self, 'mass_balance', 'surface mass balance [m/yr ice eq]')) 33 35 s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step')) 34 s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))35 36 s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps')) 36 37 s += '\t\t{}\n'.format('0: Arithmetic (default)') 37 38 s += '\t\t{}\n'.format('1: Geometric') 38 39 s += '\t\t{}\n'.format('2: Harmonic') 40 s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested')) 39 41 return s 40 # }}}42 # }}} 41 43 42 44 def extrude(self, md): # {{{ 43 45 self.mass_balance = project3d(md, 'vector', self.mass_balance, 'type', 'node') 44 46 return self 45 # }}}47 # }}} 46 48 47 49 def defaultoutputs(self, md): # {{{ 48 return [ ]49 # }}}50 return ['SmbMassBalance'] 51 # }}} 50 52 51 53 def initialize(self, md): # {{{ … … 54 56 print(" no smb.mass_balance specified: values set as zero") 55 57 return self 56 # }}}58 # }}} 57 59 58 60 def checkconsistency(self, md, solution, analyses): # {{{ … … 69 71 # }}} 70 72 71 def marshall(self, prefix, md, fid): 73 def marshall(self, prefix, md, fid): # {{{ 72 74 yts = md.constants.yts 73 75 WriteData(fid, prefix, 'name', 'md.smb.model', 'data', 1, 'format', 'Integer') … … 84 86 WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray') 85 87 # }}} 88 89 def setdefaultparameters(self): #{{{ 90 self.requested_outputs = ['SmbMassBalance'] 91 return self 92 # }}}
Note:
See TracChangeset
for help on using the changeset viewer.