source:
issm/oecreview/Archive/25834-26739/ISSM-26012-26013.diff@
26740
Last change on this file since 26740 was 26740, checked in by , 3 years ago | |
---|---|
File size: 10.3 KB |
-
../trunk-jpl/src/m/classes/initialization.py
28 28 self.epl_thickness = np.nan 29 29 self.hydraulic_potential = np.nan 30 30 self.channelarea = np.nan 31 self.sample = np.nan 31 32 32 33 #set defaults 33 34 self.setdefaultparameters() … … 49 50 s += '{}\n'.format(fielddisplay(self, 'epl_thickness', 'thickness of the epl [m]')) 50 51 s += '{}\n'.format(fielddisplay(self, 'hydraulic_potential', 'Hydraulic potential (for GlaDS) [Pa]')) 51 52 s += '{}\n'.format(fielddisplay(self, 'channelarea', 'subglaciale water channel area (for GlaDS) [m2]')) 53 s += '{}\n'.format(fielddisplay(self,'sample','Realization of a Gaussian random field')) 52 54 return s 53 55 #}}} 54 56 … … 123 125 md = checkfield(md, 'fieldname', 'initialization.watercolumn', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) 124 126 md = checkfield(md, 'fieldname', 'initialization.hydraulic_potential', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) 125 127 md = checkfield(md, 'fieldname', 'initialization.channelarea', 'NaN', 1, 'Inf', 1, '>=', 0, 'size', [md.mesh.numberofelements]) 128 if 'SamplingAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.issampling: 129 if np.any(np.isnan(md.initialization.sample)): 130 md = checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]) 126 131 return md 127 132 # }}} 128 133 … … 140 145 WriteData(fid, prefix, 'object', self, 'fieldname', 'watercolumn', 'format', 'DoubleMat', 'mattype', 1) 141 146 WriteData(fid, prefix, 'object', self, 'fieldname', 'channelarea', 'format', 'DoubleMat', 'mattype', 1) 142 147 WriteData(fid, prefix, 'object', self, 'fieldname', 'hydraulic_potential', 'format', 'DoubleMat', 'mattype', 1) 148 WriteData(fid,prefix,'object',self,'fieldname','sample','format','DoubleMat','mattype',1) 143 149 if md.thermal.isenthalpy: 144 150 if (np.size(self.enthalpy) <= 1): 145 151 tpmp = md.materials.meltingpoint - md.materials.beta * md.initialization.pressure -
../trunk-jpl/src/m/classes/model.py
75 75 from ElementConnectivity import ElementConnectivity 76 76 from contourenvelope import contourenvelope 77 77 from DepthAverage import DepthAverage 78 from sampling import sampling 78 79 #}}} 79 80 80 81 … … 115 116 self.gia = None 116 117 self.love = None 117 118 self.esa = None 119 self.sampling = None 118 120 self.autodiff = None 119 121 self.inversion = None 120 122 self.qmu = None … … 172 174 'gia', 173 175 'love', 174 176 'esa', 177 'sampling', 175 178 'autodiff', 176 179 'inversion', 177 180 'qmu', … … 223 226 s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("frontalforcings", "[%s %s]" % ("1x1", obj.frontalforcings.__class__.__name__), "parameters for frontalforcings")) 224 227 s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("gia", "[%s %s]" % ("1x1", obj.gia.__class__.__name__), "parameters for gia solution")) 225 228 s = "%s\n%s" % (s, '%19s: %-22s -- %s' % ("esa", "[%s %s]" % ("1x1", obj.esa.__class__.__name__), "parameters for elastic adjustment solution")) 229 s = "%s\n%s" % (s, '%19s: %-22s -- %s' % ("sampling", "[%s %s]" % ("1x1", obj.sampling.__class__.__name__), "parameters for stochastic sampler")) 226 230 s = "%s\n%s" % (s, '%19s: %-22s -- %s' % ("love", "[%s %s]" % ("1x1", obj.love.__class__.__name__), "parameters for love solution")) 227 231 s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("autodiff", "[%s %s]" % ("1x1", obj.autodiff.__class__.__name__), "automatic differentiation parameters")) 228 232 s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("inversion", "[%s %s]" % ("1x1", obj.inversion.__class__.__name__), "parameters for inverse methods")) … … 270 274 self.gia = giamme() 271 275 self.love = fourierlove() 272 276 self.esa = esa() 277 self.sampling = sampling() 273 278 self.autodiff = autodiff() 274 279 self.inversion = inversion() 275 280 self.qmu = qmu() -
../trunk-jpl/src/m/consistency/ismodelselfconsistent.py
78 78 analyses = ['L2ProjectionBaseAnalysis', 'HydrologyShreveAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis'] 79 79 elif 'DamageEvolutionSolution': 80 80 analyses = ['DamageEvolutionAnalysis'] 81 elseif strcmp(solutiontype,'SamplingSolution') 82 analyses=['SamplingAnalysis'] 81 83 else: 82 84 raise TypeError('solution type: {} not supported yet!'.format(solutiontype)) 83 85 -
../trunk-jpl/src/m/sampling.py
54 54 # Temporal correlation factor 55 55 self.phi = 0 56 56 # Exponent in fraction SPDE (default=2, biLaplacian covariance operator) 57 self.alpha =2;57 self.alpha = 2 58 58 # Seed for pseudorandom number generator (default -1 for random seed) 59 self.alpha =-1;59 self.alpha = -1 60 60 # Default output 61 61 self.requested_outputs = ['default'] 62 62 return self … … 67 67 if (SamplingAnalysis' not in analyses): 68 68 return md 69 69 70 md = checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0) ;71 md = checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'numel',1,'>',0) ;72 md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0) ;73 md = checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0) ;74 md = checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0) ;75 md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0 1]) ;76 md = checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1) ;77 md = checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1) ;70 md = checkfield(md,'fieldname','sampling.kappa','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0) 71 md = checkfield(md,'fieldname','sampling.tau','NaN',1,'Inf',1,'numel',1,'>',0) 72 md = checkfield(md,'fieldname','sampling.beta','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1],'>',0) 73 md = checkfield(md,'fieldname','sampling.phi','NaN',1,'Inf',1,'numel',1,'>=',0) 74 md = checkfield(md,'fieldname','sampling.alpha','NaN',1,'Inf',1,'numel',1,'>',0) 75 md = checkfield(md,'fieldname','sampling.robin','numel',1,'values',[0 1]) 76 md = checkfield(md,'fieldname','sampling.seed','NaN',1,'Inf',1,'numel',1) 77 md = checkfield(md,'fieldname','sampling.requested_outputs','stringrow',1) 78 78 79 79 return md 80 80 # }}} 81 81 82 82 def marshall(self, prefix, md, fid): # {{{ 83 WriteData(fid,prefix,'object',self,'fieldname','kappa','format','DoubleMat','mattype',1) ;84 WriteData(fid,prefix,'object',self,'fieldname','tau','format','Double') ;85 WriteData(fid,prefix,'object',self,'fieldname','beta','format','DoubleMat','mattype',1) ;86 WriteData(fid,prefix,'object',self,'fieldname','phi','format','Double') ;87 WriteData(fid,prefix,'object',self,'fieldname','alpha','format','Integer') ;88 WriteData(fid,prefix,'object',self,'fieldname','robin','format','Boolean') ;89 WriteData(fid,prefix,'object',self,'fieldname','seed','format','Integer') ;83 WriteData(fid,prefix,'object',self,'fieldname','kappa','format','DoubleMat','mattype',1) 84 WriteData(fid,prefix,'object',self,'fieldname','tau','format','Double') 85 WriteData(fid,prefix,'object',self,'fieldname','beta','format','DoubleMat','mattype',1) 86 WriteData(fid,prefix,'object',self,'fieldname','phi','format','Double') 87 WriteData(fid,prefix,'object',self,'fieldname','alpha','format','Integer') 88 WriteData(fid,prefix,'object',self,'fieldname','robin','format','Boolean') 89 WriteData(fid,prefix,'object',self,'fieldname','seed','format','Integer') 90 90 91 91 # Process requested outputs 92 92 outputs = self.requested_outputs … … 97 97 WriteData(fid, prefix, 'data', outputs, 'name', 'md.masstransport.requested_outputs', 'format', 'StringArray') 98 98 99 99 # Process requested outputs 100 outputs = self.requested_outputs ;100 outputs = self.requested_outputs 101 101 indices = [i for i, x in enumerate(outputs) if x == 'default'] 102 102 if len(indices) > 0: 103 103 outputscopy = outputs[0:max(0, indices[0] - 1)] + self.defaultoutputs(md) + outputs[indices[0] + 1:] 104 104 outputs = outputscopy 105 WriteData(fid,prefix,'data',outputs,'name','md.sampling.requested_outputs','format','StringArray') ;105 WriteData(fid,prefix,'data',outputs,'name','md.sampling.requested_outputs','format','StringArray') 106 106 # }}} 107 No newline at end of file -
../trunk-jpl/src/m/solve/solve.py
34 34 - 'Esa' or 'esa' 35 35 - 'Sealevelchange' or 'slc' 36 36 - 'Love' or 'lv' 37 - 'Sampling' or 'smp' 37 38 38 39 Extra options: 39 40 - loadonly : does not solve. only load results … … 79 80 solutionstring = 'EsaSolution' 80 81 elif solutionstring.lower() == 'slc' or solutionstring.lower() == 'sealevelchange': 81 82 solutionstring = 'SealevelchangeSolution' 83 elif solutionstring.lower() == 'smp' or solutionstring.lower() == 'sampling': 84 solutionstring = 'SamplingSolution' 82 85 else: 83 86 raise ValueError("solutionstring '%s' not supported!" % solutionstring) 84 87 options = pairoptions('solutionstring', solutionstring, *args)
Note:
See TracBrowser
for help on using the repository browser.