source: issm/trunk-jpl/src/m/classes/calvingdev.m@ 21626

Last change on this file since 21626 was 21626, checked in by youngmc3, 8 years ago

CHG: added calving stress thresholds and calving max parameters

File size: 2.4 KB
Line 
1%CALVINGDEV class definition
2%
3% Usage:
4% calvingdev=calvingdev();
5
6classdef calvingdev
7 properties (SetAccess=public)
8 stress_threshold_groundedice = 0.;
9 stress_threshold_floatingice = 0.;
10 meltingrate = NaN;
11 end
12 methods
13 function self = calvingdev(varargin) % {{{
14 switch nargin
15 case 0
16 self=setdefaultparameters(self);
17 case 1
18 inputstruct=varargin{1};
19 list1 = properties('calvingdev');
20 list2 = fieldnames(inputstruct);
21 for i=1:length(list1)
22 fieldname = list1{i};
23 if ismember(fieldname,list2),
24 self.(fieldname) = inputstruct.(fieldname);
25 end
26 end
27 otherwise
28 error('constructor not supported');
29 end
30 end % }}}
31 function self = extrude(self,md) % {{{
32 self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node');
33 end % }}}
34 function self = setdefaultparameters(self) % {{{
35
36 %Proportionality coefficient in Pi model
37 %self.coeff=2e13;
38
39 %Default sigma max
40 self.stress_threshold_groundedice = 1e6;
41 self.stress_threshold_floatingice = 150e3;
42 end % }}}
43 function md = checkconsistency(self,md,solution,analyses) % {{{
44 %Early return
45 if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end
46
47 md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'numel',1,'nan',1,'Inf',1);
48 md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'numel',1,'nan',1,'Inf',1);
49 md = checkfield(md,'fieldname','calving.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0);
50 end % }}}
51 function disp(self) % {{{
52 disp(sprintf(' Calving Pi parameters:'));
53 fielddisplay(self,'stress_threshold_groundedice','sigma_max applied to grounded ice only [Pa]');
54 fielddisplay(self,'stress_threshold_floatingice','sigma_max applied to floating ice only [Pa]');
55 fielddisplay(self,'meltingrate','melting rate at given location [m/a]');
56
57 end % }}}
58 function marshall(self,prefix,md,fid) % {{{
59 yts=md.constants.yts;
60 WriteData(fid,prefix,'name','md.calving.law','data',2,'format','Integer');
61 WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_groundedice','format','DoubleMat','mattype',1);
62 WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_floatingice','format','DoubleMat','mattype',1);
63 WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts);
64 end % }}}
65 end
66end
Note: See TracBrowser for help on using the repository browser.