Changeset 6145


Ignore:
Timestamp:
10/04/10 11:25:33 (14 years ago)
Author:
Mathieu Morlighem
Message:

Added some fields to structtomodel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/model/structtomodel.m

    r6124 r6145  
    1818
    1919%some special treatment for models of previous ISSM versions
     20
     21%Field name change
    2022if isfield(structmd,'drag'), md.drag_coefficient=structmd.drag; end
    2123if isfield(structmd,'p'), md.drag_p=structmd.p; end
     
    2325if isfield(structmd,'B'), md.rheology_B=structmd.B; end
    2426if isfield(structmd,'n'), md.rheology_n=structmd.n; end
     27if isfield(structmd,'melting'), md.melting_rate=structmd.melting; end
     28if isfield(structmd,'accumulation'), md.accumulation_rate=structmd.accumulation; end
     29
     30%Field class change
    2531if (isfield(structmd,'type') & ischar(structmd.type)),
    2632        if strcmpi(structmd.type,'2d'), md.dim=2; end
    2733        if strcmpi(structmd.type,'3d'), md.dim=3; end
    2834end
     35
     36%New fields
     37if ~isfield(structmd,'upperelements');
     38        md.upperelements=transpose(1:md.numberofelements)+md.numberofelements2d;
     39        md.upperelements(end-md.numberofelements2d+1:end)=NaN;
     40end
     41if ~isfield(structmd,'lowerelements');
     42        md.lowerelements=transpose(1:md.numberofelements)-md.numberofelements2d;
     43        md.lowerelements(1:md.numberofelements2d)=NaN;
     44end
Note: See TracChangeset for help on using the changeset viewer.