Index: /issm/trunk/src/m/model/ReadDataDimensions.m
===================================================================
--- /issm/trunk/src/m/model/ReadDataDimensions.m	(revision 6736)
+++ /issm/trunk/src/m/model/ReadDataDimensions.m	(revision 6736)
@@ -0,0 +1,39 @@
+function result=ReadDataDimensions(fid)
+%READDATA - read data dimensions, step and time, but not the data itself.
+%
+%   Usage:
+%      field=ReadDataDimensions(fid)
+
+
+%read field
+[length,count]=fread(fid,1,'int');
+
+if count==0,
+	result=struct([]);
+else
+	fieldname=fread(fid,length,'char');
+	fieldname=fieldname(1:end-1)';
+	fieldname=char(fieldname);
+	time=fread(fid,1,'double');
+	step=fread(fid,1,'int');
+
+	type=fread(fid,1,'int');
+	M=fread(fid,1,'int');
+	N=1; %default
+	if type==1,
+		fseek(fid,M*8,0);
+	elseif type==2,
+		fseek(fid,M,0);
+	elseif type==3,
+		N=fread(fid,1,'int');
+		fseek(fid,N*M*8,0);
+	else
+		error(['cannot read data of type ' num2str(type) ]);
+	end
+
+	result.fieldname=fieldname;
+	result.time=time;
+	result.step=step;
+	result.M=M;
+	result.N=N;
+end
Index: /issm/trunk/src/m/model/SectionValues.m
===================================================================
--- /issm/trunk/src/m/model/SectionValues.m	(revision 6735)
+++ /issm/trunk/src/m/model/SectionValues.m	(revision 6736)
@@ -82,6 +82,6 @@
 
 	%Interpolation of data on specified points
-	data_interp=InterpFromMeshToMesh2d(md.elements,md.x,md.y,data,X,Y);
-	%data_interp=griddata(md.x,md.y,data,X,Y);
+	%data_interp=InterpFromMeshToMesh2d(md.elements,md.x,md.y,data,X,Y);
+	data_interp=griddata(md.x,md.y,data,X,Y);
 
 	%Compute index
Index: /issm/trunk/src/m/model/loadresultsfromdisk.m
===================================================================
--- /issm/trunk/src/m/model/loadresultsfromdisk.m	(revision 6735)
+++ /issm/trunk/src/m/model/loadresultsfromdisk.m	(revision 6736)
@@ -19,5 +19,5 @@
 
 	%load results onto model
-	structure=parseresultsfromdisk(filename);
+	structure=parseresultsfromdisk(filename,~md.io_gather);
 	md.results.(structure.SolutionType)=structure;
 
Index: /issm/trunk/src/m/model/parseresultsfromdisk.m
===================================================================
--- /issm/trunk/src/m/model/parseresultsfromdisk.m	(revision 6735)
+++ /issm/trunk/src/m/model/parseresultsfromdisk.m	(revision 6736)
@@ -1,33 +1,14 @@
-function results=parseresultsfromdisk(filename)
+function results=parseresultsfromdisk(filename,iosplit)
 %PARSERESULTSFROMDISK - ...
 %
 %   Usage:
-%      results=parseresultsfromdisk(filename)
+%      results=parseresultsfromdisk(filename,iosplit)
 
-%Open file
-fid=fopen(filename,'rb');
-if(fid==-1),
-	error(['loadresultsfromdisk error message: could not open ',filename,' for binary reading']);
-end
-results=struct();
 
-%Read fields until the end of the file.
-result=ReadData(fid);
-while ~isempty(result),
 
-	%Get time and step
-	results(result.step).step=result.step;
-	results(result.step).time=result.time; 
-
-	%Add result
-	if (length(results)>=result.step & isfield(results,result.fieldname) & ~strcmp(result.fieldname,'SolutionType')),
-		results(result.step).(result.fieldname)=[ results(result.step).(result.fieldname); result.field];
-	else
-		results(result.step).(result.fieldname)=result.field;
-	end
-
-	%read next result
-	result=ReadData(fid);
-
+if iosplit,
+	results=parseresultsfromdiskiosplit(filename);
+else
+	results=parseresultsfromdiskioserial(filename);
 end
 
@@ -36,2 +17,3 @@
 
 fclose(fid);
