Index: /issm/branches/trunk-larour-SLPS2020/src/c/analyses/SealevelriseAnalysis.cpp
===================================================================
--- /issm/branches/trunk-larour-SLPS2020/src/c/analyses/SealevelriseAnalysis.cpp	(revision 25723)
+++ /issm/branches/trunk-larour-SLPS2020/src/c/analyses/SealevelriseAnalysis.cpp	(revision 25724)
@@ -202,4 +202,5 @@
 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.computesealevelchange",SolidearthSettingsComputesealevelchangeEnum));
 	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.planetradius",SolidearthPlanetRadiusEnum));
+	parameters->AddObject(iomodel->CopyConstantObject("md.solidearth.settings.glfraction",SolidearthSettingsGlfractionEnum));
 	parameters->AddObject(new DoubleParam(CumBslrEnum,0.0));
 	parameters->AddObject(new DoubleParam(CumBslrIceEnum,0.0));
Index: /issm/branches/trunk-larour-SLPS2020/src/c/classes/Elements/Tria.cpp
===================================================================
--- /issm/branches/trunk-larour-SLPS2020/src/c/classes/Elements/Tria.cpp	(revision 25723)
+++ /issm/branches/trunk-larour-SLPS2020/src/c/classes/Elements/Tria.cpp	(revision 25724)
@@ -5665,4 +5665,5 @@
 	bool scaleoceanarea= false;
 	bool computeelastic= true;
+	int  glfraction=1;
 
 	/*output: */
@@ -5711,4 +5712,5 @@
 	this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
 	this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
+	this->parameters->FindParam(&glfraction,SolidearthSettingsGlfractionEnum);
 
 	/*retrieve precomputed G:*/
@@ -5724,4 +5726,8 @@
 
 		phi=this->GetGroundedPortion(&xyz_list[0][0]); //watch out, this only works because of the Thales theorem! We are in 3D, but this routine is inherently for 2D trias
+		#ifdef _ISSM_DEBUG_
+		this->AddInput2(SealevelEustaticMaskEnum,&phi,P0Enum);
+		#endif
+		if(glfraction==0)phi=1;
 	}
 	else phi=1.0;
@@ -5760,4 +5766,5 @@
 	/*Compute barystatic contribution:*/
 	_assert_(oceanarea>0.);
+
 	if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
 	bslrice = rho_ice*area*phi*I/(oceanarea*rho_water);
Index: /issm/branches/trunk-larour-SLPS2020/src/c/shared/Enum/Enum.vim
===================================================================
--- /issm/branches/trunk-larour-SLPS2020/src/c/shared/Enum/Enum.vim	(revision 25723)
+++ /issm/branches/trunk-larour-SLPS2020/src/c/shared/Enum/Enum.vim	(revision 25724)
@@ -342,4 +342,5 @@
 syn keyword cConstant SealevelriseGElasticEnum
 syn keyword cConstant SolidearthSettingsComputesealevelchangeEnum
+syn keyword cConstant SolidearthSettingsGlfractionEnum
 syn keyword cConstant SolidearthSettingsRunFrequencyEnum
 syn keyword cConstant SealevelriseHElasticEnum
@@ -1465,5 +1466,4 @@
 syn keyword cType PowerVariogram
 syn keyword cType Profiler
-syn keyword cType QmuStatisticsMethod
 syn keyword cType Quadtree
 syn keyword cType Radar
Index: /issm/branches/trunk-larour-SLPS2020/src/c/shared/Enum/EnumDefinitions.h
===================================================================
--- /issm/branches/trunk-larour-SLPS2020/src/c/shared/Enum/EnumDefinitions.h	(revision 25723)
+++ /issm/branches/trunk-larour-SLPS2020/src/c/shared/Enum/EnumDefinitions.h	(revision 25724)
@@ -336,4 +336,5 @@
 	SealevelriseGElasticEnum,
 	SolidearthSettingsComputesealevelchangeEnum,
+	SolidearthSettingsGlfractionEnum,
 	SolidearthSettingsRunFrequencyEnum,
 	SealevelriseHElasticEnum,
