Index: /issm/trunk/src/m/solutions/dakota/plot_boxplot.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/plot_boxplot.m	(revision 1012)
+++ /issm/trunk/src/m/solutions/dakota/plot_boxplot.m	(revision 1013)
@@ -1,8 +1,36 @@
 %
-%  plot a box plot of the response functions.
+%  plot a box plot of the responses.
 %
-%  []=plot_boxplot(rfunc)
+%  []=plot_boxplot(dresp)
 %
-function []=plot_boxplot(rfunc)
+%  where the required input is:
+%    dresp         (structure array, responses)
+%
+%  the required fields of dresp are:
+%    descriptor    (char, description)
+%    sample        (double vector, list of samples)
+%
+%  for each response in the input array, this functionplots a
+%  matlab box plot of the list of samples and annotates it
+%  with the description.  the lists of samples need not all be
+%  the same length.
+%
+%  this data would typically be contained in the dakota tabular
+%  output file and read by dakota_out_parse.
+%
+%  "Copyright 2009, by the California Institute of Technology.
+%  ALL RIGHTS RESERVED. United States Government Sponsorship
+%  acknowledged. Any commercial use must be negotiated with
+%  the Office of Technology Transfer at the California Institute
+%  of Technology.  (NTR 47078)
+%
+%  This software may be subject to U.S. export control laws.
+%  By accepting this  software, the user agrees to comply with
+%  all applicable U.S. export laws and regulations. User has the
+%  responsibility to obtain export licenses, or other export
+%  authority as may be required before exporting such information
+%  to foreign countries or providing access to foreign persons."
+%
+function []=plot_boxplot(dresp)
 
 if ~nargin
@@ -13,13 +41,13 @@
 %%  assemble the data into a matrix
 
-desc=cell (1,length(rfunc));
-for i=1:length(rfunc)
-    ldata(i)=length(rfunc(i).sample);
+desc=cell (1,length(dresp));
+for i=1:length(dresp)
+    ldata(i)=length(dresp(i).sample);
 end
-data=zeros(max(ldata),length(rfunc));
+data=zeros(max(ldata),length(dresp));
 
-for i=1:length(rfunc)
-    desc(i)=cellstr(rfunc(i).descriptor);
-    data(1:ldata(i),i)=rfunc(i).sample;
+for i=1:length(dresp)
+    desc(i)=cellstr(dresp(i).descriptor);
+    data(1:ldata(i),i)=dresp(i).sample;
 end
 
@@ -33,6 +61,6 @@
 %  add the annotation
 
-title('Box Plot of Design Variables and/or Response Functions')
-xlabel('Design Variable or Response Function')
+title('Box Plot of Variables and/or Responses')
+xlabel('Variable or Response')
 ylabel('Value')
 
Index: /issm/trunk/src/m/solutions/dakota/plot_hist_norm.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/plot_hist_norm.m	(revision 1012)
+++ /issm/trunk/src/m/solutions/dakota/plot_hist_norm.m	(revision 1013)
@@ -1,7 +1,57 @@
 %
-%  plot a relative histogram along with the normal distribution.
-%
-%  []=plot_hist_norm(rfunc1   ,rfunc2  ,hmin,hmax,hnint)
-%  []=plot_hist_norm(data,desc,mu,sigma,hmin,hmax,hnint)
+%  plot a relative histogram and cdf optionally along with
+%  a normal distribution.
+%
+%  []=plot_hist_norm(dresp1   ,dresp2  ,hmin,hmax,hnint)
+%  []=plot_hist_norm(samp,desc,mu,sigma,hmin,hmax,hnint)
+%
+%  where the required varargin is:
+%    dresp1        (structure array, responses)
+%      or
+%    samp          (double array, lists of samples)
+%    desc          (cell array, list of descriptions)
+%
+%  and the optional input is:
+%    dresp2        (structure array, responses)
+%      or
+%    mu            (double vector, means)
+%    sigma         (double vector, standard deviations)
+%
+%    hmin          (numeric, minimum for histogram)
+%    hmax          (numeric, maximum for histogram)
+%    hnint         (numeric, number of intervals for histogram)
+%
+%  the required fields of dresp1 are:
+%    descriptor    (char, description)
+%    sample        (double vector, list of samples)
+%
+%  and the required fields of dresp2 are:
+%    mean          (double, mean of sample)
+%    stddev        (double, standard deviation of sample)
+%
+%  for each response in the input array, this function
+%  calculates and plots a relative histogram and CDF of the list
+%  of samples, and annotates it with the description.  in
+%  addition, a mean and standard deviation may be supplied or
+%  calculated so that a normal distribution and CDF may be
+%  plotted.
+%
+%  dresp1 data would typically be contained in the dakota tabular
+%  output file from a sampling analysis, and dresp2 data would
+%  typically be contained in the dakota output file from a local
+%  sensitivity analysis, both read by dakota_out_parse.
+%
+%  "Copyright 2009, by the California Institute of Technology.
+%  ALL RIGHTS RESERVED. United States Government Sponsorship
+%  acknowledged. Any commercial use must be negotiated with
+%  the Office of Technology Transfer at the California Institute
+%  of Technology.  (NTR 47078)
+%
+%  This software may be subject to U.S. export control laws.
+%  By accepting this  software, the user agrees to comply with
+%  all applicable U.S. export laws and regulations. User has the
+%  responsibility to obtain export licenses, or other export
+%  authority as may be required before exporting such information
+%  to foreign countries or providing access to foreign persons."
 %
 function []=plot_hist_norm(varargin)
