Changeset 26307
- Timestamp:
- 06/08/21 14:40:15 (4 years ago)
- Location:
- issm/trunk-jpl/src/m
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/pairoptions.m
r20840 r26307 182 182 end % }}} 183 183 function value = getfieldvalue(self,field,varargin), % {{{ 184 %GET OPTION- get the value of an option184 %GETFIELDVALUE - get the value of an option 185 185 % 186 186 % Usage: … … 220 220 end % }}} 221 221 function values = getfieldvalues(self,field,varargin), % {{{ 222 %GET OPTION- 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) 223 223 % 224 224 % Usage: … … 229 229 % 230 230 % 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]}); 233 233 234 234 %some argument checking: … … 248 248 for i=1:length(pos), 249 249 values{i}=self.list{pos(i),2}; 250 self.list{pos(i),3}=true; 250 self.list{pos(i),3}=true; % option used 251 251 end 252 252 return; … … 267 267 % 268 268 % if warn==1 display an info message to warn user that 269 % some of hisoptions have been removed.269 % some of their options have been removed. 270 270 271 271 %check is field exist -
issm/trunk-jpl/src/m/classes/pairoptions.py
r25455 r26307 14 14 self.list = OrderedDict() 15 15 16 #get calling function name16 #get calling function name 17 17 import inspect 18 18 if len(inspect.stack()) > 1: 19 19 self.functionname = inspect.stack()[1][3] 20 20 21 #initialize list21 #initialize list 22 22 if not len(arg): 23 23 pass #Do nothing, … … 57 57 58 58 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 60 62 if isinstance(field, str): 61 63 if field in self.list: … … 65 67 66 68 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 68 72 if isinstance(field, str): 69 73 if field not in self.list: … … 72 76 73 77 def AssignObjectFields(self, obj2): # {{{ 74 """ASSIGNOBJECTFIELDS - assign object fields from options""" 78 """ASSIGNOBJECTFIELDS - assign object fields from options 79 """ 80 75 81 for item in list(self.list.items()): 76 82 if item[0] in dir(obj2): … … 82 88 83 89 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 """ 85 92 86 93 self.list[field] = newvalue 87 94 # }}} 88 95 96 def displayunused(self): #{{{ 97 """DISPLAYUNUSED - display unused options 98 """ 99 100 disp(['WARNING: pairoptions::displayunused is not yet implemented']) 101 # }}} 89 102 def exist(self, field): # {{{ 90 """EXIST - check if the option exist""" 103 """EXIST - check if the option exists 104 """ 91 105 92 106 #some argument checking: … … 104 118 105 119 def getfieldvalue(self, field, default=None): # {{{ 106 """ 107 GETOPTION - get the value of an option 120 """GETFIELDVALUE - get the value of an option 108 121 109 122 Usage: … … 118 131 """ 119 132 120 #some argument checking:133 #some argument checking: 121 134 if field is None or field == '': 122 135 raise ValueError('getfieldvalue error message: bad usage') … … 124 137 raise TypeError("getfieldvalue error message: field '%s' should be a string." % str(field)) 125 138 126 #Recover option139 #Recover option 127 140 if field in self.list: 128 141 value = self.list[field] … … 137 150 138 151 def removefield(self, field, warn): # {{{ 139 """ 140 REMOVEFIELD - delete a field in an option list 152 """REMOVEFIELD - delete a field in an option list 141 153 142 154 Usage: … … 144 156 145 157 if warn == 1 display an info message to warn user that 146 some of hisoptions have been removed.158 some of their options have been removed. 147 159 """ 148 160 -
issm/trunk-jpl/src/m/classes/rotational.m
r25956 r26307 20 20 end % }}} 21 21 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]26 22 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] 29 29 end % }}} 30 30 function md = checkconsistency(self,md,solution,analyses) % {{{ -
issm/trunk-jpl/src/m/classes/sealevelmodel.m
r26080 r26307 14 14 icecaps = {}; % list of land/ice models, name should be change longer term. 15 15 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 17 17 cluster = 0; 18 18 miscellaneous = 0; … … 50 50 for i=1:length(slm.icecaps), 51 51 if slm.icecaps{i}.transient.iscoupler==0, 52 warning(sprintf('sealevelmodel checkconsisten ty 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)); 53 53 end 54 54 end 55 55 56 56 if slm.earth.transient.iscoupler==0, 57 warning('sealevelmodel checkconsisten ty 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!'); 58 58 end 59 59 … … 61 61 for i=1:length(slm.icecaps), 62 62 if slm.icecaps{i}.mesh.numberofvertices ~= length(slm.earth.solidearth.transitions{i}), 63 error(['sealevelmodel checkconsisten ty 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: 68 68 for i=1:length(slm.icecaps), 69 69 if slm.icecaps{i}.solidearth.settings.runfrequency~=slm.earth.solidearth.settings.runfrequency, 70 error(sprintf('sealevelmodel checkconsisten ty 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)); 71 71 end 72 72 end … … 87 87 end 88 88 end 89 89 90 %make sure that there is no solid earth external forcing on the basins: 90 91 for i=1:length(slm.icecaps), … … 102 103 end 103 104 end 104 105 105 106 106 end -
issm/trunk-jpl/src/m/classes/sealevelmodel.py
r26059 r26307 134 134 md = self.mergedcaps[2 * i] 135 135 trans = self.mergedcaps[2 * i + 1] 136 #icecaps = self.icecaps[self.range[2 * i + 2]] 136 137 for j in range(len(self.icecaps[0].results.TransientSolution)): 137 138 for k in range(len(champs)): -
issm/trunk-jpl/src/m/classes/solidearth.m
r26301 r26307 3 3 % Usage: 4 4 % solidearth=solidearth(); 5 % solidearth=solidearth('earth'); 5 6 6 7 classdef solidearth … … 79 80 self.external=[]; 80 81 81 % earthradius82 %planet radius 82 83 self.planetradius= planetradius(planet); 83 84 -
issm/trunk-jpl/src/m/classes/solidearth.py
r26299 r26307 17 17 Usage: 18 18 solidearth = solidearth() 19 solidearth = solidearth('earth') 20 21 TODO: 22 - Update translation from solidearth.m 19 23 """ 20 24 … … 71 75 self.external = [] 72 76 73 # Earthradius77 # Planet radius 74 78 self.planetradius = planetradius(planet) 75 79 #}}} -
issm/trunk-jpl/src/m/classes/solidearthsolution.m
r26274 r26307 66 66 geoid_rate(end+1,:)=time(1:end-1); 67 67 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); 72 72 73 73 end % }}} -
issm/trunk-jpl/src/m/solve/solve.m
r26059 r26307 8 8 % 9 9 % 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' 26 28 % 27 29 % 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) 33 34 % where the restart file is located 34 35 % … … 116 117 end 117 118 118 %if running QMU analysis, some preprocessing of Dakota files using model sfields needs to be carried out.119 %if running QMU analysis, some preprocessing of Dakota files using model fields needs to be carried out. 119 120 if md.qmu.isdakota, 120 121 md=preqmu(md,options); -
issm/trunk-jpl/src/m/solve/solve.py
r26059 r26307 15 15 Usage: 16 16 md = solve(md, solutionstring, varargin) 17 17 18 18 where varargin is a list of paired arguments of string OR enums 19 19 20 20 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' 37 38 38 39 Extra options: 39 - loadonly : do es not solve.only load results40 - runtimename : true or false (default is true) ,makes name unique41 - checkconsistency : 'yes' or 'no' (default is 'yes') , ensures checks on42 consistencyof model40 - 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 43 44 - restart : directory name (relative to the execution directory) 44 45 where the restart file is located … … 114 115 md.private.runtimename = md.miscellaneous.name 115 116 116 # If running QMU analysis, some preprocessing of Dakota files using model s117 # If running QMU analysis, some preprocessing of Dakota files using model 117 118 # fields needs to be carried out 118 119 if md.qmu.isdakota:
Note:
See TracChangeset
for help on using the changeset viewer.