Index: /issm/branches/trunk-larour-SLPS2020/src/c/shared/Enum/EnumToStringx.cpp
===================================================================
--- /issm/branches/trunk-larour-SLPS2020/src/c/shared/Enum/EnumToStringx.cpp	(revision 25723)
+++ /issm/branches/trunk-larour-SLPS2020/src/c/shared/Enum/EnumToStringx.cpp	(revision 25724)
@@ -344,4 +344,5 @@
 		case SealevelriseGElasticEnum : return "SealevelriseGElastic";
 		case SolidearthSettingsComputesealevelchangeEnum : return "SolidearthSettingsComputesealevelchange";
+		case SolidearthSettingsGlfractionEnum : return "SolidearthSettingsGlfraction";
 		case SolidearthSettingsRunFrequencyEnum : return "SolidearthSettingsRunFrequency";
 		case SealevelriseHElasticEnum : return "SealevelriseHElastic";
Index: /issm/branches/trunk-larour-SLPS2020/src/c/shared/Enum/StringToEnumx.cpp
===================================================================
--- /issm/branches/trunk-larour-SLPS2020/src/c/shared/Enum/StringToEnumx.cpp	(revision 25723)
+++ /issm/branches/trunk-larour-SLPS2020/src/c/shared/Enum/StringToEnumx.cpp	(revision 25724)
@@ -350,4 +350,5 @@
 	      else if (strcmp(name,"SealevelriseGElastic")==0) return SealevelriseGElasticEnum;
 	      else if (strcmp(name,"SolidearthSettingsComputesealevelchange")==0) return SolidearthSettingsComputesealevelchangeEnum;
+	      else if (strcmp(name,"SolidearthSettingsGlfraction")==0) return SolidearthSettingsGlfractionEnum;
 	      else if (strcmp(name,"SolidearthSettingsRunFrequency")==0) return SolidearthSettingsRunFrequencyEnum;
 	      else if (strcmp(name,"SealevelriseHElastic")==0) return SealevelriseHElasticEnum;
@@ -382,9 +383,9 @@
 	      else if (strcmp(name,"SmbDpermil")==0) return SmbDpermilEnum;
 	      else if (strcmp(name,"SmbDsnowIdx")==0) return SmbDsnowIdxEnum;