@@ -16,24 +66,24 @@
 ivar=1;
 if isstruct(varargin{ivar})
-    rfunc1=varargin{ivar};
+    dresp1=varargin{ivar};
     ivar=ivar+1;
     
-    desc=cell (1,length(rfunc1));
-    ldata=zeros(1,length(rfunc1));
-    for i=1:length(rfunc1)
-        ldata(i)=length(rfunc1(i).sample);
-    end
-    data=zeros(max(ldata),length(rfunc1));
-    data(:,:)=NaN;
-
-    for i=1:length(rfunc1)
-        desc(i)=cellstr(rfunc1(i).descriptor);
-        data(1:ldata(i),i)=rfunc1(i).sample;
-    end
-else
-    data=varargin{ivar};
+    desc=cell (1,length(dresp1));
+    lsamp=zeros(1,length(dresp1));
+    for i=1:length(dresp1)
+        lsamp(i)=length(dresp1(i).sample);
+    end
+    samp=zeros(max(lsamp),length(dresp1));
+    samp(:,:)=NaN;
+
+    for i=1:length(dresp1)
+        desc(i)=cellstr(dresp1(i).descriptor);
+        samp(1:lsamp(i),i)=dresp1(i).sample;
+    end
+else
+    samp=varargin{ivar};
     ivar=ivar+1;
     
-    ldata(1:size(data,2))=size(data,1);
+    lsamp(1:size(samp,2))=size(samp,1);
 
     if ivar <= nargin && iscell(varargin{ivar})
@@ -46,13 +96,13 @@
 
 if     ivar <= nargin && isstruct(varargin{ivar})
-    rfunc2=varargin{ivar};
-    ivar=ivar+1;
-
-    mu   =zeros(1,length(rfunc2));
-    sigma=zeros(1,length(rfunc2));
-
-    for i=1:length(rfunc2)
-        mu   (i)=rfunc2(i).mean;
-        sigma(i)=rfunc2(i).stddev;
+    dresp2=varargin{ivar};
+    ivar=ivar+1;
+
+    mu   =zeros(1,length(dresp2));
+    sigma=zeros(1,length(dresp2));
+
+    for i=1:length(dresp2)
+        mu   (i)=dresp2(i).mean;
+        sigma(i)=dresp2(i).stddev;
     end
 elseif ivar+1 <= nargin
@@ -61,5 +111,5 @@
             mu   =varargin{ivar};
         else
-            mu   =mean(data);
+            mu   =mean(samp);
             display('Using calculated means.')
         end
@@ -70,5 +120,5 @@
             sigma=varargin{ivar};
         else
-            sigma=std(data);
+            sigma=std(samp);
             display('Using calculated standard deviations.')
         end
@@ -82,5 +132,5 @@
     hmin=varargin{ivar};
 else
-    hmin=min(min(data));
+    hmin=min(min(samp));
 end
 ivar=ivar+1;
@@ -88,5 +138,5 @@
     hmax=varargin{ivar};
 else
-    hmax=max(max(data));
+    hmax=max(max(samp));
 end
 ivar=ivar+1;
@@ -107,13 +157,13 @@
 %  Use -inf and inf in edges to include all non-NaN values.
 
