Index: /issm/trunk/src/m/solutions/dakota/dakota_in_data.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/dakota_in_data.m	(revision 3563)
+++ /issm/trunk/src/m/solutions/dakota/dakota_in_data.m	(revision 3564)
@@ -133,5 +133,5 @@
 
 %Write in file
-dakota_in_write(dmeth.method,dmeth,dvar,dresp,params,filei,varargin{:});
+dakota_in_write(dmeth,dvar,dresp,params,filei,varargin{:});
 
 end
Index: /issm/trunk/src/m/solutions/dakota/dakota_out_parse.m
===================================================================
--- /issm/trunk/src/m/solutions/dakota/dakota_out_parse.m	(revision 3563)
+++ /issm/trunk/src/m/solutions/dakota/dakota_out_parse.m	(revision 3564)
@@ -66,5 +66,4 @@
 fline=fgetl(fidi);
 if ~ischar(fline)
-    ieof=1;
     error('File ''%s'' is empty.',filei);
 end
@@ -366,5 +365,5 @@
 display('Reading CDF''s for response functions:');
 
-while ~isempty(fline)
+while ischar(fline) && ~isempty(fline)
     fline=fgetl(fidi);
     if ~ischar(fline)
@@ -374,5 +373,5 @@
 %  process header line of cdf
 
-    while ~isempty(fline)
+    while ischar(fline) && ~isempty(fline)
         [ntokens,tokens]=fltokens(fline);
 
@@ -401,5 +400,5 @@
         fline=fgetl(fidi);
         icdf=0;
-        while ~isempty(fline) && ...
+        while ischar(fline) && ~isempty(fline) && ...
               ~strncmpi(fline,'Cumulative Distribution Function',32)
             [ntokens,tokens]=fltokens(fline);
@@ -493,9 +492,8 @@
 end
 
-ieof=0;
 display('Reading MV statistics for response functions:');
 ndresp=0;
 
-while ~ieof && ~isempty(fline) && ...
+while ischar(fline) && ~isempty(fline) && ...
         strncmpi(fline,'MV Statistics for ',18)
 
@@ -517,9 +515,8 @@
     fline=fgetl(fidi);
     if ~ischar(fline)
-        ieof=1;
         break;
     end
 
-    while ~ieof && ~isempty(fline) && ...
+    while ischar(fline) && ~isempty(fline) && ...
             strncmpi(fline,'  Importance Factor for variable ',33)
         [ntokens,tokens]=fltokens(fline);
@@ -529,8 +526,4 @@
 
         fline=fgetl(fidi);
-        if ~ischar(fline)
-            ieof=1;
-            break;
-        end
     end
 
@@ -541,13 +534,9 @@
         dresp(end).var   ={};
         dresp(end).impfac=[];
-        while ~ieof && ...
+        while ischar(fline) && ...
                 ~strncmpi(fline,'Cumulative Distribution Function',32) && ...
                 ~strncmpi(fline,'MV Statistics for ',18) && ...
                 ~strncmp (fline,'-',1)
             fline=fgetl(fidi);
-            if ~ischar(fline)
-                ieof=1;
-                break;
-            end
         end
     end
@@ -557,5 +546,5 @@
     icdf=0;
 
-    while ~ieof && ~isempty(fline) && ...
+    while ischar(fline) && ~isempty(fline) && ...
             strncmpi(fline,'Cumulative Distribution Function',32)
         [ntokens,tokens]=fltokens(fline);
@@ -607,12 +596,8 @@
         display('    Cumulative Distribution Function not available.');
         dresp(ndresp).cdf=[];
-        while ~ieof && ...
+        while ischar(fline) && ...
                 ~strncmpi(fline,'MV Statistics for ',18) && ...
                 ~strncmp (fline,'-',1)
             fline=fgetl(fidi);
-            if ~ischar(fline)
-                ieof=1;
-                break;
-            end
         end
     end
