Ignore:
Timestamp:
08/29/15 11:55:39 (10 years ago)
Author:
Eric.Larour
Message:

CHG: moved md.surfaceforcings to md.smb.
By doing so, had to rename the SMB class to SMBforcing class (it's just that, a mass_balance forcing inside
a SMB class, hence the name).
We also now have an smb_core solution, taken out of the mass transport core. Makes more sense long term.
Synced all enums according to the new changes, and operated the adjustments in all the test decks.

In addition, progressing in terms of GEMB integration into ISSM, specifically at the SMBgemb level (which
is spurring all the changes described above). Brought the class up to the level of the GEMB.m call in Alex's
code. Starting the C integration now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/SMBgradients.m

    r19040 r19527  
    1010                b_pos  = NaN;
    1111                b_neg  = NaN;
     12                requested_outputs      = {};
    1213        end
    1314        methods
     
    2526
    2627                end % }}}
     28                function list = defaultoutputs(self,md) % {{{
     29                        list = {''};
     30                end % }}}
    2731                function self = initialize(self,md) % {{{
    2832
     
    3842
    3943                        if ismember(MasstransportAnalysisEnum(),analyses),
    40                                 md = checkfield(md,'fieldname','surfaceforcings.href','timeseries',1,'NaN',1);
    41                                 md = checkfield(md,'fieldname','surfaceforcings.smbref','timeseries',1,'NaN',1);
    42                                 md = checkfield(md,'fieldname','surfaceforcings.b_pos','timeseries',1,'NaN',1);
    43                                 md = checkfield(md,'fieldname','surfaceforcings.b_neg','timeseries',1,'NaN',1);
     44                                md = checkfield(md,'fieldname','smb.href','timeseries',1,'NaN',1);
     45                                md = checkfield(md,'fieldname','smb.smbref','timeseries',1,'NaN',1);
     46                                md = checkfield(md,'fieldname','smb.b_pos','timeseries',1,'NaN',1);
     47                                md = checkfield(md,'fieldname','smb.b_neg','timeseries',1,'NaN',1);
    4448                        end
     49                        md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1);
    4550                end % }}}
    4651                function disp(self) % {{{
     
    5257                        fielddisplay(self,'b_pos',' slope of hs - smb regression line for accumulation regime required if smb gradients is activated');
    5358                        fielddisplay(self,'b_neg',' slope of hs - smb regression line for ablation regime required if smb gradients is activated');
     59                        fielddisplay(self,'requested_outputs','additional outputs requested');
    5460
    5561                end % }}}
     
    5864                        yts=365.0*24.0*3600.0;
    5965
    60                         WriteData(fid,'enum',SurfaceforcingsEnum(),'data',SMBgradientsEnum(),'format','Integer');
    61                         WriteData(fid,'object',self,'class','surfaceforcings','fieldname','href','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);
    62                         WriteData(fid,'object',self,'class','surfaceforcings','fieldname','smbref','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);
    63                         WriteData(fid,'object',self,'class','surfaceforcings','fieldname','b_pos','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);
    64                         WriteData(fid,'object',self,'class','surfaceforcings','fieldname','b_neg','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);
     66                        WriteData(fid,'enum',SmbEnum(),'data',SMBgradientsEnum(),'format','Integer');
     67                        WriteData(fid,'object',self,'class','smb','fieldname','href','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);
     68                        WriteData(fid,'object',self,'class','smb','fieldname','smbref','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);
     69                        WriteData(fid,'object',self,'class','smb','fieldname','b_pos','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);
     70                        WriteData(fid,'object',self,'class','smb','fieldname','b_neg','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);
     71                       
     72                        %process requested outputs
     73                        outputs = self.requested_outputs;
     74                        pos  = find(ismember(outputs,'default'));
     75                        if ~isempty(pos),
     76                                outputs(pos) = [];                         %remove 'default' from outputs
     77                                outputs      = [outputs defaultoutputs(self,md)]; %add defaults
     78                        end
     79                        WriteData(fid,'data',outputs,'enum',SmbRequestedOutputsEnum,'format','StringArray');
    6580
    6681                end % }}}
Note: See TracChangeset for help on using the changeset viewer.