-dhistc=histc(data,edges);
-for i=1:size(data,2)
-    dbelow(i)  =length(find(data(:,i)<edges(  1)))/ldata(i);
-    dhistc(:,i)=dhistc(:,i)                       /ldata(i);
-    dabove(i)  =length(find(data(:,i)>edges(end)))/ldata(i);
+dhistc=histc(samp,edges);
+for i=1:size(samp,2)
+    dbelow(i)  =length(find(samp(:,i)<edges(  1)))/lsamp(i);
+    dhistc(:,i)=dhistc(:,i)                       /lsamp(i);
+    dabove(i)  =length(find(samp(:,i)>edges(end)))/lsamp(i);
 end
 
 if exist('mu','var') && exist('sigma','var')
-    ncol=size(data,2);
+    ncol=size(samp,2);
     for i=1:ncol
         dbelow(ncol+i)=normcdf(edges(  1),mu(i),sigma(i));
Index: /issm/trunk/src/m/solutions/dakota/plot_if_bars.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/plot_if_bars.m	(revision 1012)
+++ /issm/trunk/src/m/solutions/dakota/plot_if_bars.m	(revision 1013)
@@ -2,7 +2,44 @@
 %  plot a stacked bar chart of the importance factors.
 %
-%  []=plot_if_bars(rfunc,ifmin,isort)
+%  []=plot_if_bars(dresp,ifmin,isort)
 %
-function []=plot_if_bars(rfunc,ifmin,isort)
+%  where the required input is:
+%    dresp         (structure array, responses)
+%
+%  and the optional input is:
+%    ifmin         (double, minimum importance factor)
+%    isort         (numeric, sort flag:  0, no sorting;
+%                                        1, highest at bottom;
+%                                       -1, lowest at bottom)
+%
+%  the required fields of dresp are:
+%    descriptor    (char, description)
+%    var           (cell array, variables)
+%    impfac        (double array, importance factors)
+%
+%  for each response in the input array, this function plots
+%  a stacked bar plot of the responses, where the bars are
+%  stacked by the importance factors, and annotates it with the
+%  description.  the legend labels are constructed from the
+%  variable list.
+%
+%  this data would typically be contained in the dakota output
+%  file from a local reliability analysis and read by
+%  dakota_out_parse.
+%
+%  "Copyright 2009, by the California Institute of Technology.
+%  ALL RIGHTS RESERVED. United States Government Sponsorship
+%  acknowledged. Any commercial use must be negotiated with
+%  the Office of Technology Transfer at the California Institute
+%  of Technology.  (NTR 47078)
+%
+%  This software may be subject to U.S. export control laws.
+%  By accepting this  software, the user agrees to comply with
+%  all applicable U.S. export laws and regulations. User has the
+%  responsibility to obtain export licenses, or other export
+%  authority as may be required before exporting such information
+%  to foreign countries or providing access to foreign persons."
+%
+function []=plot_if_bars(dresp,ifmin,isort)
 
 if ~nargin
@@ -21,14 +58,14 @@
 %%  assemble the data into a matrix
 
-desc=cell (1,length(rfunc));
-for i=1:length(rfunc)
-    ldata(i)=length(rfunc(i).impfac);
+desc=cell (1,length(dresp));
+for i=1:length(dresp)
+    ldata(i)=length(dresp(i).impfac);
 end
-data=zeros(length(rfunc),max(ldata));
-dvar=rfunc(find(ldata == max(ldata),1,'first')).desvar;
+data=zeros(length(dresp),max(ldata));
+dvar=dresp(find(ldata == max(ldata),1,'first')).var;
 
-for i=1:length(rfunc)
-    desc(i)=cellstr(rfunc(i).descriptor);
-    data(i,1:ldata(i))=rfunc(i).impfac;
+for i=1:length(dresp)
+    desc(i)=cellstr(dresp(i).descriptor);
+    data(i,1:ldata(i))=dresp(i).impfac;
 end
 
@@ -36,11 +73,11 @@
 
 if (isort)
-    ipmax=max(data,[],1);
+    ifmean=mean(data,1);
     if (isort > 0)
-        [ipmax,index]=sort(ipmax,'descend');
+        [ifmean,index]=sort(ifmean,'descend');
     else
-        [ipmax,index]=sort(ipmax,'ascend' );
+        [ifmean,index]=sort(ifmean,'ascend' );
     end
-    clear ipmax
+    clear ifmean
     
     dvar=dvar(index);
