Index: /issm/trunk-jpl/src/m/classes/clusters/pfe.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/pfe.m	(revision 13125)
+++ /issm/trunk-jpl/src/m/classes/clusters/pfe.m	(revision 13126)
@@ -9,18 +9,19 @@
     properties (SetAccess=public)  
 		 % {{{
-		 name='pfe'
-		 login='';
-		 numnodes=20;
-		 cpuspernode=8; 
-		 port=1025;
-		 queue='long';
-		 time=12*60;
-		 processor='neh';
-		 codepath='';
-		 executionpath='';
-		 interactive=0;
-		 bbftp=0;
-		 numstreams=8;
-		 hyperthreading=0;
+		 name           = 'pfe'
+		 login          = '';
+		 numnodes       = 20;
+		 cpuspernode    = 8;
+		 port           = 1025;
+		 queue          = 'long';
+		 time           = 12*60;
+		 processor      = 'neh';
+		 codepath       = '';
+		 executionpath  = '';
+		 grouplist     = 's1010';
+		 interactive    = 0;
+		 bbftp          = 0;
+		 numstreams     = 8;
+		 hyperthreading = 0;
 	 end
 	 properties (SetAccess=private) 
@@ -52,4 +53,5 @@
 			 disp(sprintf('    codepath: %s',cluster.codepath));
 			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+			 disp(sprintf('    grouplist: %s',cluster.grouplist));
 			 disp(sprintf('    interactive: %i',cluster.interactive));
 			 disp(sprintf('    hyperthreading: %i',cluster.hyperthreading));
@@ -93,4 +95,5 @@
 			 if isempty(cluster.codepath), md = checkmessage(md,'codepath empty'); end
 			 if isempty(cluster.executionpath), md = checkmessage(md,'executionpath empty'); end
+			 if isempty(cluster.grouplist), md = checkmessage(md,'grouplist empty'); end
 
 		 end
@@ -107,4 +110,55 @@
 			 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',modelname);
+			 fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
+			 fprintf(fid,'. /usr/share/modules/init/bash\n\n');
+			 fprintf(fid,'module load comp-intel/11.1.046\n');
+			 fprintf(fid,'module load mpi/mpt.1.25\n');
+			 fprintf(fid,'module load math/intel_mkl_64_10.0.011\n\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 $PBS_O_WORKDIR\n\n');
+			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,EnumToString(solution),[cluster.executionpath '/' dirname '/' modelname]);
+			 if ~io_gather, %concatenate the output files:
+				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			 end
+			 fclose(fid);
+
+			 %in interactive mode, create a run file, and errlog and outlog file
+			 if cluster.interactive,
+				 fid=fopen([modelname '.run'],'w');
+				 if ~isvalgrind,
+					 fprintf(fid,'mpiexec -np %i %s/issm.exe %s $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,EnumToString(solution),modelname);
+				 else
+					 fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/issm.exe %s $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,EnumToString(solution),modelname);
+				 end
+				 if ~io_gather, %concatenate the output files:
+					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+				 end
+				 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) % {{{
+
+			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
+
+			 %compute number of processors
+			 cluster.np=cluster.numnodes*cluster.cpuspernode;
+
+			 %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.
@@ -118,8 +172,10 @@
 			 fprintf(fid,'module load mpi/mpt.1.25\n');
 			 fprintf(fid,'module load math/intel_mkl_64_10.0.011\n\n');
-			 fprintf(fid,'export PATH="$PATH:."\n\n');
+			 fprintf(fid,'export PATH="$PATH:."\n');
+			 fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
+			 fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
 			 fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
-			 fprintf(fid,'cd $PBS_O_WORKDIR\n\n');
-			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,EnumToString(solution),modelname);
+			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
+			 fprintf(fid,'mpiexec -np %i %s/kriging.exe $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname '/' modelname]); %FIXME
 			 if ~io_gather, %concatenate the output files:
 				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
@@ -131,7 +187,7 @@
 				 fid=fopen([modelname '.run'],'w');
 				 if ~isvalgrind,
-					 fprintf(fid,'mpiexec -np %i %s/issm.exe %s $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,EnumToString(solution),modelname);
-				 else
-					 fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/issm.exe %s $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,EnumToString(solution),modelname);
+					 fprintf(fid,'mpiexec -np %i %s/kriging.exe $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname '/' modelname]);
+				 else
+					 fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/kriging.exe $PBS_O_WORKDIR %s\n',cluster.np,cluster.codepath,modelname);
 				 end
 				 if ~io_gather, %concatenate the output files:
