Changeset 27327
- Timestamp:
- 10/24/22 20:23:59 (2 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/fourierlove.py
r26840 r27327 1 1 import numpy as np 2 2 3 from checkfield import checkfield 3 4 from fielddisplay import fielddisplay 4 from checkfield import checkfield5 5 from WriteData import WriteData 6 6 … … 43 43 # - Correct display to match MATLAB 44 44 # 45 s = ' Fourier Love class:\n' 46 s += '{}\n'.format(fielddisplay(self, 'nfreq', 'number of frequencies sampled (default: 1, elastic) [Hz]')) 45 s = '{}\n'.format(fielddisplay(self, 'nfreq', 'number of frequencies sampled (default: 1, elastic) [Hz]')) 47 46 s += '{}\n'.format(fielddisplay(self, 'frequencies', 'frequencies sampled (convention defaults to 0 for the elastic case) [Hz]')) 48 47 s += '{}\n'.format(fielddisplay(self, 'sh_nmax', 'maximum spherical harmonic degree (default: 256, .35 deg, or 40 km at equator)')) … … 64 63 s += '{}\n'.format(fielddisplay(self, 'forcing_type', 'integer indicating the nature and depth of the forcing for the Love number calculation (default: 11):')) 65 64 s += '{}\n'.format(' 1: Inner core boundary -- Volumic Potential') 66 s += '{}\n'.format(' 2: Inner core boundary -- 67 s += '{}\n'.format(' 3: Inner core boundary -- 68 s += '{}\n'.format(' 4: Inner core boundary -- 69 s += '{}\n'.format(' 5: Core mantle boundary -- 70 s += '{}\n'.format(' 6: Core mantle boundary -- 71 s += '{}\n'.format(' 7: Core mantle boundary -- 72 s += '{}\n'.format(' 8: Core mantle boundary -- 73 s += '{}\n'.format(' 9: Surface --Volumic Potential')74 s += '{}\n'.format(' 10: Surface --Pressure')75 s += '{}\n'.format(' 11: Surface --Loading')76 s += '{}\n'.format(' 12: Surface --Tangential traction ')65 s += '{}\n'.format(' 2: Inner core boundary -- Pressure') 66 s += '{}\n'.format(' 3: Inner core boundary -- Loading') 67 s += '{}\n'.format(' 4: Inner core boundary -- Tangential traction') 68 s += '{}\n'.format(' 5: Core mantle boundary -- Volumic Potential') 69 s += '{}\n'.format(' 6: Core mantle boundary -- Pressure') 70 s += '{}\n'.format(' 7: Core mantle boundary -- Loading') 71 s += '{}\n'.format(' 8: Core mantle boundary -- Tangential traction') 72 s += '{}\n'.format(' 9: Surface -- Volumic Potential') 73 s += '{}\n'.format(' 10: Surface -- Pressure') 74 s += '{}\n'.format(' 11: Surface -- Loading') 75 s += '{}\n'.format(' 12: Surface -- Tangential traction ') 77 76 s += '{}\n'.format(fielddisplay(self, 'inner_core_boundary', 'interface index in materials.radius locating forcing. Only used for forcing_type 1--4 (default: 1)')) 78 77 s += '{}\n'.format(fielddisplay(self, 'core_mantle_boundary', 'interface index in materials.radius locating forcing. Only used for forcing_type 5--8 (default: 2)')) … … 87 86 self.sh_nmax = 256 # .35 degree, 40 km at the equator 88 87 self.sh_nmin = 1 89 # Work on matlabscript for computing g0 for given Earth's structure88 # Work on Python script for computing g0 for given Earth's structure 90 89 self.g0 = 9.81 # m/s^2 91 90 self.r0 = 6371 * 1e3 # m … … 129 128 130 129 md = checkfield(md, 'fieldname', 'love.istemporal', 'values', [0, 1]) 130 131 131 if md.love.istemporal: 132 132 md = checkfield(md, 'fieldname', 'love.n_temporal_iterations', 'NaN', 1, 'Inf', 1, 'numel', 1, '>', 0) 133 133 md = checkfield(md, 'fieldname', 'love.time', 'NaN', 1, 'Inf', 1, 'numel', md.love.nfreq / 2 / md.love.n_temporal_iterations) 134 if md.love.sh_nmin <= 1 and (md.love.forcing_type == 9 or md.love.forcing_type == 5 or md.love.forcing_type == 1):134 if md.love.sh_nmin <= 1 and (md.love.forcing_type == 1 or md.love.forcing_type == 5 or md.love.forcing_type == 9): 135 135 raise RuntimeError('Degree 1 not supported for forcing type {}. Use sh_min >= 2 for this kind of calculation.'.format(md.love.forcing_type)) 136 136 -
issm/trunk-jpl/src/m/classes/love.m
r27308 r27327 33 33 hypergeom_table1=0; 34 34 hypergeom_table2=0; 35 hypergeom_ nalpha=0;35 hypergeom_table1=0; 36 36 hypergeom_nz=0; 37 37 hypergeom_z=0; … … 68 68 self.underflow_tol=1e-16; %threshold of deep to surface love number ratio to trigger the deletion of layer 69 69 self.pw_threshold=1e-3; %if relative variation across frequencies is smaller than this ratio, the post-widder transform for time-dependent love numbers is bypassed 70 self.min_integration_steps =50;71 self.max_integration_dr = 10e3;70 self.min_integration_steps=50; 71 self.max_integration_dr=1e4; 72 72 self.integration_scheme=1; 73 73 self.istemporal=0; … … 96 96 fielddisplay(self,'mu0','adimensioning constant for stress (default: 10^11) [Pa]'); 97 97 fielddisplay(self,'Gravitational_Constant','Newtonian constant of gravitation (default: 6.67259e-11 [m^3 kg^-1 s^-2])'); 98 fielddisplay(self,'chandler_wobble','includes the inertial terms for the chandler wobble in the rotational feedback love numbers, only for forcing_type=11 (default: 0) (/!\ 1 is untested yet)');98 fielddisplay(self,'chandler_wobble','includes the inertial terms for the chandler wobble in the rotational feedback love numbers, only for forcing_type=11 (default: 0) (/!\ 1 has not been validated yet)'); 99 99 fielddisplay(self,'allow_layer_deletion','allow for migration of the integration boundary with increasing spherical harmonics degree (default: 1)'); 100 100 fielddisplay(self,'underflow_tol','threshold of deep to surface love number ratio to trigger the deletion of layers (default: 1e-16)'); … … 111 111 fielddisplay(self,'core_mantle_boundary','interface index in materials.radius locating forcing. Only used for forcing_type 5--8 (default: 2)'); 112 112 fielddisplay(self,'complex_computation','return love numbers as 0: real (useful for elastic or temporal forms), 1: complex numbers (useful for Fourier spectral form) (default: 0)'); 113 fielddisplay(self,'quad_precision','to ogle computation love numbers and post-widder transform with 32 digit precision, useful for temporal form (default: 1)');113 fielddisplay(self,'quad_precision','toggle computation love numbers and post-widder transform with 32 digit precision, useful for temporal form (default: 1)'); 114 114 fielddisplay(self,'debug','outputs yi system matrix prior to solving (default: 0)'); 115 115 fielddisplay(self,'hypergeom_table1','table 1 for hypergeometric function, only for EBM rheology (default: [1])'); -
issm/trunk-jpl/src/m/classes/model.py
r26928 r27327 271 271 self.calving = calving() 272 272 self.frontalforcings = frontalforcings() 273 self.love = fourierlove()273 self.love = love() 274 274 self.esa = esa() 275 275 self.sampling = sampling() -
issm/trunk-jpl/src/m/classes/sealevelmodel.py
r26358 r27327 88 88 def checkconsistency(slm, solutiontype): # {{{ 89 89 # Is the coupler turned on? 90 for i in range(len(slm.icecaps)):91 if not slm.icecaps[i].transient.iscoupler:92 print('Warning: sealevelmodel.py::checkconsistency: icecap model {} should have the transient coupler option turned on!'.format(slm.icecaps[i].miscellaneous.name))93 94 if not slm.earth.transient.iscoupler:95 print('Warning: sealevelmodel.py::checkconsistency: earth model should have the transient coupler option turned on!')90 #for i in range(len(slm.icecaps)): 91 # if not slm.icecaps[i].transient.iscoupler: 92 # print('Warning: sealevelmodel.py::checkconsistency: icecap model {} should have the transient coupler option turned on!'.format(slm.icecaps[i].miscellaneous.name)) 93 94 #if not slm.earth.transient.iscoupler: 95 # print('Warning: sealevelmodel.py::checkconsistency: earth model should have the transient coupler option turned on!') 96 96 97 97 # Check that the transition vectors have the right size 98 for i in range(len(slm.icecaps)): 99 if slm.icecaps[i].mesh.numberofvertices != len(slm.earth.slr.transitions[i]): 100 raise Exception('sealevelmodel.py::checkconsistency: issue with size of transition vector for ice cap: {} name: {}'.format(i, slm.icecaps[i].miscellaneous.name)) 98 if slm.earth.mesh.numberofvertices != len(slm.earth.solidearth.transfercount): 99 raise Exception('sealevelmodel.py::checkconsistency: earth.solidearth.transfercount should be of size earth.mesh.numberofvertices') 101 100 102 101 # Check that run frequency is the same everywhere … … 108 107 for i in range(len(slm.icecaps)): 109 108 md = slm.icecaps[i] 110 if np.nonzero(md.dsl.s teric_rate - slm.earth.dsl.steric_rate[slm.earth.dsl.transitions[i]]) != []:109 if np.nonzero(md.dsl.sea_surface_height_above_geoid - slm.earth.dsl.sea_surface_height_above_geoid[slm.transitions[i]]) != []: 111 110 raise Exception('sealevelmodel.py::checkconsistency: steric rate on ice cap {} is not the same as for the earth'.format(md.miscellaneous.name)) 112 111 … … 114 113 for i in range(len(slm.icecaps)): 115 114 md = slm.icecaps[i] 116 if md.solidearth settings.isgrd != slm.earth.solidearthsettings.isgrd:115 if md.solidearth.settings.isgrd != slm.earth.solidearth.settings.isgrd: 117 116 raise RuntimeError('sealevelmodel.py::checkconsistency: isgrd on ice cap {} is not the same as for the earth\n'.format(md.miscellaneous.name)) 118 117 … … 221 220 self.transitions = [] 222 221 self.eltransitions = [] 222 self.earth.solidearth.transfercount = np.zeros(self.earth.mesh.numberofvertices) 223 223 224 224 # For elements … … 240 240 self.transitions.append(meshintersect3d(self.earth.mesh.x, self.earth.mesh.y, self.earth.mesh.z, mdi.mesh.x, mdi.mesh.y, mdi.mesh.z, 'force', force)) 241 241 self.eltransitions.append(meshintersect3d(xe, ye, ze, xei, yei, zei, 'force', force)) 242 243 self.earth.solidearth.transfercount[self.transitions[i]] = self.earth.solidearth/transfercount[self.transitions[i]] + 1 244 245 for i in range(len(self.icecaps)): 246 self.icecaps[i].solidearth.transfercount = self.earth.solidearth.transfercount[self.transitions[i]] 242 247 # }}} 243 248 … … 246 251 for i in range(len(self.basins)): 247 252 flags[self.transitions[i]] = i 248 plotmodel(self.earth, 'data', flags, 'coastline ', 'on')253 plotmodel(self.earth, 'data', flags, 'coastlines', 'on') 249 254 # }}} 250 255 -
issm/trunk-jpl/src/m/solve/solveslm.py
r26358 r27327 77 77 nps.append(slm.earth.cluster.np) 78 78 79 BuildQueueScriptMultipleModels(cluster, slm.private.runtimename, slm.miscellaneous.name, slm.private.solution, valgrind,privateruntimenames, miscellaneousnames, nps)79 BuildQueueScriptMultipleModels(cluster, slm.private.runtimename, slm.miscellaneous.name, slm.private.solution, privateruntimenames, miscellaneousnames, nps) 80 80 81 81 # Upload all required files, given that each individual solution for icecaps and earth model already did -
issm/trunk-jpl/test/NightlyRun/test2084.py
r26881 r27327 56 56 md.love.pw_threshold = 1e-3 57 57 md.love.Gravitational_Constant = 6.6732e-11 58 md.love.integration_steps_per_layer = 10059 58 md.love.allow_layer_deletion = 1 60 59 md.love.forcing_type = 11
Note:
See TracChangeset
for help on using the changeset viewer.