Index: /issm/trunk-jpl/src/m/classes/qmu/dakota_method/dakota_method.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/dakota_method/dakota_method.m	(revision 24536)
+++ /issm/trunk-jpl/src/m/classes/qmu/dakota_method/dakota_method.m	(revision 24537)
@@ -62,45 +62,46 @@
                     else
                         mlist={...
-                            'dot_bfgs',...
-                            'dot_frcg',...
-                            'dot_mmfd',...
-                            'dot_slp',...
-                            'dot_sqp',...
-                            'npsol_sqp',...
-                            'conmin_frcg',...
-                            'conmin_mfd',...
-                            'optpp_cg',...
-                            'optpp_q_newton',...
-                            'optpp_fd_newton',...
-                            'optpp_newton',...
-                            'optpp_pds',...
-                            'asynch_pattern_search',...
-                            'coliny_cobyla',...
-                            'coliny_direct',...
-                            'coliny_ea',...
-                            'coliny_pattern_search',...
-                            'coliny_solis_wets',...
-                            'ncsu_direct',...
-                            'surrogate_based_local',...
-                            'surrogate_based_global',...
-                            'moga',...
-                            'soga',...
-                            'nl2sol',...
-                            'nlssol_sqp',...
-                            'optpp_g_newton',...
-                            'nond_sampling',...
-                            'nond_local_reliability',...
-                            'nond_global_reliability',...
-                            'nond_polynomial_chaos',...
-                            'nond_stoch_collocation',...
-                            'nond_evidence',...
-                            'dace',...
-                            'fsu_quasi_mc',...
-                            'fsu_cvt',...
-                            'vector_parameter_study',...
-                            'list_parameter_study',...
-                            'centered_parameter_study',...
-                            'multidim_parameter_study',...
-									 'bayes_calibration',...
+									'dot_bfgs',...
+									'dot_frcg',...
+									'dot_mmfd',...
+									'dot_slp',...
+									'dot_sqp',...
+									'npsol_sqp',...
+									'conmin_frcg',...
+									'conmin_mfd',...
+									'optpp_cg',...
+									'optpp_q_newton',...
+									'optpp_fd_newton',...
+									'optpp_newton',...
+									'optpp_pds',...
+									'asynch_pattern_search',...
+									'coliny_cobyla',...
+									'coliny_direct',...
+									'coliny_ea',...
+									'coliny_pattern_search',...
+									'coliny_solis_wets',...
+									'ncsu_direct',...
+									'surrogate_based_local',...
+									'surrogate_based_global',...
+									'moga',...
+									'soga',...
+									'nl2sol',...
+									'nlssol_sqp',...
+									'optpp_g_newton',...
+									'nond_sampling',...
+									'nond_local_reliability',...
+									'nond_global_reliability',...
+									'nond_polynomial_chaos',...
+									'nond_stoch_collocation',...
+									'nond_evidence',...
+									'dace',...
+									'fsu_quasi_mc',...
+									'fsu_cvt',...
+									'vector_parameter_study',...
+									'list_parameter_study',...
+									'centered_parameter_study',...
+									'multidim_parameter_study',...
+									'bayes_calibration',...
+									'polynomial_chaos',...
                             };
 
@@ -112,10 +113,8 @@
                         end
 
-%  check for a unique match in the list of methods
-
+								%  check for a unique match in the list of methods
                         switch length(mlist2)
                             case 0
