Ignore:
Timestamp:
01/26/15 18:40:38 (10 years ago)
Author:
Mathieu Morlighem
Message:

CHG: renmaned obj -> self to look like python

File:
1 edited

Legend:

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

    r18503 r19040  
    1414        end
    1515        methods
    16                 function obj = seaice(varargin) % {{{
     16                function self = seaice(varargin) % {{{
    1717                        switch nargin
    1818                                case 0
    19                                         obj=setdefaultparameters(obj);
     19                                        self=setdefaultparameters(self);
    2020                                        return;
    2121                                otherwise
     
    2323                        end
    2424                end % }}}
    25                 function md = checkconsistency(obj,md,solution,analyses) % {{{
     25                function md = checkconsistency(self,md,solution,analyses) % {{{
    2626                        if solution~=SeaiceSolutionEnum(), return; end
    2727                        md = checkfield(md,'fieldname','seaice.min_concentration','NaN',1,'>=',0,'numel',1);
     
    3232                        md = checkfield(md,'fieldname','seaice.coriolis_factor','size',[md.mesh.numberofelements 1],'NaN',1,'>=',0);
    3333                end % }}}
    34                 function obj = setdefaultparameters(obj) % {{{
     34                function self = setdefaultparameters(self) % {{{
    3535
    3636                        %Minimum ice concentration allowed in the simulation
    37                         obj.min_concentration=0.;
     37                        self.min_concentration=0.;
    3838
    3939                        %Minimum ice thickness allowed in the simulation
    40                         obj.min_thickness=0.;
     40                        self.min_thickness=0.;
    4141
    4242                        %Maxmimum ice thickness allowed in the simulation
    43                         obj.max_thickness=25.;
     43                        self.max_thickness=25.;
    4444
    4545                end % }}}
    46                 function disp(obj) % {{{
     46                function disp(self) % {{{
    4747                        disp(sprintf('   seaice parameters:'));
    48                         fielddisplay(obj,'min_concentration','minimum ice concentration allowed in the simulation [no unit]');
    49                         fielddisplay(obj,'min_thickness','minimum ice thickness allowed in the simulation [m]');
    50                         fielddisplay(obj,'max_thickness','maximum ice thickness allowed in the simulation [m]');
    51                         fielddisplay(obj,'spcvx','x-axis velocity constraint (NaN means no constraint) [m/s]');
    52                         fielddisplay(obj,'spcvy','y-axis velocity constraint (NaN means no constraint) [m/s]');
    53                         fielddisplay(obj,'coriolis_factor','factor applied to Coriolis forces (latitude dependent)');
     48                        fielddisplay(self,'min_concentration','minimum ice concentration allowed in the simulation [no unit]');
     49                        fielddisplay(self,'min_thickness','minimum ice thickness allowed in the simulation [m]');
     50                        fielddisplay(self,'max_thickness','maximum ice thickness allowed in the simulation [m]');
     51                        fielddisplay(self,'spcvx','x-axis velocity constraint (NaN means no constraint) [m/s]');
     52                        fielddisplay(self,'spcvy','y-axis velocity constraint (NaN means no constraint) [m/s]');
     53                        fielddisplay(self,'coriolis_factor','factor applied to Coriolis forces (latitude dependent)');
    5454                end % }}}
    55                 function marshall(obj,md,fid) % {{{
    56                         WriteData(fid,'object',obj,'fieldname','min_concentration','format','Double');
    57                         WriteData(fid,'object',obj,'fieldname','min_thickness','format','Double');
    58                         WriteData(fid,'object',obj,'fieldname','max_thickness','format','Double');
    59                         WriteData(fid,'object',obj,'fieldname','spcvx','format','DoubleMat','mattype',1);
    60                         WriteData(fid,'object',obj,'fieldname','spcvy','format','DoubleMat','mattype',1);
    61                         WriteData(fid,'object',obj,'fieldname','coriolis_factor','format','DoubleMat','mattype',2);
     55                function marshall(self,md,fid) % {{{
     56                        WriteData(fid,'object',self,'fieldname','min_concentration','format','Double');
     57                        WriteData(fid,'object',self,'fieldname','min_thickness','format','Double');
     58                        WriteData(fid,'object',self,'fieldname','max_thickness','format','Double');
     59                        WriteData(fid,'object',self,'fieldname','spcvx','format','DoubleMat','mattype',1);
     60                        WriteData(fid,'object',self,'fieldname','spcvy','format','DoubleMat','mattype',1);
     61                        WriteData(fid,'object',self,'fieldname','coriolis_factor','format','DoubleMat','mattype',2);
    6262                end % }}}
    6363        end
Note: See TracChangeset for help on using the changeset viewer.