Index: /issm/trunk-jpl/src/m/classes/clusters/pfe.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/pfe.m	(revision 20265)
+++ /issm/trunk-jpl/src/m/classes/clusters/pfe.m	(revision 20266)
@@ -42,5 +42,6 @@
 			 disp(sprintf('    name: %s',cluster.name));
 			 disp(sprintf('    login: %s',cluster.login));
-			 disp(sprintf('    modules: %s',strjoin(cluster.modules,', ')));
+			 modules=''; for i=1:length(cluster.modules), modules=[modules cluster.modules{i} ',']; end; modules=modules(1:end-1); 
+			 disp(sprintf('    modules: %s',modules));
 			 disp(sprintf('    port: %i',cluster.port));
 			 disp(sprintf('    numnodes: %i',cluster.numnodes));
@@ -190,4 +191,93 @@
 			 end
 		 end %}}}
+		function BuildQueueScriptMultipleModels(cluster,dirname,modelname,solution,dirnames,modelnames,nps) % {{{
+		
+			%some checks: 
+			if isempty(modelname), error('BuildQueueScriptMultipleModels error message: need a non empty model name!');end
+
+			%what is the executable being called? 
+			executable='issm_slr.exe';
+
+			if ispc(), error('BuildQueueScriptMultipleModels not support yet on windows machines');end;
+			
+			%write queuing script 
+			fid=fopen([modelname '.queue'],'w');
+			
+			fprintf(fid,'#PBS -S /bin/bash\n');
+			fprintf(fid,'#PBS -N %s\n',modelname);
+			fprintf(fid,'#PBS -l select=%i:ncpus=%i:model=%s\n',cluster.numnodes,cluster.cpuspernode,cluster.processor);
+			fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
+			fprintf(fid,'#PBS -q %s \n',cluster.queue);
+			fprintf(fid,'#PBS -W group_list=%s\n',cluster.grouplist);
+			fprintf(fid,'#PBS -m e\n');
+			fprintf(fid,'#PBS -o %s.outlog \n',[cluster.executionpath '/' dirname '/' modelname]);
+			fprintf(fid,'#PBS -e %s.errlog \n\n',[cluster.executionpath '/' dirname '/' modelname]);
+			fprintf(fid,'. /usr/share/modules/init/bash\n\n');
+			fprintf(fid,'module load comp-intel/2015.0.090\n');
+			fprintf(fid,'module load mpi-sgi/mpt.2.12r16\n');
+			fprintf(fid,'export PATH="$PATH:."\n\n');
+			fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
+			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'cd %s/%s/\n\n',cluster.executionpath,dirname);
+
+			%number of cpus: 
+			mpistring=sprintf('mpiexec -np %i ',cluster.numnodes*cluster.cpuspernode);
+
+			%executable: 
+			mpistring=[mpistring sprintf('%s/%s ',cluster.codepath,executable)];
+			
+			%solution name: 
+			mpistring=[mpistring sprintf('%s ',EnumToString(solution))];
+
+			%execution directory and model name: 
+			mpistring=[mpistring sprintf('%s/%s %s',cluster.executionpath,dirname,modelname)];
+
+			%inform main executable of how many icecaps, glaciers and earth models are being run: 
+			mpistring=[mpistring sprintf(' %i ',length(dirnames))];
+			
+			%icecaps, glaciers and earth location, names and number of processors associated:
+			for i=1:length(dirnames),
+			mpistring=[mpistring sprintf(' %s/%s %s %i ',cluster.executionpath,dirnames{i},modelnames{i},nps{i})];
+			end
+
+			%write this long string to disk: 
+			fprintf(fid,mpistring);
+			fclose(fid);
+			
+			if cluster.interactive,
+				fid=fopen([modelname '.run'],'w');
+				
+				%number of cpus: 
+				mpistring=sprintf('mpiexec -np %i ',cluster.numnodes*cluster.cpuspernode);
+
+				%executable: 
+				mpistring=[mpistring sprintf('%s/%s ',cluster.codepath,executable)];
+
+				%solution name: 
+				mpistring=[mpistring sprintf('%s ',EnumToString(solution))];
+
+				%execution directory and model name: 
+				mpistring=[mpistring sprintf('%s/%s %s',cluster.executionpath,dirname,modelname)];
+
+				%inform main executable of how many icecaps, glaciers and earth models are being run: 
+				mpistring=[mpistring sprintf(' %i ',length(dirnames))];
+
+				%icecaps, glaciers and earth location, names and number of processors associated:
+				for i=1:length(dirnames),
+					mpistring=[mpistring sprintf(' %s/Interactive%i %s %i ',cluster.executionpath,cluster.interactive,modelnames{i},nps{i})];
+				end
+						 
+				%write this long string to disk: 
+				fprintf(fid,mpistring);
+				fclose(fid);
+
+				fid=fopen([modelname '.errlog'],'w');
+				fclose(fid);
+				fid=fopen([modelname '.outlog'],'w');
+				fclose(fid);
+			 end
+		end
+		%}}}
 		 function BuildKrigingQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
 
