Index: /issm/trunk/src/m/solutions/dakota/dakota_in_data.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/dakota_in_data.m	(revision 1013)
+++ /issm/trunk/src/m/solutions/dakota/dakota_in_data.m	(revision 1014)
@@ -1,6 +1,49 @@
 %
-%  define the data to write the dakota .in file
+%  define the data to write the dakota .in and .m files.
 %
-%  []=dakota_in_data(variables,responses,dmeth,dparams,filei,package,varargin)
+%  []=dakota_in_data(dmeth,variables,responses,dparams,filei,package,varargin)
+%
+%  where the required input is:
+%    dmeth         (dakota_method, method class object)
+%    variables     (structure array, variable class objects)
+%    responses     (structure array, response class objects)
+%    dparams       (structure array, method-independent parameters)
+%    filei         (character, name of .in and .m files)
+%    package       (character, analysis package)
+%
+%  params may be empty, in which case defaults will be used.
+%
+%  the optional varargin are passed directly through to the
+%  QmuUpdateFunctions brancher to be used by the analysis
+%  package.  for example, this could be model information.
+%
+%  this function defines the data to write the dakota .in and
+%  .m files.  it is necessary for multiple reasons.  first,
+%  it collects the parameters and applies some defaults that
+%  are unique to the environment.  second, some analysis package
+%  variables and/or responses may be treated differently by
+%  dakota.  for example, an analysis package variable may be
+%  defined as an array, so the QmuSetupDesign brancher will
+%  create dakota variables for each element of the array.
+%  finally it calls the functions to write the .in and .m files.
+%  this function is independent of the particular analysis
+%  package.
+%
+%  this data would typically be generated by a matlab script
+%  for a specific model, using the method, variable, and
+%  response class objects.
+%
+%  "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 []=dakota_in_data(dmeth,variables,responses,dparams,filei,package,varargin)
@@ -55,6 +98,6 @@
 %  for linear constraints, just copy
 
-    if strcmp(class(variables.(fnames{i})),'linear_inequality_constraint') || ...
-       strcmp(class(variables.(fnames{i})),'linear_equality_constraint'  )
+    if isa(variables.(fnames{i}),'linear_inequality_constraint') || ...
+       isa(variables.(fnames{i}),'linear_equality_constraint'  )
         dvar.(fnames{i})=variables.(fnames{i});
 
Index: /issm/trunk/src/m/solutions/dakota/dakota_in_params.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/dakota_in_params.m	(revision 1013)
+++ /issm/trunk/src/m/solutions/dakota/dakota_in_params.m	(revision 1014)
@@ -3,4 +3,35 @@
 %
 %  [params]=dakota_in_params(params)
+%
+%  where the optional input is:
+%    params        (structure array, method-independent parameters)
+%
+%  and the output is the same.
+%
+%  this function takes a structure of method-independent dakota
+%  parameters, which may be empty, and adds default parameters
+%  for those parameters which do not exist.
+%
+%  the field names of the structure are identical to the dakota
+%  parameter names (and are in fact used to write them to the
+%  files).  logical values are used for parameters which have
+%  no associated data and are determined only by their presence
+%  or absence.
+%
+%  note that the method-dependent parameters are contained in
+%  the dakota_method class object.
+%
+%  "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 [params]=dakota_in_params(params)
Index: /issm/trunk/src/m/solutions/dakota/dakota_in_parse.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/dakota_in_parse.m	(revision 1013)
+++ /issm/trunk/src/m/solutions/dakota/dakota_in_parse.m	(revision 1014)
@@ -1,6 +1,43 @@
 %
-%  read a Dakota .in file and parse it.
+%  read a Dakota .in input file and parse it.
 %
 %  [method,dvar,dresp]=dakota_in_parse(filei)
