Ignore:
Timestamp:
06/07/21 20:07:14 (4 years ago)
Author:
jdquinn
Message:

CHG: test2002 MATLAB -> Python; clean up

File:
1 edited

Legend:

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

    r26231 r26301  
    1313        end
    1414        methods
    15                 function self = extrude(self,md) % {{{
    16                         self.sea_surface_height_above_geoid=project3d(md,'vector',self.sea_surface_height_above_geoid,'type','node','layer',1);
    17                         self.sea_water_pressure_at_sea_floor=project3d(md,'vector',self.sea_water_pressure_at_sea_floor,'type','node','layer',1);
    18                 end % }}}
    1915                function self = dsl(varargin) % {{{
    2016                        switch nargin
     
    3430
    3531                end % }}}
     32                function disp(self) % {{{
     33
     34                        disp(sprintf('   dsl parameters:'));
     35                        fielddisplay(self,'global_average_thermosteric_sea_level','Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).');
     36                        fielddisplay(self,'sea_surface_height_above_geoid','Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).');
     37                        fielddisplay(self,'sea_water_pressure_at_sea_floor','Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).');
     38
     39                end % }}}
    3640                function md = checkconsistency(self,md,solution,analyses) % {{{
    3741
     
    4953                       
    5054                end % }}}
    51                 function disp(self) % {{{
    52 
    53                         disp(sprintf('   dsl parameters:'));
    54                         fielddisplay(self,'global_average_thermosteric_sea_level','Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).');
    55                         fielddisplay(self,'sea_surface_height_above_geoid','Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m).');
    56                         fielddisplay(self,'sea_water_pressure_at_sea_floor','Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!).');
     55                function marshall(self,prefix,md,fid) % {{{
     56                        yts=md.constants.yts;
     57                        WriteData(fid,prefix,'name','md.dsl.model','data',1,'format','Integer');
     58                        WriteData(fid,prefix,'object',self,'fieldname','global_average_thermosteric_sea_level','format','DoubleMat','mattype',2,'timeseries',1,'timeserieslength',2,'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.
    5761
    5862                end % }}}
    59                 function marshall(self,prefix,md,fid) % {{{
    60 
    61                         WriteData(fid,prefix,'name','md.dsl.model','data',1,'format','Integer');
    62                         WriteData(fid,prefix,'object',self,'fieldname','global_average_thermosteric_sea_level','format','DoubleMat','mattype',2,'timeseries',1,'timeserieslength',2,'yts',md.constants.yts); %mattype 2, because we are sending a GMSL value identical everywhere on each element.
    63                         WriteData(fid,prefix,'object',self,'fieldname','sea_surface_height_above_geoid','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts); %mattype 1 because we specify DSL at vertex locations.
    64                         WriteData(fid,prefix,'object',self,'fieldname','sea_water_pressure_at_sea_floor','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts); %mattype 1 because we specify bottom pressure at vertex locations.
    65 
    66                 end % }}}
    67                 function savemodeljs(self,fid,modelname) % {{{
    68 
    69                         writejs1Darray(fid,[modelname '.dsl.global_average_thermosteric_sea_level'],self.global_average_thermosteric_sea_level);
    70                         writejs1Darray(fid,[modelname '.dsl.sea_surface_height_above_geoid'],self.sea_surface_height_above_geoid);
    71                         writejs1Darray(fid,[modelname '.dsl.sea_water_pressure_at_sea_floor'],self.sea_water_pressure_at_sea_floor);
    72 
     63                function self = extrude(self,md) % {{{
     64                        self.sea_surface_height_above_geoid=project3d(md,'vector',self.sea_surface_height_above_geoid,'type','node','layer',1);
     65                        self.sea_water_pressure_at_sea_floor=project3d(md,'vector',self.sea_water_pressure_at_sea_floor,'type','node','layer',1);
    7366                end % }}}
    7467                function self = initialize(self,md) % {{{
     
    8780                        end
    8881                end % }}}
    89        
     82                function savemodeljs(self,fid,modelname) % {{{
     83
     84                        writejs1Darray(fid,[modelname '.dsl.global_average_thermosteric_sea_level'],self.global_average_thermosteric_sea_level);
     85                        writejs1Darray(fid,[modelname '.dsl.sea_surface_height_above_geoid'],self.sea_surface_height_above_geoid);
     86                        writejs1Darray(fid,[modelname '.dsl.sea_water_pressure_at_sea_floor'],self.sea_water_pressure_at_sea_floor);
     87
     88                end % }}}
    9089        end
    9190end
Note: See TracChangeset for help on using the changeset viewer.