Index: /issm/trunk-jpl/src/m/classes/clusters/cloud.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/cloud.m	(revision 13629)
+++ /issm/trunk-jpl/src/m/classes/clusters/cloud.m	(revision 13629)
@@ -0,0 +1,90 @@
+%CLOUD cluster class definition
+%
+%   Usage:
+%      cluster=cloud('name','astrid','np',3);
+%      cluster=cloud('name',oshostname(),'np',3,'login','username');
+
+classdef cloud
+	properties (SetAccess=public) 
+		% {{{
+		name='';
+		login='';
+		np=1;
+		codepath='';
+		executionpath='';
+		interactive=0;
+		%}}}
+	end
+	methods
+		function cluster=cloud(varargin) % {{{
+
+			%use provided options to change fields
+			options=pairoptions(varargin{:});
+
+			%initialize cluster using user settings if provided
+			if (exist([cluster.name '_settings'])==2), eval([cluster.name '_settings']); end
+
+			%OK get other fields
+			cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
+		end
+		%}}}
+		function disp(cluster) % {{{
+			%  display the object
+			disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			disp(sprintf('    name: %s',cluster.name));
+			disp(sprintf('    login: %s',cluster.login));
+			disp(sprintf('    np: %i',cluster.np));
+			disp(sprintf('    codepath: %s',cluster.codepath));
+			disp(sprintf('    executionpath: %s',cluster.executionpath));
+			disp(sprintf('    interactive: %i',cluster.interactive));
+		end
+		%}}}
+		function md = checkconsistency(cluster,md,solution,analyses) % {{{
+			if cluster.np<1
+				md = checkmessage(md,['number of processors should be at least 1']);
+			end
+			if isnan(cluster.np),
+				md = checkmessage(md,'number of processors should not be NaN!');
+			end
+		end
+		%}}}
+		function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#!/bin/bash\n');
+			if cluster.interactive
+				fprintf(fid,'mpiexec -np %i -f /home/mpich2.hosts %s/issm.exe %s %s %s ',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
+			else
+				fprintf(fid,'mpiexec -np %i -f /home/mpich2.hosts %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname,modelname,modelname);
+			end
+		end
+		%}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist)% {{{
+
+			%compress the files into one zip.
+			compressstring=['tar -zcf ' dirname '.tar.gz '];
+			for i=1:numel(filelist),
+				compressstring = [compressstring ' ' filelist{i}];
+			end
+			if cluster.interactive,
+				compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog '];
+			end
+			system(compressstring);
+
+			disp('uploading input file and queueing script');
+			issmstscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[dirname '.tar.gz']});
+
+			disp('launching solution sequence on remote cluster');
+			launchcommand=['source ' codepath '/etc/environment.sh && cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+				' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && source  ' modelname '.queue '];
+			issmstssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end %}}}
+		function Download(cluster,dirname,filelist)% {{{
+
+			%copy files from cluster to current directory
+			directory=[cluster.executionpath '/' dirname '/'];
+			issmstscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+		end %}}}
+	end
+end
Index: /issm/trunk-jpl/src/m/os/issmstscpin.m
===================================================================
--- /issm/trunk-jpl/src/m/os/issmstscpin.m	(revision 13629)
+++ /issm/trunk-jpl/src/m/os/issmstscpin.m	(revision 13629)
@@ -0,0 +1,40 @@
+function issmstscpin(host, login,path, packages)
+%ISSMSCPIN get packages from host, using scp on unix, and pscp on windows
+%
+%   usage: issmstscpin(host,long, path, packages)
+%
+%
+
+%first get hostname
+hostname=oshostname();
+
+%get initial warning mode
+state=warning('query', 'all');
+%remove warnings in case the files do not exist
+warning off
+for i=1:numel(packages),
+	delete(packages{i});
+end
+%back to initial warning state
+warning(state);
+
+%use starcluster to scp 
+%string to copy multiple files using scp: 
+if numel(packages)==1,
+	string=packages{1};
+else
+	string='\{';
+	for i=1:numel(packages)-1,
+		string=[string packages{i} ','];
+	end
+	string=[string packages{end} '\}'];
+end
+
+eval(['!starcluster get ' host ' --user ' login ' ' path '/' string  ' ./']);
+
+%check starcluster get  worked
+for i=1:numel(packages),
+	if ~exist(['./' packages{i}]),
+		error('issmstscpin error message: could not call scp on *nix system');
+	end
+end
