Index: /issm/trunk-jpl/src/m/classes/clusters/generic.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/generic.m	(revision 12379)
+++ /issm/trunk-jpl/src/m/classes/clusters/generic.m	(revision 12380)
@@ -105,4 +105,50 @@
 		 end
 		 %}}}
+		 function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
+
+			 %write queuing script 
+			 if ~ispc,
+
+				 fid=fopen([modelname '.queue'],'w');
+				 fprintf(fid,'#!/bin/sh\n');
+				 if ~isvalgrind,
+					 if cluster.interactive
+						 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s ',cluster.np,cluster.codepath,cluster.executionpath,modelname);
+					 else
+						 fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,cluster.executionpath,modelname,modelname,modelname);
+					 end
+				 elseif isgprof,
+					 fprintf(fid,'\n gprof %s/kriging.exe gmon.out > %s.performance',cluster.codepath,modelname);
+				 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/kriging.exe %s %s 2> %s.errlog >%s.outlog ',...
+						 cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,cluster.executionpath,modelname,modelname,modelname);
+				 end
+				 if ~io_gather, %concatenate the output files:
+					 fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
+				 end
+				 fclose(fid);
+
+			 else % Windows
+
+				 fid=fopen([modelname '.bat'],'w');
+				 fprintf(fid,'@echo off\n');
+				 if cluster.interactive
+					 fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),cluster.executionpath,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
+				 fclose(fid);
+			 end
+
+			 %in interactive mode, create a run file, and errlog and outlog file
+			 if cluster.interactive,
+				 fid=fopen([modelname '.errlog'],'w'); fclose(fid);
+				 fid=fopen([modelname '.outlog'],'w'); fclose(fid);
+			 end
+		 end
+		 %}}}
 		 function LaunchQueueJob(cluster,modelname,dirname,filelist)% {{{
 