@@ -96,5 +133,5 @@
 %  so add an extra row, then reduce xlim
 
-if length(rfunc) == 1
+if length(dresp) == 1
     data=[data; data];
 end
@@ -104,5 +141,5 @@
 ax1=gca;
 set(ax1,'ylim',[0 1.2])
-if length(rfunc) == 1
+if length(dresp) == 1
     set(ax1,'xlim',[0.5 1.5])
 end
@@ -112,5 +149,5 @@
 
 title('Importance Factors')
-xlabel('Response Function')
+xlabel('Response')
 ylabel('Importance Factor Value')
 
Index: /issm/trunk/src/m/solutions/dakota/plot_normdist_bars.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/plot_normdist_bars.m	(revision 1012)
+++ /issm/trunk/src/m/solutions/dakota/plot_normdist_bars.m	(revision 1013)
@@ -2,7 +2,47 @@
 %  plot a stacked bar chart of the sample distributions.
 %
-%  []=plot_normdist_bars(rfunc,plev)
+%  []=plot_normdist_bars(dresp,plev,lstr)
 %
-function []=plot_normdist_bars(rfunc,plev)
+%  where the required input is:
+%    dresp         (structure array, responses)
+%
+%  and the optional input is:
+%    plev          (double vector, probability levels)
+%    lstr          (cell array, legend labels)
+%
+%  the required fields of dresp are:
+%    descriptor    (char, description)
+%    sample        (double vector, list of samples)
+%
+%  and the optional fields of dresp are:
+%    mean          (double, mean of sample)
+%    stddev        (double, standard deviation of sample)
+%
+%  for each response in the input array, this function plots
+%  a stacked bar plot of the list of samples, where the bars
+%  are stacked by the given or default probability levels
+%  calculated from a normal distribution, and annotates it with
+%  the description.  the mean and standard deviation will be
+%  calculated from the samples if they do not already exist.
+%  the legend labels can be given or constructed from the
+%  probability levels.
+%
+%  this data would typically be contained in the dakota tabular
+%  output file and read by dakota_out_parse.
+%
+%  "Copyright 2009, by the California Institute of Technology.
+%  ALL RIGHTS RESERVED. United States Government Sponsorship
+%  acknowledged. Any commercial use must be negotiated with
+%  the Office of Technology Transfer at the California Institute
+%  of Technology.  (NTR 47078)
+%
+%  This software may be subject to U.S. export control laws.
+%  By accepting this  software, the user agrees to comply with
+%  all applicable U.S. export laws and regulations. User has the
+%  responsibility to obtain export licenses, or other export
+%  authority as may be required before exporting such information
+%  to foreign countries or providing access to foreign persons."
+%
+function []=plot_normdist_bars(dresp,plev,lstr)
 
 if ~nargin
@@ -17,18 +57,19 @@
 %%  assemble the data into a matrix and calculate the increments
 
-desc=cell (1,length(rfunc));
-data=zeros(length(rfunc),5);
+desc=cell (1,length(dresp));
+data=zeros(length(dresp),5);
 
-if ~isfield(rfunc,'mean') || ~isfield(rfunc,'stddev')
-    for i=1:length(rfunc)
-        [rfunc(i).mean,rfunc(i).stddev,...
-            rfunc(i).meanci,rfunc(i).stddevci]=...
-            normfit(rfunc(i).sample,0.05);
+if ~isfield(dresp,'mean') || ~isfield(dresp,'stddev')
+    for i=1:length(dresp)
+%  calculate 95% confidence intervals (same as dakota)
+        [dresp(i).mean,dresp(i).stddev,...
+            dresp(i).meanci,dresp(i).stddevci]=...
+            normfit(dresp(i).sample,0.05);
     end
 end
 
-for i=1:length(rfunc)
-    desc(i)=cellstr(rfunc(i).descriptor);
-    data(i,:)=norminv(plev,rfunc(i).mean,rfunc(i).stddev);
+for i=1:length(dresp)
+    desc(i)=cellstr(dresp(i).descriptor);
+    data(i,:)=norminv(plev,dresp(i).mean,dresp(i).stddev);
 end
 
@@ -42,5 +83,5 @@
 %  so add an extra row, then reduce xlim
 
-if length(rfunc) == 1
+if length(dresp) == 1
     data=[data; data];
 end
@@ -53,14 +94,14 @@
 
 ax1=gca;
-if length(rfunc) == 1
+if length(dresp) == 1
     set(ax1,'xlim',[0.5 1.5])
 end
