Changeset 24521
- Timestamp:
- 01/14/20 20:09:11 (5 years ago)
- Location:
- issm/trunk-jpl/src/m/classes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/slr.js
r22955 r24521 7 7 //methods 8 8 this.setdefaultparameters = function (){ //{{{ 9 9 10 10 //Convergence criterion: absolute, relative and residual 11 this.reltol=0.01; // 1 per cent 11 this.reltol=0.01; // 1 per cent 12 12 this.abstol=NaN; //default 13 13 … … 15 15 this.maxiter=5; 16 16 17 //computational flags: 17 //computational flags: 18 18 this.rigid=1; 19 19 this.elastic=1; 20 20 this.rotation=0; 21 21 this.ocean_area_scaling=0; 22 23 //tidal love numbers: 22 23 //tidal love numbers: 24 24 this.tide_love_h=0.6149; //degree 2 25 25 this.tide_love_k=0.3055; //degree 2 26 27 //secular fluid love number: 28 this.fluid_love=0.942; 29 30 //moment of inertia: 31 this.equatorial_moi=8.0077*10^37; // [kg m^2] 32 this.polar_moi =8.0345*10^37; // [kg m^2] 26 27 //secular fluid love number: 28 this.fluid_love=0.942; 29 30 //moment of inertia: 31 this.equatorial_moi=8.0077*10^37; // [kg m^2] 32 this.polar_moi =8.0345*10^37; // [kg m^2] 33 33 34 34 // mean rotational velocity of earth: 35 this.angular_velocity=7.2921*10^-5; // [s^-1] 35 this.angular_velocity=7.2921*10^-5; // [s^-1] 36 36 37 37 //numerical discretization accuracy 38 38 this.degacc=.01; 39 40 //steric: 39 40 //steric: 41 41 this.steric_rate=0; 42 43 42 43 44 44 //output default: 45 45 this.requested_outputs=['default']; 46 46 47 //transitions should be a cell array of vectors: 47 //transitions should be a cell array of vectors: 48 48 this.transitions=[]; 49 49 50 50 }// }}} 51 51 this.checkconsistency = function(md,solution,analyses) { //{{{ 52 52 53 53 //Early return 54 if(ArrayAnyEqual(ArrayIsMember('SealevelriseAnalysis',analyses),0))return; 55 54 if (ArrayAnyEqual(ArrayIsMember('SealevelriseAnalysis',analyses),0) || ArrayAnyEqual(ArrayIsMember('TransientSolution',analyses),0) && !md.transient.isslr) { 55 return; 56 } 57 56 58 md = checkfield(md,'fieldname','slr.deltathickness','NaN',1,'Inf',1,'size',[md.mesh.numberofelements, 1]); 57 59 md = checkfield(md,'fieldname','slr.sealevel','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices, 1]); … … 71 73 md = checkfield(md,'fieldname','slr.degacc','size',[1, 1],'>=',1e-10); 72 74 md = checkfield(md,'fieldname','slr.requested_outputs','stringrow',1); 73 74 //check that love numbers are provided at the same level of accuracy: 75 76 //check that love numbers are provided at the same level of accuracy: 75 77 if (this.love_h.length != this.love_k.length || this.love_h.length != this.love_l.length){ 76 78 throw Error('slr error message: love numbers should be provided at the same level of accuracy'); … … 85 87 }// }}} 86 88 this.disp= function(){// {{{ 87 89 88 90 console.log(sprintf(' Sealevelrise solution parameters:')); 89 91 … … 95 97 fielddisplay(this,'love_h','load Love number for radial displacement'); 96 98 fielddisplay(this,'love_k','load Love number for gravitational potential perturbation'); 97 fielddisplay(this,'love_l','load Love number for horizontal displacements'); 99 fielddisplay(this,'love_l','load Love number for horizontal displacements'); 98 100 fielddisplay(this,'tide_love_h','tidal love number (degree 2)'); 99 101 fielddisplay(this,'tide_love_k','tidal love number (degree 2)'); … … 101 103 fielddisplay(this,'equatorial_moi','mean equatorial moment of inertia [kg m^2]'); 102 104 fielddisplay(this,'polar_moi','polar moment of inertia [kg m^2]'); 103 fielddisplay(this,'angular_velocity','mean rotational velocity of earth [per second]'); 105 fielddisplay(this,'angular_velocity','mean rotational velocity of earth [per second]'); 104 106 fielddisplay(this,'rigid','rigid earth graviational potential perturbation'); 105 107 fielddisplay(this,'elastic','elastic earth graviational potential perturbation'); 106 108 fielddisplay(this,'rotation','rotational earth potential perturbation'); 107 fielddisplay(this,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]'); 109 fielddisplay(this,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]'); 108 110 fielddisplay(this,'degacc',"accuracy (default .01 deg) for numerical discretization of the Green's functions"); 109 111 fielddisplay(this,'transitions','indices into parts of the mesh that will be icecaps'); 110 112 fielddisplay(this,'requested_outputs','additional outputs requested'); 111 fielddisplay(this,'steric_rate','rate of steric ocean expansion [mm/yr]'); 113 fielddisplay(this,'steric_rate','rate of steric ocean expansion [mm/yr]'); 112 114 } //}}} 113 115 this.marshall=function(md,prefix,fid) { //{{{ … … 171 173 //{{{ 172 174 this.deltathickness = NaN; 173 this.sealevel = NaN; 175 this.sealevel = NaN; 174 176 this.maxiter = 0; 175 177 this.reltol = 0; … … 178 180 this.love_k = 0; //idam 179 181 this.love_l = 0; //idam 180 this.tide_love_h = 0; 181 this.tide_love_k = 0; 182 this.fluid_love = 0; 183 this.equatorial_moi = 0; 184 this.polar_moi = 0; 185 this.angular_velocity = 0; 182 this.tide_love_h = 0; 183 this.tide_love_k = 0; 184 this.fluid_love = 0; 185 this.equatorial_moi = 0; 186 this.polar_moi = 0; 187 this.angular_velocity = 0; 186 188 this.rigid = 0; 187 189 this.elastic = 0; 188 190 this.rotation = 0; 189 191 this.ocean_area_scaling = 0; 190 this.steric_rate = 0; //rate of ocean expansion from steric effects. 192 this.steric_rate = 0; //rate of ocean expansion from steric effects. 191 193 this.degacc = 0; 192 194 this.requested_outputs = []; -
issm/trunk-jpl/src/m/classes/slr.py
r24519 r24521 127 127 def checkconsistency(self, md, solution, analyses): # {{{ 128 128 #Early return 129 if (solution != 'SealevelriseAnalysis') (solution == 'TransientSolution' and not md.transient.isslr:129 if (solution != 'SealevelriseAnalysis') or (solution == 'TransientSolution' and not md.transient.isslr: 130 130 return md 131 131
Note:
See TracChangeset
for help on using the changeset viewer.