-	      else if (strcmp(name,"SmbCldFrac")==0) return SmbCldFracEnum;
          else stage=4;
    }
    if(stage==4){
-	      if (strcmp(name,"SmbDelta18o")==0) return SmbDelta18oEnum;
+	      if (strcmp(name,"SmbCldFrac")==0) return SmbCldFracEnum;
+	      else if (strcmp(name,"SmbDelta18o")==0) return SmbDelta18oEnum;
 	      else if (strcmp(name,"SmbDelta18oSurface")==0) return SmbDelta18oSurfaceEnum;
 	      else if (strcmp(name,"SmbDenIdx")==0) return SmbDenIdxEnum;
@@ -505,9 +506,9 @@
 	      else if (strcmp(name,"BalancethicknessOmega0")==0) return BalancethicknessOmega0Enum;
 	      else if (strcmp(name,"BalancethicknessOmega")==0) return BalancethicknessOmegaEnum;
-	      else if (strcmp(name,"BalancethicknessThickeningRate")==0) return BalancethicknessThickeningRateEnum;
          else stage=5;
    }
    if(stage==5){
-	      if (strcmp(name,"BasalCrevasse")==0) return BasalCrevasseEnum;
+	      if (strcmp(name,"BalancethicknessThickeningRate")==0) return BalancethicknessThickeningRateEnum;
+	      else if (strcmp(name,"BasalCrevasse")==0) return BasalCrevasseEnum;
 	      else if (strcmp(name,"BasalforcingsFloatingiceMeltingRate")==0) return BasalforcingsFloatingiceMeltingRateEnum;
 	      else if (strcmp(name,"BasalforcingsGeothermalflux")==0) return BasalforcingsGeothermalfluxEnum;
@@ -628,9 +629,9 @@
 	      else if (strcmp(name,"NGiaRate")==0) return NGiaRateEnum;
 	      else if (strcmp(name,"UGia")==0) return UGiaEnum;
-	      else if (strcmp(name,"UGiaRate")==0) return UGiaRateEnum;
          else stage=6;
    }
    if(stage==6){
-	      if (strcmp(name,"Gradient")==0) return GradientEnum;
+	      if (strcmp(name,"UGiaRate")==0) return UGiaRateEnum;
+	      else if (strcmp(name,"Gradient")==0) return GradientEnum;
 	      else if (strcmp(name,"GroundinglineHeight")==0) return GroundinglineHeightEnum;
 	      else if (strcmp(name,"HydraulicPotential")==0) return HydraulicPotentialEnum;
@@ -751,9 +752,9 @@
 	      else if (strcmp(name,"SmbAccumulation")==0) return SmbAccumulationEnum;
 	      else if (strcmp(name,"SmbAini")==0) return SmbAiniEnum;
-	      else if (strcmp(name,"SmbBMax")==0) return SmbBMaxEnum;
          else stage=7;
    }
    if(stage==7){
-	      if (strcmp(name,"SmbBMin")==0) return SmbBMinEnum;
+	      if (strcmp(name,"SmbBMax")==0) return SmbBMaxEnum;
+	      else if (strcmp(name,"SmbBMin")==0) return SmbBMinEnum;
 	      else if (strcmp(name,"SmbBNeg")==0) return SmbBNegEnum;
 	      else if (strcmp(name,"SmbBPos")==0) return SmbBPosEnum;
@@ -874,9 +875,9 @@
 	      else if (strcmp(name,"SurfaceRelVelMisfit")==0) return SurfaceRelVelMisfitEnum;
 	      else if (strcmp(name,"SurfaceSlopeX")==0) return SurfaceSlopeXEnum;
-	      else if (strcmp(name,"SurfaceSlopeY")==0) return SurfaceSlopeYEnum;
          else stage=8;
    }
    if(stage==8){
-	      if (strcmp(name,"Temperature")==0) return TemperatureEnum;
+	      if (strcmp(name,"SurfaceSlopeY")==0) return SurfaceSlopeYEnum;
+	      else if (strcmp(name,"Temperature")==0) return TemperatureEnum;
 	      else if (strcmp(name,"TemperaturePDD")==0) return TemperaturePDDEnum;
 	      else if (strcmp(name,"TemperaturePicard")==0) return TemperaturePicardEnum;
@@ -997,9 +998,9 @@
 	      else if (strcmp(name,"Outputdefinition86")==0) return Outputdefinition86Enum;
 	      else if (strcmp(name,"Outputdefinition87")==0) return Outputdefinition87Enum;
-	      else if (strcmp(name,"Outputdefinition88")==0) return Outputdefinition88Enum;
          else stage=9;
    }
    if(stage==9){
-	      if (strcmp(name,"Outputdefinition89")==0) return Outputdefinition89Enum;
+	      if (strcmp(name,"Outputdefinition88")==0) return Outputdefinition88Enum;
+	      else if (strcmp(name,"Outputdefinition89")==0) return Outputdefinition89Enum;
 	      else if (strcmp(name,"Outputdefinition8")==0) return Outputdefinition8Enum;
 	      else if (strcmp(name,"Outputdefinition90")==0) return Outputdefinition90Enum;
@@ -1120,9 +1121,9 @@
 	      else if (strcmp(name,"Free")==0) return FreeEnum;
 	      else if (strcmp(name,"FreeSurfaceBaseAnalysis")==0) return FreeSurfaceBaseAnalysisEnum;
-	      else if (strcmp(name,"FreeSurfaceTopAnalysis")==0) return FreeSurfaceTopAnalysisEnum;
          else stage=10;
    }
    if(stage==10){
-	      if (strcmp(name,"FrontalForcingsDefault")==0) return FrontalForcingsDefaultEnum;
+	      if (strcmp(name,"FreeSurfaceTopAnalysis")==0) return FreeSurfaceTopAnalysisEnum;
+	      else if (strcmp(name,"FrontalForcingsDefault")==0) return FrontalForcingsDefaultEnum;
 	      else if (strcmp(name,"FrontalForcingsRignot")==0) return FrontalForcingsRignotEnum;
 	      else if (strcmp(name,"Fset")==0) return FsetEnum;
@@ -1243,9 +1244,9 @@
 	      else if (strcmp(name,"MismipFloatingMeltRate")==0) return MismipFloatingMeltRateEnum;
 	      else if (strcmp(name,"Moulin")==0) return MoulinEnum;
-	      else if (strcmp(name,"MpiDense")==0) return MpiDenseEnum;
          else stage=11;
    }
    if(stage==11){
-	      if (strcmp(name,"Mpi")==0) return MpiEnum;
+	      if (strcmp(name,"MpiDense")==0) return MpiDenseEnum;
+	      else if (strcmp(name,"Mpi")==0) return MpiEnum;
 	      else if (strcmp(name,"MpiSparse")==0) return MpiSparseEnum;
 	      else if (strcmp(name,"Mumps")==0) return MumpsEnum;
@@ -1366,9 +1367,9 @@
 	      else if (strcmp(name,"TotalGroundedBmb")==0) return TotalGroundedBmbEnum;
 	      else if (strcmp(name,"TotalGroundedBmbScaled")==0) return TotalGroundedBmbScaledEnum;
-	      else if (strcmp(name,"TotalSmb")==0) return TotalSmbEnum;
          else stage=12;
    }
    if(stage==12){
-	      if (strcmp(name,"TotalSmbScaled")==0) return TotalSmbScaledEnum;
+	      if (strcmp(name,"TotalSmb")==0) return TotalSmbEnum;
+	      else if (strcmp(name,"TotalSmbScaled")==0) return TotalSmbScaledEnum;
 	      else if (strcmp(name,"TransientArrayParam")==0) return TransientArrayParamEnum;
 	      else if (strcmp(name,"TransientInput")==0) return TransientInputEnum;
Index: /issm/branches/trunk-larour-SLPS2020/src/m/classes/organizer.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2020/src/m/classes/organizer.m	(revision 25723)
+++ /issm/branches/trunk-larour-SLPS2020/src/m/classes/organizer.m	(revision 25724)
@@ -156,4 +156,26 @@
 			error(['Could not find ' path ]);
 		end%}}}