+end
Index: /issm/trunk/src/m/model/parseresultsfromdiskioserial.m
===================================================================
--- /issm/trunk/src/m/model/parseresultsfromdiskioserial.m	(revision 6736)
+++ /issm/trunk/src/m/model/parseresultsfromdiskioserial.m	(revision 6736)
@@ -0,0 +1,34 @@
+function results=parseresultsfromdiskioserial(filename)
+%PARSERESULTSFROMDISK - ...
+%
+%   Usage:
+%      results=parseresultsfromdiskioserial(filename)
+
+
+%Open file
+fid=fopen(filename,'rb');
+if(fid==-1),
+	error(['loadresultsfromdisk error message: could not open ',filename,' for binary reading']);
+end
+results=struct();
+
+%Read fields until the end of the file.
+result=ReadData(fid);
+while ~isempty(result), 
+	%Get time and step
+	results(result.step).step=result.step;
+	results(result.step).time=result.time; 
+
+	%Add result
+	if (length(results)>=result.step & isfield(results,result.fieldname) & ~strcmp(result.fieldname,'SolutionType')),
+			results(result.step).(result.fieldname)=[ results(result.step).(result.fieldname); result.field];
+	else
+		results(result.step).(result.fieldname)=result.field;
+	end
+
+	%read next result
+	result=ReadData(fid);
+
+end
+
+fclose(fid);
Index: /issm/trunk/src/m/model/parseresultsfromdiskiosplit.m
===================================================================
--- /issm/trunk/src/m/model/parseresultsfromdiskiosplit.m	(revision 6736)
+++ /issm/trunk/src/m/model/parseresultsfromdiskiosplit.m	(revision 6736)
@@ -0,0 +1,83 @@
+function results=parseresultsfromdisk(filename)
+%PARSERESULTSFROMDISKIOSPLIT - ...
+%
+%   Usage:
+%      results=parseresultsfromdiskiosplit(filename)
+
+
+%Open file
+fid=fopen(filename,'rb');
+if(fid==-1),
+	error(['loadresultsfromdisk error message: could not open ',filename,' for binary reading']);
+end
+results=struct();
+
+%if we have done split I/O, ie, we have results that are fragmented across patches, 
+%do a first pass, and figure out the structure of results
+result=ReadDataDimensions(fid);
+while ~isempty(result),
+
+	%Get time and step
+	results(result.step).step=result.step;
+	results(result.step).time=result.time; 
+
+	%Add result
+	if strcmpi(result.fieldname,'Patch'),
+		results(result.step).(result.fieldname)=[0 result.N];
+	else
+		results(result.step).(result.fieldname)=NaN;
+	end
+
+	%read next result
+	result=ReadDataDimensions(fid);
+end
+
+%do a second pass, and figure out the size of the patches
+fseek(fid,0,-1); %rewind
+result=ReadDataDimensions(fid);
+while ~isempty(result),
+
+	%Add result
+	if strcmpi(result.fieldname,'Patch'),
+		patchdimensions=results(result.step).(result.fieldname);
+		results(result.step).(result.fieldname)=[patchdimensions(1)+result.M result.N];
+	end
+
+	%read next result
+	result=ReadDataDimensions(fid);
+end
+
+%allocate patches
+for i=1:length(results),
+	results(i).Patch=zeros(results(i).Patch(1),results(i).Patch(2));
+	results(i).counter=1; %use to index into the patch
+end
+
+%third pass, this time to read the real information
+fseek(fid,0,-1); %rewind
+result=ReadData(fid);
+while ~isempty(result),
+
+	%Get time and step
+	results(result.step).step=result.step;
+	results(result.step).time=result.time; 
+
+	%Add result
+	if strcmpi(result.fieldname,'Patch'),
+		counter=results(result.step).counter;
+		counter2=counter+size(result.field,1)-1;
+		results(result.step).(result.fieldname)(counter:counter2,:)=result.field;
+
+		%increment counter: 
+		results(result.step).counter=counter2+1;
+	else
+		results(result.step).(result.fieldname)=result.field;
+	end
+
+	%read next result
+	result=ReadData(fid);
+
+end
+
+%close file
+fclose(fid);
Index: /issm/trunk/src/m/model/tres.m
===================================================================
--- /issm/trunk/src/m/model/tres.m	(revision 6735)
+++ /issm/trunk/src/m/model/tres.m	(revision 6736)
@@ -74,4 +74,11 @@
 	md.temperature=PatchToVec(md.results.SteadystateSolution.Temperature);
 	md.melting_rate=PatchToVec(md.results.SteadystateSolution.MeltingRate);
+	
+	if md.control_analysis==1,
+		if control_type==md.control_type
+			md.(EnumToModelField(control_type))=PatchToVec(md.results.DiagnosticSolution.(EnumToString(control_type)));
+		end
+	end
+
 elseif strcmpi(string,'thermal'),
 	md.temperature=PatchToVec(md.results.ThermalSolution.Temperature);
