Index: /issm/trunk-jpl/src/m/classes/model/model.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/model/model.m	(revision 15315)
+++ /issm/trunk-jpl/src/m/classes/model/model.m	(revision 15316)
@@ -1201,4 +1201,42 @@
 			ylim([min(obj.mesh.y) max(obj.mesh.y)])
 		end % }}}
+		function md=upload(md) % {{{
+		%the goal of this routine is to upload the model onto a server, and to empty it.
+		%So first, save the model with a unique name and upload the file to the server: 
+		random_part=fix(rand(1)*10000);
+		id=[md.miscellaneous.name '-' regexprep(datestr(now),'[^\w'']','') '-' num2str(random_part)  '-' getenv('USER') '-' oshostname() '.upload']; 
+		eval(['save ' id ' md']);
+
+		%Now, upload the file: 
+		issmscpout(md.settings.upload_server,md.settings.upload_path,md.settings.upload_login,md.settings.upload_port,{id},1);
+
+		%Now, empty this model of everything except settings, and record name of file we just uploaded!
+		settings_back=md.settings;
+		md=model();
+		md.settings=settings_back;
+		md.settings.upload_filename=id;
+
+		%get locally rid of file that was uploaded
+		eval(['delete ' id]);
+
+
+		end % }}}
+		function md=download(md) % {{{
+		
+		%the goal of this routine is to download the internals of the current model from a server, because 
+		%this model is empty, except for the settings which tell us where to go and find this model!
+		
+		%Download the file: 
+		issmscpin(md.settings.upload_server, md.settings.upload_login, md.settings.upload_port, md.settings.upload_path, {md.settings.upload_filename});
+
+		name=md.settings.upload_filename;
+
+		%Now, load this model: 
+		md=loadmodel(md.settings.upload_filename);
+
+		%get locally rid of file that was downloaded
+		eval(['delete ' name]);
+
+		end % }}}
 	end
  end
Index: /issm/trunk-jpl/src/m/classes/settings.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/settings.m	(revision 15315)
+++ /issm/trunk-jpl/src/m/classes/settings.m	(revision 15316)
@@ -11,4 +11,10 @@
 		output_frequency    = 0;
 		waitonlock          = 0;
+		upload_server       = '';
+		upload_path         = '';
+		upload_login        = '';
+		upload_port         = 0;
+		upload_filename     = '';
+
 	end
 	methods
@@ -40,4 +46,8 @@
 			%0 to deactivate
 			obj.waitonlock=Inf;
+		
+			%upload options: 
+			upload_port         = 0;
+
 		end % }}}
 		function md = checkconsistency(obj,md,solution,analyses) % {{{
@@ -58,4 +68,9 @@
 			fielddisplay(obj,'output_frequency','frequency at which results are saved in all solutions with multiple time_steps');
 			fielddisplay(obj,'waitonlock','maximum number of minutes to wait for batch results (NaN to deactivate)');
+			fielddisplay(obj,'upload_server','server hostname where model should be uploaded');
+			fielddisplay(obj,'upload_path','path on server where model should be uploaded');
+			fielddisplay(obj,'upload_login','server login');
+			fielddisplay(obj,'upload_port','port login (default is 0)');
+			fielddisplay(obj,'upload_filename','unique id generated when uploading the file to server');
 
 		end % }}}
