Index: /issm/trunk/src/m/utils/OS/issmscpin.m
===================================================================
--- /issm/trunk/src/m/utils/OS/issmscpin.m	(revision 3150)
+++ /issm/trunk/src/m/utils/OS/issmscpin.m	(revision 3150)
@@ -0,0 +1,74 @@
+function scpin(host, login,port,path, packages)
+%SCPIN get packages from host, using scp on unix, and pscp on windows
+%
+%   usage: scpin(host,packages,path)
+%
+%
+
+%first get hostname
+hostname=oshostname();
+
+%first be sure packages are not in the current directory, this could conflict with pscp on windows. 
+%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);
+
+%if hostname and host are the same, do a simple copy
+if strcmpi(hostname,host),
+
+    for i=1:numel(packages),
+		success=copyfile([path '/' packages{i}]); %keep going, even if success=0
+	end
+
+else
+
+	if ispc,
+		%use the putty project pscp.exe: it should be in the path.
+		
+		%get ISSM_DIR variable
+		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
+		if status, 
+			error('scpin error message: could not find ISSM_DIR_WIN envirnoment variable');
+		end
+		ISSM_DIR=ISSM_DIR(2:end-2);
+
+		username=input('Username: (quoted string) ');
+		password=input('Password: (quoted string) ');
+
+		for i=1:numel(packages),
+			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' password '" ' host ':' path '/' packages{i} ' ./']);
+			if status, 
+				error('scpin error message: could not call putty pscp');
+			end
+		end
+
+	else
+		%just use standard unix scp
+		%string to copy multiple files using scp: 
+		string='\{';
+		for i=1:numel(packages)-1,
+			string=[string packages{i} ','];
+		end
+		string=[string packages{end} '\}'];
+
+
+		if port,
+			eval(['!scp -P ' num2str(port) ' ' login '@localhost:' path '/' string ' ./']);
+		else
+			eval(['!scp ' login '@' host ':' path '/' string ' ./']);
+		end
+		
+		%check scp worked
+		for i=1:numel(packages),
+			if ~exist(['./' packages{i}]),
+				error('scpin error message: could not call scp on *nix system');
+			end
+		end
+	end
+end
Index: /issm/trunk/src/m/utils/OS/issmscpout.m
===================================================================
--- /issm/trunk/src/m/utils/OS/issmscpout.m	(revision 3150)
+++ /issm/trunk/src/m/utils/OS/issmscpout.m	(revision 3150)
@@ -0,0 +1,57 @@
+function issmscpout(host,path,login,port,packages)
+%SCPOUT send packages to a host, using scp on unix, and pscp on windows
+%
+%   usage: scpout(host,path,packages)
+%
+%
+
+%get hostname
+hostname=oshostname();
+
+%if hostname and host are the same, do a simple copy
+
+if strcmpi(host,hostname),
+	for i=1:numel(packages),
+		here=pwd;
+		eval(['cd ' path])
+		system(['rm -rf ' packages{i} ]);
+		system(['ln -s ' here '/' packages{i} ' .']);
+		eval(['cd ' here]);
+	end
+else 
+	if ispc,
+		%use the putty project pscp.exe: it should be in the path.
+		
+		%get ISSM_DIR variable
+		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
+		if status, 
+			error('scpout error message: could not find ISSM_DIR_WIN envirnoment variable');
+		end
+		ISSM_DIR=ISSM_DIR(2:end-2);
+
+		username=input('Username: (quoted string) ');
+		password=input('Password: (quoted string) ');
+
+		for i=1:numel(packages),
+			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' password '" ' packages{i} ' ' host ':' path]);
+			if status, 
+				error('scpout error message: could not call putty pscp');
+			end
+		end
+
+	else
+		%just use standard unix scp
+		%create string of packages being sent
+		string='';
+		for i=1:numel(packages),
+			string=[string ' ' packages{i}];
+		end
+		string=[string ' '];
+		
+		if port,
+			eval(['!scp -P ' num2str(port) ' ' string ' ' login '@localhost:' path]);
+		else
+			eval(['!scp ' string ' ' login '@' host ':' path]);
+		end
+	end
+end
Index: /issm/trunk/src/m/utils/OS/issmssh.m
===================================================================
--- /issm/trunk/src/m/utils/OS/issmssh.m	(revision 3149)
+++ /issm/trunk/src/m/utils/OS/issmssh.m	(revision 3150)
@@ -1,3 +1,3 @@
-function issmssh(host,login,command)
+function issmssh(host,login,port,command)
 %ISSMSSH - wrapper for OS independent ssh command.
 %