-set(ax1,'xtick',1:1:max(length(rfunc),2));
+set(ax1,'xtick',1:1:max(length(dresp),2));
 set(ax1,'xticklabel',desc)
 
 %  add the annotation
 
-title('Normal Distributions of Design Variables and/or Response Functions')
-xlabel('Design Variable or Response Function')
+title('Normal Distributions of Variables and/or Responses')
+xlabel('Variable or Response')
 ylabel('Value')
 
Index: /issm/trunk/src/m/solutions/dakota/plot_normplot.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/plot_normplot.m	(revision 1012)
+++ /issm/trunk/src/m/solutions/dakota/plot_normplot.m	(revision 1013)
@@ -1,8 +1,36 @@
 %
-%  plot a normal probability plot of the response functions.
+%  plot a normal probability plot of the responses.
 %
-%  []=plot_normplot(rfunc)
+%  []=plot_normplot(dresp)
 %
-function []=plot_normplot(rfunc)
+%  where the required input is:
+%    dresp         (structure array, responses)
+%
+%  the required fields of dresp are:
+%    descriptor    (char, description)
+%    sample        (double vector, list of samples)
+%
+%  for each response in the input array, this function plots
+%  a matlab normal probability plot of the list of samples
+%  and annotates it with the description.  the lists of samples
+%  need not all be the same length.
+%
+%  this data would typically be contained in the dakota tabular
+%  output file and read by dakota_out_parse.
+%
+%  "Copyright 2009, by the California Institute of Technology.
+%  ALL RIGHTS RESERVED. United States Government Sponsorship
+%  acknowledged. Any commercial use must be negotiated with
+%  the Office of Technology Transfer at the California Institute
+%  of Technology.  (NTR 47078)
+%
+%  This software may be subject to U.S. export control laws.
+%  By accepting this  software, the user agrees to comply with
+%  all applicable U.S. export laws and regulations. User has the
+%  responsibility to obtain export licenses, or other export
+%  authority as may be required before exporting such information
+%  to foreign countries or providing access to foreign persons."
+%
+function []=plot_normplot(dresp)
 
 if ~nargin
@@ -13,13 +41,13 @@
 %%  assemble the data into a matrix
 
-desc=cell (1,length(rfunc));
-for i=1:length(rfunc)
-    ldata(i)=length(rfunc(i).sample);
+desc=cell (1,length(dresp));
+for i=1:length(dresp)
+    ldata(i)=length(dresp(i).sample);
 end
-data=zeros(max(ldata),length(rfunc));
+data=zeros(max(ldata),length(dresp));
 
-for i=1:length(rfunc)
-    desc(i)=cellstr(rfunc(i).descriptor);
-    data(1:ldata(i),i)=rfunc(i).sample;
+for i=1:length(dresp)
+    desc(i)=cellstr(dresp(i).descriptor);
+    data(1:ldata(i),i)=dresp(i).sample;
 end
 
@@ -33,5 +61,5 @@
 %  add the annotation
 
-title('Normal Probability Plot of Design Variables and/or Response Functions')
+title('Normal Probability Plot of Variables and/or Responses')
 xlabel('Value')
 ylabel('Probability')
Index: /issm/trunk/src/m/solutions/dakota/plot_prob_bars.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/plot_prob_bars.m	(revision 1012)
+++ /issm/trunk/src/m/solutions/dakota/plot_prob_bars.m	(revision 1013)
@@ -1,8 +1,41 @@
 %
-%  plot a stacked bar chart of the probabilities.
+%  plot a stacked bar chart of the probabilities in the CDF.
 %
-%  []=plot_prob_bars(rfunc,lstr)
+%  []=plot_prob_bars(dresp,lstr)
 %
-function []=plot_prob_bars(rfunc,lstr)
+%  where the required input is:
+%    dresp         (structure array, responses)
+%
+%  and the optional input is:
+%    lstr          (cell array, legend labels)
+%
+%  the required fields of dresp are:
+%    descriptor    (char, description)
+%    cdf(:,4)      (double matrix, CDF table)
+%
+%  for each response in the input array, this function plots
+%  a stacked bar plot of the responses, where the bars are
+%  stacked by the probabilities corresponding to the given
+%  response levels in the CDF, and annotates it with the
+%  description.  the legend labels can be given or constructed
+%  from the response levels.
+%
+%  this data would typically be contained in the dakota output
+%  file and read by dakota_out_parse.
+%
+%  "Copyright 2009, by the California Institute of Technology.
+%  ALL RIGHTS RESERVED. United States Government Sponsorship
+%  acknowledged. Any commercial use must be negotiated with
+%  the Office of Technology Transfer at the California Institute
+%  of Technology.  (NTR 47078)
+%
+%  This software may be subject to U.S. export control laws.
+%  By accepting this  software, the user agrees to comply with
+%  all applicable U.S. export laws and regulations. User has the
+%  responsibility to obtain export licenses, or other export
+%  authority as may be required before exporting such information
+%  to foreign countries or providing access to foreign persons."
+%
+function []=plot_prob_bars(dresp,lstr)
 
 if ~nargin
@@ -13,17 +46,17 @@
 %%  assemble the data into a matrix and calculate the increments
 
-desc=cell (1,length(rfunc));
-for i=1:length(rfunc)
-    ldata(i)=size(rfunc(i).cdf,1);
+desc=cell (1,length(dresp));
+for i=1:length(dresp)
+    ldata(i)=size(dresp(i).cdf,1);
 end
-data=zeros(length(rfunc),max(ldata));
+data=zeros(length(dresp),max(ldata));
 
-for i=1:length(rfunc)
-    desc(i)=cellstr(rfunc(i).descriptor);
-    if ~isempty(rfunc(i).cdf)
-    data(i,1)=rfunc(i).cdf(1,2);
-        for j=2:size(rfunc(i).cdf,1)
-            if (rfunc(i).cdf(j,2) > rfunc(i).cdf(j-1,2))
-                data(i,j)=rfunc(i).cdf(j,2)-rfunc(i).cdf(j-1,2);
+for i=1:length(dresp)
+    desc(i)=cellstr(dresp(i).descriptor);
+    if ~isempty(dresp(i).cdf)
+    data(i,1)=dresp(i).cdf(1,2);
+        for j=2:size(dresp(i).cdf,1)
+            if (dresp(i).cdf(j,2) > dresp(i).cdf(j-1,2))
+                data(i,j)=dresp(i).cdf(j,2)-dresp(i).cdf(j-1,2);
             end
         end
@@ -40,5 +73,5 @@
 %  so add an extra row, then reduce xlim
 
-if length(rfunc) == 1
+if length(dresp) == 1
     data=[data; data];
 end
@@ -54,5 +87,5 @@
 ax1=gca;
 set(ax1,'ylim',[0 120])
-if length(rfunc) == 1
+if length(dresp) == 1
     set(ax1,'xlim',[0.5 1.5])
 end
@@ -61,6 +94,6 @@
 %  add the annotation
 
-title('Probabilities for Specified Response Levels')
-xlabel('Response Function')
+title('Probabilities for Specified Response Levels (RIA)')
+xlabel('Response')
 ylabel('Percent Below Level')
 
@@ -69,8 +102,8 @@
     for i=1:max(ldata)
         lstr(i)=cellstr(sprintf('%g',...
-            rfunc(find(ldata == max(ldata),1,'first')).cdf(i,1)));
+            dresp(find(ldata == max(ldata),1,'first')).cdf(i,1)));
     end
     if ~isempty(find(ldata < max(ldata)))
-        warning('Variable number of levels for response functions.');
+        warning('Variable number of levels for responses.');
     end
 end
Index: /issm/trunk/src/m/solutions/dakota/plot_rlev_bars.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/plot_rlev_bars.m	(revision 1012)
+++ /issm/trunk/src/m/solutions/dakota/plot_rlev_bars.m	(revision 1013)
@@ -1,8 +1,41 @@
 %
-%  plot a stacked bar chart of the response levels.
+%  plot a stacked bar chart of the response levels in the cdf.
 %
-%  []=plot_rlev_bars(rfunc,lstr)
+%  []=plot_rlev_bars(dresp,lstr)
 %
