Index: issm/trunk/src/m/classes/hydrologydc.m
===================================================================
--- issm/trunk/src/m/classes/hydrologydc.m	(revision 24313)
+++ issm/trunk/src/m/classes/hydrologydc.m	(revision 25836)
@@ -1,2 +1,3 @@
+
 %Hydrologydc class definition
 %
@@ -12,5 +13,6 @@
 		rel_tol                  = 0;
 		max_iter                 = 0;
-    steps_per_step           = 0;
+		steps_per_step           = 0;
+		averaging                = 0;
 		sedimentlimit_flag       = 0;
 		sedimentlimit            = 0;
@@ -19,8 +21,8 @@
 		leakage_factor           = 0;
 		basal_moulin_input       = NaN;
-    requested_outputs        = {};
+		requested_outputs        = {};
 
 		spcsediment_head         = NaN;
-    mask_thawed_node         = NaN;
+		mask_thawed_node         = NaN;
 		sediment_transmitivity   = NaN;
 		sediment_compressibility = 0;
@@ -39,20 +41,17 @@
 		epl_conductivity         = 0;
 		eplflip_lock             = 0;
-  end
+	end
 	methods
-    % {{{ function self = extrude(self,md)
-		function self = extrude(self,md)
+		function self = extrude(self,md)    % {{{
 			self.spcsediment_head=project3d(md,'vector',self.spcsediment_head,'type','node','layer',1);
 			self.sediment_transmitivity=project3d(md,'vector',self.sediment_transmitivity,'type','node','layer',1);
 			self.basal_moulin_input=project3d(md,'vector',self.basal_moulin_input,'type','node','layer',1);
-      self.mask_thawed_node=project3d(md,'vector',self.mask_thawed_node,'type','node','layer',1);
+			self.mask_thawed_node=project3d(md,'vector',self.mask_thawed_node,'type','node','layer',1);
 			if(self.isefficientlayer==1);
 				self.spcepl_head=project3d(md,'vector',self.spcepl_head,'type','node','layer',1);
-        self.mask_eplactive_node=project3d(md,'vector',self.mask_eplactive_node,'type','node','layer',1);
-			end
-		end
-    % }}}
-		% {{{ function self = hydrologydc(varargin)
-		function self = hydrologydc(varargin)
+				self.mask_eplactive_node=project3d(md,'vector',self.mask_eplactive_node,'type','node','layer',1);
+			end
+		end    % }}}
+		function self = hydrologydc(varargin) % {{{
 			switch nargin
 				case 0
@@ -61,19 +60,17 @@
 					error('constructor not supported');
 			end
-		end
-		% }}}
-    function list = defaultoutputs(self,md) % {{{
-        list = {'SedimentHead','SedimentHeadResidual','EffectivePressure'};
-        if self.isefficientlayer,
-            list=[list,{'EplHead','HydrologydcMaskEplactiveNode','HydrologydcMaskEplactiveElt','EplHeadSlopeX','EplHeadSlopeY','HydrologydcEplThickness'}];
-        end
-        if self.steps_per_step>1,
-            list = [list,'EffectivePressureSubstep','SedimentHeadSubstep'];
-            if self.isefficientlayer,
-                list = [list,'EplHeadSubstep','HydrologydcEplThicknessSubstep'];
-            end
-        end
-    end % }}}
-
+		end% }}}
+		function list = defaultoutputs(self,md) % {{{
+			list = {'SedimentHead','SedimentHeadResidual','EffectivePressure'};
+			if self.isefficientlayer,
+				list=[list,{'EplHead','HydrologydcMaskEplactiveNode','HydrologydcMaskEplactiveElt','EplHeadSlopeX','EplHeadSlopeY','HydrologydcEplThickness'}];
+			end
+			if self.steps_per_step>1,
+				list = [list,'EffectivePressureSubstep','SedimentHeadSubstep'];
+				if self.isefficientlayer,
+					list = [list,'EplHeadSubstep','HydrologydcEplThicknessSubstep'];
+				end
+			end
+		end % }}}
 		function self = initialize(self,md) % {{{
 			self.epl_colapse_thickness = self.sediment_transmitivity/self.epl_conductivity;
@@ -84,8 +81,5 @@
 
 		end % }}}
