Changeset 26307


Ignore:
Timestamp:
06/08/21 14:40:15 (4 years ago)
Author:
jdquinn
Message:

CHG: Pending minor cleanup

Location:
issm/trunk-jpl/src/m
Files:
10 edited

Legend:

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

    r20840 r26307  
    182182                end % }}}
    183183                function value = getfieldvalue(self,field,varargin), % {{{
    184                 %GETOPTION - get the value of an option
     184                %GETFIELDVALUE - get the value of an option
    185185                %
    186186                %   Usage:
     
    220220                end % }}}
    221221                function values = getfieldvalues(self,field,varargin), % {{{
    222                 %GETOPTION - get the value of an option (if the option is repeated, return multiple values)
     222                %GETFIELDVALUES - get the value of an option (if the option is repeated, return multiple values)
    223223                %
    224224                %   Usage:
     
    229229                %
    230230                %   Examples:
    231                 %      values=getfieldvalue(options,'caxis');
    232                 %      values=getfieldvalue(options,'caxis',{[0 2],[3 4]});
     231                %      values=getfieldvalues(options,'caxis');
     232                %      values=getfieldvalues(options,'caxis',{[0 2],[3 4]});
    233233
    234234                        %some argument checking:
     
    248248                                for i=1:length(pos),
    249249                                        values{i}=self.list{pos(i),2};
    250                                         self.list{pos(i),3}=true;  % option used
     250                                        self.list{pos(i),3}=true; % option used
    251251                                end
    252252                                return;
     
    267267                %
    268268                %   if warn==1 display an info message to warn user that
    269                 %   some of his options have been removed.
     269                %   some of their options have been removed.
    270270
    271271                        %check is field exist
  • issm/trunk-jpl/src/m/classes/pairoptions.py

    r25455 r26307  
    1414        self.list = OrderedDict()
    1515
    16     #get calling function name
     16        #get calling function name
    1717        import inspect
    1818        if len(inspect.stack()) > 1:
    1919            self.functionname = inspect.stack()[1][3]
    2020
    21     #initialize list
     21        #initialize list
    2222        if not len(arg):
    2323            pass  #Do nothing,
     
    5757
    5858    def addfield(self, field, value):  # {{{
    59         """ADDFIELD - add a field to an options list"""
     59        """ADDFIELD - add a field to an options list
     60        """
     61
    6062        if isinstance(field, str):
    6163            if field in self.list:
     
    6567
    6668    def addfielddefault(self, field, value):  # {{{
    67         """ADDFIELDDEFAULT - add a field to an options list if it does not already exist"""
     69        """ADDFIELDDEFAULT - add a field to an options list if it does not already exist
     70        """
     71
    6872        if isinstance(field, str):
    6973            if field not in self.list:
     
    7276
    7377    def AssignObjectFields(self, obj2):  # {{{
    74         """ASSIGNOBJECTFIELDS - assign object fields from options"""
     78        """ASSIGNOBJECTFIELDS - assign object fields from options
     79        """
     80
    7581        for item in list(self.list.items()):
    7682            if item[0] in dir(obj2):
     
    8288
    8389    def changefieldvalue(self, field, newvalue):  # {{{
    84         """CHANGEOPTIONVALUE - change the value of an option in an option list"""
     90        """CHANGEOPTIONVALUE - change the value of an option in an option list
     91        """
    8592
    8693        self.list[field] = newvalue
    8794    # }}}
    8895
     96    def displayunused(self): #{{{
     97        """DISPLAYUNUSED - display unused options
     98        """
     99
     100        disp(['WARNING: pairoptions::displayunused is not yet implemented'])
     101    # }}}
    89102    def exist(self, field):  # {{{
    90         """EXIST - check if the option exist"""
     103        """EXIST - check if the option exists
     104        """
    91105
    92106        #some argument checking:
     
    104118
    105119    def getfieldvalue(self, field, default=None):  # {{{
    106         """
    107         GETOPTION - get the value of an option
     120        """GETFIELDVALUE - get the value of an option
    108121
    109122        Usage:
     
    118131        """
    119132
    120     #some argument checking:
     133        #some argument checking:
    121134        if field is None or field == '':
    122135            raise ValueError('getfieldvalue error message: bad usage')
     
    124137            raise TypeError("getfieldvalue error message: field '%s' should be a string." % str(field))
    125138
    126     #Recover option
     139        #Recover option
    127140        if field in self.list:
    128141            value = self.list[field]
     
    137150
    138151    def removefield(self, field, warn):  # {{{
    139         """
    140         REMOVEFIELD - delete a field in an option list
     152        """REMOVEFIELD - delete a field in an option list
    141153
    142154        Usage:
     
    144156
    145157        if warn == 1 display an info message to warn user that
    146         some of his options have been removed.
     158        some of their options have been removed.
    147159        """
    148160
  • issm/trunk-jpl/src/m/classes/rotational.m

    r25956 r26307  
    2020                end % }}}
    2121                function self = setdefaultparameters(self) % {{{
    22                
    23                 %moment of inertia:
    24                 self.equatorialmoi      =8.0077*10^37; % [kg m^2]
    25                 self.polarmoi           =8.0345*10^37; % [kg m^2]
    2622
    27                 % mean rotational velocity of earth
    28                 self.angularvelocity=7.2921*10^-5; % [s^-1]
     23                        %moment of inertia:
     24                        self.equatorialmoi      =8.0077*10^37; % [kg m^2]
     25                        self.polarmoi           =8.0345*10^37; % [kg m^2]
     26
     27                        % mean rotational velocity of earth
     28                        self.angularvelocity=7.2921*10^-5; % [s^-1]
    2929                end % }}}
    3030                function md = checkconsistency(self,md,solution,analyses) % {{{
  • issm/trunk-jpl/src/m/classes/sealevelmodel.m

    r26080 r26307  
    1414                icecaps          = {}; % list of land/ice models, name should  be change longer term.
    1515                earth            = 0;  % model for the whole earth
    16                 basins           = {}; % list  of basins, matching icecaps, where shapefile info is held.
     16                basins           = {}; % list of basins, matching icecaps, where shapefile info is held
    1717                cluster          = 0;
    1818                miscellaneous    = 0;
     
    5050                        for i=1:length(slm.icecaps),
    5151                                if slm.icecaps{i}.transient.iscoupler==0,
    52                                         warning(sprintf('sealevelmodel checkconsistenty error: icecap model %s should have the transient coupler option turned on!',slm.icecaps{i}.miscellaneous.name));
     52                                        warning(sprintf('sealevelmodel checkconsistency error: icecap model %s should have the transient coupler option turned on!',slm.icecaps{i}.miscellaneous.name));
    5353                                end
    5454                        end
    5555                               
    5656                        if slm.earth.transient.iscoupler==0,
    57                                 warning('sealevelmodel checkconsistenty error: earth model should have the transient coupler option turned on!');
     57                                warning('sealevelmodel checkconsistency error: earth model should have the transient coupler option turned on!');
    5858                        end
    5959
     
    6161                        for i=1:length(slm.icecaps),
    6262                                if slm.icecaps{i}.mesh.numberofvertices ~= length(slm.earth.solidearth.transitions{i}),
    63                                         error(['sealevelmodel checkconsistenty issue with size of transition vector for ice cap: ' num2str(i) ' name: ' slm.icecaps{i}.miscellaneous.name]);
    64                                 end
    65                         end
    66                        
    67                         %check that run_frequency is the same everywhere:
     63                                        error(['sealevelmodel checkconsistency issue with size of transition vector for ice cap: ' num2str(i) ' name: ' slm.icecaps{i}.miscellaneous.name]);
     64                                end
     65                        end
     66                       
     67                        %check that runfrequency is the same everywhere:
    6868                        for i=1:length(slm.icecaps),
    6969                                if slm.icecaps{i}.solidearth.settings.runfrequency~=slm.earth.solidearth.settings.runfrequency,
    70                                         error(sprintf('sealevelmodel checkconsistenty error: icecap model %s should have the same run frequency as earth!',slm.icecaps{i}.miscellaneous.name));
     70                                        error(sprintf('sealevelmodel checkconsistency error: icecap model %s should have the same run frequency as earth!',slm.icecaps{i}.miscellaneous.name));
    7171                                end
    7272                        end
     
    8787                                end
    8888                        end
     89
    8990                        %make sure that there is no solid earth external forcing on the basins:
    9091                        for i=1:length(slm.icecaps),
     
    102103                                end
    103104                        end
    104 
    105105
    106106                end
  • issm/trunk-jpl/src/m/classes/sealevelmodel.py

    r26059 r26307  
    134134            md = self.mergedcaps[2 * i]
    135135            trans = self.mergedcaps[2 * i + 1]
     136            #icecaps = self.icecaps[self.range[2 * i + 2]]
    136137            for j in range(len(self.icecaps[0].results.TransientSolution)):
    137138                for k in range(len(champs)):
  • issm/trunk-jpl/src/m/classes/solidearth.m

    r26301 r26307  
    33%   Usage:
    44%      solidearth=solidearth();
     5%      solidearth=solidearth('earth');
    56
    67classdef solidearth
     
    7980                        self.external=[];
    8081
    81                         %earth radius
     82                        %planet radius
    8283                        self.planetradius= planetradius(planet);
    8384               
  • issm/trunk-jpl/src/m/classes/solidearth.py

    r26299 r26307  
    1717    Usage:
    1818        solidearth = solidearth()
     19        solidearth = solidearth('earth')
     20
     21    TODO:
     22    - Update translation from solidearth.m
    1923    """
    2024
     
    7175        self.external = []
    7276
    73         # Earth radius
     77        # Planet radius
    7478        self.planetradius = planetradius(planet)
    7579    #}}}
  • issm/trunk-jpl/src/m/classes/solidearthsolution.m

    r26274 r26307  
    6666                                geoid_rate(end+1,:)=time(1:end-1);
    6767                        end
    68                         WriteData(fid,prefix,'object',self,'fieldname','displacementeast','data',displacementeast_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementeast','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
    69                         WriteData(fid,prefix,'object',self,'fieldname','displacementup','data',displacementup_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementup','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
    70                         WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','data',displacementnorth_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementnorth','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
    71                         WriteData(fid,prefix,'object',self,'fieldname','geoid','data',geoid_rate,'format','DoubleMat','name', 'md.solidearth.external.geoid','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
     68                        WriteData(fid,prefix,'object',self,'fieldname','displacementeast','data',displacementeast_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementeast','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
     69                        WriteData(fid,prefix,'object',self,'fieldname','displacementup','data',displacementup_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementup','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
     70                        WriteData(fid,prefix,'object',self,'fieldname','displacementnorth','data',displacementnorth_rate,'format','DoubleMat','name', 'md.solidearth.external.displacementnorth','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
     71                        WriteData(fid,prefix,'object',self,'fieldname','geoid','data',geoid_rate,'format','DoubleMat','name', 'md.solidearth.external.geoid','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts);
    7272                       
    7373                end % }}}
  • issm/trunk-jpl/src/m/solve/solve.m

    r26059 r26307  
    88%
    99%   Solution types available comprise:
    10 %   - 'Stressbalance'      or 'sb'
    11 %   - 'Masstransport'      or 'mt'
    12 %   - 'Oceantransport'     or 'oceant'
    13 %   - 'Thermal'            or 'th'
    14 %   - 'Steadystate'        or 'ss'
    15 %   - 'Transient'          or 'tr'
    16 %   - 'Balancethickness'   or 'mc'
    17 %   - 'Balancevelocity'    or 'bv'
    18 %   - 'BedSlope'           or 'bsl'
    19 %   - 'SurfaceSlope'       or 'ssl'
    20 %   - 'Hydrology'          or 'hy'
    21 %   - 'DamageEvolution'    or 'da'
    22 %   - 'Gia'                or 'gia'
    23 %   - 'Love'               or 'lv'
    24 %   - 'Esa'                or 'esa'
    25 %   - 'Sampling'           or 'smp'
     10%   - 'Stressbalance'        or 'sb'
     11%   - 'Masstransport'        or 'mt'
     12%   - 'Oceantransport'       or 'oceant'
     13%   - 'Thermal'              or 'th'
     14%   - 'Steadystate'          or 'ss'
     15%   - 'Transient'            or 'tr'
     16%   - 'Balancethickness'     or 'mc'
     17%   - 'Balancethickness2'
     18%   - 'BalancethicknessSoft' or 'mcsoft'
     19%   - 'Balancevelocity'      or 'bv'
     20%   - 'BedSlope'             or 'bsl'
     21%   - 'SurfaceSlope'         or 'ssl'
     22%   - 'Hydrology'            or 'hy'
     23%   - 'DamageEvolution'      or 'da'
     24%   - 'Gia'                  or 'gia'
     25%   - 'Love'                 or 'lv'
     26%   - 'Esa'                  or 'esa'
     27%   - 'Sampling'             or 'smp'
    2628%
    2729%   Extra options:
    28 %   - loadonly         : does not solve. only load results
    29 %   - runtimename      : true or false (default is true), makes name unique
    30 %   - checkconsistency : 'yes' or 'no' (default is 'yes'), ensures checks on
    31 %                        consistency of model
    32 %   - restart          : 'directory name (relative to the execution directory)
     30%   - loadonly         : do not solve, only load results
     31%   - runtimename      : true or false (default is true); makes name unique
     32%   - checkconsistency : 'yes' or 'no' (default is 'yes'); checks consistency of model
     33%   - restart          : directory name (relative to the execution directory)
    3334%                        where the restart file is located
    3435%
     
    116117end
    117118
    118 %if running QMU analysis, some preprocessing of Dakota files using models fields needs to be carried out.
     119%if running QMU analysis, some preprocessing of Dakota files using model fields needs to be carried out.
    119120if md.qmu.isdakota,
    120121        md=preqmu(md,options);
  • issm/trunk-jpl/src/m/solve/solve.py

    r26059 r26307  
    1515    Usage:
    1616        md = solve(md, solutionstring, varargin)
    17    
     17
    1818    where varargin is a list of paired arguments of string OR enums
    1919
    2020    Solution types available comprise:
    21     - 'Stressbalance'      or 'sb'
    22     - 'Masstransport'      or 'mt'
    23     - 'Oceantransport'     or 'oceant'
    24     - 'Thermal'            or 'th'
    25     - 'Steadystate'        or 'ss'
    26     - 'Transient'          or 'tr'
    27     - 'Balancethickness'   or 'mc'
    28     - 'Balancevelocity'    or 'bv'
    29     - 'BedSlope'           or 'bsl'
    30     - 'SurfaceSlope'       or 'ssl'
    31     - 'Hydrology'          or 'hy'
    32     - 'DamageEvolution'    or 'da'
    33     - 'Gia'                or 'gia'
    34     - 'Love'               or 'lv'
    35     - 'Esa'                or 'esa'
    36     - 'Sampling'           or 'smp'
     21    - 'Stressbalance'        or 'sb'
     22    - 'Masstransport'        or 'mt'
     23    - 'Oceantransport'       or 'oceant'
     24    - 'Thermal'              or 'th'
     25    - 'Steadystate'          or 'ss'
     26    - 'Transient'            or 'tr'
     27    - 'Balancethickness'     or 'mc'
     28    - 'BalancethicknessSoft' or 'mcsoft'
     29    - 'Balancevelocity'      or 'bv'
     30    - 'BedSlope'             or 'bsl'
     31    - 'SurfaceSlope'         or 'ssl'
     32    - 'Hydrology'            or 'hy'
     33    - 'DamageEvolution'      or 'da'
     34    - 'Gia'                  or 'gia'
     35    - 'Love'                 or 'lv'
     36    - 'Esa'                  or 'esa'
     37    - 'Sampling'             or 'smp'
    3738
    3839    Extra options:
    39     - loadonly         : does not solve. only load results
    40     - runtimename      : true or false (default is true), makes name unique
    41     - checkconsistency : 'yes' or 'no' (default is 'yes'), ensures checks on
    42                          consistency of model
     40    - loadonly         : do not solve, only load results
     41    - runtimename      : true or false (default is true); makes name unique
     42    - checkconsistency : 'yes' or 'no' (default is 'yes'); checks consistency
     43                         of model
    4344    - restart          : directory name (relative to the execution directory)
    4445                         where the restart file is located
     
    114115                md.private.runtimename = md.miscellaneous.name
    115116
    116     # If running QMU analysis, some preprocessing of Dakota files using models
     117    # If running QMU analysis, some preprocessing of Dakota files using model
    117118    # fields needs to be carried out
    118119    if md.qmu.isdakota:
Note: See TracChangeset for help on using the changeset viewer.