Index: /issm/trunk-jpl/src/m/classes/clusters/acenet.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/acenet.m	(revision 12350)
+++ /issm/trunk-jpl/src/m/classes/clusters/acenet.m	(revision 12351)
@@ -8,5 +8,5 @@
 classdef acenet
     properties (SetAccess=public) 
-		 % {{{1
+		 % {{{
 		 name='glacdyn.ace-net.ca'
 		 %name='placentia.ace-net.ca'
@@ -23,5 +23,5 @@
 	 end
 	 methods
-		 function cluster=acenet(varargin) % {{{1
+		 function cluster=acenet(varargin) % {{{
 			 %use provided options to change fields
 			 options=pairoptions(varargin{:});
@@ -34,5 +34,5 @@
 		 end
 		 %}}}
-		 function disp(cluster) % {{{1
+		 function disp(cluster) % {{{
 			 %  display the object
 			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
@@ -47,5 +47,5 @@
 		 end
 		 %}}}
-		 function checkconsistency(cluster,md,solution,analyses) % {{{1
+		 function checkconsistency(cluster,md,solution,analyses) % {{{
 
 			 available_queues={'debug','shortq','longq'};
@@ -56,23 +56,15 @@
 		 end
 		 %}}}
-		 function BuildQueueScript(cluster,md) % {{{1
+		 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
 
-			 %retrieve parameters 
-			 modelname=md.miscellaneous.name; 
-			 solution=md.private.solution;
+			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %open file for writing: 
+			 %write queuing script 
 			 fid=fopen([modelname '.queue'],'w');
-
-          %write instructions for launching a job on the cluster
-          % fprintf(fid,'#!/bin/sh\n');
 			 fprintf(fid,'#!/bin/bash\n');
-          %fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
-          %         cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
 			 fprintf(fid,'#$ -cwd\n');
           fprintf(fid,'#$ -N issm\n');
-          %fprintf(fid,'#$ -l h_rt=%i\n',cluster.time);
           fprintf(fid,'#$ -l h_rt=10:0:0\n');
-          %fprintf(fid,'#$ -l h_rt=1:0:0,test=true\n');
           fprintf(fid,'#$ -pe ompi* %i\n',cluster.np);
           fprintf(fid,'#$ -j y\n');
@@ -81,27 +73,11 @@
           fprintf(fid,'module load issm\n');
           fprintf(fid,'\n');
-          %fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
           fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
                    cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
-
-          % fprintf(fid,'#PBS -l select=%i:ncpus=1\n',cluster.np);
-			 % fprintf(fid,'#PBS -N %s\n',modelname);
-			 % fprintf(fid,'#PBS -l walltime=%i\n',time*60); %walltime is in seconds.
-			 % fprintf(fid,'#PBS -q %s\n',queue);
-			 % fprintf(fid,'#PBS -o %s.outlog \n',modelname);
-			 % fprintf(fid,'#PBS -e %s.errlog \n',modelname);
-			 % fprintf(fid,'export PBS_O_WORKDIR=%s\n',cluster.executionpath);
-			 % fprintf(fid,'cd $PBS_O_WORKDIR\n');
-			 % fprintf(fid,'export OMP_NUM_THREADS=1\n');
-			 % fprintf(fid,'ulimit -s unlimited\n');
-			 % fprintf(fid,'ulimit -c 0\n');
-			 % fprintf(fid,'/opt/mpich/gm/intel10.1/bin/mpiexec -np %i %s/issm.exe %s %s %s',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
-
-			 %close file
 			 fclose(fid);
 
 		 end
 		 %}}}
-		 function LaunchQueueJob(cluster,md,options)% {{{1
+		 function LaunchQueueJob(cluster,md,options)% {{{
 			  %retrieve parameters 
           modelname=md.miscellaneous.name;
@@ -134,5 +110,5 @@
 		 end
 		 %}}}
-		 function Download(cluster,md)% {{{1
+		 function Download(cluster,md)% {{{
 
 			%some check
Index: /issm/trunk-jpl/src/m/classes/clusters/castor.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/castor.m	(revision 12350)
+++ /issm/trunk-jpl/src/m/classes/clusters/castor.m	(revision 12351)
@@ -8,5 +8,5 @@
 classdef castor
     properties (SetAccess=public) 
-		 % {{{1
+		 % {{{
 		 name='castor'
 		 login='username';
@@ -20,9 +20,9 @@
 	 end
 	 methods
-		 function cluster=castor(varargin) % {{{1
+		 function cluster=castor(varargin) % {{{
 			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
 		 end
 		 %}}}
-		 function disp(cluster) % {{{1
+		 function disp(cluster) % {{{
 			 %  display the object
 			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
@@ -37,5 +37,5 @@
 		 end
 		 %}}}
-		 function checkconsistency(cluster,md,solution,analyses) % {{{1
+		 function checkconsistency(cluster,md,solution,analyses) % {{{
 
 			 available_queues={'shortc','longc'};
@@ -46,13 +46,11 @@
 		 end
 		 %}}}
-		 function BuildQueueScript(cluster,md) % {{{1
+		 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
 
-			 %retrieve parameters 
-			 modelname=md.miscellaneous.name; 
-			 solution=md.private.solution;
+			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %open file for writing: 
+			 %write queuing script 
 			 fid=fopen([modelname '.queue'],'w');
-
 			 fprintf(fid,'#!/bin/sh\n');
 			 fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
@@ -64,16 +62,13 @@
 			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
 			 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
-
 			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',cluster.executionpath);
 			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
 			 fprintf(fid,'export OMP_NUM_THREADS=1\n');
 			 fprintf(fid,'dplace -s1 -c0-%i mpiexec -np %i %s/issm.exe %s %s %s',cluster.np-1,cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
-
-			 %close file
 			 fclose(fid);
 
 		 end
 		 %}}}
-		 function LaunchQueueJob(cluster,md,options)% {{{1
+		 function LaunchQueueJob(cluster,md,options)% {{{
 			 
 			 %lauch command, to be executed via ssh
@@ -103,5 +98,5 @@
 		 end
 		 %}}}
-		 function Download(cluster,md)% {{{1
+		 function Download(cluster,md)% {{{
 
 			%some check
Index: /issm/trunk-jpl/src/m/classes/clusters/cosmos.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/cosmos.m	(revision 12350)
+++ /issm/trunk-jpl/src/m/classes/clusters/cosmos.m	(revision 12351)
@@ -8,5 +8,5 @@
 classdef cosmos
     properties (SetAccess=public) 
-		 % {{{1
+		 % {{{
 		 name='cosmos'
 		 login='username';
@@ -20,9 +20,9 @@
 	 end
 	 methods
-		 function cluster=cosmos(varargin) % {{{1
+		 function cluster=cosmos(varargin) % {{{
 			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
 		 end
 		 %}}}
-		 function disp(cluster) % {{{1
+		 function disp(cluster) % {{{
 			 %  display the object
 			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
@@ -37,5 +37,5 @@
 		 end
 		 %}}}
-		 function checkconsistency(cluster,md,solution,analyses) % {{{1
+		 function checkconsistency(cluster,md,solution,analyses) % {{{
 
 			 available_queues={'debug','shortq','longq'};
@@ -46,13 +46,11 @@
 		 end
 		 %}}}
-		 function BuildQueueScript(cluster,md) % {{{1
+		 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
 
-			 %retrieve parameters 
-			 modelname=md.miscellaneous.name; 
-			 solution=md.private.solution;
+			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %open file for writing: 
+			 %write queuing script 
 			 fid=fopen([modelname '.queue'],'w');
-
 			 fprintf(fid,'#!/bin/bash\n');
 			 fprintf(fid,'#PBS -l select=%i:ncpus=1\n',cluster.np);
@@ -68,11 +66,9 @@
 			 fprintf(fid,'ulimit -c 0\n');
 			 fprintf(fid,'/opt/mpich/gm/intel10.1/bin/mpiexec -np %i %s/issm.exe %s %s %s',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
-
-			 %close file
 			 fclose(fid);
 
 		 end
 		 %}}}
-		 function LaunchQueueJob(cluster,md,options)% {{{1
+		 function LaunchQueueJob(cluster,md,options)% {{{
 			 
 			 %lauch command, to be executed via ssh
@@ -102,5 +98,5 @@
 		 end
 		 %}}}
-		 function Download(cluster,md)% {{{1
+		 function Download(cluster,md)% {{{
 
 			%some check
Index: /issm/trunk-jpl/src/m/classes/clusters/gemini.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/gemini.m	(revision 12350)
+++ /issm/trunk-jpl/src/m/classes/clusters/gemini.m	(revision 12351)
@@ -8,5 +8,5 @@
 classdef gemini
     properties (SetAccess=public) 
-	% {{{1
+	% {{{
 		name='gemini'
 		login='username';
@@ -20,9 +20,9 @@
     end
     methods
-		 function cluster=gemini(varargin) % {{{1
+		 function cluster=gemini(varargin) % {{{
 			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
 		 end
 		 %}}}
-		 function disp(cluster) % {{{1
+		 function disp(cluster) % {{{
 			 %  display the object
 			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
@@ -37,5 +37,5 @@
 		 end
 		 %}}}
-		 function checkconsistency(cluster,md,solution,analyses) % {{{1
+		 function checkconsistency(cluster,md,solution,analyses) % {{{
 
 			 available_queues={'debug','shortg','longg'};
@@ -46,13 +46,11 @@
 		 end
 		 %}}}
-		 function BuildQueueScript(cluster,md) % {{{1
+		 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
 
-			 %retrieve parameters 
-			 modelname=md.miscellaneous.name; 
-			 solution=md.private.solution;
+			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %open file for writing: 
+			 %write queuing script 
 			 fid=fopen([modelname '.queue'],'w');
-
 			 fprintf(fid,'#!/bin/sh\n');
 			 fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
@@ -69,11 +67,9 @@
 			 fprintf(fid,'export OMP_NUM_THREADS=1\n');
 			 fprintf(fid,'dplace -s1 -c0-%i mpiexec -np %i %s/issm.exe %s %s %s',cluster.np-1,cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
-
-			 %close file
 			 fclose(fid);
 
 		 end
 		 %}}}
-		 function LaunchQueueJob(cluster,md,options)% {{{1
+		 function LaunchQueueJob(cluster,md,options)% {{{
 			 
 			 %lauch command, to be executed via ssh
@@ -103,5 +99,5 @@
 		 end
 		 %}}}
-		 function Download(cluster,md)% {{{1
+		 function Download(cluster,md)% {{{
 
 			%some check
Index: /issm/trunk-jpl/src/m/classes/clusters/generic.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/generic.m	(revision 12350)
+++ /issm/trunk-jpl/src/m/classes/clusters/generic.m	(revision 12351)
@@ -7,5 +7,5 @@
 classdef generic
     properties (SetAccess=public) 
-		 % {{{1
+		 % {{{
 		 name='';
 		 login='';
@@ -21,5 +21,5 @@
 	 end
 	 methods
-		 function cluster=generic(varargin) % {{{1
+		 function cluster=generic(varargin) % {{{
 
 			 %use provided options to change fields
@@ -36,5 +36,5 @@
 		 end
 		 %}}}
-		 function disp(cluster) % {{{1
+		 function disp(cluster) % {{{
 			 %  display the object
 			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
@@ -50,5 +50,5 @@
 		 end
 		 %}}}
-		 function checkconsistency(cluster,md,solution,analyses) % {{{1
+		 function checkconsistency(cluster,md,solution,analyses) % {{{
 			 if cluster.np<1
 				 checkmessage(['number of processors should be at least 1']);
@@ -59,13 +59,7 @@
 		 end
 		 %}}}
-		 function BuildQueueScript(cluster,md) % {{{1
+		 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
 		 
-			 %retrieve parameters
-			 modelname=md.miscellaneous.name;
-			 solution=md.private.solution;
-			 isvalgrind=md.debug.valgrind;
-			 isgprof=md.debug.gprof;
-
-			 %open file for writing: 
+			 %write queuing script 
 			 if ~ispc,
 				 fid=fopen([modelname '.queue'],'w');
@@ -115,15 +109,11 @@
 			 end
 
-			 if ~md.settings.io_gather,
-				 if ~ispc,
-					 %concatenate the output files:
+			 if ~io_gather,
+				 if ~ispc, %concatenate the output files:
 					 fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
 				 else
 					 error('iogather not supported on windows platforms');
 				 end
-
 			 end
-			 
-			 %close file: 
 			 fclose(fid);
 
@@ -133,9 +123,7 @@
 				 fid=fopen([modelname '.outlog'],'w'); fclose(fid);
 			 end
-
-
 		 end
 		 %}}}
-		 function LaunchQueueJob(cluster,md,options)% {{{1
+		 function LaunchQueueJob(cluster,md,options)% {{{
 			 
 			 if ~ispc,
@@ -171,5 +159,5 @@
 
 		end %}}}
-		 function Download(cluster,md)% {{{1
+		 function Download(cluster,md)% {{{
 
 			if ~ispc,
Index: /issm/trunk-jpl/src/m/classes/clusters/generic.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/generic.py	(revision 12350)
+++ /issm/trunk-jpl/src/m/classes/clusters/generic.py	(revision 12351)
@@ -36,182 +36,2 @@
 		return string
 		#}}}
-		
-
-#old matlab
-#		function cluster=generic(varargin) % {{{1
-#
-#			 %use provided options to change fields
-#			 options=pairoptions(varargin{:});
-#
-#			 %get name
-#			 if ~exist(options,'name'), error('option ''name'' has not been provided'); end
-#			 cluster.name=getfieldvalue(options,'name');
-#
-#			 %initialize cluster using user settings if provided
-#			 if (exist([cluster.name '_settings'])==2), eval([cluster.name '_settings']); end
-#
-#			 %OK get other fields
-#			 for i=1:size(options.list,1),
-#				 fieldname=options.list{i,1};
-#				 fieldvalue=options.list{i,2};
-#				 if ismember(fieldname,properties('generic')),
-#					 cluster.(fieldname)=fieldvalue;
-#				 else
-#					 disp(['''' fieldname ''' is not a property of cluster generic']);
-#				 end
-#			 end
-#		 end
-#		 %}}}
-#		 function checkconsistency(cluster,md,solution,analyses) % {{{1
-#			 if cluster.np<1
-#				 checkmessage(['number of processors should be at least 1']);
-#			 end
-#			 if isnan(cluster.np),
-#				 checkessage('number of processors should not be NaN!');
-#			 end
-#		 end
-#		 %}}}
-#		 function BuildQueueScript(cluster,md) % {{{1
-#		 
-#			 %retrieve parameters
-#			 modelname=md.miscellaneous.name;
-#			 solution=md.private.solution;
-#			 isvalgrind=md.debug.valgrind;
-#			 isgprof=md.debug.gprof;
-#
-#			 %open file for writing: 
-#			 if ~ispc,
-#				 fid=fopen([modelname '.queue'],'w');
-#			 else
-#				 fid=fopen([modelname '.bat'],'w');
-#			 end
-#
-#			 %write instructions for launching a job on the cluster
-#			 if ~ispc,
-#				 fprintf(fid,'#!/bin/sh\n');
-#			 else
-#				 fprintf(fid,'@echo off\n');
-#			 end
-#			 
-#			 if ~isvalgrind,
-#				 if cluster.interactive
-#					 if ~ispc,
-#						 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
-#					 else
-#						 fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
-#					 end
-#				 else
-#					 if ~ispc,
-#						 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,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
-#				 end
-#			 else
-#				 if ~ispc,
-#					 %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/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
-#					 cluster.np,cluster.valgrind,cluster.valgrindsup, cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
-#				 else
-#					 error('valgrind not supported on windows platforms');
-#				 end
-#			 end
-#
-#			 if isgprof,
-#				 if ~ispc,
-#					 fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname);
-#				 else
-#					 error('gprof not supported on windows platforms');
-#				 end
-#
-#			 end
-#
-#			 if ~md.settings.io_gather,
-#				 if ~ispc,
-#					 %concatenate the output files:
-#					 fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
-#				 else
-#					 error('iogather not supported on windows platforms');
-#				 end
-#
-#			 end
-#			 
-#			 %close file: 
-#			 fclose(fid);
-#
-#			 %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,md,options)% {{{1
-#			 
-#			 if ~ispc,
-#					 %lauch command, to be executed via ssh
-#					 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.private.runtimename ' && mkdir ' md.private.runtimename ...
-#					 ' && cd ' md.private.runtimename ' && mv ../' md.private.runtimename '.tar.gz ./ && tar -zxf ' md.private.runtimename '.tar.gz  && source  ' md.miscellaneous.name '.queue '];
-#
-#					 if ~strcmpi(options.batch,'yes'),
-#
-#						 %compress the files into one zip.
-#						 compressstring=['tar -zcf ' md.private.runtimename '.tar.gz ' md.miscellaneous.name '.bin ' md.miscellaneous.name '.queue '  md.miscellaneous.name '.petsc '];
-#						 if md.qmu.isdakota,
-#							 compressstring=[compressstring md.miscellaneous.name '.qmu.in'];
-#					end
-#					if cluster.interactive,
-#						compressstring=[compressstring ' ' md.miscellaneous.name '.errlog ' md.miscellaneous.name '.outlog '];
-#					end
-#					system(compressstring);
-#
-#					disp('uploading input file and queueing script');
-#					issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[md.private.runtimename '.tar.gz']});
-#
-#					disp('launching solution sequence on remote cluster');
-#					issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
-#				else
-#					disp('batch mode requested: not launching job interactively');
-#					disp('launch solution sequence on remote cluster by hand');
-#				end
-#			else
-#				%launch right here, do not compress or archive.
-#				system([md.miscellaneous.name '.bat']);
-#			end
-#
-#		end %}}}
-#		 function Download(cluster,md)% {{{1
-#
-#			if ~ispc,
-#				%some check
-#				if isempty(md.private.runtimename),
-#					error('supply runtime name for results to be loaded!');
-#				end
-#
-#				%Figure out the  directory where all the files are in: 
-#				directory=[cluster.executionpath '/' md.private.runtimename '/'];
-#
-#				%What packages are we picking up from remote cluster
-#				packages={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
-#				if md.qmu.isdakota,
-#					packages{end+1}=[md.miscellaneous.name '.qmu.err'];
-#					packages{end+1}=[md.miscellaneous.name '.qmu.out'];
-#					if isfield(md.qmu.params,'tabular_graphics_data'),
-#						if md.qmu.params.tabular_graphics_data==true,
-#							packages{end+1}='dakota_tabular.dat'; 
-#						end
-#					end
-#				else
-#					packages{end+1}=[md.miscellaneous.name '.outbin'];
-#				end
-#
-#				%copy files from cluster to present directory
-#				issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
-#			else
-#				%do nothing!
-#			end
-#		end %}}}
-#
Index: /issm/trunk-jpl/src/m/classes/clusters/greenplanet.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/greenplanet.m	(revision 12350)
+++ /issm/trunk-jpl/src/m/classes/clusters/greenplanet.m	(revision 12351)
@@ -8,5 +8,5 @@
 classdef greenplanet
     properties (SetAccess=public)  
-		 % {{{1
+		 % {{{
 		 name='greenplanet'
 		 login='';
@@ -24,5 +24,5 @@
 	 end
 	 methods
-		 function cluster=greenplanet(varargin) % {{{1
+		 function cluster=greenplanet(varargin) % {{{
 
 			 %initialize cluster using default settings if provided
@@ -33,5 +33,5 @@
 		 end
 		 %}}}
-		 function disp(cluster) % {{{1
+		 function disp(cluster) % {{{
 			 %  display the object
 			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
@@ -48,5 +48,5 @@
 		 end
 		 %}}}
-		 function checkconsistency(cluster,md,solution,analyses) % {{{1
+		 function checkconsistency(cluster,md,solution,analyses) % {{{
 
 			 available_queues={'rignot','default'};
@@ -63,17 +63,14 @@
 		 end
 		 %}}}
-		 function BuildQueueScript(cluster,md) % {{{1
+		 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
 
-			 %retrieve parameters 
-			 modelname=md.miscellaneous.name; 
-			 solution=md.private.solution;
-			 isvalgrind=md.debug.valgrind;
+			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
 			 %compute number of processors
 			 cluster.np=cluster.numnodes*cluster.cpuspernode;
 
-			 %open file for writing: 
+			 %write queuing script 
 			 fid=fopen([modelname '.queue'],'w');
-
 			 fprintf(fid,'#PBS -S /bin/bash\n');
 			 fprintf(fid,'#PBS -N %s\n',modelname);
@@ -84,14 +81,9 @@
 			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
 			 fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
-
 			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,md.private.runtimename);
 			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
-
-			 if ~md.settings.io_gather,
-				 %concatenate the output files:
+			 if ~io_gather, %concatenate the output files:
 				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
 			 end
-
-			 %close file
 			 fclose(fid);
 
@@ -100,7 +92,5 @@
 				 fid=fopen([modelname '.run'],'w');
 				 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
-
-				 if ~md.settings.io_gather,
-					 %concatenate the output files:
+				 if ~io_gather, %concatenate the output files:
 					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
 				 end
@@ -112,5 +102,5 @@
 			 end
 		 end %}}}
-		 function LaunchQueueJob(cluster,md,options)% {{{1
+		 function LaunchQueueJob(cluster,md,options)% {{{
 			 
 			 %lauch command, to be executed via ssh
@@ -152,5 +142,5 @@
 		 end
 		 %}}}
-		 function Download(cluster,md)% {{{1
+		 function Download(cluster,md)% {{{
 
 			%some check
Index: /issm/trunk-jpl/src/m/classes/clusters/none.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/none.m	(revision 12350)
+++ /issm/trunk-jpl/src/m/classes/clusters/none.m	(revision 12351)
@@ -11,5 +11,5 @@
     end
     methods
-		 function cluster=none(varargin) % {{{1
+		 function cluster=none(varargin) % {{{
 			 error('Cannot assign md.cluster to ''none'': ISSM is not available in serial model anymore');
 		 end
Index: sm/trunk-jpl/src/m/classes/clusters/none.py
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/none.py	(revision 12350)
+++ 	(revision )
@@ -1,24 +1,0 @@
-#NONE cluster class definition
-#
-#   Usage:
-#      cluster=none();
-#      cluster=none('np',3);
-#      cluster=none('np',3,'login','username');
-
-class none:
-	#properties
-	def __init__(self):
-		# {{{ Properties
-		self.name='none'
-		#}}}
-	def __repr__(obj):
-		# {{{ Display
-		
-		string="class 'none' object:"
-		string="%s\n\n%s"%(string,"%s%s"%('    name: ',obj.name))
-		return string
-		#}}}
-	def checkconsistency(cluster,md,solution,analyses):
-		pass
-	def BuildQueueScript(cluster,md):
-			 raise RuntimeError('none.BuildQueueScript error message: serial cluster cannot build queue script')
Index: /issm/trunk-jpl/src/m/classes/clusters/pfe.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/pfe.m	(revision 12350)
+++ /issm/trunk-jpl/src/m/classes/clusters/pfe.m	(revision 12351)
@@ -8,5 +8,5 @@
 classdef pfe
     properties (SetAccess=public)  
-		 % {{{1
+		 % {{{
 		 name='pfe'
 		 login='';
@@ -29,5 +29,5 @@
 	 end
 	 methods
-		 function cluster=pfe(varargin) % {{{1
+		 function cluster=pfe(varargin) % {{{
 
 			 %initialize cluster using default settings if provided
@@ -38,5 +38,5 @@
 		 end
 		 %}}}
-		 function disp(cluster) % {{{1
+		 function disp(cluster) % {{{
 			 %  display the object
 			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
@@ -56,5 +56,5 @@
 		 end
 		 %}}}
-		 function checkconsistency(cluster,md,solution,analyses) % {{{1
+		 function checkconsistency(cluster,md,solution,analyses) % {{{
 
 			 available_queues={'long','normal','debug'};
@@ -96,17 +96,13 @@
 		 end
 		 %}}}
-		 function BuildQueueScript(cluster,md) % {{{1
-
-			 %retrieve parameters 
-			 modelname=md.miscellaneous.name; 
-			 solution=md.private.solution;
-			 isvalgrind=md.debug.valgrind;
+		 function BuildQueueScript(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;
 
-			 %open file for writing: 
+			 %write queuing script 
 			 fid=fopen([modelname '.queue'],'w');
-
 			 fprintf(fid,'#PBS -S /bin/bash\n');
 %			 fprintf(fid,'#PBS -N %s\n',modelname);
@@ -118,24 +114,15 @@
 			 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,'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);
-
-			 if ~md.settings.io_gather,
-				 %concatenate the output files:
+			 if ~io_gather, %concatenate the output files:
 				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
 			 end
-
-			 %close file
 			 fclose(fid);
 
@@ -148,7 +135,5 @@
 					 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 ~md.settings.io_gather,
-					 %concatenate the output files:
+				 if ~io_gather, %concatenate the output files:
 					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
 				 end
@@ -160,5 +145,5 @@
 			 end
 		 end %}}}
-		 function LaunchQueueJob(cluster,md,options)% {{{1
+		 function LaunchQueueJob(cluster,md,options)% {{{
 			 
 			 %lauch command, to be executed via ssh
@@ -204,5 +189,5 @@
 		 end
 		 %}}}
-		 function Download(cluster,md)% {{{1
+		 function Download(cluster,md)% {{{
 
 			%some check
Index: /issm/trunk-jpl/src/m/classes/clusters/pollux.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/clusters/pollux.m	(revision 12350)
+++ /issm/trunk-jpl/src/m/classes/clusters/pollux.m	(revision 12351)
@@ -8,5 +8,5 @@
 classdef pollux
     properties (SetAccess=public) 
-		 % {{{1
+		 % {{{
 		 name='pollux'
 		 login='username';
@@ -20,9 +20,9 @@
 	 end
 	 methods
-		 function cluster=pollux(varargin) % {{{1
+		 function cluster=pollux(varargin) % {{{
 			 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster);
 		 end
 		 %}}}
-		 function disp(cluster) % {{{1
+		 function disp(cluster) % {{{
 			 %  display the object
 			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
@@ -37,5 +37,5 @@
 		 end
 		 %}}}
-		 function checkconsistency(cluster,md,solution,analyses) % {{{1
+		 function checkconsistency(cluster,md,solution,analyses) % {{{
 
 			 available_queues={'shortp','longp'};
@@ -46,13 +46,11 @@
 		 end
 		 %}}}
-		 function BuildQueueScript(cluster,md) % {{{1
+		 function BuildQueueScript(cluster,modelname,solution,io_gather,isvalgrind,isgprof) % {{{
 
-			 %retrieve parameters 
-			 modelname=md.miscellaneous.name; 
-			 solution=md.private.solution;
+			 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end
+			 if(isgprof),    disp('gprof not supported by cluster, ignoring...'); end
 
-			 %open file for writing: 
+			 %write queuing script 
 			 fid=fopen([modelname '.queue'],'w');
-
 			 fprintf(fid,'#!/bin/sh\n');
 			 fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
@@ -64,16 +62,13 @@
 			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
 			 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
-
 			 fprintf(fid,'export PBS_O_WORKDIR=%s\n',cluster.executionpath);
 			 fprintf(fid,'cd $PBS_O_WORKDIR\n');
 			 fprintf(fid,'export OMP_NUM_THREADS=1\n');
 			 fprintf(fid,'dplace -s1 -c0-%i mpiexec -np %i %s/issm.exe %s %s %s',cluster.np-1,cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
-
-			 %close file
 			 fclose(fid);
 
 		 end
 		 %}}}
-		 function LaunchQueueJob(cluster,md,options)% {{{1
+		 function LaunchQueueJob(cluster,md,options)% {{{
 			 
 			 %lauch command, to be executed via ssh
@@ -103,5 +98,5 @@
 		 end
 		 %}}}
-		 function Download(cluster,md)% {{{1
+		 function Download(cluster,md)% {{{
 
 			%some check
Index: /issm/trunk-jpl/src/m/classes/model/model.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/model/model.m	(revision 12350)
+++ /issm/trunk-jpl/src/m/classes/model/model.m	(revision 12351)
@@ -242,8 +242,7 @@
 			 if isfield(structmd,'pressureload'), md.diagnostic.icefront=structmd.pressureload; end
 			 if isfield(structmd,'diagnostic_ref'), md.diagnostic.referential=structmd.diagnostic_ref; end
-
-
-
-
+			 if isfield(structmd,'npart'); md.qmu.numberofpartitions=structmd.npart; end
+			 if isfield(structmd,'part'); md.qmu.partition=structmd.part; end
+				 
 			 %Field changes
 			 if (isfield(structmd,'type') & ischar(structmd.type)), 
@@ -356,7 +355,5 @@
 				 md.diagnostic.referential=NaN*ones(md.mesh.numberofvertices,6);
 			 end
-			 if isfield(structmd,'npart'); md.qmu.numberofpartitions=structmd.npart; end
-			 if isfield(structmd,'part'); md.qmu.partition=structmd.part; end
-				 
+
 		 end% }}}
 		 function md = setdefaultparameters(md) % {{{1
Index: /issm/trunk-jpl/src/m/classes/pairoptions.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/pairoptions.m	(revision 12350)
+++ /issm/trunk-jpl/src/m/classes/pairoptions.m	(revision 12351)
@@ -223,4 +223,19 @@
 			end
 		end % }}}
+		function marshall(obj,fid)% {{{
+			disp('No options marshalled for now');
+			for i=1:size(obj.list,1),
+				name  = obj.list{i,1};
+				value = obj.list{i,2};
+
+				if (isnumeric(value) & numel(value)==1),
+					%
+				elseif ischar(value),
+					%
+				else
+					error(['Cannot marshall option ' name ': format not supported yet']);
+				end
+			end
+		end % }}}
 	end
 end
Index: /issm/trunk-jpl/src/m/model/solve.m
===================================================================
--- /issm/trunk-jpl/src/m/model/solve.m	(revision 12350)
+++ /issm/trunk-jpl/src/m/model/solve.m	(revision 12351)
@@ -24,8 +24,6 @@
 %      md=solve(md,DiagnosticSolutionEnum);
 
-%recover options
+%recover and process solve options
 options=pairoptions(varargin{:},'solution_type',solutionenum);
-
-%add default options
 options=process_solve_options(options);
 
@@ -46,15 +44,12 @@
 end
 
-%if running qmu analysis, some preprocessing of dakota files using 
-%models fields needs to be carried out. 
+%if running qmu analysis, some preprocessing of dakota files using models
+%fields needs to be carried out. 
 if md.qmu.isdakota,
 	md=preqmu(md,options);
 end
 
-%Save model as is (in case of a crash)
-assignin('base',inputname(1),md);
-
 %flaim analysis
-if (md.private.solution == FlaimSolutionEnum)
+if (options.solution_type == FlaimSolutionEnum)
 	md=flaim_sol(md,options);
 	md.private.solution=EnumToString(options.solution_type);
@@ -62,29 +57,50 @@
 end
 
-%Marshall model data into a binary file.
-marshall(md);
-
-%write a template file for issm to use, in parallel
-PetscFile(md.solver,[md.miscellaneous.name '.petsc']);
-
-%If running in parallel, we have a different way of launching the solution
-%sequences. 
-if ~strcmpi(md.cluster.name,'none'),
-	md=solveparallel(md,options);
+%Do we load results only?
+if options.loadonly,  
+	md=loadresultsfromcluster(md);
 	return;
 end
 
-%Launch correct solution sequence
-md=issm(md,md.private.solution);
+%Wite all input files
+marshall(md);                                          % bin file
+PetscFile(md.solver,[md.miscellaneous.name '.petsc']); % petsc file
 
-%post processes qmu results if necessary
-if md.qmu.isdakota,
-	md=postqmu(md);
-	cd ..
-	if ~strncmpi(options.keep,'y',1)
-		system(['rm -rf qmu' num2str(feature('GetPid'))]);
-	end
+%Launch job on remote cluster
+cluster=md.cluster;
+
+%we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
+if ~ispetsc,
+	disp('PETSC support not included, running on 1 cpu only!');
+	cluster.np=1;
 end
 
-%convert analysis type to string finally
-md.private.solution=EnumToString(options.solution_type);
+%First, build a runtime name that is unique
+c=clock; md.private.runtimename=sprintf('%s-%02i-%02i-%04i-%02i-%02i-%02i-%i',md.miscellaneous.name,c(2),c(3),c(1),c(4),c(5),floor(c(6)),feature('GetPid'));
+
+BuildQueueScript(cluster,md.miscellaneous.name,md.private.solution,md.settings.io_gather,md.debug.valgrind,md.debug.gprof);
+LaunchQueueJob(cluster,md,options);
+
+if ~strcmpi(options.upload,'on'), %did we even try to run? if so, wait on lock
+
+	%Do we return, or just wait for results?
+	if (md.settings.waitonlock>0 &  ~strcmpi(options.batch,'yes')),
+		%we wait for the done file
+		islock=waitonlock(md);
+		if islock==0, %no results to be loaded
+			disp('The results must be loaded manually with md=loadresultsfromcluster(md).');
+		else          %load results
+			disp('loading results from cluster');
+			md=loadresultsfromcluster(md);
+		end
+	end
+
+	%post processes qmu results if necessary
+	if md.qmu.isdakota,
+		if ~strncmpi(options.keep,'y',1)
+			system(['rm -rf qmu' num2str(feature('GetPid'))]);
+		end
+	end
+else
+	disp('solve done uploading test decks');
+end
Index: sm/trunk-jpl/src/m/model/solveparallel.m
===================================================================
--- /issm/trunk-jpl/src/m/model/solveparallel.m	(revision 12350)
+++ 	(revision )
@@ -1,58 +1,0 @@
-function md=solveparallel(md,options)
-%SOLVEPARALLEL - solution sequence using a cluster in parallel mode
-%
-%   Usage:
-%      md=solveparallel(md);
-
-%retrieve cluster: otherwise, we can't call its methods (subsref bug)
-cluster=md.cluster;
-
-if options.loadonly,  
-	md=loadresultsfromcluster(md);
-else
-
-	%In parallel mode, we need to make sure we have PETSC support, otherwise, we run with only one cpu: 
-	if ~ispetsc,
-		disp('PETSC support not included, running on 1 cpu only!');
-		cluster.np=1;
-	end
-
-	%First, build a runtime name that is unique, that we will use to create 
-	%directories, name jobs, etc ...
-	c=clock; md.private.runtimename=sprintf('%s-%02i-%02i-%04i-%02i-%02i-%02i-%i',md.miscellaneous.name,c(2),c(3),c(1),c(4),c(5),floor(c(6)),feature('GetPid'));
-
-	if verLessThan('matlab', '7.6')
-		BuildQueueScript(cluster,md);
-		LaunchQueueJob(cluster,md,options);
-	else
-		cluster.BuildQueueScript(md);
-		cluster.LaunchQueueJob(md,options);
-	end
-
-	if ~strcmpi(options.upload,'on'), %did we even try to run? if so, wait on lock
-
-		%Do we return, or just wait for results?
-		if (md.settings.waitonlock>0 &  ~strcmpi(options.batch,'yes')),
-			%we wait for the done file
-			islock=waitonlock(md);
-			if islock==0,
-				%no results to be loaded
-				disp('The results must be loaded manually with md=loadresultsfromcluster(md).');
-			else
-				%load results
-				disp('loading results from cluster');
-				md=loadresultsfromcluster(md);
-			end
-		end
-
-		%post processes qmu results if necessary
-		if md.qmu.isdakota,
-			if ~strncmpi(options.keep,'y',1)
-				system(['rm -rf qmu' num2str(feature('GetPid'))]);
-			end
-		end
-	else
-		error('solveparallel done uploading test decks');
-	end
-
-end
