source: issm/trunk-jpl/src/m/classes/dsl.js@ 24469

Last change on this file since 24469 was 24469, checked in by Eric.Larour, 5 years ago

CHG: new dsl class to take care of the dynamic sea level in our sealevelrise_core. We made a new field
to the model class to fit the dsl fields. The fields come from the slr steric rates class essentially.
We also added GetStericRate and GetDynamicRate to the sea level core, which splits what used to be only
the steric rate field.

File size: 2.7 KB
RevLine 
[24469]1//dsl Class definition
2//
3// Usage:
4// dsl=dsl();
5
6function dsl(){
7 //methods
8 this.setdefaultparameters = function(){// {{{
9 this.requested_outputs=['default'];
10 } // }}}
11 this.disp = function(){ // {{{
12 console.log(sprintf(' dsl parameters:'));
13 fielddisplay(this,'global_average_thermosteric_sea_level_change','corresponds to zostoga field in CMIP5 archives. Specified as a temporally variable global rate (mm/yr)');
14 fielddisplay(this,'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)');
15 fielddisplay(this,'sea_water_pressure_change_at_sea_floor','corresponds to bpo field in CMIP5 archives. Specified as a spatio-temporally variable rate (in Pa/yr)');
16
17
18 } // }}}
19 this.defaultoutputs = function(){ // {{{
20 return '';
21 }//}}}
22 this.classname = function(){ // {{{
23 return "dsl";
24 } // }}}
25 this.extrude = function(md) {//{{{
26 this.sea_surface_height_change_above_geoid=project3d(md,'vector',this.sea_surface_height_change_above_geoid,'type','node');
27 this.sea_water_pressure_change_at_sea_floor=project3d(md,'vector',this.sea_water_pressure_change_at_sea_floor,'type','node');
28 return this;
29 }//}}}
30 this.checkconsistency = function(md,solution,analyses) { //{{{
31
32 if(ArrayAnyEqual(ArrayIsMember('SealevelriseAnalysis',analyses),1)){
33 checkfield(md,'fieldname','dsl.sea_surface_height_change_above_geoid','timeseries',1,'NaN',1,'Inf',1);
34 checkfield(md,'fieldname','dsl.sea_water_pressure_change_at_sea_floor','timeseries',1,'NaN',1,'Inf',1);
35 }
36
37 } // }}}
38 this.marshall=function(md,prefix,fid) { //{{{
39
40 var yts=md.constants.yts;
41
42 WriteData(fid,prefix,'name','md.dsl.model','data',1,'format','Integer');
43 WriteData(fid,prefix,'object',this,'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);
44 WriteData(fid,prefix,'object',this,'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);
45 WriteData(fid,prefix,'object',this,'class',dsl,'fieldname','sea_surface_height_change_above_geoid','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
46 }//}}}
47 this.fix=function() { //{{{
48 }//}}}
49 //properties
50 // {{{
51 this.global_average_thermosteric_sea_level_change = NaN;
52 this.sea_surface_height_change_above_geoid = NaN;
53 this.sea_water_pressure_change_at_sea_floor = NaN;
54 // }}}
55}
Note: See TracBrowser for help on using the repository browser.