Index: /issm/trunk-jpl/src/m/classes/clusters/vilje.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/vilje.m	(revision 22063)
+++ /issm/trunk-jpl/src/m/classes/clusters/vilje.m	(revision 22064)
@@ -15,4 +15,5 @@
 		procspernodes  = 16;
 		mem            = 28;
+		numstreams		= 8; %Henning added
 		queue          = 'workq';
 		time           = 2*60;
@@ -79,5 +80,6 @@
 
 			%compute number of processors
-			cluster.np=cluster.numnodes*cluster.cpuspernode;
+% 			cluster.np=cluster.numnodes*cluster.cpuspernode;
+			np(cluster);%=cluster.numnodes*cluster.cpuspernode;
 
 			%write queuing script 
@@ -86,5 +88,8 @@
 			fprintf(fid,'#PBS -N %s\n',modelname);
 			fprintf(fid,'#PBS -l select=%i:ncpus=%i:mpiprocs=%i\n',cluster.numnodes,cluster.cpuspernode,16);
-			fprintf(fid,'#PBS -l walltime=%s\n',cluster.time); %walltime is in seconds.
+			
+			%calculate walltime in hh:mm:ss format
+			walltime=datestr(cluster.time/(60*24),'HH:MM:SS');
+			fprintf(fid,'#PBS -l walltime=%s\n',walltime); %walltime should be in hh:mm:ss
 			fprintf(fid,'#PBS -A %s\n',cluster.accountname);
 			fprintf(fid,'#PBS -o %s.outlog \n',modelname);
@@ -92,4 +97,9 @@
 			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
 			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'module load intelcomp/17.0.0\n') 
+			fprintf(fid,'module load mpt/2.14\n')
+			fprintf(fid,'module load petsc/3.7.4d\n')
+			fprintf(fid,'module load parmetis/4.0.3\n') 
+			fprintf(fid,'module load mumps/5.0.2\n')
 			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,modelname);
 			fprintf(fid,'mpiexec_mpt -n %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
@@ -117,14 +127,22 @@
 
 			%compute number of processors
-			cluster.np=cluster.numnodes*cluster.cpuspernode;                     
-			shortname = substring(modelname,1,min(12,length(modelname)));
+% 			cluster.np=cluster.numnodes*cluster.cpuspernode;
+			np(cluster);%=cluster.numnodes*cluster.cpuspernode;                     
+% 			shortname = substring(modelname,1,min(12,length(modelname)));
 
 			%write queuing script 
 			fid=fopen([modelname '.queue'],'w');
 			fprintf(fid,'#PBS -S /bin/bash\n');
-			fprintf(fid,'#PBS -N %s\n',shortname);
+% 			fprintf(fid,'#PBS -N %s\n',shortname);
+			fprintf(fid,'#PBS -N %s\n',modelname);
 			fprintf(fid,'#PBS -q %s \n',cluster.queue);
 			fprintf(fid,'#PBS -l select=%i:ncpus=%i:mpiprocs=%i\n',cluster.numnodes,cluster.cpuspernode,cluster.procspernodes);
-			fprintf(fid,'#PBS -l walltime=%s\n',duration(0,cluster.time,0)); %walltime is in minutes.
+
+			%calculate walltime in hh:mm:ss format
+			walltime=datestr(cluster.time/(60*24),'HH:MM:SS');
+% 			fprintf(fid,'#PBS -l walltime=%s\n',duration(0,cluster.time,0)); %walltime is in minutes.
+% 			fprintf(fid,'#PBS -l walltime=%s\n',10); %walltime is in minutes.
+			fprintf(fid,'#PBS -l walltime=%s\n',walltime); %walltime should be in hh:mm:ss
+% 			fprintf(fid,'#PBS -l walltime=%i\n',walltime); %walltime is in hh:mm:ss
 			fprintf(fid,'#PBS -A %s\n',cluster.accountname);
 			fprintf(fid,'#PBS -o %s.outlog \n',[cluster.executionpath '/' dirname '/' modelname]);
@@ -132,6 +150,11 @@
 			fprintf(fid,'export ISSM_DIR="%s/../"\n',cluster.codepath); %FIXME
 			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'module load intelcomp/17.0.0\n') 
+			fprintf(fid,'module load mpt/2.14\n')
+			fprintf(fid,'module load petsc/3.7.4d\n')
+			fprintf(fid,'module load parmetis/4.0.3\n') 
+			fprintf(fid,'module load mumps/5.0.2\n')
 			fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,dirname);
-			fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
+			fprintf(fid,'mpiexec_mpt -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
 
 			if ~io_gather, %concatenate the output files:
@@ -143,5 +166,5 @@
 			if cluster.interactive,
 				fid=fopen([modelname '.run'],'w');
-				fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
+				fprintf(fid,'mpiexec_mpt -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname);
 				if ~io_gather, %concatenate the output files:
 					fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
@@ -164,9 +187,10 @@
 			disp('uploading input file and queueing script');
 			directory=cluster.executionpath;
-			issmbbftpout(cluster.name,directory,cluster.login,cluster.port,cluster.numstreams,{[dirname '.tar.gz']});
-
-		end
-		%}}}
-		function LaunchQueueJob(cluster,modelname,dirname,filelist)% {{{
+% 			issmbbftpout(cluster.name,directory,cluster.login,cluster.port,cluster.numstreams,{[dirname '.tar.gz']});
+			issmscpout(cluster.name,directory,cluster.login,cluster.port,{[dirname '.tar.gz']});
+
+		end
+		%}}}
+		function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
 
 			disp('launching solution sequence on remote cluster');