-function []=plot_rlev_bars(rfunc,lstr)
+%  where the required input is:
+%    dresp         (structure array, responses)
+%
+%  and the optional input is:
+%    lstr          (cell array, legend labels)
+%
+%  the required fields of dresp are:
+%    descriptor    (char, description)
+%    cdf(:,4)      (double matrix, CDF table)
+%
+%  for each response in the input array, this function plots
+%  a stacked bar plot of the responses, where the bars are
+%  stacked by the response levels corresponding to the given
+%  probabilities in the CDF, and annotates it with the
+%  description.  the legend labels can be given or constructed
+%  from the probabilities.
+%
+%  this data would typically be contained in the dakota output
+%  file and read by dakota_out_parse.
+%
+%  "Copyright 2009, by the California Institute of Technology.
+%  ALL RIGHTS RESERVED. United States Government Sponsorship
+%  acknowledged. Any commercial use must be negotiated with
+%  the Office of Technology Transfer at the California Institute
+%  of Technology.  (NTR 47078)
+%
+%  This software may be subject to U.S. export control laws.
+%  By accepting this  software, the user agrees to comply with
+%  all applicable U.S. export laws and regulations. User has the
+%  responsibility to obtain export licenses, or other export
+%  authority as may be required before exporting such information
+%  to foreign countries or providing access to foreign persons."
+%
+function []=plot_rlev_bars(dresp,lstr)
 
 if ~nargin
@@ -13,17 +46,17 @@
 %%  assemble the data into a matrix and calculate the increments
 
-desc=cell (1,length(rfunc));
-for i=1:length(rfunc)
-    ldata(i)=size(rfunc(i).cdf,1);
+desc=cell (1,length(dresp));
+for i=1:length(dresp)
+    ldata(i)=size(dresp(i).cdf,1);
 end
-data=zeros(length(rfunc),max(ldata));
+data=zeros(length(dresp),max(ldata));
 
-for i=1:length(rfunc)
-    desc(i)=cellstr(rfunc(i).descriptor);
-    if ~isempty(rfunc(i).cdf)
-        data(i,1)=rfunc(i).cdf(1,1);
-        for j=2:size(rfunc(i).cdf,1)
-            if (rfunc(i).cdf(j,1) > rfunc(i).cdf(j-1,1))
-                data(i,j)=rfunc(i).cdf(j,1)-rfunc(i).cdf(j-1,1);
+for i=1:length(dresp)
+    desc(i)=cellstr(dresp(i).descriptor);
+    if ~isempty(dresp(i).cdf)
+        data(i,1)=dresp(i).cdf(1,1);
+        for j=2:size(dresp(i).cdf,1)
+            if (dresp(i).cdf(j,1) > dresp(i).cdf(j-1,1))
+                data(i,j)=dresp(i).cdf(j,1)-dresp(i).cdf(j-1,1);
             end
         end
@@ -36,5 +69,5 @@
 %  so add an extra row, then reduce xlim
 
-if length(rfunc) == 1
+if length(dresp) == 1
     data=[data; data];
 end
@@ -47,5 +80,5 @@
 
 ax1=gca;
-if length(rfunc) == 1
+if length(dresp) == 1
     set(ax1,'xlim',[0.5 1.5])
 end
@@ -54,6 +87,6 @@
 %  add the annotation
 
-title('Response Levels for Specified Probabilities')
-xlabel('Response Function')
+title('Response Levels for Specified Probabilities (PMA)')
+xlabel('Response')
 ylabel('Response Level')
 
@@ -62,8 +95,8 @@
     for i=1:max(ldata)
         lstr(i)=cellstr(sprintf('%g%%',...
-            100*rfunc(find(ldata == max(ldata),1,'first')).cdf(i,2)));
+            100*dresp(find(ldata == max(ldata),1,'first')).cdf(i,2)));
     end
     if ~isempty(find(ldata < max(ldata)))
-        warning('Variable number of probabilities for response functions.');
+        warning('Variable number of probabilities for responses.');
     end
 end
Index: /issm/trunk/src/m/solutions/dakota/plot_sampdist_bars.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/plot_sampdist_bars.m	(revision 1012)
+++ /issm/trunk/src/m/solutions/dakota/plot_sampdist_bars.m	(revision 1013)
@@ -2,7 +2,46 @@
 %  plot a stacked bar chart of the sample distributions.
 %
-%  []=plot_sampdist_bars(rfunc)
+%  []=plot_sampdist_bars(dresp,lstr)
 %
