Changeset 8369


Ignore:
Timestamp:
05/20/11 07:33:26 (14 years ago)
Author:
Mathieu Morlighem
Message:

trunk: fixed marshalling and extrusion of forcings

Location:
issm/trunk/src/m/model
Files:
2 edited

Legend:

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

    r8318 r8369  
    153153md.dhdt=project3d(md,md.dhdt,'node');
    154154md.firn_layer=project3d(md,md.firn_layer,'node',md.numlayers);
    155 if ~isnan(md.forcing_accumulation), md.forcing_accumulation=[project3d(md,md.forcing_accumulation(1:end-1,:),'node');md.forcing_accumulation(end,:)]; end
     155if ~isempty(md.forcings),
     156        forcingnames=fieldnames(md.forcings);
     157        numforcings=length(md.forcings);
     158        for i=1:numforcings
     159                forcing=md.forcings.(forcingnames{i});
     160                md.forcings.(forcingnames{i})=[project3d(md,forcing(1:end-1,:),'node');forcing(end,:)];
     161        end
     162end
    156163
    157164%results
  • issm/trunk/src/m/model/marshall.m

    r8365 r8369  
    9595
    9696%deal with forcings
    97 if ~isnans(md.forcings),
     97if ~isempty(md.forcings),
    9898        forcingnames=fieldnames(md.forcings);
    9999        numforcings=length(forcingnames);
    100100        forcingtypes=zeros(numforcings,1);
    101101        for i=1:numforcings,
    102                 forcingtypes(i)=StringToEnum(forcingnames{i});
     102                switch (forcingnames{i})
     103                        case 'accumulation_rate'
     104                                forcingtypes(i)=AccumulationRateEnum;
     105                        case 'melting_rate'
     106                                forcingtypes(i)=MeltingRateEnum;
     107                        otherwise
     108                                error(['forcing ' forcingnames{i} ' not supported yet']);
     109                end
    103110        end
    104111        WriteData(fid,numforcings,'Integer','numforcings');
Note: See TracChangeset for help on using the changeset viewer.