[9612] | 1 | %BASAL FORCINGS class definition
|
---|
| 2 | %
|
---|
| 3 | % Usage:
|
---|
| 4 | % basalforcings=basalforcings();
|
---|
| 5 |
|
---|
| 6 | classdef basalforcings
|
---|
| 7 | properties (SetAccess=public)
|
---|
[10981] | 8 | melting_rate = NaN;
|
---|
| 9 | melting_rate_correction = NaN;
|
---|
| 10 | geothermalflux = NaN;
|
---|
[9612] | 11 | end
|
---|
| 12 | methods
|
---|
| 13 | function obj = basalforcings(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 | end % }}}
|
---|
[12706] | 24 | function md = checkconsistency(obj,md,solution,analyses) % {{{
|
---|
[9739] | 25 |
|
---|
[13395] | 26 | if ismember(PrognosticAnalysisEnum(),analyses) & ~(solution==TransientSolutionEnum() & md.transient.isprognostic==0),
|
---|
[12706] | 27 | md = checkfield(md,'basalforcings.melting_rate','NaN',1,'forcing',1);
|
---|
[9854] | 28 | end
|
---|
[13395] | 29 | if ismember(BalancethicknessAnalysisEnum(),analyses),
|
---|
[12706] | 30 | md = checkfield(md,'basalforcings.melting_rate','NaN',1,'size',[md.mesh.numberofvertices 1]);
|
---|
[9854] | 31 | end
|
---|
[13395] | 32 | if ismember(ThermalAnalysisEnum(),analyses) & ~(solution==TransientSolutionEnum() & md.transient.isthermal==0),
|
---|
[12706] | 33 | md = checkfield(md,'basalforcings.melting_rate','NaN',1,'forcing',1);
|
---|
| 34 | md = checkfield(md,'basalforcings.geothermalflux','NaN',1,'forcing',1,'>=',0);
|
---|
[9854] | 35 | end
|
---|
[9739] | 36 | end % }}}
|
---|
[9799] | 37 | function disp(obj) % {{{
|
---|
| 38 | disp(sprintf(' basal forcings parameters:'));
|
---|
| 39 |
|
---|
[15396] | 40 | fielddisplay(obj,'melting_rate','basal melting rate (positive if melting) [m/yr]');
|
---|
| 41 | fielddisplay(obj,'melting_rate_correction','additional melting applied to compensate for dh/dt [m/yr]');
|
---|
[9799] | 42 | fielddisplay(obj,'geothermalflux','geothermal heat flux [W/m^2]');
|
---|
| 43 |
|
---|
| 44 | end % }}}
|
---|
[15396] | 45 | function marshall(obj,md,fid) % {{{
|
---|
| 46 |
|
---|
| 47 | yts=365.0*24.0*3600.0;
|
---|
| 48 |
|
---|
| 49 | WriteData(fid,'object',obj,'fieldname','melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
|
---|
| 50 | WriteData(fid,'object',obj,'fieldname','melting_rate_correction','format','DoubleMat','mattype',1,'scale',1./yts);
|
---|
| 51 | WriteData(fid,'object',obj,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
|
---|
[10981] | 52 | end % }}}
|
---|
[9612] | 53 | end
|
---|
| 54 | end
|
---|