Index: /issm/trunk-jpl/src/m/os/issmscpin.m
===================================================================
--- /issm/trunk-jpl/src/m/os/issmscpin.m	(revision 13070)
+++ /issm/trunk-jpl/src/m/os/issmscpin.m	(revision 13071)
@@ -1,6 +1,6 @@
-function scpin(host, login,port,path, packages)
-%SCPIN get packages from host, using scp on unix, and pscp on windows
+function issmscpin(host, login,port,path, packages)
+%ISSMSCPIN get packages from host, using scp on unix, and pscp on windows
 %
-%   usage: scpin(host,packages,path)
+%   usage: issmscpin(host,packages,path)
 %
 %
@@ -35,5 +35,5 @@
 		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
 		if status, 
-			error('scpin error message: could not find ISSM_DIR_WIN environment variable');
+			error('issmscpin error message: could not find ISSM_DIR_WIN environment variable');
 		end
 		ISSM_DIR=ISSM_DIR(2:end-2);
@@ -45,5 +45,5 @@
 			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' host ':' path '/' packages{i} ' ./']);
 			if status, 
-				error('scpin error message: could not call putty pscp');
+				error('issmscpin error message: could not call putty pscp');
 			end
 		end
@@ -72,5 +72,5 @@
 		for i=1:numel(packages),
 			if ~exist(['./' packages{i}]),
-				error('scpin error message: could not call scp on *nix system');
+				error('issmscpin error message: could not call scp on *nix system');
 			end
 		end
Index: /issm/trunk-jpl/src/m/os/issmscpin.py
===================================================================
--- /issm/trunk-jpl/src/m/os/issmscpin.py	(revision 13070)
+++ /issm/trunk-jpl/src/m/os/issmscpin.py	(revision 13071)
@@ -6,9 +6,9 @@
 from MatlabFuncs import *
 
-def scpin(host, login,port,path, packages):
+def issmscpin(host, login,port,path, packages):
 	"""
-	SCPIN get packages from host, using scp on unix, and pscp on windows
+	ISSMSCPIN get packages from host, using scp on unix, and pscp on windows
  
-	   usage: scpin(host,packages,path)
+	   usage: issmscpin(host,packages,path)
 	"""
 
@@ -42,5 +42,5 @@
 				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
 			else:
-				raise OSError("scpin error message: could not find ISSM_DIR_WIN environment variable.")
+				raise OSError("issmscpin error message: could not find ISSM_DIR_WIN environment variable.")
 
 			username=raw_input('Username: (quoted string) ')
@@ -51,5 +51,5 @@
 					subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s:%s %s' % (ISSM_DIR,username,key,host,os.path.join(path,package),os.getcwd()),shell=True)
 				except CalledProcessError as e:
-					raise CalledProcessError("scpin error message: could not call putty pscp.")
+					raise CalledProcessError("issmscpin error message: could not call putty pscp.")
 
 		else:
@@ -73,4 +73,4 @@
 			for package in packages:
 				if not os.path.exists(os.path.join('.',package)):
-					raise OSError("scpin error message: could not call scp on *nix system.")
+					raise OSError("issmscpin error message: could not call scp on *nix system.")
 
Index: /issm/trunk-jpl/src/m/os/issmscpout.m
===================================================================
--- /issm/trunk-jpl/src/m/os/issmscpout.m	(revision 13070)
+++ /issm/trunk-jpl/src/m/os/issmscpout.m	(revision 13071)
@@ -1,6 +1,6 @@
 function issmscpout(host,path,login,port,packages)
-%SCPOUT send packages to a host, using scp on unix, and pscp on windows
+%ISSMSCPOUT send packages to a host, using scp on unix, and pscp on windows
 %
-%   usage: scpout(host,path,packages)
+%   usage: issmscpout(host,path,packages)
 %
 %
@@ -26,5 +26,5 @@
 		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
 		if status, 
-			error('scpout error message: could not find ISSM_DIR_WIN environment variable');
+			error('issmscpout error message: could not find ISSM_DIR_WIN environment variable');
 		end
 		ISSM_DIR=ISSM_DIR(2:end-2);
@@ -36,5 +36,5 @@
 			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' key '" ' packages{i} ' ' host ':' path]);
 			if status, 
-				error('scpout error message: could not call putty pscp');
+				error('issmscpout error message: could not call putty pscp');
 			end
 		end
