source: issm/trunk/src/m/classes/basalforcings.m@ 9769

Last change on this file since 9769 was 9769, checked in by Mathieu Morlighem, 14 years ago

minor (do not check for now)

File size: 1.2 KB
Line 
1%BASAL FORCINGS class definition
2%
3% Usage:
4% basalforcings=basalforcings();
5
6classdef basalforcings
7 properties (SetAccess=public)
8 melting_rate = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
9 melting_rate_correction = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
10 geothermalflux = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1);
11 end
12 methods
13 function obj = basalforcings(varargin) % {{{
14 switch nargin
15 case 0
16 obj=setdefaultparameters(obj);
17 case 1
18 in=varargin{1};
19 if (isa(in,'numeric') & in==0),
20 % requesting templates do nothing
21 else
22 error('constructor not supported');
23 end
24 otherwise
25 error('constructor not supported');
26 end
27 end % }}}
28 function obj = setdefaultparameters(obj) % {{{
29
30 %first, use the defaults provided by the properties definition above.
31 fieldnames=fields(obj);
32 for i=1:length(fieldnames),
33 fieldname=fieldnames{i};
34 obj.(fieldname)=obj.(fieldname).default;
35 end
36 end % }}}
37 function checkconsistency(obj,md) % {{{
38
39 %fields={'melting_rate','geothermalflux'};
40 checksize(md,'basalforcings',fields,[md.mesh.numberofvertices 1]);
41 end % }}}
42 end
43end
Note: See TracBrowser for help on using the repository browser.