-function []=plot_sampdist_bars(rfunc)
+%  where the required input is:
+%    dresp         (structure array, responses)
+%
+%  and the optional input is:
+%    lstr          (cell array, legend labels)
+%
+%  the required fields of dresp are:
+%    descriptor    (char, description)
+%    sample        (double vector, list of samples)
+%
+%  and the optional fields of dresp are:
+%    min           (double, minimum of sample)
+%    quart1        (double, first quartile of sample)
+%    median        (double, median of sample)
+%    quart3        (double, third quartile of sample)
+%    max           (double, maximum of sample)
+%
+%  for each response in the input array, this function plots
+%  a stacked bar plot of the list of samples, where the bars
+%  are stacked by the four quartiles, and annotates it with
+%  the description.  the quartiles will be calculated from the
+%  samples if they do not already exist.
+%
+%  this data would typically be contained in the dakota tabular
+%  output file and read by dakota_out_parse.
+%
+%  "Copyright 2009, by the California Institute of Technology.
+%  ALL RIGHTS RESERVED. United States Government Sponsorship
+%  acknowledged. Any commercial use must be negotiated with
+%  the Office of Technology Transfer at the California Institute
+%  of Technology.  (NTR 47078)
+%
+%  This software may be subject to U.S. export control laws.
+%  By accepting this  software, the user agrees to comply with
+%  all applicable U.S. export laws and regulations. User has the
+%  responsibility to obtain export licenses, or other export
+%  authority as may be required before exporting such information
+%  to foreign countries or providing access to foreign persons."
+%
+function []=plot_sampdist_bars(dresp,lstr)
 
 if ~nargin
@@ -13,26 +52,26 @@
 %%  assemble the data into a matrix and calculate the increments
 
-desc=cell (1,length(rfunc));
-data=zeros(length(rfunc),5);
+desc=cell (1,length(dresp));
+data=zeros(length(dresp),5);
 
-if ~isfield(rfunc,'min')    || ~isfield(rfunc,'quart1') || ...
-   ~isfield(rfunc,'median') || ~isfield(rfunc,'quart3') || ...
-   ~isfield(rfunc,'max')
-    for i=1:length(rfunc)
-        rfunc(i).min   =min    (rfunc(i).sample);
-        rfunc(i).quart1=prctile(rfunc(i).sample,25);
-        rfunc(i).median=median (rfunc(i).sample);
-        rfunc(i).quart3=prctile(rfunc(i).sample,75);
-        rfunc(i).max   =max    (rfunc(i).sample);
+if ~isfield(dresp,'min')    || ~isfield(dresp,'quart1') || ...
+   ~isfield(dresp,'median') || ~isfield(dresp,'quart3') || ...
+   ~isfield(dresp,'max')
+    for i=1:length(dresp)
+        dresp(i).min   =min    (dresp(i).sample);
+        dresp(i).quart1=prctile(dresp(i).sample,25);
+        dresp(i).median=median (dresp(i).sample);
+        dresp(i).quart3=prctile(dresp(i).sample,75);
+        dresp(i).max   =max    (dresp(i).sample);
     end
 end
 
-for i=1:length(rfunc)
-    desc(i)=cellstr(rfunc(i).descriptor);
-    data(i,1)=rfunc(i).min;
-    data(i,2)=rfunc(i).quart1-rfunc(i).min;
-    data(i,3)=rfunc(i).median-rfunc(i).quart1;
-    data(i,4)=rfunc(i).quart3-rfunc(i).median;
-    data(i,5)=rfunc(i).max   -rfunc(i).quart3;
+for i=1:length(dresp)
+    desc(i)=cellstr(dresp(i).descriptor);
+    data(i,1)=dresp(i).min;
+    data(i,2)=dresp(i).quart1-dresp(i).min;
+    data(i,3)=dresp(i).median-dresp(i).quart1;
+    data(i,4)=dresp(i).quart3-dresp(i).median;
+    data(i,5)=dresp(i).max   -dresp(i).quart3;
 end
 
@@ -42,5 +81,5 @@
 %  so add an extra row, then reduce xlim
 
-if length(rfunc) == 1
+if length(dresp) == 1
     data=[data; data];
 end
@@ -53,14 +92,14 @@
 
 ax1=gca;
-if length(rfunc) == 1
+if length(dresp) == 1
     set(ax1,'xlim',[0.5 1.5])
 end
-set(ax1,'xtick',1:1:max(length(rfunc),2));
+set(ax1,'xtick',1:1:max(length(dresp),2));
 set(ax1,'xticklabel',desc)
 
 %  add the annotation
 
-title('Sample Distributions of Design Variables and/or Response Functions')
-xlabel('Design Variable or Response Function')
+title('Sample Distributions of Variables and/or Responses')
+xlabel('Variable or Response')
 ylabel('Value')
 
