Changeset 25969


Ignore:
Timestamp:
02/03/21 12:51:18 (4 years ago)
Author:
Mathieu Morlighem
Message:

CHG: minor

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

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/solidearth.m

    r25956 r25969  
    1717                partitionice           = [];
    1818                partitionhydro         = [];
     19        end
     20        methods (Static)
     21                function self = loadobj(self) % {{{
     22                        % This function is directly called by matlab when a model object is
     23                        % loaded. If the input is a struct it is an old version of this class and
     24                        % old fields must be recovered (make sure they are in the deprecated
     25                        % model properties)
     26
     27                        if isstruct(self)
     28                                % 2021, Jan 10
     29                                if isfield(self,'sealevel')
     30                                        self.initialsealevel = self.sealevel;
     31                                end
     32                                self = structtoobj(solidearth(),self);
     33
     34                        end
     35                end% }}}
    1936        end
    2037        methods
     
    7693                        disp(sprintf('   solidearth inputs, forcings and settings:'));
    7794
    78                         fielddisplay(self,'initialsealevel','sea level at the start of computation) [m]');
     95                        fielddisplay(self,'initialsealevel','sea level at the start of computation [m]');
    7996                        fielddisplay(self,'planetradius','planet radius [m]');
    8097                        fielddisplay(self,'transitions','indices into parts of the mesh that will be icecaps');
  • issm/trunk-jpl/src/m/classes/solidearth.py

    r25962 r25969  
    4141            raise Exception('solidearth constructor error message: zero or one argument only!')
    4242    #}}}
    43 
    4443    def __repr__(self):  # {{{
    4544        s = '   solidearthinputs, forcings and settings:\n'
     
    6059        return s
    6160    #}}}
    62 
    6361    def setdefaultparameters(self, planet):  # {{{
    6462        # Default output
     
    7876        self.planetradius = planetradius(planet)
    7977    #}}}
    80 
    8178    def checkconsistency(self, md, solution, analyses):  # {{{
    8279        if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc):
     
    9693        return md
    9794    #}}}
    98 
    9995    def defaultoutputs(self, md):  #{{{
    10096        return ['Sealevel']
    10197    #}}}
    102 
    10398    def marshall(self, prefix, md, fid):  #{{{
    10499        WriteData(fid, prefix, 'object', self, 'fieldname', 'initialsealevel', 'mattype', 1, 'format', 'DoubleMat', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
     
    136131        WriteData(fid, prefix, 'data', outputs, 'name', 'md.solidearth.requested_outputs', 'format', 'StringArray')
    137132    #}}}
    138 
    139133    def extrude(self, md): #{{{
    140134        self.initialsealevel = project3d(md, 'vector', self.initialsealevel, 'type', 'node')
Note: See TracChangeset for help on using the changeset viewer.