source:
issm/oecreview/Archive/25834-26739/ISSM-26058-26059.diff
Last change on this file was 26740, checked in by , 3 years ago | |
---|---|
File size: 119.2 KB |
-
../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.m
30 30 31 31 %Initialize surface and basal forcings 32 32 md.smb = initialize(md.smb,md); 33 md.basalforcings 33 md.basalforcings = initialize(md.basalforcings,md); 34 34 35 35 %Initialize ocean forcings and sealevel 36 md.dsl = initialize(md.dsl,md);36 md.dsl = initialize(md.dsl,md); 37 37 38 38 %Deal with other boundary conditions 39 39 if isnan(md.balancethickness.thickening_rate), -
../trunk-jpl/src/m/boundaryconditions/SetIceSheetBC.py
2 2 3 3 4 4 def SetIceSheetBC(md): 5 """ 6 SETICESHEETBC - Create the boundary conditions for stressbalance and thermal models for an IceSheet with no Ice Front 5 """SETICESHEETBC - Create the boundary conditions for stressbalance and thermal models for an IceSheet with no Ice Front 7 6 8 9 7 Usage: 8 md = SetIceSheetBC(md) 10 9 11 10 See also: SETICESHELFBC, SETMARINEICESHEETBC 12 11 """ 13 12 14 13 #node on Dirichlet … … 32 31 33 32 #No ice front -> do nothing 34 33 35 # Create zeros basalforcings and smb34 #Initialize surface and basal forcings 36 35 md.smb.initialize(md) 37 36 md.basalforcings.initialize(md) 38 37 38 #Initialize ocean forcings and sealevel 39 md.dsl.initialize(md) 40 39 41 #Deal with other boundary conditions 40 42 if np.all(np.isnan(md.balancethickness.thickening_rate)): 41 43 md.balancethickness.thickening_rate = np.zeros((md.mesh.numberofvertices)) -
../trunk-jpl/src/m/classes/hydrologydc.py
6 6 7 7 8 8 class hydrologydc(object): 9 """ 10 Hydrologydc class definition 9 """HYDROLOGYDC class definition 11 10 12 11 Usage: 13 12 hydrologydc = hydrologydc() 14 13 """ 15 14 16 15 def __init__(self): # {{{ … … 48 47 self.epl_conductivity = 0 49 48 self.eplflip_lock = 0 50 49 51 #set defaults52 50 self.setdefaultparameters() 53 51 # }}} 54 52 55 53 def __repr__(self): # {{{ 54 # TODO: 55 # - Convert all formatting to calls to <string>.format (see any 56 # already converted <class>.__repr__ method for examples) 57 # 56 58 string = ' hydrology Dual Porous Continuum Equivalent parameters:' 57 59 string = ' - general parameters' 58 60 string = "%s\n%s" % (string, fielddisplay(self, 'water_compressibility', 'compressibility of water [Pa^ - 1]')) -
../trunk-jpl/src/m/classes/hydrologytws.m
23 23 end % }}} 24 24 function list = defaultoutputs(self,md) % {{{ 25 25 list = {''}; 26 end % }}} 26 end % }}} 27 27 28 28 function self = setdefaultparameters(self) % {{{ 29 29 self.requested_outputs = {'default'}; … … 45 45 function marshall(self,prefix,md,fid) % {{{ 46 46 WriteData(fid,prefix,'name','md.hydrology.model','data',2,'format','Integer'); 47 47 WriteData(fid,prefix,'object',self,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts); 48 49 50 51 52 53 54 48 outputs = self.requested_outputs; 49 pos = find(ismember(outputs,'default')); 50 if ~isempty(pos), 51 outputs(pos) = []; %remove 'default' from outputs 52 outputs = [outputs defaultoutputs(self,md)]; %add defaults 53 end 54 WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray'); 55 55 end % }}} 56 56 function savemodeljs(self,fid,modelname) % {{{ 57 57 58 58 writejs1Darray(fid,[modelname '.hydrology.spcwatercolumn'],self.spcwatercolumn); 59 59 60 60 end % }}} -
../trunk-jpl/src/m/classes/hydrologytws.py
1 import numpy as np 2 3 from structtoobj import structtoobj 4 5 class hydrologytws(object): 6 """HYDROLOGYTWS class definition 7 8 Usage: 9 hydrologytws = hydrologytws() 10 """ 11 12 def __init__(self): # {{{ 13 self.spcwatercolumn = np.nan 14 self.requested_outputs = np.nan 15 16 nargs = len(args) 17 if nargs == 0: 18 self.setdefaultparameters() 19 elif nargs == 1: 20 self = structtoobj(self, args[0]) 21 else: 22 raise RuntimeError('constructor not supported') 23 #}}} 24 25 def __repr__(self): # {{{ 26 s = ' hydrologytws solution parameters:\n' 27 s += '{}\n'.format(fielddisplay(self, 'spcwatercolumn', 'water thickness constraints (NaN means no constraint) [m]')) 28 s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested')) 29 return s 30 #}}} 31 32 def defaultoutputs(self, md): # {{{ 33 return [''] 34 #}}} 35 36 def setdefaultparameters(self): # {{{ 37 self.requested_outputs = ['defualt'] 38 return self 39 #}}} 40 41 def extrude(self, md): # {{{ 42 return self 43 #}}} 44 45 def checkconsistency(self, md, solution, analyses): # {{{ 46 # Early return 47 if 'HydrologyTwsAnalysis' not in analyses: 48 return 49 md = checkfield(md, 'fieldname', 'hydrology.spcwatercolumn', 'Inf', 1, 'timeseries', 1) 50 #}}} 51 52 def marshall(self, prefix, md, fid): # {{{ 53 WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 2, 'format', 'Integer') 54 WriteData(fid, prefix, 'object', self, 'fieldname', 'spcwatercolumn', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts) 55 outputs = self.requested_outputs 56 pos = find(ismember(outputs,'default')) 57 if not len(pos), 58 outputs[pos] = []; # remove 'default' from outputs 59 outputs.extend(defaultoutputs(self, md)) # add defaults 60 end 61 WriteData(fid, prefix, 'data', outputs, 'name', 'md.hydrology.requested_outputs', 'format', 'StringArray') 62 # }}} 63 64 -
../trunk-jpl/src/m/classes/matenhancedice.m
5 5 6 6 classdef matenhancedice 7 7 properties (SetAccess=public) 8 rho_ice = 0.;9 rho_water = 0.;10 rho_freshwater = 0.;11 mu_water = 0.;12 heatcapacity = 0.;13 latentheat = 0.;14 thermalconductivity = 0.;15 temperateiceconductivity = 0.;8 rho_ice = 0.; 9 rho_water = 0.; 10 rho_freshwater = 0.; 11 mu_water = 0.; 12 heatcapacity = 0.; 13 latentheat = 0.; 14 thermalconductivity = 0.; 15 temperateiceconductivity = 0.; 16 16 effectiveconductivity_averaging = 0.; 17 meltingpoint = 0.;18 beta = 0.;19 mixed_layer_capacity = 0.;20 thermal_exchange_velocity = 0.;21 rheology_E = NaN;22 rheology_B = NaN;23 rheology_n = NaN;24 rheology_law = '';17 meltingpoint = 0.; 18 beta = 0.; 19 mixed_layer_capacity = 0.; 20 thermal_exchange_velocity = 0.; 21 rheology_E = NaN; 22 rheology_B = NaN; 23 rheology_n = NaN; 24 rheology_law = ''; 25 25 26 % slr27 earth_density = 0;26 %SLC 27 earth_density = 0; 28 28 29 29 end 30 30 methods -
../trunk-jpl/src/m/classes/matestar.m
5 5 6 6 classdef matestar 7 7 properties (SetAccess=public) 8 rho_ice = 0.;9 rho_water = 0.;10 rho_freshwater = 0.;11 mu_water = 0.;12 heatcapacity = 0.;13 latentheat = 0.;14 thermalconductivity = 0.;15 temperateiceconductivity = 0.;8 rho_ice = 0.; 9 rho_water = 0.; 10 rho_freshwater = 0.; 11 mu_water = 0.; 12 heatcapacity = 0.; 13 latentheat = 0.; 14 thermalconductivity = 0.; 15 temperateiceconductivity = 0.; 16 16 effectiveconductivity_averaging = 0; 17 meltingpoint = 0.;18 beta = 0.;19 mixed_layer_capacity = 0.;20 thermal_exchange_velocity = 0.;21 rheology_B = NaN;22 rheology_Ec = NaN;23 rheology_Es = NaN;24 rheology_law = '';17 meltingpoint = 0.; 18 beta = 0.; 19 mixed_layer_capacity = 0.; 20 thermal_exchange_velocity = 0.; 21 rheology_B = NaN; 22 rheology_Ec = NaN; 23 rheology_Es = NaN; 24 rheology_law = ''; 25 25 26 26 %slc 27 earth_density = 0;27 earth_density = 0; 28 28 29 29 end 30 30 methods -
../trunk-jpl/src/m/classes/matice.py
7 7 8 8 9 9 class matice(object): 10 ''' 11 MATICE class definition 10 """MATICE class definition 12 11 13 12 Usage: 14 13 matice = matice() 15 '''14 """ 16 15 17 16 def __init__(self): #{{{ 18 17 self.rho_ice = 0. … … 32 31 self.rheology_n = np.nan 33 32 self.rheology_law = '' 34 33 35 #giaivins 36 self.lithosphere_shear_modulus = 0. 37 self.lithosphere_density = 0. 38 self.mantle_shear_modulus = 0. 39 self.mantle_density = 0. 40 41 #slr 34 #slc 42 35 self.earth_density = 0 43 36 self.setdefaultparameters() 44 37 #}}} … … 61 54 s = "%s\n%s" % (s, fielddisplay(self, "rheology_B", "flow law parameter [Pa s^(1/n)]")) 62 55 s = "%s\n%s" % (s, fielddisplay(self, "rheology_n", "Glen's flow law exponent")) 63 56 s = "%s\n%s" % (s, fielddisplay(self, "rheology_law", "law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', or 'NyeH2O'")) 64 s = "%s\n%s" % (s, fielddisplay(self, "lithosphere_shear_modulus", "Lithosphere shear modulus [Pa]"))65 s = "%s\n%s" % (s, fielddisplay(self, "lithosphere_density", "Lithosphere density [g/cm^-3]"))66 s = "%s\n%s" % (s, fielddisplay(self, "mantle_shear_modulus", "Mantle shear modulus [Pa]"))67 s = "%s\n%s" % (s, fielddisplay(self, "mantle_density", "Mantle density [g/cm^-3]"))68 57 s = "%s\n%s" % (s, fielddisplay(self, "earth_density", "Mantle density [kg/m^-3]")) 69 58 70 59 return s … … 107 96 #available: none, paterson and arrhenius 108 97 self.rheology_law = 'Paterson' 109 98 110 # GIA: 111 self.lithosphere_shear_modulus = 6.7e10 # (Pa) 112 self.lithosphere_density = 3.32 # (g/cm^-3) 113 self.mantle_shear_modulus = 1.45e11 # (Pa) 114 self.mantle_density = 3.34 # (g/cm^-3) 99 # Rheology for ice 100 self.rheology_B = 2.1 * 1e8 101 self.rheology_n = 3 115 102 116 103 # SLR 117 104 self.earth_density = 5512 # average density of the Earth, (kg/m^3) … … 118 105 #}}} 119 106 120 107 def checkconsistency(self, md, solution, analyses): #{{{ 121 if solution != 'SealevelriseSolution': 108 if solution == 'TransientSolution' and md.transient.isslc: 109 md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', [1]) 110 else: 122 111 md = checkfield(md, 'fieldname', 'materials.rho_ice', '>', 0) 123 112 md = checkfield(md, 'fieldname', 'materials.rho_water', '>', 0) 124 113 md = checkfield(md, 'fieldname', 'materials.rho_freshwater', '>', 0) 125 114 md = checkfield(md, 'fieldname', 'materials.mu_water', '>', 0) 126 115 md = checkfield(md, 'fieldname', 'materials.rheology_B', '>', 0, 'universal', 1, 'NaN', 1, 'Inf', 1) 127 md = checkfield(md, 'fieldname', 'materials.rheology_n', '>', 0, ' size', [md.mesh.numberofelements])116 md = checkfield(md, 'fieldname', 'materials.rheology_n', '>', 0, 'universal',1, 'NaN', 1, 'Inf', 1) 128 117 md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval', 'NyeCO2', 'NyeH2O']) 129 md = checkfield(md, 'fieldname','materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2])118 md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2]) 130 119 131 if 'GiaAnalysis' in analyses:132 md = checkfield(md, 'fieldname', 'materials.lithosphere_shear_modulus', '>', 0, 'numel', [1])133 md = checkfield(md, 'fieldname', 'materials.lithosphere_density', '>', 0, 'numel', [1])134 md = checkfield(md, 'fieldname', 'materials.mantle_shear_modulus', '>', 0, 'numel', [1])135 md = checkfield(md, 'fieldname', 'materials.mantle_density', '>', 0, 'numel', [1])136 137 if 'SealevelriseAnalysis' in analyses:138 md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', [1])139 140 120 return md 141 121 #}}} 142 122 … … 158 138 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_B', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts) 159 139 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_n', 'format', 'DoubleMat', 'mattype', 2) 160 140 WriteData(fid, prefix, 'data', self.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String') 161 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_shear_modulus', 'format', 'Double')162 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_density', 'format', 'Double', 'scale', 10.**3.)163 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_shear_modulus', 'format', 'Double')164 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_density', 'format', 'Double', 'scale', 10.**3.)165 141 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double') 166 142 #}}} -
../trunk-jpl/src/m/classes/surfaceload.m
19 19 end 20 20 end % }}} 21 21 function self = setdefaultparameters(self) % {{{ 22 22 23 23 icethicknesschange=[]; 24 24 waterheightchange=[]; 25 25 otherchange=[]; 26 26 27 27 end % }}} 28 28 function md = checkconsistency(self,md,solution,analyses) % {{{ 29 29 30 30 if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.transient.isslc==0), 31 31 return; -
../trunk-jpl/src/m/classes/transient.m
7 7 properties (SetAccess=public) 8 8 issmb = 0; 9 9 ismasstransport = 0; 10 isoceantransport 10 isoceantransport = 0; 11 11 isstressbalance = 0; 12 12 isthermal = 0; 13 13 isgroundingline = 0; … … 15 15 isdamageevolution = 0; 16 16 ismovingfront = 0; 17 17 ishydrology = 0; 18 18 issampling = 0; 19 19 isslc = 0; 20 20 amr_frequency = 0; 21 21 isoceancoupling = 0; … … 43 43 self.isdamageevolution = 0; 44 44 self.ismovingfront =0; 45 45 self.ishydrology = 0; 46 46 self.issampling = 0; 47 47 self.isslc = 0; 48 48 self.isoceancoupling = 0; 49 49 self.amr_frequency = 0; … … 64 64 self.isdamageevolution = 0; 65 65 self.ismovingfront = 0; 66 66 self.ishydrology = 0; 67 67 self.issampling = 0; 68 68 self.isslc = 0; 69 69 self.isoceancoupling = 0; 70 70 self.amr_frequency = 0; … … 97 97 md = checkfield(md,'fieldname','transient.requested_outputs','stringrow',1); 98 98 md = checkfield(md,'fieldname','transient.isslc','numel',[1],'values',[0 1]); 99 99 md = checkfield(md,'fieldname','transient.isoceancoupling','numel',[1],'values',[0 1]); 100 100 md = checkfield(md,'fieldname','transient.issampling','numel',[1],'values',[0 1]); 101 101 md = checkfield(md,'fieldname','transient.amr_frequency','numel',[1],'>=',0,'NaN',1,'Inf',1); 102 102 103 103 if (~strcmp(solution,'TransientSolution') & md.transient.iscoupling==1), … … 120 120 fielddisplay(self,'isdamageevolution','indicates whether damage evolution is used in the transient'); 121 121 fielddisplay(self,'ismovingfront','indicates whether a moving front capability is used in the transient'); 122 122 fielddisplay(self,'ishydrology','indicates whether an hydrology model is used'); 123 123 fielddisplay(self,'issampling','indicates whether sampling is used in the transient') 124 124 fielddisplay(self,'isslc','indicates whether a sea-level change solution is used in the transient'); 125 125 fielddisplay(self,'isoceancoupling','indicates whether a coupling with an ocean model is used in the transient'); 126 126 fielddisplay(self,'amr_frequency','frequency at which mesh is refined in simulations with multiple time_steps'); … … 138 138 WriteData(fid,prefix,'object',self,'fieldname','isdamageevolution','format','Boolean'); 139 139 WriteData(fid,prefix,'object',self,'fieldname','ishydrology','format','Boolean'); 140 140 WriteData(fid,prefix,'object',self,'fieldname','ismovingfront','format','Boolean'); 141 141 WriteData(fid,prefix,'object',self,'fieldname','issampling','format','Boolean'); 142 142 WriteData(fid,prefix,'object',self,'fieldname','isslc','format','Boolean'); 143 143 WriteData(fid,prefix,'object',self,'fieldname','isoceancoupling','format','Boolean'); 144 144 WriteData(fid,prefix,'object',self,'fieldname','amr_frequency','format','Integer'); … … 164 164 writejsdouble(fid,[modelname '.trans.isdamageevolution'],self.isdamageevolution); 165 165 writejsdouble(fid,[modelname '.trans.ismovingfront'],self.ismovingfront); 166 166 writejsdouble(fid,[modelname '.trans.ishydrology'],self.ishydrology); 167 167 writejsdouble(fid,[modelname '.trans.issampling'],self.issampling); 168 168 writejsdouble(fid,[modelname '.trans.isslc'],self.isslc); 169 169 writejsdouble(fid,[modelname '.trans.isoceancoupling'],self.isoceancoupling); 170 170 writejsdouble(fid,[modelname '.trans.amr_frequency'],self.amr_frequency); -
../trunk-jpl/src/m/consistency/ismodelselfconsistent.m
2 2 %ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem. 3 3 % 4 4 % Usage: 5 % ismodelselfconsistent(md) ,5 % ismodelselfconsistent(md); 6 6 7 7 %initialize consistency as true 8 8 md.private.isconsistent=true; -
../trunk-jpl/src/m/plot/radarpower.py
1 def solveslm(slm, solutionstringi, *args): 2 """RADARPOWER - overlay a power radar image on an existing mesh 3 4 This routine will overlay a power radar image on an existing mesh. 5 The power amplitude will be output to vel for now. 6 In the future, think about a field to hold this value. 7 8 Usage: 9 md=radarpower(md,options); 10 md=radarpower(md) 11 12 TODO: 13 - Translate from MATLAB API as we bring Python plotting capabilities online 14 """ 15 16 return md -
../trunk-jpl/src/m/solve/solveslm.m
1 1 function slm=solveslm(slm,solutionstringi,varargin) 2 %SOLVESL R- apply solution sequence for this sealevel model2 %SOLVESLM - apply solution sequence for this sealevel model 3 3 % 4 4 % Usage: 5 5 % slm=solve(slm,solutionstring,varargin) … … 42 42 slm.private.solution=solutionstring; 43 43 cluster=slm.cluster; 44 44 batch=0; 45 %now, go through icecaps, glacie s and earth, and upload all the data independently:45 %now, go through icecaps, glaciers and earth, and upload all the data independently: 46 46 disp('solving ice caps first'); 47 47 for i=1:length(slm.icecaps), 48 48 slm.icecaps{i}=solve(slm.icecaps{i},solutionstringi,'batch','yes'); … … 50 50 disp('solving earth now'); 51 51 slm.earth=solve(slm.earth,solutionstringi,'batch','yes'); 52 52 53 %Firs , build a runtime name that is unique53 %First, build a runtime name that is unique 54 54 c=clock; 55 55 slm.private.runtimename=sprintf('%s-%02i-%02i-%04i-%02i-%02i-%02i-%i',slm.miscellaneous.name,c(2),c(3),c(1),c(4),c(5),floor(c(6)),feature('GetPid')); 56 56 -
../trunk-jpl/src/m/solve/solveslm.py
1 from datetime import datetime 2 import os 3 4 import numpy as np 5 6 from loadresultsfromcluster import loadresultsfromcluster 7 from pairoptions import pairoptions 8 from waitonlock import waitonlock 9 10 11 def solveslm(slm, solutionstringi, *args): 12 """SOLVESLM - apply solution sequence for this sealevel model 13 14 Usage: 15 slm=solve(slm,solutionstring,varargin) 16 where varargin is a lit of paired arguments of string OR enums 17 18 solution types available comprise: 19 - 'Transient' 20 21 extra options: 22 23 Examples: 24 slm=solve(slm,'Transient'); 25 """ 26 27 # Recover and process solve options 28 if solutionstringi.lower() == 'tr' or solutionstringi.lower() == 'transient': 29 solutionstring = 'TransientSolution' 30 else: 31 raise RuntimeError('solutionstring {} not supported!'.format(solutionstringi)) 32 33 # Default settings for debugging 34 valgrind = 0 35 #slm.cluster.interactive = 0 36 #valgrind = 1 37 38 # Check consistency 39 slm.checkconsistency(solutionstring) 40 41 # Process options 42 options = pairoptions('solutionstring', solutionstring, *args) 43 44 # Make sure we request sum of cluster processors 45 totalnp = 0 46 for i in range(len(slm.icecaps)): 47 totalnp = totalnp + slm.icecaps[i].cluster.np 48 totalnp = totalnp + slm.earth.cluster.np 49 if totalnp != slm.cluster.np: 50 raise RuntimeError('sum of all icecaps and earch cluster processors requestes should be equal to slm.cluster.np') 51 52 # Recover some fields 53 slm.private.solution = solutionstring 54 cluster = slm.cluster 55 batch = 0 56 # Now, go through icecaps, glaciers and earth, and upload all the data independently 57 print('solving ice caps first') 58 for i in range(len(slm.icecaps)): 59 slm.icecaps[i] = solve(slm.icecaps[i], solutionastringi,'batch','yes') 60 print('solving earth now') 61 slm.earth = solve(slm.earth, solutionstringi, 'batch', 'yes') 62 63 # First, build a runtime name that is unique 64 c = datetime.now() 65 md.private.runtimename = "%s-%02i-%02i-%04i-%02i-%02i-%02i-%i" % (md.miscellaneous.name, c.month, c.day, c.year, c.hour, c.minute, c.second, os.getpid()) 66 67 # Write all input files 68 privateruntimenames = [] 69 miscellaneousnames = [] 70 nps = [] 71 for i in range(len(slm.icecaps)): 72 privateruntimenames.append(slm.icecaps[i],private.runtimename) 73 miscellaneousnames.append(slm.earth.miscellaneous.name) 74 nps.append(slm.earth.cluster.np) 75 76 BuildQueueScriptMultipleModels(cluster, slm.private.runtimename, slm.miscellaneous.name, slm.private.solution, valgrind, privateruntimenames, miscellaneousnames, nps) 77 78 # Upload all required files, given that each individual solution for icecaps and earth model already did 79 filelist = [slm.miscellaneous.name + '.queue'] 80 UploadQueueJob(cluster, slm.miscellaneous.name, slm.private.runtimename, filelist) 81 82 # Launch queue job 83 LaunchQueueJob(cluster, slm.miscellaneous.name, slm.private.runtimename, filelist, '', batch) 84 85 # Wait on lock 86 if slm.settings.waitonlock > 0: 87 islock = waitonlock(slm) 88 if islock == 0: # no results to be loaded 89 print('The results must be loaded manually with md = loadresultsfromcluster(md).') 90 else: # load results 91 if slm.verbose.solution: 92 print('loading results from cluster') 93 slm = loadresultsfromcluster(slm) 94 95 return slm -
../trunk-jpl/src/m/classes/dsl.m
6 6 classdef dsl 7 7 properties (SetAccess=public) 8 8 9 global_average_thermosteric_sea_level; % corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m)10 sea_surface_height_above_geoid; % corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable (in m)11 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!)9 global_average_thermosteric_sea_level; %Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m). 10 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). 11 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!). 12 12 13 13 end 14 14 methods … … 50 50 function disp(self) % {{{ 51 51 52 52 disp(sprintf(' dsl parameters:')); 53 fielddisplay(self,'global_average_thermosteric_sea_level',' corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m)');54 fielddisplay(self,'sea_surface_height_above_geoid',' corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally quantity (in m)');55 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)');53 fielddisplay(self,'global_average_thermosteric_sea_level','Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).'); 54 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).'); 55 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!).'); 56 56 57 57 end % }}} 58 58 function marshall(self,prefix,md,fid) % {{{ -
../trunk-jpl/src/m/classes/dsl.py
14 14 """ 15 15 16 16 def __init__(self): #{{{ 17 self.global_average_thermosteric_sea_level_change = 0 #corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable global rate (mm/yr) 18 self.sea_surface_height_change_above_geoid = float('NaN') #corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr) 19 self.sea_water_pressure_change_at_sea_floor = float('NaN') #corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable rate (in Pa/yr) 20 self.compute_fingerprints = 0; #do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid 17 self.global_average_thermosteric_sea_level = np.nan # Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m). 18 self.sea_surface_height_above_geoid = np.nan # Corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable quantity (in m). 19 self.sea_water_pressure_at_sea_floor = np.nan # Corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable quantity (in m equivalent, not in Pa!). 21 20 #}}} 22 21 23 22 def __repr__(self): #{{{ 24 23 s = ' dsl parameters:\n' 25 s += '{}\n'.format(fielddisplay(self, 'global_average_thermosteric_sea_level_change', 'corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable global rate (mm/yr)')) 26 s += '{}\n'.format(fielddisplay(self, 'sea_surface_height_change_above_geoid', 'corresponds to zos field in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr)')) 27 s += '{}\n'.format(fielddisplay(self, 'sea_water_pressure_change_at_sea_floor', 'corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable rate (in Pa/yr)')) 28 s += '{}\n'.format(fielddisplay(self, 'compute_fingerprints', 'do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid')) 24 s += '{}\n'.format(fielddisplay(self, 'global_average_thermosteric_sea_level', 'Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m).')) 25 s += '{}\n'.format(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).')) 26 s += '{}\n'.format(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!).')) 29 27 return s 30 28 #}}} 31 29 32 30 def extrude(self, md): #{{{ 33 self.sea_surface_height_ change_above_geoid = project3d(md, 'vector', self.sea_surface_height_change_above_geoid, 'type', 'node')34 self.sea_water_pressure_ change_at_sea_floor = project3d(md, 'vector', self.sea_water_pressure_change_at_sea_floor, 'type', 'node')31 self.sea_surface_height_above_geoid = project3d(md, 'vector', self.sea_surface_height_above_geoid, 'type', 'node') 32 self.sea_water_pressure_at_sea_floor = project3d(md, 'vector', self.sea_water_pressure_at_sea_floor, 'type', 'node') 35 33 return self 36 34 #}}} 37 35 … … 41 39 42 40 def checkconsistency(self, md, solution, analyses): #{{{ 43 41 # Early return 44 if 'SealevelriseAnalysis' not in analyses:42 if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc): 45 43 return md 46 if solution == 'TransientSolution' and md.transient.isslc == 0: 47 return md 48 md = checkfield(md, 'fieldname', 'dsl.global_average_thermosteric_sea_level_change', 'NaN', 1, 'Inf', 1) 49 md = checkfield(md, 'fieldname', 'dsl.sea_surface_height_change_above_geoid', 'NaN', 1, 'Inf', 1, 'timeseries', 1) 50 md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_change_at_sea_floor', 'NaN', 1, 'Inf', 1, 'timeseries', 1) 51 md = checkfield(md, 'fieldname', 'dsl.compute_fingerprints', 'NaN', 1, 'Inf', 1, 'values', [0, 1]) 52 if self.compute_fingerprints: 53 # Check if geodetic flag of slr is on 54 if not md.slr.geodetic: 55 raise RuntimeError('DSL checkconsistency error message: if bottom pressure fingerprints computations are requested, slr class should have geodetic flag on') 44 45 md = checkfield(md, 'fieldname', 'dsl.global_average_thermosteric_sea_level', 'NaN', 1, 'Inf', 1) 46 md = checkfield(md, 'fieldname', 'dsl.sea_surface_height_above_geoid', 'NaN', 1, 'Inf', 1, 'timeseries', 1) 47 md = checkfield(md, 'fieldname', 'dsl.sea_water_pressure_at_sea_floor', 'NaN', 1, 'Inf', 1, 'timeseries', 1) 48 49 if md.solidearth.settings.compute_bp_grd: 50 md = checkfield(md, 'fieldname', dsl.sea_water_pressure_at_sea_floor, 'empty', 1) 51 56 52 return md 57 53 # }}} 58 54 … … 59 55 def marshall(self, prefix, md, fid): #{{{ 60 56 yts = md.constants.yts 61 57 WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 1, 'format', 'Integer') 62 WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'compute_fingerprints', 'format', 'Integer') 63 WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'global_average_thermosteric_sea_level_change', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 1+1, 'yts', md.constants.yts, 'scale', 1e-3/md.constants.yts) 64 WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'sea_water_pressure_change_at_sea_floor', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices+1, 'yts', md.constants.yts, 'scale', 1e-3/md.constants.yts) 65 WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'sea_surface_height_change_above_geoid', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices+1, 'yts', md.constants.yts) 58 WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'DoubleMat', 'mattype', 2, 'timeserieslength', 1+1, 'yts', md.constants.yts, 'scale', 1e-3/md.constants.yts) # mattype 2, because we are sending a GMSL value identical everywhere on each element. 59 WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices+1, 'yts', md.constants.yts, 'scale', 1e-3/md.constants.yts) # mattype 1 because we specify DSL at vertex locations. 60 WriteData(fid, prefix, 'object', self, 'class', 'dsl', 'fieldname', 'sea_surface_height_above_geoid', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices+1, 'yts', md.constants.yts) # mattype 1 because we specify bottom pressure at vertex locations. 66 61 # }}} -
../trunk-jpl/src/m/classes/dslmme.m
7 7 properties (SetAccess=public) 8 8 9 9 modelid; %index into the multi-model ensemble, determine which field will be used. 10 global_average_thermosteric_sea_level; % corresponds to zostoga fields in CMIP5 archives. Specified as a temporallyquantity (in m) for each ensemble.11 sea_surface_height_above_geoid; % corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally quantity (in m) for each ensemble12 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!) for each ensemble10 global_average_thermosteric_sea_level; %Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble. 11 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) for each ensemble. 12 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!) for each ensemble. 13 13 14 14 end 15 15 methods … … 52 52 53 53 disp(sprintf(' dsl mme parameters:')); 54 54 fielddisplay(self,'modelid','index into the multi-model ensemble, determine which field will be used.'); 55 fielddisplay(self,'global_average_thermosteric_sea_level',' corresponds to zostoga fieldsin CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.');56 fielddisplay(self,'sea_surface_height_above_geoid',' corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporallyquantity (in m) for each ensemble.');57 fielddisplay(self,'sea_water_pressure_at_sea_floor',' corresponds to bpo fields in CMIP5 archives. Specified as a spatio-temporally quantity (in m) for each ensemble.');55 fielddisplay(self,'global_average_thermosteric_sea_level','Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.'); 56 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) for each ensemble.'); 57 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!) for each ensemble.'); 58 58 end % }}} 59 59 function marshall(self,prefix,md,fid) % {{{ 60 60 -
../trunk-jpl/src/m/classes/dslmme.py
14 14 """ 15 15 16 16 def __init__(self, *args): #{{{ 17 self.modelid = 0 #index into the multi-model ensemble 18 self.global_average_thermosteric_sea_level_change = [] #corresponds to zostoga fields in CMIP5 archives. Specified as a temporally variable global rate (mm/yr) for each ensemble. 19 self.sea_surface_height_change_above_geoid = [] #corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr) for each ensemble 20 self.sea_water_pressure_change_at_sea_floor = [] #corresponds to bpo fields in CMIP5 archives. Specified as a spatio-temporally variable rate (in mm/yr equivalent, not in Pa/yr!) for each ensemble 21 self.compute_fingerprints = 0 #corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr) for each ensemble 22 23 nargin = len(args) 17 self.modelid = 0 # Index into the multi-model ensemble 18 self.global_average_thermosteric_sea_level = [] # Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble. 19 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) for each ensemble. 20 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!) for each ensemble. 24 21 25 if nargin == 0: 22 nargs = len(args) 23 24 if nargs == 0: 26 25 self.setdefaultparameters() 27 26 else: 28 27 raise Exception('constructor not supported') … … 31 30 def __repr__(self): # {{{ 32 31 s = ' dsl mme parameters:\n' 33 32 s += '{}\n'.format(fielddisplay(self, 'modelid', 'index into the multi-model ensemble, determines which field will be used.')) 34 s += '{}\n'.format(fielddisplay(self, 'global_average_thermosteric_sea_level_change', 'corresponds to zostoga fields in CMIP5 archives. Specified as a temporally variable global rate (mm/yr) for each ensemble.')) 35 s += '{}\n'.format(fielddisplay(self, 'sea_surface_height_change_above_geoid', 'corresponds to zos fields in CMIP5 archives. Spatial average is 0. Specified as a spatio-temporally variable rate (mm/yr) for each ensemble.')) 36 s += '{}\n'.format(fielddisplay(self, 'sea_water_pressure_change_at_sea_floor', 'corresponds to bpo fields in CMIP5 archives. Specified as a spatio-temporally variable rate (in mm/yr) for each ensemble.')) 37 s += '{}\n'.format(fielddisplay(self, 'compute_fingerprints', 'do we use the sea water pressure change to compute fingerprints and correct sea_surface_height_change_above_geoid')) 33 s += '{}\n'.format(fielddisplay(self, 'global_average_thermosteric_sea_level', 'Corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable quantity (in m) for each ensemble.')) 34 s += '{}\n'.format(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) for each ensemble.')) 35 s += '{}\n'.format(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!) for each ensemble.')) 38 36 return s 39 37 #}}} 40 38 … … 43 41 #}}} 44 42 45 43 def checkconsistency(self, md, solution, analyses): # {{{ 46 if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslr): 44 # Early return 45 if ('SealevelriseAnalysis' not in analyses) or (solution == 'TransientSolution' and not md.transient.isslc): 47 46 return md 48 for i in range(len(self.global_average_thermosteric_sea_level_change)): 49 md = checkfield(md, 'field', self.global_average_thermosteric_sea_level_change[i], 'NaN', 1, 'Inf', 1) 50 md = checkfield(md, 'field', self.sea_surface_height_change_above_geoid[i], 'NaN', 1, 'Inf', 1, 'timeseries', 1) 51 md = checkfield(md, 'field', self.sea_water_pressure_change_at_sea_floor[i], 'NaN', 1, 'Inf', 1, 'timeseries', 1) 52 md = checkfield(md, 'field', self.modelid, 'NaN', 1, 'Inf', 1, '>=', 1, '<=',len(self.global_average_thermosteric_sea_level_change)) 53 if self.compute_fingerprints: 54 #check geodetic flag of slr is on 55 if not md.solidearth.settings.computesealevelchange: 56 raise Exception('DSL checkconsistency error message: if bottom pressure fingerprints computations are requested, slr class should have geodetic flag on') 47 48 for i in range(len(self.global_average_thermosteric_sea_level)): 49 md = checkfield(md, 'field', self.global_average_thermosteric_sea_level[i], 'NaN', 1, 'Inf', 1) 50 md = checkfield(md, 'field', self.sea_surface_height_above_geoid[i], 'NaN', 1, 'Inf', 1, 'timeseries', 1) 51 md = checkfield(md, 'field', self.sea_water_pressure_at_sea_floor[i], 'NaN', 1, 'Inf', 1, 'timeseries', 1) 52 md = checkfield(md, 'field', self.modelid, 'NaN', 1, 'Inf', 1, '>=', 1, '<=',len(self.global_average_thermosteric_sea_level)) 53 54 if self.solidearth.settings.compute_bp_grd: 55 md = checkfield(md, 'field', self.sea_water_pressure_at_sea_floor, 'empty', 1) 56 57 57 return md 58 58 #}}} 59 59 60 60 def marshall(self, prefix, md, fid): #{{{ 61 61 WriteData(fid, prefix, 'name', 'md.dsl.model', 'data', 2, 'format', 'Integer') 62 WriteData(fid, prefix, 'object', self, 'fieldname', 'compute_fingerprints', 'format', 'Integer')63 62 WriteData(fid, prefix, 'object', self, 'fieldname', 'modelid', 'format', 'Double') 64 WriteData(fid, prefix, 'name', 'md.dsl.nummodels', 'data', len(self.global_average_thermosteric_sea_level _change), 'format', 'Integer')65 WriteData(fid, prefix, 'object', self, 'fieldname', 'global_average_thermosteric_sea_level _change', 'format', 'MatArray', 'timeseries', 1, 'timeserieslength', 2, 'yts', md.constants.yts, 'scale', 1e-3 / md.constants.yts)66 WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_water_pressure_ change_at_sea_floor', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts, 'scale', 1e-3)67 WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_surface_height_ change_above_geoid', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts, 'scale', 1e-3 / md.constants.yts)63 WriteData(fid, prefix, 'name', 'md.dsl.nummodels', 'data', len(self.global_average_thermosteric_sea_level), 'format', 'Integer') 64 WriteData(fid, prefix, 'object', self, 'fieldname', 'global_average_thermosteric_sea_level', 'format', 'MatArray', 'timeseries', 1, 'timeserieslength', 2, 'yts', md.constants.yts, 'scale', 1e-3 / md.constants.yts) 65 WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_water_pressure_at_sea_floor', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts, 'scale', 1e-3) 66 WriteData(fid, prefix, 'object', self, 'fieldname', 'sea_surface_height_above_geoid', 'format', 'MatArray', 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts, 'scale', 1e-3 / md.constants.yts) 68 67 #}}} 69 68 70 69 def extrude(self, md): #{{{ 71 for i in range(len(self.global_average_thermosteric_sea_level _change)):72 self.sea_surface_height_ change_above_geoid[i] = project3d(md, 'vector', self.self.sea_surface_height_change_above_geoid[i], 'type', 'node', 'layer', 1)73 self.sea_water_pressure_ change_at_sea_floor[i] = project3d(md, 'vector', self.sea_water_pressure_change_at_sea_floor[i], 'type', 'node', 'layer', 1)70 for i in range(len(self.global_average_thermosteric_sea_level)): 71 self.sea_surface_height_above_geoid[i] = project3d(md, 'vector', self.self.sea_surface_height_above_geoid[i], 'type', 'node', 'layer', 1) 72 self.sea_water_pressure_at_sea_floor[i] = project3d(md, 'vector', self.sea_water_pressure_at_sea_floor[i], 'type', 'node', 'layer', 1) 74 73 75 74 return self 76 75 #}}} -
../trunk-jpl/src/m/classes/fourierlove.m
79 79 end 80 80 81 81 %need 'litho' material: 82 if ~isa(md.materials,'materials') 82 if ~isa(md.materials,'materials') | ~sum(strcmpi(md.materials.nature,'litho')) 83 83 error('Need a ''litho'' material to run a Fourier Love number analysis'); 84 else85 if ~sum(strcmpi(md.materials.nature,'litho')),86 error('Need a ''litho'' material to run a Fourier Love number analysis');87 end88 84 end 89 85 90 86 end % }}} -
../trunk-jpl/src/m/classes/fourierlove.py
4 4 5 5 6 6 class fourierlove(object): 7 """ 8 Fourier Love Number class definition 7 """FOURIERLOVE - Fourier Love Number class definition 9 8 10 11 9 Usage: 10 fourierlove = fourierlove() 12 11 """ 13 12 def __init__(self): # {{{ 14 13 self.nfreq = 0 … … 22 21 self.love_kernels = 0 23 22 self.forcing_type = 0 24 23 25 #set defaults26 24 self.setdefaultparameters() 27 25 #}}} 28 26 29 27 def __repr__(self): # {{{ 28 # TODO: 29 # - Convert all formatting to calls to <string>.format (see any 30 # already converted <class>.__repr__ method for examples) 31 # 30 32 string = ' Fourier Love class:' 31 33 string = "%s\n%s" % (string, fielddisplay(self, 'nfreq', 'number of frequencies sampled (default 1, elastic) [Hz]')) 32 34 string = "%s\n%s" % (string, fielddisplay(self, 'frequencies', 'frequencies sampled (convention defaults to 0 for the elastic case) [Hz]')) … … 75 77 #}}} 76 78 77 79 def checkconsistency(self, md, solution, analyses): # {{{ 80 if 'LoveAnalysis' not in analyses: 81 return md 78 82 md = checkfield(md, 'fieldname', 'love.nfreq', 'NaN', 1, 'Inf', 1, 'numel', [1], '>', 0) 79 83 md = checkfield(md, 'fieldname', 'love.frequencies', 'NaN', 1, 'Inf', 1, 'numel', [md.love.nfreq]) 80 84 md = checkfield(md, 'fieldname', 'love.sh_nmax', 'NaN', 1, 'Inf', 1, 'numel', [1], '>', 0) … … 88 92 if md.love.sh_nmin <= 1 and md.love.forcing_type == 9: 89 93 raise RuntimeError("Degree 1 not supported for Volumetric Potential forcing. Use sh_min >= 2 for this kind of calculation.") 90 94 95 # need 'litho' material 96 if not hasattr(md.materials, 'materials') or 'litho' not in md.materials.nature: 97 raise RuntimeError('Need a \'litho\' material to run a Fourier Love number analysis') 91 98 return md 92 99 # }}} 93 100 -
../trunk-jpl/src/m/classes/geometry.m
84 84 85 85 end % }}} 86 86 function marshall(self,prefix,md,fid) % {{{ 87 88 if (size(self.thickness ==md.mesh.numberofvertices) | (self.thickness==md.mesh.numberofvertices+1)),87 88 if (size(self.thickness)==md.mesh.numberofvertices) | (size(self.thickness)==md.mesh.numberofvertices+1)), 89 89 WriteData(fid,prefix,'object',self,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts); 90 elseif (size(self.thickness ==md.mesh.numberofelements) | (self.thickness==md.mesh.numberofelements+1)),90 elseif (size(self.thickness)==md.mesh.numberofelements) | (size(self.thickness)==md.mesh.numberofelements+1)), 91 91 WriteData(fid,prefix,'object',self,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts); 92 92 else 93 93 error('geometry thickness time series should be a vertex or element time series'); -
../trunk-jpl/src/m/classes/geometry.py
50 50 #}}} 51 51 52 52 def checkconsistency(self, md, solution, analyses): #{{{ 53 if (solution == 'TransientSolution' and md.transient.isgia) or (solution == 'GiaSolution'): 54 md = checkfield(md, 'fieldname', 'geometry.thickness', 'timeseries', 1, 'NaN', 1, 'Inf', 1) 55 elif solution == 'SealevelriseSolution': 56 md = checkfield(md, 'fieldname', 'geometry.bed', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) 57 elif solution == 'LoveSolution': 58 return 53 if solution == 'LoveSolution': 54 return md 59 55 else: 60 56 md = checkfield(md, 'fieldname', 'geometry.surface', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) 61 57 md = checkfield(md, 'fieldname', 'geometry.base', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) … … 70 66 if np.any(np.abs(self.bed[pos] - self.base[pos]) > 10**-9): 71 67 md.checkmessage('equality base = bed on grounded ice violated') 72 68 md = checkfield(md, 'fieldname', 'geometry.bed', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) 73 74 69 return md 75 70 # }}} 76 71 77 72 def marshall(self, prefix, md, fid): #{{{ 73 if (len(self.thickness) == md.mesh.numberofvertices) or (len(self.thickness) == md.mesh.numberofvertices + 1): 74 WriteData(fid, prefix, 'object', self, 'fieldname', 'thickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts) 75 elif (len(self.thickness) == md.mesh.numberofelements) or (len(self.thickness) == md.mesh.numberofelements + 1): 76 WriteData(fid, prefix, 'object', self, 'fieldname', 'thickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts) 77 else: 78 raise RuntimeError('geometry thickness time series should be a vertex or element time series') 79 78 80 WriteData(fid, prefix, 'object', self, 'fieldname', 'surface', 'format', 'DoubleMat', 'mattype', 1) 79 WriteData(fid, prefix, 'object', self, 'fieldname', 'thickness', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)80 81 WriteData(fid, prefix, 'object', self, 'fieldname', 'base', 'format', 'DoubleMat', 'mattype', 1) 81 82 WriteData(fid, prefix, 'object', self, 'fieldname', 'bed', 'format', 'DoubleMat', 'mattype', 1) 82 83 WriteData(fid, prefix, 'object', self, 'fieldname', 'hydrostatic_ratio', 'format', 'DoubleMat', 'mattype', 1) -
../trunk-jpl/src/m/classes/hydrologyshreve.m
30 30 31 31 %Type of stabilization to use 0:nothing 1:artificial_diffusivity 32 32 self.stabilization = 1; 33 33 self.requested_outputs = {'default'}; 34 34 end % }}} 35 35 function md = checkconsistency(self,md,solution,analyses) % {{{ 36 36 -
../trunk-jpl/src/m/classes/hydrologyshreve.py
4 4 5 5 6 6 class hydrologyshreve(object): 7 """ 8 HYDROLOGYSHREVE class definition 7 """HYDROLOGYSHREVE class definition 9 8 10 11 9 Usage: 10 hydrologyshreve = hydrologyshreve() 12 11 """ 13 12 14 13 def __init__(self): # {{{ … … 15 14 self.spcwatercolumn = float('NaN') 16 15 self.stabilization = 0 17 16 self.requested_outputs = [] 18 #set defaults 17 19 18 self.setdefaultparameters() 20 21 19 #}}} 22 20 23 21 def __repr__(self): # {{{ 24 22 # TODO: 23 # - Convert all formatting to calls to <string>.format (see any 24 # already converted <class>.__repr__ method for examples) 25 # 25 26 string = ' hydrologyshreve solution parameters:' 26 27 string = "%s\n%s" % (string, fielddisplay(self, 'spcwatercolumn', 'water thickness constraints (NaN means no constraint) [m]')) 27 28 string = "%s\n%s" % (string, fielddisplay(self, 'stabilization', 'artificial diffusivity (default is 1). can be more than 1 to increase diffusivity.')) … … 47 48 48 49 def checkconsistency(self, md, solution, analyses): # {{{ 49 50 #Early return 50 if 'HydrologyShreveAnalysis' not in analyses :51 if 'HydrologyShreveAnalysis' not in analyses or (solution == 'TransientSolution' and not md.transient.ishydrology): 51 52 return md 52 53 53 54 md = checkfield(md, 'fieldname', 'hydrology.spcwatercolumn', 'Inf', 1, 'timeseries', 1) … … 60 61 WriteData(fid, prefix, 'name', 'md.hydrology.model', 'data', 2, 'format', 'Integer') 61 62 WriteData(fid, prefix, 'object', self, 'fieldname', 'spcwatercolumn', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts) 62 63 WriteData(fid, prefix, 'object', self, 'fieldname', 'stabilization', 'format', 'Double') 63 #process requested outputs64 #process requested outputs 64 65 outputs = self.requested_outputs 65 66 indices = [i for i, x in enumerate(outputs) if x == 'default'] 66 67 if len(indices) > 0: -
../trunk-jpl/src/m/classes/initialization.m
21 21 channelarea = NaN; 22 22 sealevel = NaN; 23 23 bottompressure = NaN; 24 24 sample = NaN; 25 25 end 26 26 methods 27 27 function self = extrude(self,md) % {{{ … … 51 51 end 52 52 end % }}} 53 53 function self = setdefaultparameters(self) % {{{ 54 55 54 end % }}} 56 55 function md = checkconsistency(self,md,solution,analyses) % {{{ 57 56 if ismember('StressbalanceAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.isstressbalance == 0), … … 97 96 end 98 97 if ismember('HydrologyShreveAnalysis',analyses), 99 98 if isa(md.hydrology,'hydrologyshreve'), 100 if strcmp(solution,'TransientSolution') & md.transient.ishydrology,99 if (strcmp(solution,'TransientSolution') & md.transient.ishydrology) | strcmp(solution,'HydrologySolution'), 101 100 md = checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]); 102 101 end 103 if strcmp(solution,'HydrologySolution'),104 md = checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]);105 end106 102 end 107 103 end 108 104 if ismember('HydrologyTwsAnalysis',analyses), … … 110 106 md = checkfield(md,'fieldname','initialization.watercolumn','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]); 111 107 end 112 108 end 113 if ismember('SealevelchangeAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.isslc == 0),109 if ismember('SealevelchangeAnalysis',analyses), 114 110 if strcmp(solution,'TransientSolution') & md.transient.isslc, 115 111 md = checkfield(md,'fieldname','initialization.sealevel','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]); 116 112 end … … 133 129 md = checkfield(md,'fieldname','initialization.epl_head','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]); 134 130 md = checkfield(md,'fieldname','initialization.epl_thickness','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]); 135 131 end 136 end 137 end 138 if ismember('SamplingAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.issampling == 0), 139 if ~isnan(md.initialization.sample) 140 md = checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]); 141 end 132 end 142 133 end 134 if ismember('SamplingAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.issampling == 0), 135 if ~isnan(md.initialization.sample) 136 md = checkfield(md,'fieldname','initialization.sample','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]); 137 end 138 end 143 139 end % }}} 144 140 function disp(self) % {{{ 145 141 disp(sprintf(' initial field values:')); … … 158 154 fielddisplay(self,'watercolumn','subglacial water sheet thickness (for Shreve and GlaDS) [m]'); 159 155 fielddisplay(self,'hydraulic_potential','Hydraulic potential (for GlaDS) [Pa]'); 160 156 fielddisplay(self,'channelarea','subglacial water channel area (for GlaDS) [m2]'); 161 157 fielddisplay(self,'sample','Realization of a Gaussian random field'); 162 158 end % }}} 163 159 function marshall(self,prefix,md,fid) % {{{ 164 160 … … 178 174 WriteData(fid,prefix,'object',self,'fieldname','watercolumn','format','DoubleMat','mattype',1); 179 175 WriteData(fid,prefix,'object',self,'fieldname','channelarea','format','DoubleMat','mattype',1); 180 176 WriteData(fid,prefix,'object',self,'fieldname','hydraulic_potential','format','DoubleMat','mattype',1); 181 182 177 WriteData(fid,prefix,'object',self,'fieldname','sample','format','DoubleMat','mattype',1); 178 183 179 if md.thermal.isenthalpy, 184 180 if numel(self.enthalpy) <= 1, 185 181 %reconstruct enthalpy … … 194 190 end 195 191 end % }}} 196 192 function savemodeljs(self,fid,modelname) % {{{ 197 193 198 194 writejs1Darray(fid,[modelname '.initialization.vx'],self.vx); 199 195 writejs1Darray(fid,[modelname '.initialization.vy'],self.vy); 200 196 writejs1Darray(fid,[modelname '.initialization.vz'],self.vz); … … 209 205 writejs1Darray(fid,[modelname '.initialization.watercolumn'],self.watercolumn); 210 206 writejs1Darray(fid,[modelname '.initialization.hydraulic_potential'],self.hydraulic_potential); 211 207 writejs1Darray(fid,[modelname '.initialization.channel'],self.channelarea); 212 213 208 writejs1Darray(fid,[modelname '.initialization.sample'],self.sample); 209 214 210 end % }}} 215 211 end 216 212 end -
../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.sealevel = np.nan 32 self.bottompressure = np.nan 31 33 self.sample = np.nan 32 34 33 35 #set defaults … … 66 68 self.sediment_head = project3d(md, 'vector', self.sediment_head, 'type', 'node', 'layer', 1) 67 69 self.epl_head = project3d(md, 'vector', self.epl_head, 'type', 'node', 'layer', 1) 68 70 self.epl_thickness = project3d(md, 'vector', self.epl_thickness, 'type', 'node', 'layer', 1) 71 self.sealevel = project3d(md, 'vector', self.sealevel, 'type', 'node', 'layer', 1) 72 self.bottompressure = project3d(md, 'vector', self.bottompressure, 'type', 'node', 'layer', 1) 69 73 70 74 #Lithostatic pressure by default 71 75 if np.ndim(md.geometry.surface) == 2: … … 89 93 if 'MasstransportAnalysis' in analyses and not solution == 'TransientSolution' and not md.transient.ismasstransport: 90 94 md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) 91 95 md = checkfield(md, 'fieldname', 'initialization.vy', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) 96 if 'OceantransportAnalysis' in analyses: 97 if solution == 'TransientSolution' and md.transient.isslc and md.transient.isoceantransport: 98 md = checkfield(md, 'fieldname', 'initialization.bottompressure', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) 92 99 if 'BalancethicknessAnalysis' in analyses and solution == 'BalancethicknessSolution': 93 100 md = checkfield(md, 'fieldname', 'initialization.vx', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) 94 101 md = checkfield(md, 'fieldname', 'initialization.vy', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) … … 111 118 md = checkfield(md, 'fieldname', 'delta Tpmp', 'field', np.absolute(md.initialization.temperature[pos] - (md.materials.meltingpoint - md.materials.beta * md.initialization.pressure[pos])), '<', 1e-11, 'message', 'set temperature to pressure melting point at locations with waterfraction > 0') 112 119 if 'HydrologyShreveAnalysis' in analyses: 113 120 if hasattr(md.hydrology, 'hydrologyshreve'): 121 if (solution == 'TransientSolution' and md.transient.ishydrology) or solution == 'HydrologySolution': 122 md = checkfield(md, 'fieldname', 'initialization.watercolumn', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) 123 if 'HydrologyTwsAnalysis' in analyses: 124 if hasattr(md.hydrology, 'hydrologytws'): 114 125 md = checkfield(md, 'fieldname', 'initialization.watercolumn', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) 115 if 'HydrologyDCInefficientAnalysis' in analyses: 116 if hasattr(md.hydrology, 'hydrologydc'): 117 md = checkfield(md, 'fieldname', 'initialization.sediment_head', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) 118 if 'HydrologyDCEfficientAnalysis' in analyses: 119 if hasattr(md.hydrology, 'hydrologydc'): 120 if md.hydrology.isefficientlayer == 1: 121 md = checkfield(md, 'fieldname', 'initialization.epl_head', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) 122 md = checkfield(md, 'fieldname', 'initialization.epl_thickness', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) 126 if 'SealevelchangeAnalysis' in analyses: 127 if solution == 'TransientSolution' and md.transient.isslc: 128 md = checkfield(md, 'fieldname', 'initialization.sealevel', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) 123 129 if 'HydrologyGlaDSAnalysis' in analyses: 124 130 if hasattr(md.hydrology, 'hydrologyglads'): 125 131 md = checkfield(md, 'fieldname', 'initialization.watercolumn', 'NaN', 1, 'Inf', 1, 'size', [md.mesh.numberofvertices]) … … 137 143 WriteData(fid, prefix, 'object', self, 'fieldname', 'vy', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts) 138 144 WriteData(fid, prefix, 'object', self, 'fieldname', 'vz', 'format', 'DoubleMat', 'mattype', 1, 'scale', 1. / yts) 139 145 WriteData(fid, prefix, 'object', self, 'fieldname', 'pressure', 'format', 'DoubleMat', 'mattype', 1) 146 WriteData(fid, prefix, 'object', self, 'fieldname', 'sealevel', 'format', 'DoubleMat', 'mattype', 1) 147 WriteData(fid, prefix, 'object', self, 'fieldname', 'bottompressure', 'format', 'DoubleMat', 'mattype', 1) 140 148 WriteData(fid, prefix, 'object', self, 'fieldname', 'temperature', 'format', 'DoubleMat', 'mattype', 1) 141 149 WriteData(fid, prefix, 'object', self, 'fieldname', 'waterfraction', 'format', 'DoubleMat', 'mattype', 1) 142 150 WriteData(fid, prefix, 'object', self, 'fieldname', 'sediment_head', 'format', 'DoubleMat', 'mattype', 1) -
../trunk-jpl/src/m/consistency/ismodelselfconsistent.py
1 1 def ismodelselfconsistent(md): #{{{ 2 ''' 3 ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem. 2 """ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem. 4 3 5 6 ismodelselfconsistent(md),7 '''4 Usage: 5 ismodelselfconsistent(md) 6 """ 8 7 9 8 #initialize consistency as true 10 9 md.private.isconsistent = True … … 52 51 analyses = ['EnthalpyAnalysis', 'ThermalAnalysis', 'MeltingAnalysis'] 53 52 elif solutiontype == 'MasstransportSolution': 54 53 analyses = ['MasstransportAnalysis'] 54 elif solutiontype == 'OceantransportSolution': 55 analyses = ['OceantransportAnalysis'] 55 56 elif solutiontype == 'BalancethicknessSolution': 56 57 analyses = ['BalancethicknessAnalysis'] 57 58 elif solutiontype == 'Balancethickness2Solution': … … 71 72 elif solutiontype == 'EsaSolution': 72 73 analyses = ['EsaAnalysis'] 73 74 elif solutiontype == 'TransientSolution': 74 analyses = ['StressbalanceAnalysis', 'StressbalanceVerticalAnalysis', 'StressbalanceSIAAnalysis', 'L2ProjectionBaseAnalysis', 'ThermalAnalysis', 'MeltingAnalysis', 'EnthalpyAnalysis', 'MasstransportAnalysis', ' HydrologyShaktiAnalysis', 'HydrologyGladsAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis', 'SealevelriseAnalysis']75 analyses = ['StressbalanceAnalysis', 'StressbalanceVerticalAnalysis', 'StressbalanceSIAAnalysis', 'L2ProjectionBaseAnalysis', 'ThermalAnalysis', 'MeltingAnalysis', 'EnthalpyAnalysis', 'MasstransportAnalysis', 'OceantransportAnalysis', 'HydrologyShaktiAnalysis', 'HydrologyGladsAnalysis', 'HydrologyShreveAnalysis', 'HydrologyTwsAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis', 'SealevelriseAnalysis'] 75 76 elif solutiontype == 'SealevelriseSolution': 76 77 analyses = ['SealevelriseAnalysis'] 77 78 elif solutiontype == 'HydrologySolution': 78 analyses = ['L2ProjectionBaseAnalysis', 'HydrologyShreveAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis' ]79 analyses = ['L2ProjectionBaseAnalysis', 'HydrologyShreveAnalysis', 'HydrologyDCInefficientAnalysis', 'HydrologyDCEfficientAnalysis', 'HydrologyGladsAnalysis', 'HydrologyShaktiAnalysis', 'HydrologyTwsAnalysis'] 79 80 elif 'DamageEvolutionSolution': 80 81 analyses = ['DamageEvolutionAnalysis'] 81 82 elif 'SamplingSolution': -
../trunk-jpl/src/m/solve/solve.m
9 9 % Solution types available comprise: 10 10 % - 'Stressbalance' or 'sb' 11 11 % - 'Masstransport' or 'mt' 12 % - 'Oceantransport' or 'oceant'12 % - 'Oceantransport' or 'oceant' 13 13 % - 'Thermal' or 'th' 14 14 % - 'Steadystate' or 'ss' 15 15 % - 'Transient' or 'tr' -
../trunk-jpl/test/NightlyRun/test2001.m
21 21 %Loading history 22 22 md.timestepping.start_time=-2400000; %4,800 kyr :: EVALUATION TIME 23 23 md.timestepping.time_step= 2400000; %2,400 kyr :: EVALUATION TIME 24 % to get rid of default final_time : make sure final_time>start_time25 md.timestepping.final_time=2400000; %2, 500 kyr24 % to get rid of default final_time, make sure final_time > start_time 25 md.timestepping.final_time=2400000; %2,400 kyr 26 26 md.masstransport.spcthickness=[... 27 27 [md.geometry.thickness; 0],... 28 28 [md.geometry.thickness; 2400000]... … … 45 45 %md.cluster=generic('name',oshostname(),'np',3); 46 46 md.verbose=verbose('11111111111'); 47 47 md.verbose.solver=0; 48 md=solve(md,' tr');48 md=solve(md,'Transient'); 49 49 50 50 %Fields and tolerances to track changes 51 51 field_names ={'UGrd'}; -
../trunk-jpl/src/m/classes/matdamageice.m
5 5 6 6 classdef matdamageice 7 7 properties (SetAccess=public) 8 rho_ice = 0.;9 rho_water = 0.;10 rho_freshwater = 0.;11 mu_water = 0.;12 heatcapacity = 0.;13 latentheat = 0.;14 thermalconductivity = 0.;15 temperateiceconductivity = 0.;8 rho_ice = 0.; 9 rho_water = 0.; 10 rho_freshwater = 0.; 11 mu_water = 0.; 12 heatcapacity = 0.; 13 latentheat = 0.; 14 thermalconductivity = 0.; 15 temperateiceconductivity = 0.; 16 16 effectiveconductivity_averaging = 0.; 17 meltingpoint = 0.;18 beta = 0.;19 mixed_layer_capacity = 0.;20 thermal_exchange_velocity = 0.;21 rheology_B = NaN;22 rheology_n = NaN;23 rheology_law = '';17 meltingpoint = 0.; 18 beta = 0.; 19 mixed_layer_capacity = 0.; 20 thermal_exchange_velocity = 0.; 21 rheology_B = NaN; 22 rheology_n = NaN; 23 rheology_law = ''; 24 24 25 25 %slc 26 earth_density = 0;26 earth_density = 0; 27 27 28 28 end 29 29 methods -
../trunk-jpl/src/m/classes/matdamageice.py
30 30 self.rheology_n = float('NaN') 31 31 self.rheology_law = '' 32 32 33 #giaivins: 34 self.lithosphere_shear_modulus = 0. 35 self.lithosphere_density = 0. 36 self.mantle_shear_modulus = 0. 37 self.mantle_density = 0. 33 #SLC 34 self.earth_density = 5512 # average density of the Earth, (kg / m^3) 38 35 39 #SLR40 self.earth_density = 5512 # average density of the Earth, (kg / m^3)41 36 self.setdefaultparameters() 42 37 #}}} 43 38 44 39 def __repr__(self): # {{{ 40 # TODO: 41 # - Convert all formatting to calls to <string>.format (see any 42 # already converted <class>.__repr__ method for examples) 43 # 45 44 string = " Materials:" 46 45 string = "%s\n%s" % (string, fielddisplay(self, "rho_ice", "ice density [kg / m^3]")) 47 46 string = "%s\n%s" % (string, fielddisplay(self, "rho_water", "water density [kg / m^3]")) … … 59 58 string = "%s\n%s" % (string, fielddisplay(self, "rheology_B", "flow law parameter [Pa s^(1 / n)]")) 60 59 string = "%s\n%s" % (string, fielddisplay(self, "rheology_n", "Glen's flow law exponent")) 61 60 string = "%s\n%s" % (string, fielddisplay(self, "rheology_law", "law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'")) 62 string = "%s\n%s" % (string, fielddisplay(self, "lithosphere_shear_modulus", "Lithosphere shear modulus [Pa]"))63 string = "%s\n%s" % (string, fielddisplay(self, "lithosphere_density", "Lithosphere density [g / cm^ - 3]"))64 string = "%s\n%s" % (string, fielddisplay(self, "mantle_shear_modulus", "Mantle shear modulus [Pa]"))65 string = "%s\n%s" % (string, fielddisplay(self, "mantle_density", "Mantle density [g / cm^ - 3]"))66 61 string = "%s\n%s" % (string, fielddisplay(self, "earth_density", "Mantle density [kg / m^ - 3]")) 67 62 return string 68 63 #}}} … … 104 99 #available: none, paterson and arrhenius 105 100 self.rheology_law = 'Paterson' 106 101 107 # GIA: 108 self.lithosphere_shear_modulus = 6.7e10 # (Pa) 109 self.lithosphere_density = 3.32 # (g / cm^ - 3) 110 self.mantle_shear_modulus = 1.45e11 # (Pa) 111 self.mantle_density = 3.34 # (g / cm^ - 3) 112 113 #SLR 102 #SLC 114 103 self.earth_density = 5512 #average density of the Earth, (kg / m^3) 115 104 return self 116 105 #}}} … … 130 119 md = checkfield(md, 'fieldname', 'materials.mantle_density', '>', 0, 'numel', [1]) 131 120 md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', [1]) 132 121 133 if 'GiaAnalysis' in analyses:134 md = checkfield(md, 'fieldname', 'materials.lithosphere_shear_modulus', '>', 0, 'numel', 1)135 md = checkfield(md, 'fieldname', 'materials.lithosphere_density', '>', 0, 'numel', 1)136 md = checkfield(md,'fieldname', 'materials.mantle_shear_modulus', '>', 0, 'numel', 1)137 md = checkfield(md,'fieldname', 'materials.mantle_density', '>', 0, 'numel', 1)138 139 122 if 'SealevelriseAnalysis' in analyses: 140 123 md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1) 141 124 … … 160 143 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_B', 'format', 'DoubleMat', 'mattype', 1) 161 144 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_n', 'format', 'DoubleMat', 'mattype', 2) 162 145 WriteData(fid, prefix, 'data', self.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String') 163 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_shear_modulus', 'format', 'Double')164 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_density', 'format', 'Double', 'scale', 10.**3.)165 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_shear_modulus', 'format', 'Double')166 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_density', 'format', 'Double', 'scale', 10.**3.)167 146 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double') 168 147 169 148 # }}} -
../trunk-jpl/src/m/classes/matenhancedice.py
1 from checkfield import checkfield 1 2 from fielddisplay import fielddisplay 2 3 from project3d import project3d 3 from checkfield import checkfield4 4 from WriteData import WriteData 5 5 6 6 7 7 class matenhancedice(object): 8 """ 9 MATICE class definition 8 """MATICE class definition 10 9 11 12 10 Usage: 11 matenhancedice = matenhancedice() 13 12 """ 14 13 15 14 def __init__(self): #{{{ … … 31 30 self.rheology_n = float('NaN') 32 31 self.rheology_law = '' 33 32 34 #GIA 35 self.lithosphere_shear_modulus = 0. 36 self.lithosphere_density = 0. 37 self.mantle_shear_modulus = 0. 38 self.mantle_density = 0. 33 #SLC 34 self.earth_density = 0 # average density of the Earth, (kg/m^3) 39 35 40 #SLR41 self.earth_density = 0 # average density of the Earth, (kg/m^3)42 36 self.setdefaultparameters() 43 37 #}}} 44 38 45 39 def __repr__(self): #{{{ 40 # TODO: 41 # - Convert all formatting to calls to <string>.format (see any 42 # already converted <class>.__repr__ method for examples) 43 # 46 44 s = " Materials:" 47 45 s = "%s\n%s" % (s, fielddisplay(self, "rho_ice", "ice density [kg/m^3]")) 48 46 s = "%s\n%s" % (s, fielddisplay(self, "rho_water", "water density [kg/m^3]")) … … 61 59 s = "%s\n%s" % (s, fielddisplay(self, "rheology_B", "flow law parameter [Pa s^(1/n)]")) 62 60 s = "%s\n%s" % (s, fielddisplay(self, "rheology_n", "Glen's flow law exponent")) 63 61 s = "%s\n%s" % (s, fielddisplay(self, "rheology_law", "law for the temperature dependance of the rheology: 'None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius' or 'LliboutryDuval'")) 64 s = "%s\n%s" % (s, fielddisplay(self, "lithosphere_shear_modulus", "Lithosphere shear modulus [Pa]"))65 s = "%s\n%s" % (s, fielddisplay(self, "lithosphere_density", "Lithosphere density [g/cm^-3]"))66 s = "%s\n%s" % (s, fielddisplay(self, "mantle_shear_modulus", "Mantle shear modulus [Pa]"))67 s = "%s\n%s" % (s, fielddisplay(self, "mantle_density", "Mantle density [g/cm^-3]"))68 62 s = "%s\n%s" % (s, fielddisplay(self, "earth_density", "Mantle density [kg/m^-3]")) 69 63 70 64 return s … … 108 102 #available: none, paterson and arrhenius 109 103 self.rheology_law = 'Paterson' 110 104 111 # GIA:105 #GIA 112 106 self.lithosphere_shear_modulus = 6.7 * 10**10 # (Pa) 113 107 self.lithosphere_density = 3.32 # (g / cm^ - 3) 114 108 self.mantle_shear_modulus = 1.45 * 10**11 # (Pa) 115 109 self.mantle_density = 3.34 # (g / cm^ - 3) 116 110 117 #SLR111 #SLC 118 112 self.earth_density = 5512 #average density of the Earth, (kg / m^3) 119 113 120 114 return self … … 131 125 md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval']) 132 126 md = checkfield(md, 'fieldname', 'materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2]) 133 127 134 if 'GiaAnalysis' in analyses:135 md = checkfield(md, 'fieldname', 'materials.lithosphere_shear_modulus', '>', 0, 'numel', 1)136 md = checkfield(md, 'fieldname', 'materials.lithosphere_density', '>', 0, 'numel', 1)137 md = checkfield(md, 'fieldname', 'materials.mantle_shear_modulus', '>', 0, 'numel', 1)138 md = checkfield(md, 'fieldname', 'materials.mantle_density', '>', 0, 'numel', 1)139 140 128 if 'SealevelriseAnalysis' in analyses: 141 129 md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1) 142 130 return md … … 161 149 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_B', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts) 162 150 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_n', 'format', 'DoubleMat', 'mattype', 2) 163 151 WriteData(fid, prefix, 'data', self.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String') 164 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_shear_modulus', 'format', 'Double')165 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_density', 'format', 'Double', 'scale', 10**3)166 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_shear_modulus', 'format', 'Double')167 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_density', 'format', 'Double', 'scale', 10**3)168 152 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double') 169 153 # }}} -
../trunk-jpl/src/m/classes/materials.m
122 122 self.rheology_B = 1*1e8; 123 123 self.rheology_n = 3; 124 124 125 126 125 case 'litho' 127 126 %we default to a configuration that enables running GIA solutions using giacaron and/or giaivins. 128 127 self.numlayers=2; -
../trunk-jpl/src/m/classes/materials.py
7 7 8 8 9 9 class materials(object): 10 ''' 11 MATERIALS class definition 10 """MATERIALS class definition 12 11 13 14 15 '''12 Usage: 13 materials = materials() 14 """ 16 15 17 16 def __init__(self, *args): #{{{ 18 17 self.nature = [] … … 37 36 setattr(self, 'latentheat', 0) 38 37 setattr(self, 'thermalconductivity', 0) 39 38 setattr(self, 'temperateiceconductivity', 0) 39 setattr(self, 'effectiveconductivity_averaging', 0) 40 40 setattr(self, 'meltingpoint', 0) 41 41 setattr(self, 'beta', 0) 42 42 setattr(self, 'mixed_layer_capacity', 0) … … 59 59 setattr(self, 'rho_ice', 0) 60 60 setattr(self, 'rho_water', 0) 61 61 setattr(self, 'rho_freshwater', 0) 62 setattr(self, 'earth_density', 0)63 62 else: 64 63 raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')") 64 setattr(self, 'earth_density', 0) 65 65 66 66 #set default parameters: 67 67 self.setdefaultparameters() … … 73 73 if nat == 'ice': 74 74 #ice density (kg/m^3) 75 75 self.rho_ice = 917. 76 76 77 #ocean water density (kg/m^3) 77 78 self.rho_water = 1023. 79 78 80 #fresh water density (kg/m^3) 79 81 self.rho_freshwater = 1000. 82 80 83 #water viscosity (N.s/m^2) 81 84 self.mu_water = 0.001787 85 82 86 #ice heat capacity cp (J/kg/K) 83 87 self.heatcapacity = 2093. 88 84 89 #ice latent heat of fusion L (J / kg) 85 90 self.latentheat = 3.34e5 91 86 92 #ice thermal conductivity (W/m/K) 87 93 self.thermalconductivity = 2.4 94 88 95 #wet ice thermal conductivity (W/m/K) 89 96 self.temperateiceconductivity = 0.24 97 98 #computation of effective conductivity 99 self.effectiveconductivity_averaging = 1 100 90 101 #the melting point of ice at 1 atmosphere of pressure in K 91 102 self.meltingpoint = 273.15 103 92 104 #rate of change of melting point with pressure (K/Pa) 93 105 self.beta = 9.8e-8 106 94 107 #mixed layer (ice-water interface) heat capacity (J/kg/K) 95 108 self.mixed_layer_capacity = 3974. 109 96 110 #thermal exchange velocity (ice-water interface) (m/s) 97 111 self.thermal_exchange_velocity = 1.00e-4 112 98 113 #Rheology law: what is the temperature dependence of B with T 99 114 #available: none, paterson and arrhenius 100 115 self.rheology_law = 'Paterson' 116 117 #Rheology fields default 118 self.rheology_B = 1e8 119 self.rheology_n = 3 101 120 elif nat == 'litho': 102 #we default to a configuration that enables running GIA solutions using giacaron and /or giaivins.121 #we default to a configuration that enables running GIA solutions using giacaron and/or giaivins. 103 122 self.numlayers = 2 123 104 124 #center of the earth (approximation, must not be 0), then the lab (lithosphere / asthenosphere boundary) then the surface 105 125 #(with 1d3 to avoid numerical singularities) 106 126 self.radius = [1e3, 6278e3, 6378e3] 127 107 128 self.viscosity = [1e21, 1e40] #mantle and lithosphere viscosity (respectively) [Pa.s] 108 129 self.lame_mu = [1.45e11, 6.7e10] # (Pa) #lithosphere and mantle shear modulus (respectively) [Pa] 109 130 self.lame_lambda = self.lame_mu # (Pa) #mantle and lithosphere lamba parameter (respectively) [Pa] … … 115 136 elif nat == 'hydro': 116 137 #ice density (kg/m^3) 117 138 self.rho_ice = 917. 139 118 140 #ocean water density (kg/m^3) 119 141 self.rho_water = 1023. 120 #average density of the Earth (kg/m^3) 121 self.earth_density = 5512 142 122 143 #fresh water density (kg/m^3) 123 144 self.rho_freshwater = 1000. 124 145 else: 125 146 raise RuntimeError("materials setdefaultparameters error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')") 147 148 #average density of the Earth (kg/m^3) 149 self.earth_density = 5512 126 150 #}}} 127 151 128 152 def __repr__(self): #{{{ … … 222 246 #1: MatdamageiceEnum 2: MatestarEnum 3: MaticeEnum 4: MatenhancediceEnum 5: MaterialsEnum 223 247 WriteData(fid, prefix, 'name', 'md.materials.nature', 'data', naturetointeger(self.nature), 'format', 'IntMat', 'mattype', 3) 224 248 WriteData(fid, prefix, 'name', 'md.materials.type', 'data', 5, 'format', 'Integer') #DANGER, this can evolve if you have classes 225 226 249 for i in range(len(self.nature)): 227 250 nat = self.nature[i] 228 251 if nat == 'ice': … … 235 258 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'latentheat', 'format', 'Double') 236 259 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'thermalconductivity', 'format', 'Double') 237 260 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'temperateiceconductivity', 'format', 'Double') 261 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'effectiveconductivity_averaging', 'format', 'Integer') 238 262 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'meltingpoint', 'format', 'Double') 239 263 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'beta', 'format', 'Double') 240 264 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mixed_layer_capacity', 'format', 'Double') … … 253 277 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'isburgers', 'format', 'DoubleMat', 'mattype', 3) 254 278 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'burgers_viscosity', 'format', 'DoubleMat', 'mattype', 3) 255 279 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'burgers_mu', 'format', 'DoubleMat', 'mattype', 3) 280 # Compute earth density compatible with our layer density distribution 281 earth_density = 0 282 for i in range(len(self.numlayers)): 283 earth_density = earth_density + (self.radius[i + 1] ** 3 - self.radius[i] ** 3) * self.density[i] 284 earth_density = earth_density / self.radius[self.numlayers + 1] ** 3 285 self.earth_density = earth_density 256 286 elif nat == 'hydro': 257 287 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_ice', 'format', 'Double') 258 288 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_water', 'format', 'Double') 259 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double')260 289 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rho_freshwater', 'format', 'Double') 261 290 else: 262 291 raise RuntimeError("materials constructor error message: nature of the material not supported yet! ('ice' or 'litho' or 'hydro')") 292 WriteData(fid, prefix, 'data', self.earth_density, 'name', 'md.materials.earth_density', 'format', 'Double') 263 293 #}}} 264 294 265 295 def extrude(self, md): #{{{ -
../trunk-jpl/src/m/classes/matestar.py
33 33 self.rheology_Es = np.nan 34 34 self.rheology_law = '' 35 35 36 #GIA 37 self.lithosphere_shear_modulus = 0. 38 self.lithosphere_density = 0. 39 self.mantle_shear_modulus = 0. 40 self.mantle_density = 0. 41 42 #SLR 36 #slc 43 37 self.earth_density = 0 44 38 45 39 #set default parameters … … 65 59 s = "%s\n%s" % (s, fielddisplay(self, 'rheology_Ec', 'compressive enhancement factor')) 66 60 s = "%s\n%s" % (s, fielddisplay(self, 'rheology_Es', 'shear enhancement factor')) 67 61 s = "%s\n%s" % (s, fielddisplay(self, 'rheology_law', ['law for the temperature dependance of the rheology: ''None'', ''BuddJacka'', ''Cuffey'', ''CuffeyTemperate'', ''Paterson'', ''Arrhenius'' or ''LliboutryDuval'''])) 68 s = "%s\n%s" % (s, fielddisplay(self, 'lithosphere_shear_modulus', 'Lithosphere shear modulus [Pa]'))69 s = "%s\n%s" % (s, fielddisplay(self, 'lithosphere_density', 'Lithosphere density [g/cm^-3]'))70 s = "%s\n%s" % (s, fielddisplay(self, 'mantle_shear_modulus', 'Mantle shear modulus [Pa]'))71 s = "%s\n%s" % (s, fielddisplay(self, 'mantle_density', 'Mantle density [g/cm^-3]'))72 62 s = "%s\n%s" % (s, fielddisplay(self, 'earth_density', 'Mantle density [kg/m^-3]')) 73 63 74 64 return s … … 112 102 #Rheology law: what is the temperature dependence of B with T 113 103 #available: none, paterson and arrhenius 114 104 self.rheology_law = 'Paterson' 115 # GIA 116 self.lithosphere_shear_modulus = 6.7e10 # (Pa) 117 self.lithosphere_density = 3.32 # (g / cm^ - 3) 118 self.mantle_shear_modulus = 1.45e11 # (Pa) 119 self.mantle_density = 3.34 # (g / cm^ - 3) 120 #SLR 105 #slc 121 106 self.earth_density = 5512 # average density of the Earth, (kg / m^3) 122 107 123 108 return self … … 134 119 md = checkfield(md, 'fieldname', 'materials.rheology_law', 'values', ['None', 'BuddJacka', 'Cuffey', 'CuffeyTemperate', 'Paterson', 'Arrhenius', 'LliboutryDuval']) 135 120 md = checkfield(md, 'fieldname', 'materials.effectiveconductivity_averaging', 'numel', [1], 'values', [0, 1, 2]) 136 121 137 if 'GiaAnalysis' in analyses:138 md = checkfield(md, 'fieldname', 'materials.lithosphere_shear_modulus', '>', 0, 'numel', 1)139 md = checkfield(md, 'fieldname', 'materials.lithosphere_density', '>', 0, 'numel', 1)140 md = checkfield(md, 'fieldname', 'materials.mantle_shear_modulus', '>', 0, 'numel', 1)141 md = checkfield(md, 'fieldname', 'materials.mantle_density', '>', 0, 'numel', 1)142 143 122 if 'SealevelriseAnalysis' in analyses: 144 123 md = checkfield(md, 'fieldname', 'materials.earth_density', '>', 0, 'numel', 1) 145 124 … … 165 144 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_Ec', 'format', 'DoubleMat', 'mattype', 1) 166 145 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'rheology_Es', 'format', 'DoubleMat', 'mattype', 1) 167 146 WriteData(fid, prefix, 'data', self.rheology_law, 'name', 'md.materials.rheology_law', 'format', 'String') 168 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_shear_modulus', 'format', 'Double')169 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'lithosphere_density', 'format', 'Double', 'scale', 1.0e3)170 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_shear_modulus', 'format', 'Double')171 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'mantle_density', 'format', 'Double', 'scale', 1.0e3)172 147 WriteData(fid, prefix, 'object', self, 'class', 'materials', 'fieldname', 'earth_density', 'format', 'Double') 173 148 # }}} -
../trunk-jpl/src/m/classes/matice.m
103 103 104 104 end % }}} 105 105 function md = checkconsistency(self,md,solution,analyses) % {{{ 106 106 107 107 if strcmpi(solution,'TransientSolution') & md.transient.isslc, 108 108 md = checkfield(md,'fieldname','materials.earth_density','>',0,'numel',1); 109 return; 110 end 111 112 md = checkfield(md,'fieldname','materials.rho_ice','>',0); 113 md = checkfield(md,'fieldname','materials.rho_water','>',0); 114 md = checkfield(md,'fieldname','materials.rho_freshwater','>',0); 115 md = checkfield(md,'fieldname','materials.mu_water','>',0); 116 md = checkfield(md,'fieldname','materials.rheology_B','>',0,'universal',1,'NaN',1,'Inf',1); 117 md = checkfield(md,'fieldname','materials.rheology_n','>',0,'universal',1,'NaN',1,'Inf',1); 118 md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval' 'NyeCO2' 'NyeH2O'}); 119 md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]); 109 else 110 md = checkfield(md,'fieldname','materials.rho_ice','>',0); 111 md = checkfield(md,'fieldname','materials.rho_water','>',0); 112 md = checkfield(md,'fieldname','materials.rho_freshwater','>',0); 113 md = checkfield(md,'fieldname','materials.mu_water','>',0); 114 md = checkfield(md,'fieldname','materials.rheology_B','>',0,'universal',1,'NaN',1,'Inf',1); 115 md = checkfield(md,'fieldname','materials.rheology_n','>',0,'universal',1,'NaN',1,'Inf',1); 116 md = checkfield(md,'fieldname','materials.rheology_law','values',{'None' 'BuddJacka' 'Cuffey' 'CuffeyTemperate' 'Paterson' 'Arrhenius' 'LliboutryDuval' 'NyeCO2' 'NyeH2O'}); 117 md = checkfield(md,'fieldname','materials.effectiveconductivity_averaging','numel',[1],'values',[0 1 2]); 120 118 121 119 end % }}} 122 120 function disp(self) % {{{ -
../trunk-jpl/src/m/classes/model.m
43 43 frontalforcings = 0; 44 44 love = 0; 45 45 esa = 0; 46 46 sampling = 0; 47 47 48 48 autodiff = 0; 49 49 inversion = 0; … … 155 155 %2019 Jan.. 156 156 if isa(md.frontalforcings,'double'); 157 157 if(isprop('meltingrate',md.calving) & ~isnan(md.calving.meltingrate)) 158 disp('Warning: md.calving.meltingrate is now in md.frontalforcings');158 gia disp('Warning: md.calving.meltingrate is now in md.frontalforcings'); 159 159 end 160 160 md.frontalforcings=frontalforcings(md.calving); 161 161 end … … 186 186 md.smb.isconstrainsurfaceT = 0; 187 187 end 188 188 end 189 190 189 end 190 %2021 February 17 191 191 if isa(md.sampling,'double'); md.sampling=sampling(); end 192 192 end% }}} 193 193 end … … 241 241 md.frontalforcings = frontalforcings(); 242 242 md.love = fourierlove(); 243 243 md.esa = esa(); 244 244 md.sampling = sampling(); 245 245 md.autodiff = autodiff(); 246 246 md.inversion = inversion(); 247 247 md.qmu = qmu(); … … 614 614 %size = number of elements * n 615 615 elseif fieldsize(1)==numberofelements1 616 616 md2.(model_fields{i}).(object_fields{j})=field(pos_elem,:); 617 618 617 elseif (fieldsize(1)==numberofelements1+1) 618 md2.(model_fields{i}).(object_fields{j})=[field(pos_elem,:); field(end,:)]; 619 619 end 620 620 end 621 621 else … … 627 627 %size = number of elements * n 628 628 elseif fieldsize(1)==numberofelements1 629 629 md2.(model_fields{i})=field(pos_elem,:); 630 630 elseif (fieldsize(1)==numberofelements1+1) 631 631 md2.(model_fields{i})=[field(pos_elem,:); field(end,:)]; 632 632 end 633 633 end … … 774 774 %get subfields 775 775 % loop over time steps 776 776 for p=1:length(md1.results.(solutionfields{i})) 777 778 779 777 current = md1.results.(solutionfields{i})(p); 778 solutionsubfields=fields(current); 779 for j=1:length(solutionsubfields), 780 780 field=md1.results.(solutionfields{i})(p).(solutionsubfields{j}); 781 781 if length(field)==numberofvertices1, 782 782 md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field(pos_node); 783 783 elseif length(field)==numberofelements1, 784 784 md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field(pos_elem); 785 785 else 786 786 md2.results.(solutionfields{i})(p).(solutionsubfields{j})=field; 787 787 end 788 788 end 789 789 end 790 790 else 791 791 field=md1.results.(solutionfields{i}); … … 1500 1500 disp(sprintf('%19s: %-22s -- %s','frontalforcings' ,['[1x1 ' class(self.frontalforcings) ']'],'parameters for frontalforcings')); 1501 1501 disp(sprintf('%19s: %-22s -- %s','esa' ,['[1x1 ' class(self.esa) ']'],'parameters for elastic adjustment solution')); 1502 1502 disp(sprintf('%19s: %-22s -- %s','love' ,['[1x1 ' class(self.love) ']'],'parameters for love solution')); 1503 1503 disp(sprintf('%19s: %-22s -- %s','sampling' ,['[1x1 ' class(self.sampling) ']'],'parameters for stochastic sampler')); 1504 1504 disp(sprintf('%19s: %-22s -- %s','autodiff' ,['[1x1 ' class(self.autodiff) ']'],'automatic differentiation parameters')); 1505 1505 disp(sprintf('%19s: %-22s -- %s','inversion' ,['[1x1 ' class(self.inversion) ']'],'parameters for inverse methods')); 1506 1506 disp(sprintf('%19s: %-22s -- %s','qmu' ,['[1x1 ' class(self.qmu) ']'],'Dakota properties')); -
../trunk-jpl/src/m/classes/model.py
54 54 from thermal import thermal 55 55 from steadystate import steadystate 56 56 from transient import transient 57 from giaivins import giaivins58 from giamme import giamme59 57 from esa import esa 60 58 from autodiff import autodiff 61 59 from inversion import inversion … … 113 111 self.levelset = None 114 112 self.calving = None 115 113 self.frontalforcings = None 116 self.gia = None117 114 self.love = None 118 115 self.esa = None 119 116 self.sampling = None … … 171 168 'levelset', 172 169 'calving', 173 170 'frontalforcings', 174 'gia',175 171 'love', 176 172 'esa', 177 173 'sampling', … … 224 220 s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("levelset", "[%s %s]" % ("1x1", obj.levelset.__class__.__name__), "parameters for moving boundaries (level - set method)")) 225 221 s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("calving", "[%s %s]" % ("1x1", obj.calving.__class__.__name__), "parameters for calving")) 226 222 s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("frontalforcings", "[%s %s]" % ("1x1", obj.frontalforcings.__class__.__name__), "parameters for frontalforcings")) 227 s = "%s\n%s" % (s, "%19s: %-22s -- %s" % ("gia", "[%s %s]" % ("1x1", obj.gia.__class__.__name__), "parameters for gia solution"))228 223 s = "%s\n%s" % (s, '%19s: %-22s -- %s' % ("esa", "[%s %s]" % ("1x1", obj.esa.__class__.__name__), "parameters for elastic adjustment solution")) 229 224 s = "%s\n%s" % (s, '%19s: %-22s -- %s' % ("sampling", "[%s %s]" % ("1x1", obj.sampling.__class__.__name__), "parameters for stochastic sampler")) 230 225 s = "%s\n%s" % (s, '%19s: %-22s -- %s' % ("love", "[%s %s]" % ("1x1", obj.love.__class__.__name__), "parameters for love solution")) … … 271 266 self.levelset = levelset() 272 267 self.calving = calving() 273 268 self.frontalforcings = frontalforcings() 274 self.gia = giamme()275 269 self.love = fourierlove() 276 270 self.esa = esa() 277 271 self.sampling = sampling() … … 851 845 if not np.isnan(md.initialization.watercolumn).all(): 852 846 md.initialization.watercolumn = project2d(md, md.initialization.watercolumn, 1) 853 847 854 # giaivins855 if md.gia.__class__.__name__ == 'giaivins':856 if not np.isnan(md.gia.mantle_viscosity).all():857 md.gia.mantle_viscosity = project2d(md, md.gia.mantle_viscosity, 1)858 if not np.isnan(md.gia.lithosphere_thickness).all():859 md.gia.lithosphere_thickness = project2d(md, md.gia.lithosphere_thickness, 1)860 861 848 # elementstype 862 849 if not np.isnan(md.flowequation.element_equation).all(): 863 850 md.flowequation.element_equation = project2d(md, md.flowequation.element_equation, 1) -
../trunk-jpl/src/m/classes/sealevelmodel.m
90 90 for i=1:length(slm.icecaps), 91 91 md= slm.icecaps{i}; 92 92 if ~isempty(md.solidearth.external), 93 error( sprintf('cannot run external forcings on an ice sheet when runing a coupling earth/ice sheet model');93 error('cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model'); 94 94 end 95 95 96 96 end 97 %make sure that we have the rig th grd model for computing oufsealevel patterns:97 %make sure that we have the right grd model for computing out sealevel patterns: 98 98 for i=1:length(slm.icecaps), 99 99 md= slm.icecaps{i}; 100 100 if md.solidearth.settings.grdmodel~=0 101 error(sprintf('sealevelmodel checkconsisten ty error message: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap %i',i));101 error(sprintf('sealevelmodel checkconsistency error message: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap %i',i)); 102 102 end 103 103 end 104 104 -
../trunk-jpl/src/m/classes/sealevelmodel.py
110 110 md = slm.icecaps[i] 111 111 if np.nonzero(md.slr.steric_rate - slm.earth.slr.steric_rate[slm.earth.slr.transitions[i]]) != []: 112 112 raise Exception('steric rate on ice cap {} is not the same as for the earth'.format(md.miscellaneous.name)) 113 114 # Make sure grd is the same everywhere 115 for i in range(len(slm.icecaps)): 116 md = slm.icecaps[i] 117 if md.solidearthsettings.isgrd != slm.earth.solidearthsettings.isgrd: 118 raise RuntimeError('isgrd on ice cap {} is not the same as for the earth\n'.format(md.miscellaneous.name)) 119 # Make sure that there is no solid earth external forcing on the basins 120 for i in range(len(slm.icecaps)): 121 md = slm.icecaps[i] 122 if md.solidearth.external: 123 raise RuntimeError('cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model') 124 # Make sure that we have the right grd model for computing our sealevel patterns 125 for i in range(len(slm.icecaps)): 126 md = slm.icecaps[i] 127 if md.solidearth.settings.grdmodel != 0: 128 raise RuntimeError('sealevelmodel checkconsistency error message: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap {}'.format(i)) 113 129 #}}} 114 130 115 131 def mergeresults(self): # {{{ -
../trunk-jpl/src/m/classes/transient.py
13 13 def __init__(self): # {{{ 14 14 self.issmb = 0 15 15 self.ismasstransport = 0 16 self.isoceantransport = 0 16 17 self.isstressbalance = 0 17 18 self.isthermal = 0 18 19 self.isgroundingline = 0 19 self.isgia = 020 20 self.isesa = 0 21 21 self.isdamageevolution = 0 22 22 self.ismovingfront = 0 … … 23 23 self.ishydrology = 0 24 24 self.issampling = 0 25 25 self.isslc = 0 26 self.iscoupler = 027 26 self.amr_frequency = 0 28 27 self.isoceancoupling = 0 29 28 self.requested_outputs = [] … … 35 34 s = ' transient solution parameters:\n' 36 35 s += '{}\n'.format(fielddisplay(self, 'issmb', 'indicates if a surface mass balance solution is used in the transient')) 37 36 s += '{}\n'.format(fielddisplay(self, 'ismasstransport', 'indicates if a masstransport solution is used in the transient')) 37 s += '{}\n'.format(fielddisplay(self, 'isoceantransport', 'indicates whether an ocean masstransport solution is used in the transient')) 38 38 s += '{}\n'.format(fielddisplay(self, 'isstressbalance', 'indicates if a stressbalance solution is used in the transient')) 39 39 s += '{}\n'.format(fielddisplay(self, 'isthermal', 'indicates if a thermal solution is used in the transient')) 40 40 s += '{}\n'.format(fielddisplay(self, 'isgroundingline', 'indicates if a groundingline migration is used in the transient')) 41 s += '{}\n'.format(fielddisplay(self, 'isgia', 'indicates if a postglacial rebound is used in the transient'))42 41 s += '{}\n'.format(fielddisplay(self, 'isesa', 'indicates whether an elastic adjustment model is used in the transient')) 43 42 s += '{}\n'.format(fielddisplay(self, 'isdamageevolution', 'indicates whether damage evolution is used in the transient')) 44 43 s += '{}\n'.format(fielddisplay(self, 'ismovingfront', 'indicates whether a moving front capability is used in the transient')) … … 46 45 s += '{}\n'.format(fielddisplay(self, 'issampling', 'indicates whether sampling is used in the transient')) 47 46 s += '{}\n'.format(fielddisplay(self, 'isslc', 'indicates if a sea level change solution is used in the transient')) 48 47 s += '{}\n'.format(fielddisplay(self, 'isoceancoupling', 'indicates whether coupling with an ocean model is used in the transient')) 49 s += '{}\n'.format(fielddisplay(self, 'iscoupler', 'indicates whether different models are being run with need for coupling'))50 48 s += '{}\n'.format(fielddisplay(self, 'amr_frequency', 'frequency at which mesh is refined in simulations with multiple time_steps')) 51 49 s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'list of additional outputs requested')) 52 50 return s … … 62 60 def deactivateall(self): #{{{ 63 61 self.issmb = 0 64 62 self.ismasstransport = 0 63 self.isoceantransport = 0 65 64 self.isstressbalance = 0 66 65 self.isthermal = 0 67 66 self.isgroundingline = 0 68 self.isgia = 069 67 self.isesa = 0 70 68 self.isdamageevolution = 0 71 69 self.ismovingfront = 0 … … 73 71 self.issampling = 0 74 72 self.isslc = 0 75 73 self.isoceancoupling = 0 76 self.iscoupler = 077 74 self.amr_frequency = 0 78 75 79 76 # Default output … … 85 82 #full analysis: Stressbalance, Masstransport and Thermal but no groundingline migration for now 86 83 self.issmb = 1 87 84 self.ismasstransport = 1 85 self.isoceantransport = 0 88 86 self.isstressbalance = 1 89 87 self.isthermal = 1 90 88 self.isgroundingline = 0 91 self.isgia = 092 89 self.isesa = 0 93 90 self.isdamageevolution = 0 94 91 self.ismovingfront = 0 … … 96 93 self.issampling = 0 97 94 self.isslc = 0 98 95 self.isoceancoupling = 0 99 self.iscoupler = 0100 96 self.amr_frequency = 0 101 97 102 98 # Default output … … 111 107 112 108 md = checkfield(md, 'fieldname', 'transient.issmb', 'numel', [1], 'values', [0, 1]) 113 109 md = checkfield(md, 'fieldname', 'transient.ismasstransport', 'numel', [1], 'values', [0, 1]) 110 md = checkfield(md, 'fieldname', 'transient.isocealtransport', 'numel', [1], 'values', [0, 1]) 114 111 md = checkfield(md, 'fieldname', 'transient.isstressbalance', 'numel', [1], 'values', [0, 1]) 115 112 md = checkfield(md, 'fieldname', 'transient.isthermal', 'numel', [1], 'values', [0, 1]) 116 113 md = checkfield(md, 'fieldname', 'transient.isgroundingline', 'numel', [1], 'values', [0, 1]) 117 md = checkfield(md, 'fieldname', 'transient.isgia', 'numel', [1], 'values', [0, 1])118 114 md = checkfield(md, 'fieldname', 'transient.isesa', 'numel', [1], 'values', [0, 1]) 119 115 md = checkfield(md, 'fieldname', 'transient.isdamageevolution', 'numel', [1], 'values', [0, 1]) 120 116 md = checkfield(md, 'fieldname', 'transient.ishydrology', 'numel', [1], 'values', [0, 1]) … … 122 118 md = checkfield(md, 'fieldname', 'transient.ismovingfront', 'numel', [1], 'values', [0, 1]) 123 119 md = checkfield(md, 'fieldname', 'transient.isslc', 'numel', [1], 'values', [0, 1]) 124 120 md = checkfield(md, 'fieldname', 'transient.isoceancoupling', 'numel', [1], 'values', [0, 1]) 125 md = checkfield(md, 'fieldname', 'transient.iscoupler', 'numel', [1], 'values', [0, 1])126 121 md = checkfield(md, 'fieldname', 'transient.amr_frequency', 'numel', [1], '>=', 0, 'NaN', 1, 'Inf', 1) 127 122 128 123 if solution != 'TransientSolution' and md.transient.iscoupling: … … 135 130 def marshall(self, prefix, md, fid): # {{{ 136 131 WriteData(fid, prefix, 'object', self, 'fieldname', 'issmb', 'format', 'Boolean') 137 132 WriteData(fid, prefix, 'object', self, 'fieldname', 'ismasstransport', 'format', 'Boolean') 133 WriteData(fid, prefix, 'object', self, 'fieldname', 'isoceantransport', 'format', 'Boolean') 138 134 WriteData(fid, prefix, 'object', self, 'fieldname', 'isstressbalance', 'format', 'Boolean') 139 135 WriteData(fid, prefix, 'object', self, 'fieldname', 'isthermal', 'format', 'Boolean') 140 136 WriteData(fid, prefix, 'object', self, 'fieldname', 'isgroundingline', 'format', 'Boolean') 141 WriteData(fid, prefix, 'object', self, 'fieldname', 'isgia', 'format', 'Boolean')142 137 WriteData(fid, prefix, 'object', self, 'fieldname', 'isesa', 'format', 'Boolean') 143 138 WriteData(fid, prefix, 'object', self, 'fieldname', 'isdamageevolution', 'format', 'Boolean') 144 139 WriteData(fid, prefix, 'object', self, 'fieldname', 'ishydrology', 'format', 'Boolean') … … 146 141 WriteData(fid, prefix, 'object', self, 'fieldname', 'issampling', 'format', 'Boolean') 147 142 WriteData(fid, prefix, 'object', self, 'fieldname', 'isslc', 'format', 'Boolean') 148 143 WriteData(fid, prefix, 'object', self, 'fieldname', 'isoceancoupling', 'format', 'Boolean') 149 WriteData(fid, prefix, 'object', self, 'fieldname', 'iscoupler', 'format', 'Boolean')150 144 WriteData(fid, prefix, 'object', self, 'fieldname', 'amr_frequency', 'format', 'Integer') 151 145 152 146 # Process requested outputs -
../trunk-jpl/src/m/solve/solve.py
1 1 from datetime import datetime 2 2 import os 3 import shutil4 3 5 4 from ismodelselfconsistent import ismodelselfconsistent 6 5 from loadresultsfromcluster import loadresultsfromcluster … … 21 20 Solution types available comprise: 22 21 - 'Stressbalance' or 'sb' 23 22 - 'Masstransport' or 'mt' 23 - 'Oceantransport' or 'oceant' 24 24 - 'Thermal' or 'th' 25 25 - 'Steadystate' or 'ss' 26 26 - 'Transient' or 'tr' … … 31 31 - 'Hydrology' or 'hy' 32 32 - 'DamageEvolution' or 'da' 33 33 - 'Gia' or 'gia' 34 - 'Love' or 'lv' 34 35 - 'Esa' or 'esa' 35 - 'Sealevelchange' or 'slc'36 - 'Love' or 'lv'37 36 - 'Sampling' or 'smp' 38 37 39 38 Extra options: … … 54 53 solutionstring = 'StressbalanceSolution' 55 54 elif solutionstring.lower() == 'mt' or solutionstring.lower() == 'masstransport': 56 55 solutionstring = 'MasstransportSolution' 56 elif solutionstring.lower() == 'oceant' or solutionstring.lower() == 'oceantransport': 57 solutionstring = 'OceantransportSolution' 57 58 elif solutionstring.lower() == 'th' or solutionstring.lower() == 'thermal': 58 59 solutionstring = 'ThermalSolution' 59 60 elif solutionstring.lower() == 'st' or solutionstring.lower() == 'steadystate': … … 78 79 solutionstring = 'LoveSolution' 79 80 elif solutionstring.lower() == 'esa': 80 81 solutionstring = 'EsaSolution' 81 elif solutionstring.lower() == 'slc' or solutionstring.lower() == 'sealevelchange':82 solutionstring = 'SealevelchangeSolution'83 82 elif solutionstring.lower() == 'smp' or solutionstring.lower() == 'sampling': 84 83 solutionstring = 'SamplingSolution' 85 84 else: … … 150 149 # Wait on lock 151 150 if md.settings.waitonlock > 0: 152 151 islock = waitonlock(md) 153 if islock == 0: 152 if islock == 0: # no results to be loaded 154 153 print('The results must be loaded manually with md = loadresultsfromcluster(md).') 155 else: 154 else: # load results 156 155 if md.verbose.solution: 157 156 print('loading results from cluster') 158 157 md = loadresultsfromcluster(md) -
../trunk-jpl/test/NightlyRun/test2001.py
3 3 4 4 import numpy as np 5 5 6 from giaivins import giaivins6 from materials import * 7 7 from model import * 8 8 from parameterize import * 9 9 from setflowequation import * … … 16 16 md = setmask(md, '', '') 17 17 md = parameterize(md, '../Par/SquareSheetConstrained.py') 18 18 19 #GIA 20 md.gia = giaivins() 21 md.gia.lithosphere_thickness = 100. * np.ones(md.mesh.numberofvertices) # in km 22 md.gia.mantle_viscosity = 1.0e21 * np.ones(md.mesh.numberofvertices) # in Pa.s 23 md.materials.lithosphere_shear_modulus = 6.7e10 # in Pa 24 md.materials.lithosphere_density = 3.32 # in g/cm^3 25 md.materials.mantle_shear_modulus = 1.45e11 # in Pa 26 md.materials.mantle_density = 3.34 # in g/cm^3 19 # GIA Ivins, 2 layer model 20 md.solidearth.settings.grdmodel = 2 27 21 28 #Indicate what you want to compute 29 md.gia.cross_section_shape = 1 # for square-edged x-section 22 md.materials = materials('litho','ice') 23 md.materials.numlayers = 2; 24 md.materials.radius = [10, 6271e3, 6371e3] 25 md.materials.density = [3.34e3, 3.32e3] 26 md.materials.lame_mu = [1.45e11, 6.7e10] 27 md.materials.viscosity = [1e21, 0] 28 md.initialization.sealevel = np.zeros(md.mesh.numberofvertices) 29 md.solidearth.settings.cross_section_shape = 1 # for square-edged x-section 30 md.solidearth.settings.computesealevelchange = 0 # do not compute sea level, only deformation 31 md.solidearth.requested_outputs = ['Sealevel', 'SealevelUGrd'] 30 32 31 #Define loading history (see test2001.m for the description) 32 md.timestepping.start_time = 2400000 # 2, 400 kyr 33 md.timestepping.final_time = 2500000 # 2, 500 kyr 34 md.geometry.thickness = np.array([ 35 np.append(md.geometry.thickness * 0.0, 0.0), 36 np.append(md.geometry.thickness / 2.0, 0.1), 37 np.append(md.geometry.thickness, 0.2), 38 np.append(md.geometry.thickness, 1.0), 39 np.append(md.geometry.thickness, md.timestepping.start_time) 33 # Loading history 34 md.timestepping.start_time = -2400000 # 4,800 kyr :: EVALUATION TIME 35 md.timestepping.time_step = 2400000 # 2,400 kyr :: EVALUATION TIME 36 # To get rid of default final_time, make sure final_time > start_time 37 md.timestepping.final_time = 2400000 # 2,400 kyr 38 md.masstransport.spcthickness np.array([ 39 np.append(md.geometry.thickness, 0), 40 np.append(md.geometry.thickness, 2400000) 40 41 ]).T 41 42 43 # Geometry at 0 initially 44 md.geometry.thickness = np.zeros(md.mesh.numberofvertices) 45 md.geometry.surface = np.zeros(md.mesh.numberofvertices) 46 md.geometry.base = np.zeros(md.mesh.numberofvertices) 47 48 # Physics 49 md.transient.issmb = 0 50 md.transient.isstressbalance = 0 51 md.transient.isthermal = 0 52 md.transient.ismasstransport = 0 53 md.transient.isslc = 0 54 42 55 #Solve for GIA deflection 56 md.cluster = generic('name', gethostname(), 'np', 1) 43 57 md.cluster = generic('name', gethostname(), 'np', 3) 44 md.verbose = verbose('1111111') 45 md = solve(md, 'Gia') 58 md.verbose = verbose('11111111111') 59 md.verbose.solver = 0 60 md = solve(md, 'Transient') 46 61 47 62 #Fields and tolerances to track changes 48 field_names = ['UG ia', 'UGiaRate']49 field_tolerances = [1e-13 , 1e-13]50 field_values = [md.results. GiaSolution.UGia, md.results.GiaSolution.UGiaRate]63 field_names = ['UGrd'] 64 field_tolerances = [1e-13] 65 field_values = [md.results.TransientSolution[0].SealevelUGrd]
Note:
See TracBrowser
for help on using the repository browser.