Index: /issm/trunk-jpl/src/m/classes/clusters/generic.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/generic.m	(revision 18088)
+++ /issm/trunk-jpl/src/m/classes/clusters/generic.m	(revision 18089)
@@ -20,4 +20,5 @@
 		valgrindsup=[issmdir() '/externalpackages/valgrind/issm.supp'];
 		verbose=1;
+		shell='/bin/sh';
 		%}}}
 	end
@@ -70,4 +71,5 @@
 			disp(sprintf('    valgrindsup: %s',cluster.valgrindsup));
 			disp(sprintf('    verbose: %s',cluster.verbose));
+			disp(sprintf('    shell: %s',cluster.shell));
 		end
 		%}}}
@@ -87,9 +89,9 @@
 
 				fid=fopen([modelname '.queue'],'w');
-				fprintf(fid,'#!/bin/sh\n');
+				fprintf(fid,'#!%s\n',cluster.shell);
 				if ~isvalgrind,
 					if cluster.interactive
 						if IssmConfig('_HAVE_MPI_'),
-							fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
+							fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s \n',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
 						else
 							fprintf(fid,'%s/issm.exe %s %s %s ',cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname],modelname);
@@ -202,4 +204,12 @@
 
 			if ~ispc,
+
+				%figure out what shell extension we will use:
+				if isempty(strfind(cluster.shell,'csh')),
+					shellext='sh';
+				else
+					shellext='csh';
+				end
+
 				%compress the files into one zip.
 				compressstring=['tar -zcf ' dirname '.tar.gz '];
@@ -216,5 +226,5 @@
 
 				if cluster.verbose, disp('launching solution sequence on remote cluster'); end
-				launchcommand=['source ' cluster.etcpath '/environment.sh && cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
+				launchcommand=['source ' cluster.etcpath '/environment.' shellext ' && cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
 					' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && source  ' modelname '.queue '];
 				issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
