Index: /issm/branches/trunk-larour-SLPS2022/src/m/classes/clusters/pfe.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/classes/clusters/pfe.m	(revision 27316)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/classes/clusters/pfe.m	(revision 27317)
@@ -51,5 +51,5 @@
 			disp(sprintf('    queue: %s',cluster.queue));
 			disp(sprintf('    time: %i',cluster.time));
-			disp(sprintf('    processor: %sn',cluster.processor));
+			disp(sprintf('    processor: %s',cluster.processor));
 			disp(sprintf('    srcpath: %s',cluster.srcpath));
 			disp(sprintf('    extpkgpath: %s',cluster.extpkgpath));
Index: /issm/branches/trunk-larour-SLPS2022/src/m/classes/dslmme.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/classes/dslmme.m	(revision 27316)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/classes/dslmme.m	(revision 27317)
@@ -38,4 +38,5 @@
 				return;
 			end
+			nt=length(self.global_average_thermosteric_sea_level);
 			for i=1:length(self.global_average_thermosteric_sea_level),
 				md = checkfield(md,'field',self.global_average_thermosteric_sea_level{i},'NaN',1,'Inf',1);
@@ -50,32 +51,34 @@
 
 			%check time stamps: they should all be in seconds 
-			%global_average_thermosteric_sea_level {{{
-			for i=1:nt, 
-				h=self.global_average_thermosteric_sea_level{i};
-				times=h(end,:);
-				avgtime=mean(times);
-				if(avgtime<10000)
-					error('dslmme checkconsistency error messages: time tags for global_average_thermosteric_sea_level should be in seconds!');
-				end
-			end %}}}
-			%sea_surface_height_above_geoid {{{
-			for i=1:nt, 
-				h=self.sea_surface_height_above_geoid{i};
-				times=h(end,:);
-				avgtime=mean(times)
-				if(avgtime<10000)
-					error('dslmme checkconsistency error messages: time tags for sea_surface_height_above_geoid should be in seconds!');
-				end
-			end %}}}
-			%sea_water_pressure_at_sea_floor {{{
-			for i=1:nt, 
-				h=self.sea_water_pressure_at_sea_floor{i};
-				times=h(end,:);
-				avgtime=mean(times)
-				if(avgtime<10000)
-					error('dslmme checkconsistency error messages: time tags for sea_water_pressure_at_sea_floor should be in seconds!');
-				end
-			end %}}}
-
+			checkseconds=0;
+			if checkseconds,
+				%global_average_thermosteric_sea_level {{{
+				for i=1:nt, 
+					h=self.global_average_thermosteric_sea_level{i};
+					times=h(end,:);
+					avgtime=mean(times);
+					if(avgtime<10000)
+						error('dslmme checkconsistency error messages: time tags for global_average_thermosteric_sea_level should be in seconds!');
+					end
+				end %}}}
+				%sea_surface_height_above_geoid {{{
+				for i=1:nt, 
+					h=self.sea_surface_height_above_geoid{i};
+					times=h(end,:);
+					avgtime=mean(times)
+					if(avgtime<10000)
+						error('dslmme checkconsistency error messages: time tags for sea_surface_height_above_geoid should be in seconds!');
+					end
+				end %}}}
+				%sea_water_pressure_at_sea_floor {{{
+				for i=1:nt, 
+					h=self.sea_water_pressure_at_sea_floor{i};
+					times=h(end,:);
+					avgtime=mean(times)
+					if(avgtime<10000)
+						error('dslmme checkconsistency error messages: time tags for sea_water_pressure_at_sea_floor should be in seconds!');
+					end
+				end %}}}
+			end
 		end % }}}
 		function disp(self) % {{{
Index: /issm/branches/trunk-larour-SLPS2022/src/m/classes/mmeofflinesolidearthsolution.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/classes/mmeofflinesolidearthsolution.m	(revision 27316)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/classes/mmeofflinesolidearthsolution.m	(revision 27317)
@@ -51,4 +51,6 @@
 
 			%check time stamps: they should all be in seconds 
+			checkseconds=0;
+			if checkseconds,
 			%displacementup {{{
 			for i=1:sup, 
@@ -57,5 +59,5 @@
 				avgtime=mean(times);
 				if(avgtime<10000)
-					error('dslmme checkconsistency error messages: time tags for displacementup should be in seconds!');
+					error('mmeofflinesolidearthsolution checkconsistency error messages: time tags for displacementup should be in seconds!');
 				end
 			end %}}}
@@ -87,5 +89,5 @@
 				end
 			end %}}}