+%
+%  where the required input is:
+%    filei         (character, name of .in file)
+%
+%  the required output is:
+%    method        (character, dakota method name)
+%    dvar          (structure array, variables)
+%    dresp         (structure array, responses)
+%
+%  the filei will be prompted if empty.  the fields of dvar and
+%  dresp are particular to the data contained within the file.
+%
+%  this function reads a dakota .in input file and parses it
+%  into the matlab workspace.  it operates in a content-driven
+%  fashion, where it parses whatever input data it encounters
+%  in the file, rather than searching for data based on the
+%  particular method.  (this makes it independent of method.)
+%
+%  as of now, parameters are generally not parsed.  also, the
+%  variable and response classes are not used for output.
+%
+%  this data would typically be used for modifying and submitting
+%  a subsequent dakota run.  it could also be used with output
+%  data for post-processing or annotation purposes.
+%
+%  "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 [method,dvar,dresp]=dakota_in_parse(filei)
@@ -233,5 +270,5 @@
 function [dresp]=responses_parse(fidi,tokens,itoken)
 
-display('Reading Dakota response functions.');
+display('Reading Dakota responses.');
 dresp=[];
 nof =0;
@@ -515,5 +552,5 @@
        strncmpi(tokens{1}{itoken},'responses',9)
 
-%  assemble the lists by response function
+%  assemble the lists by response
 
         if exist('nrespl','var') && isfield(dresp,'rf')
Index: /issm/trunk/src/m/solutions/dakota/dakota_in_write.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/dakota_in_write.m	(revision 1013)
+++ /issm/trunk/src/m/solutions/dakota/dakota_in_write.m	(revision 1014)
@@ -1,6 +1,41 @@
 %
-%  write a Dakota .in file.
+%  write a Dakota .in input file.
 %
 %  []=dakota_in_write(method,dmeth,dvar,dresp,params,filei,varargin)
+%
+%  where the required input is:
+%    method        (character, dakota method name)
+%    dmeth         (dakota_method, method class object)
+%    dvar          (structure array, variable class objects)
+%    dresp         (structure array, response class objects)
+%    params        (structure array, method-independent parameters)
+%    filei         (character, name of .in file)
+%
+%  the method, dmeth, and filei will be prompted if empty.
+%  params may be empty, in which case defaults will be used.
+%
+%  the optional varargin are not yet used.
+%
+%  this function writes a dakota .in input file to be used
+%  by dakota.  this file is independent of the particular
+%  analysis package.
+%
+%  this data would typically be generated by a matlab script
+%  for a specific model, using the method, variable, and
+%  response class objects.  this function may be called by
+%  dakota_in_data.
+%
+%  "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 []=dakota_in_write(method,dmeth,dvar,dresp,params,filei,varargin)
@@ -26,4 +61,5 @@
 [pathstr,name,ext,versn] = fileparts(filei);
 if isempty(ext)
+% fileparts only considers '.in' to be the extension, not '.qmu.in'
     ext='.qmu.in';
 end
Index: /issm/trunk/src/m/solutions/dakota/dakota_m_write.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/dakota_m_write.m	(revision 1013)
+++ /issm/trunk/src/m/solutions/dakota/dakota_m_write.m	(revision 1014)
@@ -1,7 +1,51 @@
 %
-%  write a Dakota .m file for the Matlab direct or external
-%  driver.
-%
-%  []=dakota_m_write(method,dmeth,dvar,dresp,params,filem,package)
+%  write a Matlab .m function file to be called by Dakota for
+%  the Matlab direct or external driver.
+%
+%  []=dakota_m_write(method,dmeth,dvar,dresp,params,filem,package,varargin)
+%
+%  where the required input is:
+%    method        (character, dakota method name)
+%    dmeth         (dakota_method, method class object)
+%    dvar          (structure array, variable class objects)
+%    dresp         (structure array, response class objects)
+%    params        (structure array, method-independent parameters)
+%    filem         (character, name of .m file)
+%    package       (character, analysis package)
+%
+%  the method, dmeth, and filem will be prompted if empty.
+%  params may be empty, in which case defaults will be used.
+%
+%  the optional varargin are passed directly through to the
+%  QmuUpdateFunctions brancher to be used by the analysis
+%  package.  for example, this could be model information.
+%
+%  this function writes a matlab .m function file to be called
+%  by dakota for the matlab direct or external driver.  for
+%  the direct driver, dakota is linked with matlab and
+%  automatically starts a matlab session, passing the variables
+%  and responses through the function; for the external driver,
+%  dakota calls a shell script to start the matlab session,
+%  passing the variables and responses through text files.
+%  this function must be tailored to the particular analysis
+%  package.
+%
+%  this data would typically be generated by a matlab script
+%  for a specific model, using the method, variable, and
+%  response class objects.  this function may be called by
+%  dakota_in_data.
+%
+%  "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 []=dakota_m_write(method,dmeth,dvar,dresp,params,filem,package,varargin)
@@ -99,5 +143,5 @@
 end
 
