model2ocmodel

PURPOSE ^

MODEL2OCMODEL - create an out of core model

SYNOPSIS ^

function md2=model2ocmodel(md,repository)

DESCRIPTION ^

MODEL2OCMODEL - create an out of core model

   This routine will take an input model, running in core (ie: md.repository=''),
   and copy all its fields to an output model which will run out of core on 'repository'.

   Usage:
      md2=model2ocmodel(md,repository);

   Example:
      md2=model2ocmodel(md,'PineIsland');

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function md2=model2ocmodel(md,repository)
0002 %MODEL2OCMODEL - create an out of core model
0003 %
0004 %   This routine will take an input model, running in core (ie: md.repository=''),
0005 %   and copy all its fields to an output model which will run out of core on 'repository'.
0006 %
0007 %   Usage:
0008 %      md2=model2ocmodel(md,repository);
0009 %
0010 %   Example:
0011 %      md2=model2ocmodel(md,'PineIsland');
0012 
0013 md2=model(repository);
0014 
0015 structfields=fields(md);
0016 for i=1:length(structfields),
0017     field=structfields(i);field=field{1};
0018     if strcmpi(field,'repository'),
0019         %we don't want to clobber md2.repository!
0020         continue;
0021     end
0022     fieldval=getfield(md,field);
0023     if isfield(struct(md2),field),
0024     eval(['md2.' field '=fieldval;']);
0025     end
0026 end

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003