0001 function plotmodel(md,varargin)
0002
0003
0004 global ISSM_DIR
0005 if isempty(ISSM_DIR),
0006 error('ISSM_DIR variable got erased! This variable is needed to run Ice code correctly. Please rerun your startup file.');
0007 end
0008
0009
0010 datavalues=findarg(varargin,'data');
0011 numberofplots=length(datavalues);
0012 subplotwidth=ceil(sqrt(numberofplots));
0013
0014
0015 figurevalues=findarg(varargin,'figure');
0016 if ~isempty(figurevalues),
0017 if length(figurevalues)>1,
0018 error('plotmodel error message: only one figure allowed');
0019 else
0020 figurenumber=figurevalues.value;
0021 end
0022 else
0023 figurenumber=1;
0024 end
0025
0026
0027 if numberofplots,
0028
0029
0030 options=recover_plot_options(md,varargin,numberofplots);
0031
0032
0033 figure(figurenumber),clf;
0034
0035
0036 for i=1:numberofplots,
0037
0038
0039 plot_unit(md,options{i},subplotwidth,i);
0040
0041 end
0042 else
0043 error('plotmodel error message: no output data found. ');
0044 end