Index: /issm/trunk/src/m/classes/public/tres.m
===================================================================
--- /issm/trunk/src/m/classes/public/tres.m	(revision 1785)
+++ /issm/trunk/src/m/classes/public/tres.m	(revision 1785)
@@ -0,0 +1,27 @@
+function md=tres(md,string)
+%TRANSFERVEL transfer results results to corresponding model fields. 
+%
+%    Usage: md=tres(md,string)
+%
+%
+%    Example: md=tres(md,'diagnostic');
+%             md=tres(md,'control');
+
+if strcmpi(string,'diagnostic'),
+	md.vx=md.results.diagnostic.vx;
+	md.vy=md.results.diagnostic.vy;
+	md.vel=md.results.diagnostic.vel;
+	md.pressure=md.results.diagnostic.pressure;
+else if strcmpi(string,'thermalstatic'),
+	md.vx=md.results.thermalstatic.vx;
+	md.vy=md.results.thermalstatic.vy;
+	md.vel=md.results.thermalstatic.vel;
+	md.pressure=md.results.thermalstatic.pressure;
+	md.temperature=md.results.thermalstatic.temperature;
+	md.melting=md.results.thermalstatic.melting;
+else if strcmpi(string,'thermal'),
+	md.temperature=md.results.thermalstatic.temperature;
+	md.melting=md.results.thermalstatic.melting;
+else 
+	error(['tres error message: analysis ' string ' not supported yet!']);
+end
