Index: /issm/trunk-jpl/src/m/classes/clusters/generic.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/generic.m	(revision 11484)
+++ /issm/trunk-jpl/src/m/classes/clusters/generic.m	(revision 11485)
@@ -78,31 +78,63 @@
 
 			 %open file for writing: 
-			 fid=fopen([modelname '.queue'],'w');
+			 if ~ispc,
+				 fid=fopen([modelname '.queue'],'w');
+			 else
+				 fid=fopen([modelname '.bat'],'w');
+			 end
 
 			 %write instructions for launching a job on the cluster
-			 fprintf(fid,'#!/bin/sh\n');
+			 if ~ispc,
+				 fprintf(fid,'#!/bin/sh\n');
+			 else
+				 fprintf(fid,'@echo off\n');
+			 end
+			 
 			 if ~isvalgrind,
 				 if cluster.interactive
-					 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',...
-						 cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
-				 else
-					 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
-						 cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
+					 if ~ispc,
+						 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
+					 else
+						 fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
+					 end
+				 else
+					 if ~ispc,
+						 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
+					 else
+						 fprintf(fid,'"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
+					 end
 				 end
 			 else
-				 %Add --gen-suppressions=all to get suppression lines
-				 fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
-				 fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
+				 if ~ispc,
+					 %Add --gen-suppressions=all to get suppression lines
+					 fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
+					 fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
 					 cluster.np,cluster.valgrind,cluster.valgrindsup, cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
+				 else
+					 error('valgrind not supported on windows platforms');
+				 end
 			 end
 
 			 if isgprof,
-				 fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname);
+				 if ~ispc,
+					 fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname);
+				 else
+					 error('gprof not supported on windows platforms');
+				 end
+
 			 end
 
 			 if ~md.settings.io_gather,
-				 %concatenate the output files:
-				 fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
-			 end
+				 if ~ispc,
+					 %concatenate the output files:
+					 fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
+				 else
+					 error('iogather not supported on windows platforms');
+				 end
+
+			 end
+			 
+			 %close file: 
+			 fclose(fid);
 
 			 %in interactive mode, create a run file, and errlog and outlog file
@@ -112,61 +144,71 @@
 			 end
 
+
 		 end
 		 %}}}
 		 function LaunchQueueJob(cluster,md,options)% {{{1
 			 
-			 %lauch command, to be executed via ssh
-			 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.private.runtimename ' && mkdir ' md.private.runtimename ...
-			                ' && cd ' md.private.runtimename ' && mv ../' md.private.runtimename '.tar.gz ./ && tar -zxf ' md.private.runtimename '.tar.gz  && source  ' md.miscellaneous.name '.queue '];
-
-			if ~strcmpi(options.batch,'yes'),
-				
-				%compress the files into one zip.
-				compressstring=['tar -zcf ' md.private.runtimename '.tar.gz ' md.miscellaneous.name '.bin ' md.miscellaneous.name '.queue '  md.miscellaneous.name '.petsc '];
-				if md.qmu.isdakota,
-					compressstring=[compressstring md.miscellaneous.name '.qmu.in'];
-				end
-				if cluster.interactive,
-					compressstring=[compressstring ' ' md.miscellaneous.name '.errlog ' md.miscellaneous.name '.outlog '];
-				end
-				system(compressstring);
-				
-				disp('uploading input file and queueing script');
-				issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[md.private.runtimename '.tar.gz']});
-
-				disp('launching solution sequence on remote cluster');
-				issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-			else
-				disp('batch mode requested: not launching job interactively');
-				disp('launch solution sequence on remote cluster by hand');
-			end
-
-		 end %}}}
-		 function Download(cluster,md)% {{{1
-
-			%some check
-			if isempty(md.private.runtimename),
-				error('supply runtime name for results to be loaded!');
-			end
-
-			%Figure out the  directory where all the files are in: 
-			directory=[cluster.executionpath '/' md.private.runtimename '/'];
-
-			%What packages are we picking up from remote cluster
-			packages={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
-			if md.qmu.isdakota,
-				packages{end+1}=[md.miscellaneous.name '.qmu.err'];
-				packages{end+1}=[md.miscellaneous.name '.qmu.out'];
-				if isfield(md.qmu.params,'tabular_graphics_data'),
-					if md.qmu.params.tabular_graphics_data==true,
-						packages{end+1}='dakota_tabular.dat'; 
+			 if ~ispc,
+					 %lauch command, to be executed via ssh
+					 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.private.runtimename ' && mkdir ' md.private.runtimename ...
+					 ' && cd ' md.private.runtimename ' && mv ../' md.private.runtimename '.tar.gz ./ && tar -zxf ' md.private.runtimename '.tar.gz  && source  ' md.miscellaneous.name '.queue '];
+
+					 if ~strcmpi(options.batch,'yes'),
+
+						 %compress the files into one zip.
+						 compressstring=['tar -zcf ' md.private.runtimename '.tar.gz ' md.miscellaneous.name '.bin ' md.miscellaneous.name '.queue '  md.miscellaneous.name '.petsc '];
+						 if md.qmu.isdakota,
+							 compressstring=[compressstring md.miscellaneous.name '.qmu.in'];
 					end
+					if cluster.interactive,
+						compressstring=[compressstring ' ' md.miscellaneous.name '.errlog ' md.miscellaneous.name '.outlog '];
+					end
+					system(compressstring);
+
+					disp('uploading input file and queueing script');
+					issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[md.private.runtimename '.tar.gz']});
+
+					disp('launching solution sequence on remote cluster');
+					issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+				else
+					disp('batch mode requested: not launching job interactively');
+					disp('launch solution sequence on remote cluster by hand');
 				end
 			else
-				packages{end+1}=[md.miscellaneous.name '.outbin'];
+				%launch right here, do not compress or archive.
+				system([md.miscellaneous.name '.bat']);
 			end
 
-			%copy files from cluster to present directory
-			issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
+		end %}}}
+		 function Download(cluster,md)% {{{1
+
+			if ~ispc,
+				%some check
+				if isempty(md.private.runtimename),
+					error('supply runtime name for results to be loaded!');
+				end
+
+				%Figure out the  directory where all the files are in: 
+				directory=[cluster.executionpath '/' md.private.runtimename '/'];
+
+				%What packages are we picking up from remote cluster
+				packages={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
+				if md.qmu.isdakota,
+					packages{end+1}=[md.miscellaneous.name '.qmu.err'];
+					packages{end+1}=[md.miscellaneous.name '.qmu.out'];
+					if isfield(md.qmu.params,'tabular_graphics_data'),
+						if md.qmu.params.tabular_graphics_data==true,
+							packages{end+1}='dakota_tabular.dat'; 
+						end
+					end
+				else
+					packages{end+1}=[md.miscellaneous.name '.outbin'];
+				end
+
+				%copy files from cluster to present directory
+				issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
+			else
+				%do nothing!
+			end
 		end %}}}
 	end