Index: /issm/trunk-jpl/src/m/os/issmscpout.py
===================================================================
--- /issm/trunk-jpl/src/m/os/issmscpout.py	(revision 13070)
+++ /issm/trunk-jpl/src/m/os/issmscpout.py	(revision 13071)
@@ -3,19 +3,12 @@
 import subprocess
 import os
-import shutil
 from MatlabFuncs import *
 
 def issmscpout(host,path,login,port,packages):
 	"""
-	SCPOUT send packages to a host, using scp on unix, and pscp on windows
+	ISSMSCPOUT send packages to a host, using scp on unix, and pscp on windows
  
-	   usage: scpout(host,path,packages)
+	   usage: issmscpout(host,path,packages)
 	"""
-
-	print "host=",host
-	print "path=",path
-	print "login=",login
-	print "port=",port
-	print "packages=",packages
 
 	#get hostname
@@ -28,5 +21,8 @@
 			here=os.getcwd()
 			os.chdir(path)
-			shutil.rmtree(package)
+			try:
+				os.remove(package)
+			except OSError as e:
+				pass
 			subprocess.call('ln -s %s %s' % (os.path.join(here,package),path),shell=True)
 			os.chdir(here)
@@ -39,5 +35,5 @@
 				ISSM_DIR=os.environ['ISSM_DIR_WIN'][1:-2]
 			else:
-				raise OSError("scpout error message: could not find ISSM_DIR_WIN environment variable.")
+				raise OSError("issmscpout error message: could not find ISSM_DIR_WIN environment variable.")
 
 			username=raw_input('Username: (quoted string) ')
@@ -48,5 +44,5 @@
 					subprocess.check_call('%s/externalpackages/ssh/pscp.exe -l "%s" -pw "%s" %s %s:%s' % (ISSM_DIR,username,key,package,host,path),shell=True)
 				except CalledProcessError as e:
-					raise CalledProcessError("scpout error message: could not call putty pscp.")
+					raise CalledProcessError("issmscpout error message: could not call putty pscp.")
 
 		else:
Index: /issm/trunk-jpl/src/m/parameterization/parameterize.m
===================================================================
--- /issm/trunk-jpl/src/m/parameterization/parameterize.m	(revision 13070)
+++ /issm/trunk-jpl/src/m/parameterization/parameterize.m	(revision 13071)
@@ -56,2 +56,3 @@
 end
 md.miscellaneous.notes=['Model created by using parameter file: ' parametername ' on: ' datestr(now)];
+
Index: /issm/trunk-jpl/src/m/solve/WriteData.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/WriteData.py	(revision 13070)
+++ /issm/trunk-jpl/src/m/solve/WriteData.py	(revision 13071)
@@ -104,5 +104,5 @@
 			data=numpy.array([data])
 		if len(data.shape) == 1:
-			data=data.reshape(numpy.size(data,0),1)
+			data=data.reshape(1,numpy.size(data,0))
 
 		#Get size
@@ -124,5 +124,5 @@
 		for i in xrange(s[0]):
 			for j in xrange(s[1]):
-				fid.write(struct.pack('i',data[i][j]))    #get to the "c" convention, hence the transpose
+				fid.write(struct.pack('d',float(data[i][j])))    #get to the "c" convention, hence the transpose
 		# }}}
 
@@ -132,5 +132,5 @@
 			data=numpy.array([data])
 		if len(data.shape) == 1:
-			data=data.reshape(numpy.size(data,0),1)
+			data=data.reshape(1,numpy.size(data,0))
 
 		#Get size
@@ -152,13 +152,13 @@
 		for i in xrange(s[0]):
 			for j in xrange(s[1]):
-				fid.write(struct.pack('i',data[i][j]))    #get to the "c" convention, hence the transpose
+				fid.write(struct.pack('d',float(data[i][j])))    #get to the "c" convention, hence the transpose
 		# }}}
 
 	elif strcmpi(format,'DoubleMat'):    # {{{
 
-		if isinstance(data,(int,long,float)):
+		if isinstance(data,(bool,int,long,float)):
 			data=numpy.array([data])
 		if len(data.shape) == 1:
-			data=data.reshape(numpy.size(data,0),1)
+			data=data.reshape(1,numpy.size(data,0))
 
 		#Get size
@@ -180,5 +180,5 @@
 		for i in xrange(s[0]):
 			for j in xrange(s[1]):
-				fid.write(struct.pack('d',data[i][j]))    #get to the "c" convention, hence the transpose
+				fid.write(struct.pack('d',float(data[i][j])))    #get to the "c" convention, hence the transpose
 		# }}}
 