+		function loaddatanoprefix(org,string),% {{{
+
+			%Get model path
+			if ~ischar(string), error('argument provided is not a string'); end
+			path=[org.repository '/' string];
+
+			%figure out if the data is there, otherwise, we have to use the default path supplied by user.
+			if exist(path,'file'),
+				path=path;
+			elseif exist([path '.mat'],'file'),
+				path=[path '.mat'];
+			else
+				error(['Could not find ' path ]);
+			end
+			if exist(path,'file')
+				evalin('caller',['load -mat ' path]);
+				return;
+			end
+
+			%If we are here, the data has not been found. 
+			error(['Could not find ' path ]);
+		end%}}}
 		function bool=perform(org,varargin) % {{{
 
@@ -254,4 +276,30 @@
 			eval(['save(''' name '''' variables ',''-v7.3'');']);
 		end%}}}
+		function savedatanoprefix(org,varargin) % {{{
+
+			%check
+			if (org.currentstep==0), error('Cannot save data because organizer (org) is empty! Make sure you did not skip any perform call'); end
+			if (org.currentstep>length(org.steps)), error('Cannot save data because organizer (org) is not up to date!'); end
+
+			name=[org.repository '/' org.steps(org.currentstep).string ];
+			disp(['saving data in: ' name]);
+
+			%Skip if requested
+			if org.skipio,
+				disp(['WARNING: Skipping saving ' name]);
+				return;
+			end
+
+			%check that md is a model
+			if (org.currentstep>length(org.steps)), error(['organizer error message: element with id ' num2str(org.currentstep) ' not found']); end
+
+			%list of variable names: 
+			variables='';
+			for i=2:nargin, 
+				variables=[variables ',' '''' inputname(i) ''''];
+				eval([inputname(i) '= varargin{' num2str(i-1) '};']);
+			end
+			eval(['save(''' name '''' variables ',''-v7.3'');']);
+		end%}}}
 	end
 end
Index: /issm/branches/trunk-larour-SLPS2020/src/m/classes/solidearthsettings.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2020/src/m/classes/solidearthsettings.m	(revision 25723)
+++ /issm/branches/trunk-larour-SLPS2020/src/m/classes/solidearthsettings.m	(revision 25724)
@@ -17,4 +17,5 @@
 		degacc                 = 0; %degree increment for resolution of Green tables
 		horiz                  = 0; %compute horizontal deformation
+		glfraction             = 1; %barystatic contribution full or fractional (default fractional)
 	end
 	methods
@@ -48,4 +49,7 @@
 		%how many time steps we skip before we run solidearthsettings solver during transient
 		self.runfrequency=1;
+		
+		%fractional contribution: 
+		self.glfraction=1;
 	
 		%horizontal displacement?  (not by default)
@@ -63,4 +67,5 @@
 			md = checkfield(md,'fieldname','solidearth.settings.degacc','size',[1 1],'>=',1e-10);
 			md = checkfield(md,'fieldname','solidearth.settings.horiz','NaN',1,'Inf',1,'values',[0 1]);
+			md = checkfield(md,'fieldname','solidearth.settings.glfraction','values',[0 1]);
 
 			%a coupler to a planet model is provided. 
@@ -91,4 +96,5 @@
 			fielddisplay(self,'rotation','earth rotational potential perturbation');
 			fielddisplay(self,'degacc','accuracy (default .01 deg) for numerical discretization of the Green''s functions');
+			fielddisplay(self,'glfraction','contribute fractionally (default, 1) to barystatic sea level');
 		end % }}}
 		function marshall(self,prefix,md,fid) % {{{
@@ -104,4 +110,5 @@
 			WriteData(fid,prefix,'object',self,'fieldname','horiz','name','md.solidearth.settings.horiz','format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','computesealevelchange','name','md.solidearth.settings.computesealevelchange','format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','glfraction','name','md.solidearth.settings.glfraction','format','Integer');
 		end % }}}
 		function savemodeljs(self,fid,modelname) % {{{
@@ -116,4 +123,5 @@
 			writejsdouble(fid,[modelname '.slr.settings.run_frequency'],self.run_frequency);
 			writejsdouble(fid,[modelname '.slr.settings.degacc'],self.degacc);
+			writejsdouble(fid,[modelname '.slr.settings.glfraction'],self.glfraction);
 		end % }}}
 		function self = extrude(self,md) % {{{
Index: /issm/branches/trunk-larour-SLPS2020/src/m/contrib/larour/glacier_inventory.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2020/src/m/contrib/larour/glacier_inventory.m	(revision 25723)
+++ /issm/branches/trunk-larour-SLPS2020/src/m/contrib/larour/glacier_inventory.m	(revision 25724)
@@ -183,4 +183,5 @@
 			%Go through O2 regions: 
 			for i=subsetregions,
+			%for i=33,
 				string=self.boxes(i).RGI_CODE; 
 				disp(['progressing with region ' num2str(i) ' ' string]);
@@ -208,5 +209,5 @@
 						case 19, radius=60;
 						case 32, radius=60;
-						case 33, radius=5;
+						case 33, radius=10;
 						case 41, radius=75;
 						case 42, radius=45;
Index: /issm/branches/trunk-larour-SLPS2020/src/m/contrib/larour/ismip6.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2020/src/m/contrib/larour/ismip6.m	(revision 25723)
+++ /issm/branches/trunk-larour-SLPS2020/src/m/contrib/larour/ismip6.m	(revision 25724)
@@ -13,6 +13,12 @@
 		directories    = {};   %directories where the files are
 		experiments    = {};   %names of experiments
+		base           = {};   %placeholder for base
+		surface        = {};   %placeholder for surface
 		thickness      = {};   %placeholder for thicknesses
 		deltathickness = {};   %placeholder for delta thicknesses
+		deltathicknessvaf = {};   %placeholder for delta thicknesses above floatation
+		deltathicknesshal = {};   %placeholder for delta thicknesses halosteric origins
+		deltathicknessbar = {};   %placeholder for delta thicknesses halosteric origins
+		thicknesscorrection={};  
 		icemask        = {};   %placeholder for ice masks
 		oceanmask      = {};   %placeholder for ocean masks
@@ -20,4 +26,5 @@
 		timestart      = {};   %placeholder for times
 		calendar      = {};   %placeholder for times
+		di            = {}; %ice densities
 	end
 	methods
@@ -146,4 +153,7 @@
 			end
 
+			if ~exist('timestart','var'), timestart=2015; end
+			if ~exist('calendar','var'), calendar=0; end
+
 		end % }}}
 		function info=readinfo(self,experiment,field) % {{{
@@ -203,5 +213,10 @@
 
 				%map onto mesh: correct only for thicknesses
-				hg=ismip2mesh_correction.*(ismip2mesh*ht) ;
+				if strcmpi(field,'lithk') | strcmpi(field,'orog') | strcmpi(field,'base'),
+					hg=ismip2mesh_correction.*(ismip2mesh*ht) ;
+					%hg=ismip2mesh*ht ;
+				else
+					hg=ismip2mesh*ht ;
+				end
 
 				%keep field:
@@ -209,4 +224,12 @@
 					pos=find(isnan(hg)); hg(pos)=0;
 					self.thickness{i}=hg; 
+				end
+				if strcmpi(field,'orog'),
+					pos=find(isnan(hg)); hg(pos)=0;
+					self.surface{i}=hg; 
+				end
+				if strcmpi(field,'base'),
+					pos=find(isnan(hg)); hg(pos)=0;
+					self.base{i}=hg; 
 				end
 				if strcmpi(field,'sftgif'),
@@ -220,11 +243,12 @@
 				end
 				if strcmpi(field,'sftgrf'),
-					hge=-ones(md.mesh.numberofvertices,size(hg,2));
+					hgv=-ones(md.mesh.numberofvertices,size(hg,2));
 					for j=1:size(hg,2),
 						hgj=hg(:,j);
-						pos=find(hgj>0);
-						hge(md.mesh.elements(pos,:),j)=1;
-					end
-					self.oceanmask{i}=hge; 
+						pos=find(hgj>.99); %we want fully grounded
+						%pos=find(hgj>0); %we want slightly grounded
+						hgv(md.mesh.elements(pos,:),j)=1;
+					end
+					self.oceanmask{i}=hgv; 
 				end
 
Index: /issm/branches/trunk-larour-SLPS2020/src/m/contrib/larour/legendd.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2020/src/m/contrib/larour/legendd.m	(revision 25723)
+++ /issm/branches/trunk-larour-SLPS2020/src/m/contrib/larour/legendd.m	(revision 25724)
@@ -20,8 +20,8 @@
 	nl=length(strings);
 	for i=1:nl,
-		l=line([x+w/6 x+w/3],[y+(nl+1-i)*h/(nl+1) y+(nl+1-i)*h/(nl+1)]);
+		l=line([x+w/20 x+w/4],[y+(nl+1-i)*h/(nl+1) y+(nl+1-i)*h/(nl+1)]);
 		set(l,'Color',colors{i});
 		set(l,'LineWidth',linewidth);
-		text(x+1.3*w/3,y+(nl+1-i)*h/(nl+1),strings{i},'FontSize',fontsize);
+		text(x+1.3*w/5,y+(nl+1-i)*h/(nl+1),strings{i},'FontSize',fontsize);
 	end
 
Index: /issm/branches/trunk-larour-SLPS2020/src/m/contrib/larour/mme_autotime_correlation_matrix.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2020/src/m/contrib/larour/mme_autotime_correlation_matrix.m	(revision 25723)
+++ /issm/branches/trunk-larour-SLPS2020/src/m/contrib/larour/mme_autotime_correlation_matrix.m	(revision 25724)
@@ -1,53 +1,20 @@
-function matrix=mme_time_correlation_matrix(mme,varargin); 
+function matrix=mme_autotime_correlation_matrix(mme,type)
 
-	if nargin==2,
-		type=varargin{1};
-	elseif nargin==3,
-		mme2=varargin{1};
-		type=varargin{2};
-	else 
-		error('mme_time_correlation_matrix usage error: 2 or 3 arguments only allowed!');
+
+	%Out of a multi model ensemble (nsamples x nsteps) of runs, build 
+	%a temporal correlation matrix (of size nsteps x nsteps)
+
+	nsamples=size(mme,1);
+	nsteps=size(mme,2);
+
+	%initialize with 1 in the diagonal: 
+	matrix=eye(nsteps,nsteps);
+
+	%go through time steps, and fill up the top part. 
+	for i=1:nsteps,
+		for j=i+1:nsteps,
+			matrix(i,j)=corr(mme(:,i),mme(:,j),'Type',type);
+			matrix(j,i)=matrix(i,j);
+		end
 	end
 
-	if nargin==2,
-
-		%Out of a multi model ensemble (nsamples x nsteps) of runs, build 
-		%a temporal correlation matrix (of size nsteps x nsteps)
-
-		nsamples=size(mme,1);
-		nsteps=size(mme,2);
-
-		%initialize with 1 in the diagonal: 
-		matrix=eye(nsteps,nsteps);
-
-		%go through time steps, and fill up the top part. 
-		for i=1:nsteps,
-			for j=i+1:nsteps,
-				matrix(i,j)=corr(mme(:,i),mme(:,j),'Type',type);
-				matrix(j,i)=matrix(i,j);
-			end
-		end
-	else
-
-		%Same kind of computations, except it's not autocorrelation:
-		nsamples=size(mme,1); nsamples2=size(mme2,1);
-		nsteps=size(mme,2); nsteps2=size(mme2,2);
-
-		if nsteps2~=nsteps,
-			error('number of time steps from both sample matrices should be identical!');
-		end
-		if nsamples2~=nsamples,
-			error('number of samples from both sample matrices should be identical!');
-		end
-
-		%initialize with 1 in the diagonal: 
-		matrix=zeros(nsteps,nsteps);
-
-		%go through time steps, and fill up the top part. 
-		for i=1:nsteps,
-			for j=i:nsteps,
-				matrix(i,j)=corr(mme(:,i),mme2(:,j),'Type',type);
-				matrix(j,i)=matrix(i,j);
-			end
-		end
-	end
Index: /issm/branches/trunk-larour-SLPS2020/src/m/interp/averaging.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2020/src/m/interp/averaging.m	(revision 25723)
+++ /issm/branches/trunk-larour-SLPS2020/src/m/interp/averaging.m	(revision 25724)
@@ -61,5 +61,9 @@
 elseif dimension(md.mesh)==2,
 	rep=3;
-	areas=GetAreas(index,md.mesh.x,md.mesh.y);
+	if isa(md.mesh,'mesh3dsurface'),
+		areas=GetAreas3DTria(md.mesh.elements,md.mesh.x,md.mesh.y,md.mesh.z);
+	else
+		areas=GetAreas(index,md.mesh.x,md.mesh.y);
+	end
 else
 	rep=3;
Index: /issm/branches/trunk-larour-SLPS2020/src/m/mesh/FixMesh.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2020/src/m/mesh/FixMesh.m	(revision 25723)
+++ /issm/branches/trunk-larour-SLPS2020/src/m/mesh/FixMesh.m	(revision 25724)
@@ -1,3 +1,3 @@
-function  [index2 x2 y2 value2]=FixMesh(index,x,y,value)
+function  [index2 x2 y2 value2 newpos]=FixMesh(index,x,y,value)
 % FIXMESH - FixMesh fix mesh with broken triangles, orphan vertices, etc ...
 %
@@ -15,4 +15,5 @@
 y2=y;
 value2=value;
+newpos=1:length(x);
 
 %First, look for orphan vertices, and take them out.
@@ -29,4 +30,5 @@
 	y2(orphan)=[];
 	value2(orphan)=[];
+	newpos(orphan)=[];
 
 	%now, the index:
Index: /issm/branches/trunk-larour-SLPS2020/src/m/plot/processdatalatlong.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2020/src/m/plot/processdatalatlong.m	(revision 25723)
+++ /issm/branches/trunk-larour-SLPS2020/src/m/plot/processdatalatlong.m	(revision 25724)
@@ -22,8 +22,6 @@
 		%interpolate data: 
 		extradata=griddata(x0,y0,data,xextra,yextra,'nearest');
-
 		data=[data; extradata];
 	elseif length(data)==length(md.mesh.elements),
-		error('processdatalatlong error message: coord ''latlong'' case not covered for element data ');
 		datatype=1;
 	end
Index: /issm/branches/trunk-larour-SLPS2020/src/m/units/sletogt.m
===================================================================
--- /issm/branches/trunk-larour-SLPS2020/src/m/units/sletogt.m	(revision 25723)
+++ /issm/branches/trunk-larour-SLPS2020/src/m/units/sletogt.m	(revision 25724)
@@ -1,3 +1,4 @@
 function conversionfactor=sletogt()
-	
-	conversionfactor=361.9;  %361.9 Gigatons to 1 mm sea-level equivalent.
+
+	rho_water=1023;
+	conversionfactor=rho_water/1000*361.9; %361.9 Gigatons to 1 mm sea-level equivalent.
