Ignore:
Timestamp:
10/19/20 13:31:26 (4 years ago)
Author:
jdquinn
Message:

CHG: MATLAB -> Python translations in support of tests 2005 and 2006 (still have errors to work out here); clean up; various minor improvements

Location:
issm/trunk-jpl/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src

  • issm/trunk-jpl/src/m/classes/surfaceload.py

    r25499 r25688  
    3131        s += '{}\n'.format(fielddisplay(self, 'waterheightchange', 'water height change: water height equivalent [mWater/yr]'))
    3232        s += '{}\n'.format(fielddisplay(self, 'other', 'other loads (sediments) [kg/m^2/yr]'))
    33 
    3433        return s
    3534    #}}}
    3635
    3736    def setdefaultparameters(self): # {{{
    38         return
     37        return self
    3938    #}}}
    4039
    4140    def checkconsistency(self, md, solution, analyses): # {{{
    42         if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and md.transient.isslr == 0):
     41        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslr):
    4342            return md
    44 
    4543        if len(self.icethicknesschange):
    4644            md  = checkfield(md,'fieldname', 'solidearth.surfaceload.icethicknesschange', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
    47 
    4845        if len(self.waterheightchange):
    4946            md  = checkfield(md,'fieldname', 'solidearth.surfaceload.waterheightchange', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
    50 
    5147        if len(self.other):
    5248            md  = checkfield(md,'fieldname', 'solidearth.surfaceload.other', 'timeseries', 1, 'NaN', 1, 'Inf', 1)
    53 
    5449        return md
    5550    #}}}
     
    5853        if len(self.icethicknesschange) == 0:
    5954            self.icethicknesschange = np.zeros((md.mesh.numberofelements + 1, ))
    60 
    6155        if len(self.waterheightchange) == 0:
    6256            self.waterheightchange = np.zeros((md.mesh.numberofelements + 1, ))
    63 
    6457        if len(self.other) == 0:
    6558            self.other = np.zeros((md.mesh.numberofelements + 1, ))
    66 
    6759        WriteData(fid, prefix, 'object', self, 'fieldname', 'icethicknesschange', 'name', 'md.solidearth.surfaceload.icethicknesschange', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', md.constants.yts)
    6860        WriteData(fid, prefix, 'object', self, 'fieldname', 'waterheightchange', 'name', 'md.solidearth.surfaceload.waterheightchange', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', md.mesh.numberofelements + 1, 'yts', md.constants.yts)
Note: See TracChangeset for help on using the changeset viewer.