-                                error('Unrecognized method: ''%s''.',...
-                                    method);
+                                error(['Unrecognized method: ''' method '''']);
                             case 1
                                 dm.method=mlist2{1};
@@ -125,9 +124,7 @@
                         end
 
-%  assign the default values for the method
-
+								%  assign the default values for the method
                         switch dm.method
-                            case {'dot_bfgs',...
-                                  'dot_frcg'}
+                            case {'dot_bfgs','dot_frcg'}
                                 dm.type     ='dot';
                                 dm.variables={'continuous_design',...
@@ -842,6 +839,14 @@
 										  dm.params.diagonal=false;
 										  dm.params.values=[];
-
-
+									  case {'polynomial_chaos'}
+										  dm.type     ='polynomial_chaos';
+										  dm.params.sparse_grid_level = 3;
+										  dm.params.dimension_adaptive = 'whoops';
+										  dm.responses={'objective_function',...
+											  'response_function',...
+											  'calibration_function'};
+										  dm.variables={'normal_uncertain',...
+											  'uniform_uncertain',...
+											  'continuous_state'};
                             otherwise
                                 error('Unimplemented method: ''%s''.',dm.method);
Index: /issm/trunk-jpl/src/m/classes/qmu/dakota_method/dmeth_params_write.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/dakota_method/dmeth_params_write.m	(revision 24536)
+++ /issm/trunk-jpl/src/m/classes/qmu/dakota_method/dmeth_params_write.m	(revision 24537)
@@ -1,8 +1,8 @@
+function dmeth_params_write(dm,fid,sbeg)
+%DMETH_PARAMS_WRITE - write the parameters from a dakota_method object
 %
-%  write the parameters from a dakota_method object.
+%   Usage:
+%      dmeth_params_write(dm,fid,sbeg)
 %
-%  []=dmeth_params_write(dm,fid,sbeg)
-%
-function []=dmeth_params_write(dm,fid,sbeg)
 
 if ~isa(dm,'dakota_method')
@@ -542,4 +542,13 @@
 		end
 
+	case {'polynomial_chaos'}
+		switch dm.method
+				case {'polynomial_chaos'}
+					param_write(fid,sbeg,'sparse_grid_level',' = ','\n',dm.params);
+					fprintf(fid,'\t  dimension_adaptive p_refinement sobol\n');
+					fprintf(fid,'\t  \tmax_iterations  = 3\n');
+					fprintf(fid,'\t  \tconvergence_tol = 1.e-1\n');
+			end
+
     otherwise
         error('Unrecognized method type: ''%s''.',dm.type);
@@ -548,56 +557,47 @@
 end
 
-%%  function to write a structure of parameters
-
-function []=param_struc_write(fidi,sbeg,smid,send,params)
-
-%  loop through each parameter field in the structure
-
-fnames=fieldnames(params);
-
-for i=1:numel(fnames)
-    param_write(fidi,sbeg,fnames{i},smid,send,params);
-end
-
-end
-
+function param_struc_write(fidi,sbeg,smid,send,params) % {{{
+	%%  function to write a structure of parameters
+
+	%  loop through each parameter field in the structure
+
+	fnames=fieldnames(params);
+
+	for i=1:numel(fnames)
+		param_write(fidi,sbeg,fnames{i},smid,send,params);
+	end
+
+end %}}}
+function param_write(fidi,sbeg,pname,smid,send,params) % {{{
 %%  function to write a parameter
 
-function []=param_write(fidi,sbeg,pname,smid,send,params)
-
-%  check for errors
-
-if ~isfield(params,pname)
-    warning('param_write:param_not_found',...
-        'Parameter ''%s'' not found in ''%s''.',...
-        pname,inputname(6));
-    return
-elseif islogical(params.(pname)) && ~params.(pname)
-    return
-elseif isempty(params.(pname))
-    warning('param_write:param_empty',...
-        'Parameter ''%s'' requires input of type ''%s''.',...
-        pname,class(params.(pname)));
-    return
-end
-
-%  construct the parameter string based on type
-
-if     islogical(params.(pname))
-    fprintf(fidi,[sbeg '%s' send],pname);
-elseif isnumeric(params.(pname))
-    fprintf(fidi,[sbeg '%s' smid '%g'],pname,params.(pname)(1));
-    for i=2:numel(params.(pname))
-        fprintf(fidi,[' %g'],params.(pname)(i));
-    end
-    fprintf(fidi,[send]);
-elseif ischar   (params.(pname))
-    fprintf(fidi,[sbeg '%s' smid '%s' send],pname,params.(pname));
-else
-    warning('param_write:param_unrecog',...
-        'Parameter ''%s'' is of unrecognized type ''%s''.',...
-        pname,class(params.(pname)));
-    return
-end
-
-end
+	%  check for errors
+
+	if ~isfield(params,pname)
+		warning('param_write:param_not_found','Parameter ''%s'' not found in ''%s''.',pname,inputname(6));
+		return
+	elseif islogical(params.(pname)) && ~params.(pname)
+		return
+	elseif isempty(params.(pname))
+		warning('param_write:param_empty','Parameter ''%s'' requires input of type ''%s''.',...
+			pname,class(params.(pname)));
+		return
+	end
+
+	%  construct the parameter string based on type
+	if islogical(params.(pname))
+		fprintf(fidi,[sbeg '%s' send],pname);
+	elseif isnumeric(params.(pname))
+		fprintf(fidi,[sbeg '%s' smid '%g'],pname,params.(pname)(1));
+		for i=2:numel(params.(pname))
+			fprintf(fidi,[' %g'],params.(pname)(i));
+		end
+		fprintf(fidi,[send]);
+	elseif ischar   (params.(pname))
+		fprintf(fidi,[sbeg '%s' smid '%s' send],pname,params.(pname));
+	else
+		warning('param_write:param_unrecog','Parameter ''%s'' is of unrecognized type ''%s''.',pname,class(params.(pname)));
+		return
+	end
+
+end% }}}
Index: /issm/trunk-jpl/src/m/classes/qmu/response_function.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/qmu/response_function.m	(revision 24536)
+++ /issm/trunk-jpl/src/m/classes/qmu/response_function.m	(revision 24537)
@@ -43,10 +43,8 @@
             switch nargin
 
-%  create a default object
-
+					%  create a default object
                 case 0
 
-%  copy the object or create the object from the input
-
+						 %  copy the object or create the object from the input
                 otherwise
                     if  (nargin == 1) && isa(varargin{1},'response_function')
@@ -170,22 +168,18 @@
         function [rdesc]=dakota_write(fidi,dresp,rdesc)
 
-%  collect only the responses of the appropriate class
-
+			  %  collect only the responses of the appropriate class
             rf=struc_class(dresp,'response_function');
 
-%  write responses
+				%  write responses
+				[rdesc]=rlist_write(fidi,'response_functions','response_function',rf,rdesc);
+			end
 
-            [rdesc]=rlist_write(fidi,'response_functions','response_function',rf,rdesc);
-        end
+			function []=dakota_rlev_write(fidi,dresp,params)
 
-        function []=dakota_rlev_write(fidi,dresp,params)
+				%  collect only the responses of the appropriate class
+				rf=struc_class(dresp,'response_function');
 
-%  collect only the responses of the appropriate class
-
-            rf=struc_class(dresp,'response_function');
-
-%  write response levels
-
-            rlev_write(fidi,rf,params);
+				%  write response levels
+				rlev_write(fidi,rf,params);
         end
     end