-%%  function to write design variables into the Matlab m-file
+%%  function to write variables into the Matlab m-file
 
 function []=variables_write(fidm,dmeth,dvar,params,varargin)
@@ -145,5 +189,5 @@
 		eval([descriptor '_lock=1;']);
 
-		%now, we need a string to put in the matlab file, which will update all the design variables 
+		%now, we need a string to put in the matlab file, which will update all the variables 
 		%for  this descriptor.
 		[string,ixc]=QmuUpdateFunctions(ixc,descriptor,dvar,params,i,varargin{:});
Index: /issm/trunk/src/m/solutions/dakota/dakota_out_parse.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/dakota_out_parse.m	(revision 1013)
+++ /issm/trunk/src/m/solutions/dakota/dakota_out_parse.m	(revision 1014)
@@ -1,6 +1,48 @@
 %
-%  read a Dakota .out file and parse it.
+%  read a Dakota .out or .dat output file and parse it.
 %
 %  [method,dresp,scm,pcm,srcm,prcm]=dakota_out_parse(filei)
+%
+%  where the required input is:
+%    filei         (character, name of .out file)
+%
+%  the required output is:
+%    method        (character, dakota method name)
+%    dresp         (structure array, responses)
+%
+%  and the optional output is:
+%    scm           (double array, simple correlation matrix)
+%    pcm           (double array, partial correlation matrix)
+%    srcm          (double array, simple rank correlation matrix)
+%    prcm          (double array, partial rank correlation matrix)
+%
+%  the filei will be prompted if empty.  the fields of dresp
+%  are particular to the data contained within the file.  the
+%  scm, pcm, srcm, and prcm are output by dakota only for the
+%  sampling methods.
+%
+%  this function reads a dakota .out output file and parses it
+%  into the matlab workspace.  it operates in a content-driven
+%  fashion, where it skips the intermediate data and then parses
+%  whatever output data it encounters in the order in which it
+%  exists in the file, rather than searching for data based on
+%  the particular method.  (this makes it independent of method.)
+%  it also can read and parse the .dat tabular_output file.
+%
+%  this data would typically be used for plotting and other
+%  post-processing within matlab or excel.
+%
+%  "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 [method,dresp,scm,pcm,srcm,prcm]=dakota_out_parse(filei)
@@ -183,12 +225,12 @@
 %  draw box plot
 
-%figure
-%subplot(2,1,1)
-%plot_boxplot(dresp);
+% figure
+% subplot(2,1,1)
+% plot_boxplot(dresp);
 
 %  draw normal probability plot
 
-%subplot(2,1,2)
-%plot_normplot(dresp);
+% subplot(2,1,2)
+% plot_normplot(dresp);
 
 end
@@ -483,5 +525,5 @@
         [ntokens,tokens]=fltokens(fline);
         idvar=idvar+1;
-        dresp(end).desvar(idvar,1)=cellstr(tokens{1}{5});
+        dresp(end).var   (idvar,1)=cellstr(tokens{1}{5});
         dresp(end).impfac(idvar,1)=        tokens{1}{7};
 
@@ -497,5 +539,5 @@
     if ~idvar
         display('    Importance Factors not available.');
-        dresp(end).desvar={};
+        dresp(end).var   ={};
         dresp(end).impfac=[];
         while ~ieof && ...