@@ -188,4 +188,9 @@
 		recordlength=4+4    #number of records + code
 		for matrix in data:
+			if isinstance(matrix,(bool,int,long,float)):
+				matrix=numpy.array([matrix])
+			if len(matrix.shape) == 1:
+				matrix=matrix.reshape(1,numpy.size(matrix,0))
+
 			s=matrix.shape
 			recordlength+=4*2+s[0]*s[1]*8    #row and col of matrix + matrix of doubles
@@ -202,4 +207,9 @@
 		#write each matrix: 
 		for matrix in data:
+			if isinstance(matrix,(bool,int,long,float)):
+				matrix=numpy.array([matrix])
+			if len(matrix.shape) == 1:
+				matrix=matrix.reshape(1,numpy.size(matrix,0))
+
 			s=matrix.shape
 			fid.write(struct.pack('i',s[0])) 
@@ -207,5 +217,5 @@
 			for i in xrange(s[0]):
 				for j in xrange(s[1]):
-					fid.write(struct.pack('d',matrix[i][j]))
+					fid.write(struct.pack('d',float(matrix[i][j])))
 		# }}}
 
Index: /issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 13070)
+++ /issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py	(revision 13071)
@@ -3,4 +3,5 @@
 import socket
 from MatlabFuncs import *
+from loadresultsfromdisk import *
 
 def loadresultsfromcluster(md,runtimename=False):
@@ -17,5 +18,4 @@
 	if runtimename:
 		md.private.runtimename=runtimename
-	end
 
 	#Download outputs from the cluster
@@ -28,5 +28,5 @@
 				filelist.append('dakota_tabular.dat')
 		filelist.append(md.miscellaneous.name+'.outbin')
-	Download(cluster,md.private.runtimename,filelist)
+	cluster.Download(md.private.runtimename,filelist)
 
 	#If we are here, no errors in the solution sequence, call loadresultsfromdisk.
Index: /issm/trunk-jpl/src/m/solve/loadresultsfromdisk.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 13070)
+++ /issm/trunk-jpl/src/m/solve/loadresultsfromdisk.py	(revision 13071)
@@ -1,3 +1,4 @@
 import os
+from parseresultsfromdisk import *
 from EnumToString import EnumToString
 
@@ -28,5 +29,4 @@
 		if not len(structure):
 			raise RuntimeError("No result found in binary file '%s'. Check for solution crash." % filename)
-		end
 		md.results[structure[1]['SolutionType']]=structure;
 
Index: /issm/trunk-jpl/src/m/solve/solve.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/solve.py	(revision 13070)
+++ /issm/trunk-jpl/src/m/solve/solve.py	(revision 13071)
@@ -9,4 +9,6 @@
 from marshall import *
 from ispetsc import *
+from waitonlock import *
+from loadresultsfromcluster import *
 
 def solve(md,solutionenum,*args):
@@ -79,5 +81,5 @@
 	marshall(md)                                           # bin file
 	md.solver.PetscFile(md.miscellaneous.name+'.petsc')    # petsc file
-	cluster.BuildQueueScript(md.miscellaneous.name,md.private.runtimename,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof)    # queue file
+	cluster.BuildQueueScript(md.private.runtimename,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof)    # queue file
 
 	#we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
Index: /issm/trunk-jpl/src/m/solve/waitonlock.m
===================================================================
--- /issm/trunk-jpl/src/m/solve/waitonlock.m	(revision 13070)
+++ /issm/trunk-jpl/src/m/solve/waitonlock.m	(revision 13071)
@@ -1,3 +1,3 @@
-function flag=waitonlock(md,executionpath,login,port)
+function flag=waitonlock(md)
 %WAITONLOCK - wait for a file
 %
@@ -6,5 +6,5 @@
 %
 %   Usage:
-%      flag=waitonlock(md,executionpath)
+%      flag=waitonlock(md)
 
 %Get filename (lock file) and options
Index: /issm/trunk-jpl/src/m/solve/waitonlock.py
===================================================================
--- /issm/trunk-jpl/src/m/solve/waitonlock.py	(revision 13070)
+++ /issm/trunk-jpl/src/m/solve/waitonlock.py	(revision 13071)
@@ -4,5 +4,5 @@
 from MatlabFuncs import *
 
-def waitonlock(md,executionpath,login,port):
+def waitonlock(md):
 	"""
 	WAITONLOCK - wait for a file
@@ -12,5 +12,5 @@
  
 	   Usage:
-	      flag=waitonlock(md,executionpath)
+	      flag=waitonlock(md)
 	"""
 