-		% {{{ function self = setdefaultparameters(self)
-
-		function self = setdefaultparameters(self)
-
+		function self = setdefaultparameters(self)% {{{
 			%Parameters from de Fleurian 2014
 			self.water_compressibility    = 5.04e-10;
@@ -96,4 +90,5 @@
 			self.max_iter                 = 100;
 			self.steps_per_step           = 1;
+			self.averaging                = 0;
 			self.sedimentlimit_flag       = 0;
 			self.sedimentlimit            = 0;
@@ -101,5 +96,5 @@
 			self.unconfined_flag          = 0;
 			self.leakage_factor           = 1.0e-10;
-      self.requested_outputs        = {'default'};
+			self.requested_outputs        = {'default'};
 
 
@@ -117,11 +112,7 @@
 			self.epl_max_thickness        = 5.0;
 			self.eplflip_lock             = 0;
-		end
-
-		% }}}
-		% {{{ function md = checkconsistency(self,md,solution,analyses)
-
-		function md = checkconsistency(self,md,solution,analyses)
-			%Early return
+		end  % }}}
+		function md = checkconsistency(self,md,solution,analyses)% {{{
+		%Early return
 			if ~ismember('HydrologyDCInefficientAnalysis',analyses) & ~ismember('HydrologyDCEfficientAnalysis',analyses),
 				return;
@@ -135,8 +126,9 @@
 			md = checkfield(md,'fieldname','hydrology.max_iter','>',0,'numel',1);
 			md = checkfield(md,'fieldname','hydrology.steps_per_step','>',0,'numel',1);
+			md = checkfield(md,'fieldname','hydrology.averaging','numel',[1],'values',[0 1 2]);
 			md = checkfield(md,'fieldname','hydrology.sedimentlimit_flag','numel',[1],'values',[0 1 2 3]);
 			md = checkfield(md,'fieldname','hydrology.transfer_flag','numel',[1],'values',[0 1]);
 			md = checkfield(md,'fieldname','hydrology.unconfined_flag','numel',[1],'values',[0 1]);
-      md = checkfield(md,'fieldname','hydrology.requested_outputs','stringrow',1);
+			md = checkfield(md,'fieldname','hydrology.requested_outputs','stringrow',1);
 			if self.sedimentlimit_flag==1,
 				md = checkfield(md,'fieldname','hydrology.sedimentlimit','>',0,'numel',1);
@@ -152,5 +144,5 @@
 			md = checkfield(md,'fieldname','hydrology.sediment_thickness','>',0,'numel',1);
 			md = checkfield(md,'fieldname','hydrology.sediment_transmitivity','>=',0,'size',[md.mesh.numberofvertices 1]);
-      md = checkfield(md,'fieldname','hydrology.mask_thawed_node','size',[md.mesh.numberofvertices 1],'values',[0 1]);
+			md = checkfield(md,'fieldname','hydrology.mask_thawed_node','size',[md.mesh.numberofvertices 1],'values',[0 1]);
 
 			if self.isefficientlayer==1,
@@ -169,10 +161,6 @@
 				end
 			end
-		end
-
-		% }}}
-		% {{{ function disp(self)
-
-		function disp(self)
+		end% }}}
+		function disp(self)% {{{
 			disp(sprintf('   hydrology Dual Porous Continuum Equivalent parameters:'));
 			disp(sprintf('   - general parameters'));
@@ -184,4 +172,8 @@
 			fielddisplay(self,'max_iter','maximum number of nonlinear iteration');
 			fielddisplay(self,'steps_per_step','number of hydrology steps per timestep');
+			fielddisplay(self, 'averaging', 'averaging methods from short to long steps');
+			disp(sprintf('%55s  0: Arithmetic (default)'));
+			disp(sprintf('%55s  0: Geometric'));
+			disp(sprintf('%55s  0: Harmonic'));
 			fielddisplay(self,'sedimentlimit_flag','what kind of upper limit is applied for the inefficient layer');
 			disp(sprintf('%55s  0: no limit',' '));
@@ -224,11 +216,6 @@
 				fielddisplay(self,'eplflip_lock','lock the epl activation to avoid fli-floping (default is 0, no stabilization)');
 			end
-
-		end
-
-		% }}}
-		% {{{ function marshall(self,prefix,md,fid)
-
-		function marshall(self,prefix,md,fid)
+		end % }}}
+		function marshall(self,prefix,md,fid)% {{{
 			WriteData(fid,prefix,'name','md.hydrology.model','data',1,'format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','water_compressibility','format','Double');
@@ -239,4 +226,5 @@
 			WriteData(fid,prefix,'object',self,'fieldname','max_iter','format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','steps_per_step','format','Integer');
+			WriteData(fid,prefix,'object',self,'fieldname','averaging','format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','sedimentlimit_flag','format','Integer');
 			WriteData(fid,prefix,'object',self,'fieldname','transfer_flag','format','Integer');
@@ -255,6 +243,5 @@
 			WriteData(fid,prefix,'object',self,'fieldname','sediment_thickness','format','Double');
 			WriteData(fid,prefix,'object',self,'fieldname','sediment_transmitivity','format','DoubleMat','mattype',1');
-      WriteData(fid,prefix,'object',self,'fieldname','mask_thawed_node','format','DoubleMat','mattype',1);
-
+			WriteData(fid,prefix,'object',self,'fieldname','mask_thawed_node','format','DoubleMat','mattype',1);
 			if self.isefficientlayer==1,
 				WriteData(fid,prefix,'object',self,'fieldname','spcepl_head','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
@@ -269,14 +256,12 @@
 				WriteData(fid,prefix,'object',self,'fieldname','eplflip_lock','format','Integer');
 			end
-      outputs = self.requested_outputs;
-      pos  = find(ismember(outputs,'default'));
-      if ~isempty(pos),
-        outputs(pos) = [];  %remove 'default' from outputs
-        outputs      = [outputs defaultoutputs(self,md)]; %add defaults
-      end
-      WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
-		end
-
-		% }}}
+			outputs = self.requested_outputs;
+			pos  = find(ismember(outputs,'default'));
+			if ~isempty(pos),
+				outputs(pos) = [];  %remove 'default' from outputs
+				outputs      = [outputs defaultoutputs(self,md)]; %add defaults
+			end
+			WriteData(fid,prefix,'data',outputs,'name','md.hydrology.requested_outputs','format','StringArray');
+		end% }}}
 	end
 end
