source: issm/trunk/src/m/classes/constants.m@ 11995

Last change on this file since 11995 was 11995, checked in by Mathieu Morlighem, 13 years ago

merged trunk-jpl and trunk for revision 11994M

File size: 1.5 KB
Line 
1%CONSTANTS class definition
2%
3% Usage:
4% constants=constants();
5
6classdef constants
7 properties (SetAccess=public)
8 g = 0;
9 yts = 0;
10 referencetemperature = 0;
11 end
12 methods
13 function obj = constants(varargin) % {{{
14 switch nargin
15 case 0
16 obj=setdefaultparameters(obj);
17 otherwise
18 error('constructor not supported');
19 end
20 end % }}}
21 function obj = setdefaultparameters(obj) % {{{
22
23 %acceleration due to gravity (m/s^2)
24 obj.g=9.81;
25
26 %converstion from year to seconds
27 obj.yts=365*24*3600;
28
29 %the reference temperature for enthalpy model (cf Aschwanden)
30 obj.referencetemperature=223.15;
31
32 end % }}}
33 function flag = checkconsistency(obj,md,solution,analyses) % {{{
34
35 checkfield(md,'constants.g','>',0,'size',[1 1]);
36 checkfield(md,'constants.yts','>',0,'size',[1 1]);
37 checkfield(md,'constants.referencetemperature','size',[1 1]);
38
39 end % }}}
40 function disp(obj) % {{{
41 disp(sprintf(' constants parameters:'));
42
43 fielddisplay(obj,'g','gravitational acceleration');
44 fielddisplay(obj,'yts','number of seconds in a year');
45 fielddisplay(obj,'referencetemperature','reference temperature used in the enthalpy model');
46
47 end % }}}
48 function marshall(obj,fid) % {{{
49 WriteData(fid,'object',obj,'fieldname','g','format','Double');
50 WriteData(fid,'object',obj,'fieldname','yts','format','Double');
51 WriteData(fid,'object',obj,'fieldname','referencetemperature','format','Double');
52 end % }}}
53 end
54end
Note: See TracBrowser for help on using the repository browser.