@@ -29,5 +29,9 @@
 	else
 		%just use standard unix ssh
-		eval(['!ssh -l ' login ' ' host ' ' command]);
+		if port,
+			eval(['!ssh -l ' login ' -p ' num2str(port) ' localhost "' command '"']);
+		else
+			eval(['!ssh -l ' login ' ' host ' "' command '"']);
+		end
 	end
 end
Index: sm/trunk/src/m/utils/OS/scpin.m
===================================================================
--- /issm/trunk/src/m/utils/OS/scpin.m	(revision 3149)
+++ 	(revision )
@@ -1,67 +1,0 @@
-function scpin(host, login,path, packages)
-%SCPIN get packages from host, using scp on unix, and pscp on windows
-%
-%   usage: scpin(host,packages,path)
-%
-%
-
-%first get hostname
-hostname=oshostname();
-
-%first be sure packages are not in the current directory, this could conflict with pscp on windows. 
-%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);
-
-%if hostname and host are the same, do a simple copy
-if strcmpi(hostname,host),
-
-    for i=1:numel(packages),
-		success=copyfile([path '/' packages{i}]); %keep going, even if success=0
-	end
-
-else
-
-	if ispc,
-		%use the putty project pscp.exe: it should be in the path.
-		
-		%get ISSM_DIR variable
-		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
-		if status, 
-			error('scpin error message: could not find ISSM_DIR_WIN envirnoment variable');
-		end
-		ISSM_DIR=ISSM_DIR(2:end-2);
-
-		username=input('Username: (quoted string) ');
-		password=input('Password: (quoted string) ');
-
-		for i=1:numel(packages),
-			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' password '" ' host ':' path '/' packages{i} ' ./']);
-			if status, 
-				error('scpin error message: could not call putty pscp');
-			end
-		end
-
-	else
-		%just use standard unix scp
-		%string to copy multiple files using scp: 
-		string='\{';
-		for i=1:numel(packages)-1,
-			string=[string packages{i} ','];
-		end
-		string=[string packages{end} '\}'];
-
-		eval(['!scp ' login '@' host ':' path '/' string ' ./']);
-		for i=1:numel(packages),
-			if ~exist(['./' packages{i}]),
-				error('scpin error message: could not call scp on *nix system');
-			end
-		end
-	end
-end
Index: sm/trunk/src/m/utils/OS/scpout.m
===================================================================
--- /issm/trunk/src/m/utils/OS/scpout.m	(revision 3149)
+++ 	(revision )
@@ -1,52 +1,0 @@
-function scpout(host,path,packages)
-%SCPOUT send packages to a host, using scp on unix, and pscp on windows
-%
-%   usage: scpout(host,path,packages)
-%
-%
-
-%get hostname
-hostname=oshostname();
-
-%if hostname and host are the same, do a simple copy
-
-if strcmpi(host,hostname),
-	for i=1:numel(packages),
-		here=pwd;
-		eval(['cd ' path])
-		system(['rm -rf ' packages{i} ]);
-		system(['ln -s ' here '/' packages{i} ' .']);
-		eval(['cd ' here]);
-	end
-else 
-	if ispc,
-		%use the putty project pscp.exe: it should be in the path.
-		
-		%get ISSM_DIR variable
-		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
-		if status, 
-			error('scpout error message: could not find ISSM_DIR_WIN envirnoment variable');
-		end
-		ISSM_DIR=ISSM_DIR(2:end-2);
-
-		username=input('Username: (quoted string) ');
-		password=input('Password: (quoted string) ');
-
-		for i=1:numel(packages),
-			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' password '" ' packages{i} ' ' host ':' path]);
-			if status, 
-				error('scpout error message: could not call putty pscp');
-			end
-		end
-
-	else
-		%just use standard unix scp
-		%create string of packages being sent
-		string='';
-		for i=1:numel(packages),
-			string=[string ' ' packages{i}];
-		end
-		string=[string ' '];
-		eval(['!scp ' string host ':' path]);
-	end
-end