-
+			end
 		end % }}}
 		function disp(self) % {{{
@@ -99,5 +101,5 @@
 		function marshall(self,prefix,md,fid) % {{{
 			WriteData(fid,prefix,'data',4,'name','md.solidearth.external.nature','format','Integer'); %code 4 for mmeofflinesolidearthsolution class
-			WriteData(fid,prefix,'data',self.modelid,'name','md.solidearth.external.modelid','format','Integer');
+			WriteData(fid,prefix,'data',self.modelid,'name','md.solidearth.external.modelid','format','Double');
 			nummodels=length(self.displacementeast);
 			WriteData(fid,prefix,'name','md.solidearth.external.nummodels','data',nummodels,'format','Integer');
Index: /issm/branches/trunk-larour-SLPS2022/src/m/classes/modellist.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/classes/modellist.m	(revision 27316)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/classes/modellist.m	(revision 27317)
@@ -8,4 +8,8 @@
 		models  = cell(0,1);
 		cluster = generic();
+		name = '';
+	end
+	properties (SetAccess=public) 
+		runtimename = '';
 	end
 	methods
@@ -122,14 +126,13 @@
 
 		end % }}}
-		function self = modellist(varargin) % {{{
+		function self = modellist(name,cluster,varargin) % {{{
 
 			%initialize list
 			if nargin==0,
 				%Do nothing,
-			elseif nargin==1,
-				if ~isa(varargin{1},'cell'),
-					error('not supported yet');
-				end
-
+			else
+
+				self.name=name;
+				self.cluster=cluster;
 				celllist=varargin{1};
 
@@ -145,7 +148,5 @@
 					end
 				end
-
 				self.models  = celllist;
-				self.cluster = self.models{1}.cluster;
 			end
 		end % }}}
@@ -208,34 +209,35 @@
 			delete('ModelResults.tar.gz');
 		end % }}}
-		function self = solve(self,varargin)% {{{
+		function self = solve(self,solutiontype,varargin)% {{{
 			%SOLVE - apply solution sequence for  a list of models. Used in batch mode.
 			%
 			%   Usage:
-			%      self=solve(self,varargin)
+			%      self=solve(self,solutiontype,varargin)
 			%      where varargin is a lit of paired arguments. 
-			%      arguments can be: 'analysis_type': 'stressbalance','thermal','masstransport','transient'
 			%
 			%   Examples:
-			%      self=solve(self,'analysis_type','stressbalance');
-
+			%      self=solve(self,'tr','batch','yes');
+
+			disp('Starting multiple solve');
+			
+
+			%come up with a run time name: 
+			c=clock;
+			self.runtimename=sprintf('%s-%02i-%02i-%04i-%02i-%02i-%02i-%i',self.name,c(2),c(3),c(1),c(4),c(5),floor(c(6)),feature('GetPid'));
+
+			
 			%recover options
-			options=pairoptions(varargin{:});
-
-			%add default options
-			options=process_solve_options(options);
+			options=pairoptions(varargin{:},'solutionstring',solutiontype);
 
 			%length of list
 			nummodels=length(self.models);
 
-			%name of queue: to make it unique, add a time stamp
-			name=[self.name '-' datestr(now,1) '-' datestr(now,'HH-MM-SS') ];
-
-			%name of cluster will be first name of list
-			cluster=self.cluster;
-
-			%Figure out parameters for this particular cluster
-			cluster_rc_location=which('cluster.rc');
-			[codepath,executionpath]=ClusterParameters(cluster,cluster_rc_location);
-
+			%come up with unique names for all our models: 
+			for i=1:nummodels,
+				self.models{i}.miscellaneous.name=sprintf('%s%i',self.models{i}.miscellaneous.name,i);
+			end
+
+			names={};
+			
 			%solve in batch mode: 
 			for i=1:nummodels,
@@ -244,142 +246,196 @@
 				mdex=self.models{i};
 
-				%recover some fields
-				mdex.analysis_type=options.analysis_type;
-
-				mdex.name=[name '-' num2str(i) 'vs' num2str(nummodels)];
-				mdex.time=self.time;
-				mdex.queue=self.queue;
-				mdex.cluster=self.cluster;
-				if ~isnan(self.np),
-					mdex.np=self.np;
-				end
-
 				%call solve in batch mode:
-				if strcmpi(cluster,oshostname),
+				disp(sprintf('   marshalling model %i/%i',i,nummodels));
+				if strcmpi(self.cluster,oshostname),
 					mdex=solve(mdex,varargin{:});
 				else
-					mdex=solve(mdex,varargin{:},'batch','yes','directory',name);
+					mdex=solve(mdex,solutiontype,varargin{:},'batch','yes');
 				end
 
 				%feed back
 				self.models{i}=mdex;
+				
+				%record name: 
+				names{end+1}=sprintf('%s.tar.gz',mdex.private.runtimename);
 			end
 
 			%locally, we are done.
-			if strcmpi(cluster,oshostname),
+			if strcmpi(self.cluster,oshostname),
 				return
 			end
-
-			%now, tar all the files and then erase them.
-			eval(['!find -iname ''' name '-*'' > file_list.txt']);
-			!tar zcvf ModelList.tar.gz --files-from file_list.txt
-			!rm -rf *.bin *.queue file_list.txt
+			
+			%tar files: 
+			tar('ModelList.tar.gz',names);
 
 			%still have to build a launching script.
-			BuildMultipleQueueingScript(cluster,name,executionpath,codepath);
+			self.BuildQueueingScript(solutiontype);
+
+			%upload data
+			self.UploadQueueJob();
 
 			%launch jobs on remote cluster
-			LaunchMultipleQueueJob(cluster,name,executionpath);
+			self.LaunchQueueJob();
 
 			%erase files: 
-			delete([name '.queue']);
 			delete('ModelList.tar.gz');
 
-			%save name: 
-			self.name=name;
 		end % }}}
+		function self = loadresults(self) % {{{
+
+			nummodels=length(self.models);
+			cluster=self.cluster;
+			
+			%solve in batch mode: 
+			directory=sprintf('%s/Interactive%i',cluster.executionpath,cluster.interactive);
+			filelist={};
+			for i=1:nummodels,
+				filelist{end+1}= sprintf('%s/%s.outbin',self.models{i}.private.runtimename,self.models{i}.miscellaneous.name);
+			end
+			issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
+
+			%load results: 
+			for i=1:nummodels,
+				self.models{i}=loadresultsfromdisk(self.models{i},sprintf('%s.outbin',self.models{i}.miscellaneous.name));
+			end
+
+		end %}}}
+		function num= nummodels(self) % {{{
+			num=length(self.models);
+		end %}}}
+		function BuildQueueingScript(self,solution)% {{{
+
+			scriptname=[self.runtimename '.queue'];
+			cluster=self.cluster;
+			dirname=self.runtimename;
+			modelname=self.name;
+			nummodels=length(self.models);
+
+			%recover and process solve options %{{{
+			if strcmpi(solution,'sb') || strcmpi(solution,'Stressbalance')
+				solution = 'StressbalanceSolution';
+			elseif strcmpi(solution,'mt') || strcmpi(solution,'Masstransport')
+				solution = 'MasstransportSolution';
+			elseif strcmpi(solution,'oceant') || strcmpi(solution,'Oceantransport')
+				solution = 'OceantransportSolution';
+			elseif strcmpi(solution,'th') || strcmpi(solution,'Thermal')
+				solution = 'ThermalSolution';
+			elseif strcmpi(solution,'ss') || strcmpi(solution,'Steadystate') 
+				solution = 'SteadystateSolution';
+			elseif strcmpi(solution,'tr') || strcmpi(solution,'Transient')
+				solution = 'TransientSolution';
+			elseif strcmpi(solution,'mc') || strcmpi(solution,'Balancethickness')
+				solution = 'BalancethicknessSolution';
+			elseif strcmpi(solution,'Balancethickness2')
+				solution = 'Balancethickness2Solution';
+			elseif strcmpi(solution,'mcsoft') || strcmpi(solution,'BalancethicknessSoft')
+				solution = 'BalancethicknessSoftSolution';
+			elseif strcmpi(solution,'bv') || strcmpi(solution,'Balancevelocity')
+				solution = 'BalancevelocitySolution';
+			elseif strcmpi(solution,'bsl') || strcmpi(solution,'BedSlope')
+				solution = 'BedSlopeSolution';
+			elseif strcmpi(solution,'ssl') || strcmpi(solution,'SurfaceSlope')
+				solution = 'SurfaceSlopeSolution';
+			elseif strcmpi(solution,'hy') || strcmpi(solution,'Hydrology')
+				solution = 'HydrologySolution';
+			elseif strcmpi(solution,'da') || strcmpi(solution,'DamageEvolution')
+				solution = 'DamageEvolutionSolution';
+			elseif strcmpi(solution,'gia') || strcmpi(solution,'Gia')
+				solution = 'GiaSolution';
+			elseif strcmpi(solution,'lv') || strcmpi(solution,'Love')
+				solution = 'LoveSolution';
+			elseif strcmpi(solution,'esa') || strcmpi(solution,'Esa')
+				solution = 'EsaSolution';
+			elseif strcmpi(solution,'smp') || strcmpi(solution,'Sampling')
+				solution = 'SamplingSolution';    
+			else
+				error(['solution ' solution ' not supported!']);
+			end
+			%}}}
+
+			executable='issm.exe';
+
+			fid=fopen([modelname '.queue'],'w');
+			fprintf(fid,'#PBS -S /bin/bash\n');
+			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/%s/%s.outlog \n',cluster.executionpath,dirname,modelname);
+			fprintf(fid,'#PBS -e %s/%s/%s.errlog \n\n',cluster.executionpath,dirname,modelname);
+			fprintf(fid,'. /usr/share/modules/init/bash\n\n');
+			for i=1:numel(cluster.modules), fprintf(fid,['module load ' cluster.modules{i} '\n']); end
+			fprintf(fid,'export PATH="$PATH:."\n\n');
+			fprintf(fid,'export MPI_LAUNCH_TIMEOUT=520\n');
+			fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
+			fprintf(fid,'export ISSM_DIR="%s"\n',cluster.srcpath); %FIXME
+
+			fprintf(fid,'source $ISSM_DIR/etc/environment.sh\n');       %FIXME
+			fprintf(fid,'cd %s/%s/\n\n',cluster.executionpath,dirname);
+
+			for i=1:nummodels,
+				fprintf(fid,'cd %s && mpiexec -np %i /u/scicon/tools/bin/mbind.x %s/%s %s %s/%s/%s && cd ..\n',self.models{i}.private.runtimename,cluster.nprocs(),cluster.codepath,executable,solution,cluster.executionpath,self.runtimename,self.models{i}.private.runtimename);
+			end
+			fclose(fid);
+
+			%in interactive mode, create a run file, and errlog and outlog file
+			if cluster.interactive,
+				fid=fopen([modelname '.run'],'w');
+				for i=1:nummodels,
+					fprintf(fid,'cd %s && mpiexec -np %i /u/scicon/tools/bin/mbind.x %s/%s %s %s/%s %s && cd ..\n',self.models{i}.private.runtimename,cluster.nprocs(),cluster.codepath,executable,solution,[cluster.executionpath '/Interactive' num2str(cluster.interactive)] ,self.models{i}.private.runtimename,self.models{i}.miscellaneous.name);
+				end
+				fclose(fid);
+				fid=fopen([modelname '.errlog'],'w'); fclose(fid);
+				fid=fopen([modelname '.outlog'],'w'); fclose(fid);
+			end
+		end% }}}
+		function UploadQueueJob(self) % {{{
+
+			cluster=self.cluster;
+
+			%compress the files into one zip.
+			compressstring=sprintf('tar -zcf %s.tar.gz ModelList.tar.gz %s.queue ',self.name,self.name);
+			if cluster.interactive,
+				compressstring = sprintf('%s %s.run %s.errlog %s.outlog',compressstring, self.name,self.name,self.name);
+			end
+			system(compressstring);
+
+			disp('uploading input file and queueing script');
+			if cluster.interactive,
+				directory=[cluster.executionpath '/Interactive' num2str(cluster.interactive)];
+			else 
+				directory=cluster.executionpath;
+			end
+
+			issmscpout(cluster.name,directory,cluster.login,cluster.port,{[self.name '.tar.gz']});
+
+		end
+		%}}}
+		function LaunchQueueJob(self)% {{{
+			%LAUNCHQUEUEJOB - LAUNCH MULTIPLE QUEUEING SCRIPT ON PFE CLUSTER
+			%
+			%   Usage:
+			%      LaunchQueueJob(self)
+
+			cluster=self.cluster;
+			modelname=self.name;
+			nummodels=length(self.models);
+
+			disp('uploading inputs files');
+			if cluster.interactive,
+				launchcommand=sprintf('cd %s/Interactive%i && tar -zxf %s.tar.gz && tar -zxvf ModelList.tar.gz ',cluster.executionpath,cluster.interactive,modelname);
+				for i=1:nummodels,
+					launchcommand=sprintf('%s && mkdir %s && cd %s && mv ../%s.tar.gz ./ && tar -zxvf %s.tar.gz && cd .. ',launchcommand,self.models{i}.private.runtimename, ...
+						self.models{i}.private.runtimename, self.models{i}.private.runtimename, self.models{i}.private.runtimename);
+				end
+			else
+				launchcommand=['cd ' cluster.executionpath ' && mkdir ' self.runtimename...
+					' && cd ' self.runtimename ' && mv ../' self.runtimename '.tar.gz ./ && tar -zxf ' dirname '.tar.gz && qsub ' modelname '.queue '];
+			end
+
+			disp('launching solution sequence on remote cluster');
+			issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+		end
 	end
 end
-
-function BuildMultipleQueueingScript(cluster,name,executionpath,codepath)% {{{
-%BUILDMULTIPLEQUEUEINGSCRIPT - 
-%
-%   Usage:
-%      BuildMultipleQueueingScript(executionpath,codepath)
-
-disp('building queueing script');
-
-%First try and figure out if there is a special script for this particular cluster
-function_name=['BuildMultipleQueueingScript' cluster]
-
-%some specific treatment of identical cluster, gemini, castor and pollux
-if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'),
-	function_name='BuildMultipleQueueingScriptgemini';
-end
-
-if exist(function_name,'file'),
-	%Call this function:
-	eval([function_name '(name,executionpath,codepath);']);
-else
-	%Call the generic BuildQueueingScript:
-	BuildMultipleQueueingScriptGeneric(name,executionpath,codepath);
-end
-end % }}}
-function BuildQueueingScriptgemini(name,executionpath,codepath)% {{{
-%BUILDQUEUEINGSCRIPTGEMINI - ...
-%
-%   Usage:
-%      BuildQueueingScriptgemini(md,executionpath,codepath)
-
-scriptname=[name '.queue'];
-
-fid=fopen(scriptname,'w');
-if fid==-1,
-	error(['BuildQueueingScriptgeminierror message: could not open ' scriptname ' file for ascii writing']);
-end
-
-fprintf(fid,'#!/bin/sh\n');
-fprintf(fid,'cd %s\n',executionpath);
-fprintf(fid,'mkdir %s\n',name);
-fprintf(fid,'cd %s\n',name);
-fprintf(fid,'mv ../ModelList.tar.gz ./\n');
-fprintf(fid,'tar -zxvf ModelList.tar.gz\n');
-fprintf(fid,'foreach i (%s-*vs*.queue)\n',name);
-fprintf(fid,'qsub $i\n');
-fprintf(fid,'end\n');
-fclose(fid);
-end% }}}
-function LaunchMultipleQueueJob(cluster,name,executionpath)% {{{
-%LAUNCHMULTIPLEQUEUEJOB - ...
-%
-%   Usage:
-%      LaunchMultipleQueueJob(executionpath)
-
-%First try and figure out if there is a special script for thie particular cluster
-function_name=['LaunchMultipleQueueJob' cluster]
-
-%some specific treatment of identical cluster, gemini, castor and pollux
-if strcmpi(cluster,'castor') || strcmpi(cluster,'pollux'),
-	function_name='LaunchMultipleQueueJobgemini';
-end
-
-if exist(function_name,'file'),
-	%Call this function:
-	eval([function_name '(cluster,name,executionpath);']);
-else
-	%Call the generic LaunchMultipleQueueJob:
-	LaunchMultipleQueueJobGeneric(cluster,name,executionpath);
-end
-end% }}}
-function md=LaunchMultipleQueueJobgemini(cluster,name,executionpath)% {{{
-%LAUNCHMULTIPLEQUEUEJOBGEMINI - Launch multiple queueing script on Gemini cluster
-%
-%   Usage:
-%      LaunchMultipleQueueJobgemini(cluster,name,executionpath)
-
-%first, check we have the binary file and the queueing script
-if ~exist([ name '.queue'],'file'),
-	error('LaunchMultipleQueueJobgemini error message: queueing script issing, cannot go forward');
-end
-
-if ~exist('ModelList.tar.gz','file'),
-	error('LaunchMultipleQueueJobgemini error message: inputs models file missing, cannot go forward');
-end
-
-%upload both files to cluster
-disp('uploading input file,  queueing script and variables script');
-eval(['!scp ModelList.tar.gz ' name '.queue '  cluster ':' executionpath]);
-
-disp('launching solution sequence on remote cluster');
-issmssh(cluster,login,['"cd ' executionpath ' && source ' name '.queue "']);
-end% }}}
Index: /issm/branches/trunk-larour-SLPS2022/src/m/contrib/larour/glacier_inventory.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/contrib/larour/glacier_inventory.m	(revision 27316)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/contrib/larour/glacier_inventory.m	(revision 27317)
@@ -183,5 +183,5 @@
 			%Go through O2 regions: 
 			for i=subsetregions,
-			%for i=33,
+			%for i=89:150,
 				string=self.boxes(i).RGI_CODE; 
 				disp(['progressing with region ' num2str(i) ' ' string]);
@@ -210,9 +210,17 @@
 						case 32, radius=60;
 						case 33, radius=10;
+						case 36, radius=10;
 						case 41, radius=75;
 						case 42, radius=45;
+						case 51, radius=10;
 						case 61, radius=66;
+						case 63, radius=10;
 						case 68, radius=10;
+						case 77, radius=10;
 						case 82, radius=30;
+						case 83, radius=20;
+						case 89, radius=20;
+						case 90, radius=10;
+						case 93, radius=10;
 						otherwise,
 					end % }}}
Index: /issm/branches/trunk-larour-SLPS2022/src/m/contrib/larour/groundedicearea.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/contrib/larour/groundedicearea.m	(revision 27317)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/contrib/larour/groundedicearea.m	(revision 27317)
@@ -0,0 +1,68 @@
+function [totalarea,groundediceelements]=groundedicearea(md)
+
+	times=md.timestepping.start_time:md.timestepping.time_step:md.timestepping.final_time;
+	nt=length(times); 
+
+	totalarea=zeros(nt,1);
+	areas=GetAreasSphericalTria(md.mesh.elements,md.mesh.lat,md.mesh.long,planetradius('earth'));
+
+	rho_ice=md.materials.rho_ice;
+	rho_water=md.materials.rho_water;
+	oceanarea=3.619e+14;
+
+	groundediceelements=zeros(md.mesh.numberofelements,nt);
+	for t=1:nt-1, 
+	
+		time=times(t);
+
+		tocean=md.mask.ocean_levelset(end,:);
+		ind=findind(time,tocean);
+		ocean=md.mask.ocean_levelset(1:end-1,ind);
+
+		tice=md.mask.ice_levelset(end,:); 
+		ind=findind(time,tice);
+		ice=md.mask.ice_levelset(1:end-1,ind);
+		
+		masks.isiceonly=isiceonly(ice(md.mesh.elements));
+		masks.isoceanin=isoceanin(ocean(md.mesh.elements));
+		masks.isfullyfloating=isfullyfloating(ocean(md.mesh.elements));
+		masks.notfullygrounded=notfullygrounded(ocean(md.mesh.elements));
+
+		%Go through elements and sum up: 
+		pos=find(masks.isiceonly & ~masks.isfullyfloating);
+		totalarea(t)=sum(areas(pos));
+
+		flags=zeros(md.mesh.numberofelements,1);
+		flags(pos)=1;
+		groundediceelements(:,t)=flags;
+	end
+end
+function ind=findind(t,ts) % {{{
+
+	nts=length(ts);
+	if t<ts(2), 
+		ind=1; 
+	elseif t>=ts(end), 
+		ind=nts;
+	end;
+	for i=2:nts-1, 
+		if (t>=ts(i) & t<ts(i+1)),
+			ind=i;
+			break;
+		end
+	end
+end   % }}}
+function flags=isiceonly(ice) % {{{
+	flags=max(ice,[],2)<0.0;
+end % }}}
+function flag=isoceanin(ocean)% {{{
+	flag=min(ocean,[],2)<0;
+end% }}}
+function flags=isfullyfloating(ocean)% {{{
+	flags=max(ocean,[],2)<=0;
+end% }}}
+function flags=notfullygrounded(ocean)% {{{
+	flags=zeros(length(ocean),1);
+	pos=find(min(ocean,[],2)<0); 
+	flags(pos)=1; 
+end% }}}
Index: /issm/branches/trunk-larour-SLPS2022/src/m/contrib/larour/isfullyfloating.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/contrib/larour/isfullyfloating.m	(revision 27317)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/contrib/larour/isfullyfloating.m	(revision 27317)
@@ -0,0 +1,4 @@
+function flags=isfullyfloating(ocean)% {{{
+	flags=max(ocean,[],2)<=0;
+end% }}}
+
Index: /issm/branches/trunk-larour-SLPS2022/src/m/contrib/larour/isiceonly.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/contrib/larour/isiceonly.m	(revision 27317)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/contrib/larour/isiceonly.m	(revision 27317)
@@ -0,0 +1,4 @@
+function flags=isiceonly(ice) % {{{
+	flags=max(ice,[],2)<0.0;
+end % }}}
+
Index: /issm/branches/trunk-larour-SLPS2022/src/m/contrib/larour/isoceanin.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/contrib/larour/isoceanin.m	(revision 27317)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/contrib/larour/isoceanin.m	(revision 27317)
@@ -0,0 +1,4 @@
+function flag=isoceanin(ocean)% {{{
+	flag=min(ocean,[],2)<0;
+end% }}}
+
Index: /issm/branches/trunk-larour-SLPS2022/src/m/contrib/larour/notfullygrounded.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/contrib/larour/notfullygrounded.m	(revision 27317)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/contrib/larour/notfullygrounded.m	(revision 27317)
@@ -0,0 +1,5 @@
+function flags=notfullygrounded(ocean)% {{{
+	flags=zeros(length(ocean),1);
+	pos=find(min(ocean,[],2)<0); 
+	flags(pos)=1; 
+end% }}}
Index: /issm/branches/trunk-larour-SLPS2022/src/m/plot/applyoptions.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/plot/applyoptions.m	(revision 27316)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/plot/applyoptions.m	(revision 27317)
@@ -399,6 +399,6 @@
 
 %coastlines
-if (strcmpi(getfieldvalue(options,'coastlines','off'),'on') | ...
-	strcmpi(getfieldvalue(options,'coastlines','off'),'on'))
+if (strcmpi(getfieldvalue(options,'coastlines','on'),'on') | ...
+	strcmpi(getfieldvalue(options,'coastlines','on'),'on'))
 	plot_coastlines(md.mesh,options);
 end
Index: /issm/branches/trunk-larour-SLPS2022/src/m/plot/plot_coastlines.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/plot/plot_coastlines.m	(revision 27316)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/plot/plot_coastlines.m	(revision 27317)
@@ -9894,5 +9894,5 @@
 	hold on, p=plot(x,y,'k-');
 	xlim(xl); ylim(yl); 
-	set(p,'Color',getfieldvalue(options,'coast_color','k'));
+	set(p,'Color',getfieldvalue(options,'coast_color','w'));
 	set(p,'LineWidth',getfieldvalue(options,'coast_linewidth',1));
 else
@@ -9901,10 +9901,13 @@
 		[x,y,z]=AboveGround(coastlat,coastlon,mesh.r(1),1000);
 		hold on, p=plot3(x,y,z,'k-'); 
-		set(p,'Color',getfieldvalue(options,'coast_color','k'));
+		set(p,'Color',getfieldvalue(options,'coast_color','w'));
 		set(p,'LineWidth',getfieldvalue(options,'coast_linewidth',1));
 	else
 		hold on, 
+		warning off;
 		p=polyshape(coastlon,coastlat);
-		plot(p,'FaceColor','w','FaceAlpha',1);
+		warning on;
+		pp=plot(p,'FaceColor',getfieldvalue(options,'coast_color','w'),'FaceAlpha',getfieldvalue(options,'coast_alpha',1),...
+			'LineWidth',getfieldvalue(options,'coast_linewidth',1),'EdgeColor',getfieldvalue(options,'coast_color','w'));
 		if strcmpi(getfieldvalue(options,'coordcent','atlantic'),'pacific'),
 			xlim(getfieldvalue(options,'xlim',[-360 0]));
Index: /issm/branches/trunk-larour-SLPS2022/src/m/plot/processdatalatlong.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/src/m/plot/processdatalatlong.m	(revision 27316)
+++ /issm/branches/trunk-larour-SLPS2022/src/m/plot/processdatalatlong.m	(revision 27317)
@@ -24,4 +24,8 @@
 		data=[data; extradata];
 	elseif length(data)==length(md.mesh.elements),
-		datatype=1;
+		datatype=2;
+		data=averaging(md,data,0);
+		extradata=griddata(x0,y0,data,xextra,yextra,'nearest');
+		data=[data; extradata];
+
 	end
Index: /issm/branches/trunk-larour-SLPS2022/test/NightlyRun/test2002.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/test/NightlyRun/test2002.m	(revision 27316)
+++ /issm/branches/trunk-larour-SLPS2022/test/NightlyRun/test2002.m	(revision 27317)
@@ -78,4 +78,5 @@
 %Solution parameters
 md.cluster.np=3;
+md.cluster.codepath='/Users/larour/issm-trunks/trunk-SLPS/build-dak/bin';
 md.solidearth.settings.reltol=NaN;
 md.solidearth.settings.abstol=1e-3;
Index: /issm/branches/trunk-larour-SLPS2022/test/NightlyRun/test2090.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/test/NightlyRun/test2090.m	(revision 27316)
+++ /issm/branches/trunk-larour-SLPS2022/test/NightlyRun/test2090.m	(revision 27317)
@@ -121,4 +121,5 @@
 md.solidearth.settings.viscous=1;
 md.solidearth.settings.rotation=1;
+error;
 md=solve(md,'tr');
 
Index: /issm/branches/trunk-larour-SLPS2022/test/NightlyRun/test2091.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2022/test/NightlyRun/test2091.m	(revision 27316)
+++ /issm/branches/trunk-larour-SLPS2022/test/NightlyRun/test2091.m	(revision 27317)
@@ -23,4 +23,5 @@
 defaultoptions={'KeepVertices',0,'MaxCornerAngle',0.0000000001,'NoBoundaryRefinement',1}; 
 md2d=bamg(model,'domain',dom,'subdomains',co,'hmin',100e3,'hmax',10000e3,defaultoptions{:});
+%hmax a 3000
 
 colat=sqrt(md2d.mesh.x.^2+md2d.mesh.y.^2)/re;
@@ -145,4 +146,5 @@
 %Solution parameters
 md.cluster.np=3;
+md.cluster.codepath='/Users/larour/issm-trunks/trunk-SLPS/build-dak/bin';
 md.solidearth.settings.reltol=NaN;
 md.solidearth.settings.abstol=1e-3;
