Changeset 21148


Ignore:
Timestamp:
08/18/16 10:07:27 (9 years ago)
Author:
Mathieu Morlighem
Message:

CHG: better way to deal with recovering old SMB fields

Location:
issm/trunk-jpl/src/m/classes
Files:
2 edited

Legend:

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

    r21049 r21148  
    1313                        switch nargin
    1414                                case 0
     15                                case 1
     16                                        inputstruct=varargin{1};
     17                                        list1 = properties('SMBhenning');
     18                                        list2 = fieldnames(inputstruct);
     19                                        for i=1:length(list1)
     20                                                fieldname = list1{i};
     21                                                if ismember(fieldname,list2),
     22                                                        self.(fieldname) = inputstruct.(fieldname);
     23                                                end
     24                                        end
    1525                                otherwise
    1626                                        error('constructor not supported');
  • issm/trunk-jpl/src/m/classes/model.m

    r21097 r21148  
    10441044                        end
    10451045                        %2014 January 9th
    1046                         if isfield(structmd,'surfaceforcings'),
     1046                        if isfield(structmd,'surfaceforcings') & isa(md.smb,'surfaceforcings'),
    10471047                                disp('Recovering old surfaceforcings class');
    10481048                                mass_balance=structmd.surfaceforcings.mass_balance;
     
    10511051                        end
    10521052                        %2015 September 10
    1053                         if isfield(structmd,'surfaceforcings') & isa(md.smb,'SMB'),
     1053                        if isfield(structmd,'surfaceforcings') & isa(structmd.surfaceforcings,'SMB'),
    10541054                                disp('Recovering old SMB class');
    10551055                                md.smb=SMBforcing(structmd.surfaceforcings);
     1056                        end
     1057                        if isfield(structmd,'surfaceforcings') & isa(structmd.surfaceforcings,'SMBhenning'),
     1058                                disp('Recovering old SMBhenning class');
     1059                                md.smb=SMBhenning(structmd.surfaceforcings);
    10561060                        end
    10571061
Note: See TracChangeset for help on using the changeset viewer.