Index: /issm/oecreview/Archive/17984-18295/Date.tex
===================================================================
--- /issm/oecreview/Archive/17984-18295/Date.tex	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/Date.tex	(revision 18296)
@@ -0,0 +1,1 @@
+Jul-30-2014
Index: /issm/oecreview/Archive/17984-18295/ISSM-17984-17985.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-17984-17985.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-17984-17985.diff	(revision 18296)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- ../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 17984)
++++ ../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 17985)
+@@ -282,6 +282,7 @@
+ def TimesteppingCflCoefficientEnum(): return StringToEnum("TimesteppingCflCoefficient")[0]
+ def TimesteppingTimeAdaptEnum(): return StringToEnum("TimesteppingTimeAdapt")[0]
+ def TimesteppingTimeStepEnum(): return StringToEnum("TimesteppingTimeStep")[0]
++def TimesteppingInterpForcingsEnum(): return StringToEnum("TimesteppingInterpForcings")[0]
+ def TransientIsstressbalanceEnum(): return StringToEnum("TransientIsstressbalance")[0]
+ def TransientIsgroundinglineEnum(): return StringToEnum("TransientIsgroundingline")[0]
+ def TransientIsmasstransportEnum(): return StringToEnum("TransientIsmasstransport")[0]
Index: /issm/oecreview/Archive/17984-18295/ISSM-17990-17991.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-17990-17991.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-17990-17991.diff	(revision 18296)
@@ -0,0 +1,94 @@
+Index: ../trunk-jpl/src/m/classes/model.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.py	(revision 17990)
++++ ../trunk-jpl/src/m/classes/model.py	(revision 17991)
+@@ -656,10 +656,11 @@
+ 		#connectivity
+ 		md.mesh.elementconnectivity=numpy.tile(md.mesh.elementconnectivity,(numlayers-1,1))
+ 		md.mesh.elementconnectivity[numpy.nonzero(md.mesh.elementconnectivity==0)]=-sys.maxint-1
+-		for i in xrange(1,numlayers-1):
+-			md.mesh.elementconnectivity[i*md.mesh.numberofelements2d:(i+1)*md.mesh.numberofelements2d,:] \
+-				=md.mesh.elementconnectivity[i*md.mesh.numberofelements2d:(i+1)*md.mesh.numberofelements2d,:]+md.mesh.numberofelements2d
+-		md.mesh.elementconnectivity[numpy.nonzero(md.mesh.elementconnectivity<0)]=0
++		if not numpy.isnan(md.mesh.lementconnectivity).all():
++			for i in xrange(1,numlayers-1):
++				md.mesh.elementconnectivity[i*md.mesh.numberofelements2d:(i+1)*md.mesh.numberofelements2d,:] \
++						=md.mesh.elementconnectivity[i*md.mesh.numberofelements2d:(i+1)*md.mesh.numberofelements2d,:]+md.mesh.numberofelements2d
++				md.mesh.elementconnectivity[numpy.nonzero(md.mesh.elementconnectivity<0)]=0
+ 
+ 		#materials
+ 		md.materials.rheology_B=project3d(md,'vector',md.materials.rheology_B,'type','node')
+@@ -763,7 +764,7 @@
+ 		md.stressbalance.referential=project2d(md,md.stressbalance.referential,md.mesh.numberoflayers)
+ 		md.stressbalance.loadingforce=project2d(md,md.stressbalance.loadingforce,md.mesh.numberoflayers)
+ 		md.masstransport.spcthickness=project2d(md,md.masstransport.spcthickness,md.mesh.numberoflayers)
+-		md.damage.spcdamage=project2d(md,md.damage.spcdamage,md.mesh.numberoflayers-1)
++		if not numpy.isnan(md.damage.spcdamage).all(): md.damage.spcdamage=project2d(md,md.damage.spcdamage,md.mesh.numberoflayers-1)
+ 		md.thermal.spctemperature=project2d(md,md.thermal.spctemperature,md.mesh.numberoflayers-1)
+ 
+ 		#materials
+@@ -804,8 +805,8 @@
+ 		mesh.numberofvertices=md.mesh.numberofvertices2d
+ 		mesh.numberofelements=md.mesh.numberofelements2d
+ 		mesh.elements=md.mesh.elements2d
+-		mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1)
+-		mesh.elementconnectivity=project2d(md,md.mesh.elementconnectivity,1)
++		if not numpy.isnan(md.mesh.vertexonboundary).all(): mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1)
++		if not numpy.isnan(md.mesh.elementconnectivity).all(): mesh.elementconnectivity=project2d(md,md.mesh.elementconnectivity,1)
+ 		md.mesh=mesh
+ 
+ 		return md
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 17990)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 17991)
+@@ -207,7 +207,7 @@
+ 			md.stressbalance.referential=project2d(md,md.stressbalance.referential,md.mesh.numberoflayers);
+ 			md.stressbalance.loadingforce=project2d(md,md.stressbalance.loadingforce,md.mesh.numberoflayers);
+ 			md.masstransport.spcthickness=project2d(md,md.masstransport.spcthickness,md.mesh.numberoflayers);
+-			md.damage.spcdamage=project2d(md,md.damage.spcdamage,md.mesh.numberoflayers)
++			if ~isnan(md.damage.spcdamage), md.damage.spcdamage=project2d(md,md.damage.spcdamage,md.mesh.numberoflayers); end
+ 			md.thermal.spctemperature=project2d(md,md.thermal.spctemperature,md.mesh.numberoflayers);
+ 
+ 			%materials
+@@ -235,6 +235,7 @@
+ 			md.geometry.thickness=project2d(md,md.geometry.thickness,1);
+ 			md.geometry.base=project2d(md,md.geometry.base,1);
+ 			md.geometry.bed=project2d(md,md.geometry.bed,1);
++
+ 			md.mask.groundedice_levelset=project2d(md,md.mask.groundedice_levelset,1);
+ 			md.mask.ice_levelset=project2d(md,md.mask.ice_levelset,1);
+ 
+@@ -249,8 +250,8 @@
+ 			mesh.numberofvertices=md.mesh.numberofvertices2d;
+ 			mesh.numberofelements=md.mesh.numberofelements2d;
+ 			mesh.elements=md.mesh.elements2d;
+-			mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1);
+-			mesh.elementconnectivity=project2d(md,md.mesh.elementconnectivity,1);
++			if ~isnan(md.mesh.vertexonboundary), mesh.vertexonboundary=project2d(md,md.mesh.vertexonboundary,1); end
++			if ~isnan(md.mesh.elementconnectivity), mesh.elementconnectivity=project2d(md,md.mesh.elementconnectivity,1); end
+ 			md.mesh=mesh;
+ 
+ 		end % }}}
+@@ -759,13 +760,15 @@
+ 	    end
+ 
+ 			%connectivity
+-			md.mesh.elementconnectivity=repmat(md.mesh.elementconnectivity,numlayers-1,1);
+-			md.mesh.elementconnectivity(find(md.mesh.elementconnectivity==0))=NaN;
+-			for i=2:numlayers-1,
+-				md.mesh.elementconnectivity((i-1)*md.mesh.numberofelements2d+1:(i)*md.mesh.numberofelements2d,:)...
+-					=md.mesh.elementconnectivity((i-1)*md.mesh.numberofelements2d+1:(i)*md.mesh.numberofelements2d,:)+md.mesh.numberofelements2d;
++			if ~isnan(md.mesh.elementconnectivity)
++				md.mesh.elementconnectivity=repmat(md.mesh.elementconnectivity,numlayers-1,1);
++				md.mesh.elementconnectivity(find(md.mesh.elementconnectivity==0))=NaN;
++				for i=2:numlayers-1,
++					md.mesh.elementconnectivity((i-1)*md.mesh.numberofelements2d+1:(i)*md.mesh.numberofelements2d,:)...
++						=md.mesh.elementconnectivity((i-1)*md.mesh.numberofelements2d+1:(i)*md.mesh.numberofelements2d,:)+md.mesh.numberofelements2d;
++				end
++				md.mesh.elementconnectivity(find(isnan(md.mesh.elementconnectivity)))=0;
+ 			end
+-			md.mesh.elementconnectivity(find(isnan(md.mesh.elementconnectivity)))=0;
+ 
+ 			%materials
+ 			md.materials.rheology_B=project3d(md,'vector',md.materials.rheology_B,'type','node');
Index: /issm/oecreview/Archive/17984-18295/ISSM-17991-17992.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-17991-17992.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-17991-17992.diff	(revision 18296)
@@ -0,0 +1,16 @@
+Index: ../trunk-jpl/src/m/enum/TimesteppingInterpForcingsEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/TimesteppingInterpForcingsEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/TimesteppingInterpForcingsEnum.m	(revision 17992)
+@@ -0,0 +1,11 @@
++function macro=TimesteppingInterpForcingsEnum()
++%TIMESTEPPINGINTERPFORCINGSENUM - Enum of TimesteppingInterpForcings
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=TimesteppingInterpForcingsEnum()
++
++macro=StringToEnum('TimesteppingInterpForcings');
Index: /issm/oecreview/Archive/17984-18295/ISSM-17992-17993.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-17992-17993.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-17992-17993.diff	(revision 18296)
@@ -0,0 +1,13473 @@
+Index: ../trunk-jpl/src/java/build/gui_elements/PathPanel.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/gui_elements/PathPanel.class
+===================================================================
+--- ../trunk-jpl/src/java/build/gui_elements/PathPanel.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/gui_elements/PathPanel.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/gui_elements/PathPanel.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/gui_elements/IntegerPanel.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/gui_elements/IntegerPanel.class
+===================================================================
+--- ../trunk-jpl/src/java/build/gui_elements/IntegerPanel.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/gui_elements/IntegerPanel.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/gui_elements/IntegerPanel.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/gui_elements/DecimalPanel.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/gui_elements/DecimalPanel.class
+===================================================================
+--- ../trunk-jpl/src/java/build/gui_elements/DecimalPanel.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/gui_elements/DecimalPanel.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/gui_elements/DecimalPanel.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/gui_elements/GUIBuildException.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/gui_elements/GUIBuildException.class
+===================================================================
+--- ../trunk-jpl/src/java/build/gui_elements/GUIBuildException.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/gui_elements/GUIBuildException.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/gui_elements/GUIBuildException.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/gui_elements/CombinedPanel$1.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/gui_elements/CombinedPanel$1.class
+===================================================================
+--- ../trunk-jpl/src/java/build/gui_elements/CombinedPanel$1.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/gui_elements/CombinedPanel$1.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/gui_elements/CombinedPanel$1.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/gui_elements/ControlledPanel.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/gui_elements/ControlledPanel.class
+===================================================================
+--- ../trunk-jpl/src/java/build/gui_elements/ControlledPanel.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/gui_elements/ControlledPanel.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/gui_elements/ControlledPanel.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/gui_elements/DuplicatorPanel.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/gui_elements/DuplicatorPanel.class
+===================================================================
+--- ../trunk-jpl/src/java/build/gui_elements/DuplicatorPanel.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/gui_elements/DuplicatorPanel.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/gui_elements/DuplicatorPanel.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/gui_elements/OptionPanel.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/gui_elements/OptionPanel.class
+===================================================================
+--- ../trunk-jpl/src/java/build/gui_elements/OptionPanel.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/gui_elements/OptionPanel.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/gui_elements/OptionPanel.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/gui_elements/AlternativePanel.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/gui_elements/AlternativePanel.class
+===================================================================
+--- ../trunk-jpl/src/java/build/gui_elements/AlternativePanel.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/gui_elements/AlternativePanel.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/gui_elements/AlternativePanel.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/gui_elements/CombinedPanel.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/gui_elements/CombinedPanel.class
+===================================================================
+--- ../trunk-jpl/src/java/build/gui_elements/CombinedPanel.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/gui_elements/CombinedPanel.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/gui_elements/CombinedPanel.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/gui_elements/SelectorPanel.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/gui_elements/SelectorPanel.class
+===================================================================
+--- ../trunk-jpl/src/java/build/gui_elements/SelectorPanel.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/gui_elements/SelectorPanel.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/gui_elements/SelectorPanel.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/gui_elements/ColorCellRenderer.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/gui_elements/ColorCellRenderer.class
+===================================================================
+--- ../trunk-jpl/src/java/build/gui_elements/ColorCellRenderer.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/gui_elements/ColorCellRenderer.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/gui_elements/ColorCellRenderer.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/gui_elements/CheckBoxPanel.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/gui_elements/CheckBoxPanel.class
+===================================================================
+--- ../trunk-jpl/src/java/build/gui_elements/CheckBoxPanel.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/gui_elements/CheckBoxPanel.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/gui_elements/CheckBoxPanel.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/gui_elements/CombinedPanel$Type.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/gui_elements/CombinedPanel$Type.class
+===================================================================
+--- ../trunk-jpl/src/java/build/gui_elements/CombinedPanel$Type.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/gui_elements/CombinedPanel$Type.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/gui_elements/CombinedPanel$Type.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/gui_elements/TextfieldPanel.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/gui_elements/TextfieldPanel.class
+===================================================================
+--- ../trunk-jpl/src/java/build/gui_elements/TextfieldPanel.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/gui_elements/TextfieldPanel.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/gui_elements/TextfieldPanel.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/gui_elements/FramePanel.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/gui_elements/FramePanel.class
+===================================================================
+--- ../trunk-jpl/src/java/build/gui_elements/FramePanel.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/gui_elements/FramePanel.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/gui_elements/FramePanel.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/main/GUIBuilder.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/main/GUIBuilder.class
+===================================================================
+--- ../trunk-jpl/src/java/build/main/GUIBuilder.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/main/GUIBuilder.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/main/GUIBuilder.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/main/GUIBuilder$1.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/main/GUIBuilder$1.class
+===================================================================
+--- ../trunk-jpl/src/java/build/main/GUIBuilder$1.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/main/GUIBuilder$1.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/main/GUIBuilder$1.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/main/PanelControl.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/main/PanelControl.class
+===================================================================
+--- ../trunk-jpl/src/java/build/main/PanelControl.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/main/PanelControl.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/main/PanelControl.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/main/XMLHelper.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/main/XMLHelper.class
+===================================================================
+--- ../trunk-jpl/src/java/build/main/XMLHelper.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/main/XMLHelper.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/main/XMLHelper.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/main/GUI.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/main/GUI.class
+===================================================================
+--- ../trunk-jpl/src/java/build/main/GUI.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/main/GUI.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/main/GUI.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/main/PanelNode.class
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/main/PanelNode.class
+===================================================================
+--- ../trunk-jpl/src/java/build/main/PanelNode.class	(revision 17992)
++++ ../trunk-jpl/src/java/build/main/PanelNode.class	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/main/PanelNode.class
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/document-open-2.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/resources/document-open-2.png
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/document-open-2.png	(revision 17992)
++++ ../trunk-jpl/src/java/build/resources/document-open-2.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/resources/document-open-2.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/document-preview.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/resources/document-preview.png
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/document-preview.png	(revision 17992)
++++ ../trunk-jpl/src/java/build/resources/document-preview.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/resources/document-preview.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/document-export-4.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/resources/document-export-4.png
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/document-export-4.png	(revision 17992)
++++ ../trunk-jpl/src/java/build/resources/document-export-4.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/resources/document-export-4.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/config_schema.xsd
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/config_schema.xsd	(revision 0)
++++ ../trunk-jpl/src/java/build/resources/config_schema.xsd	(revision 17993)
+@@ -0,0 +1,141 @@
++<?xml version="1.0"?>
++<!-- 
++*   
++*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*    	
++* -->
++
++<xsd:schema version="1.0"
++xmlns:xsd="http://www.w3.org/2001/XMLSchema">
++
++  <xsd:element name="inishell_config" type="general" />
++  
++	<xsd:complexType name="general">
++      <xsd:choice maxOccurs="unbounded">
++			<xsd:element name="parameter" type="parametertype" />
++			<xsd:element name="parametergroup" type="pargroup" />
++			<xsd:element name="include" type="pathonly" /> 
++      </xsd:choice>
++	  <xsd:attribute name="application" />
++    </xsd:complexType>
++	
++	<xsd:complexType name="parametertype">
++		<xsd:complexContent>
++			<xsd:extension base="parbasetype">
++				<xsd:attribute name="key" type="xsd:string" use="required"/> 
++				<xsd:attribute name="default" type="xsd:string" />
++				<xsd:attribute name="counter" type="xsd:integer" />
++			</xsd:extension>
++		</xsd:complexContent>		
++	</xsd:complexType>
++   
++   <xsd:complexType name="nameonly">
++		<xsd:attribute name="name" />   
++   </xsd:complexType>
++   
++   <xsd:complexType name="pathonly">
++		<xsd:attribute name="path" />   
++   </xsd:complexType>
++   
++	<xsd:complexType name="pargroup">
++		<xsd:choice minOccurs="1" maxOccurs="unbounded">
++			<xsd:element name="parameter" type="parametertype" />
++			<xsd:element name="reference" type="nameonly" />
++		</xsd:choice>
++		<xsd:attribute name="name" />
++	</xsd:complexType>
++  
++	
++	<xsd:complexType name="parbasetype">
++		<xsd:sequence>
++			<xsd:sequence minOccurs="0" maxOccurs="unbounded">
++				<xsd:element name="section" type="nameonly"/>
++			</xsd:sequence>
++			<xsd:sequence minOccurs="0" maxOccurs="unbounded">
++				<xsd:element name="replace" type="nameonly"/>
++			</xsd:sequence>
++			<xsd:sequence minOccurs="0" maxOccurs="unbounded">
++				<xsd:element name="parameter" type="parametertype" />
++			</xsd:sequence>
++			<xsd:choice minOccurs="0" maxOccurs="unbounded">				
++				<xsd:element name="option" minOccurs="0">
++					<xsd:complexType>
++						<xsd:complexContent>
++							<xsd:extension base="parbasetype">
++								<xsd:attribute name="value" type="xsd:string" use="required" />
++								<xsd:attribute name="label" type="xsd:string" use="optional" />
++								<xsd:attribute name="default" type="xsd:boolean"/>
++							</xsd:extension>
++						</xsd:complexContent>
++					</xsd:complexType>
++				</xsd:element>
++			</xsd:choice>
++			<xsd:sequence minOccurs="0" maxOccurs="unbounded">
++				<xsd:element name="reference" type="nameonly" />
++			</xsd:sequence>
++			<xsd:sequence minOccurs="0" maxOccurs="unbounded">
++				<xsd:element name="help" type="helptype"/>	
++			</xsd:sequence>
++		</xsd:sequence>
++		
++		<xsd:attribute name="type" use="required">
++		     <xsd:simpleType>
++				<xsd:restriction base="xsd:string">
++					<xsd:enumeration value="integer" />
++					<xsd:enumeration value="integer+" />
++					<xsd:enumeration value="decimal" />
++					<xsd:enumeration value="path" />
++					<xsd:enumeration value="file" />
++					<xsd:enumeration value="choice" />
++					<xsd:enumeration value="alternative" />
++					<xsd:enumeration value="string" />
++					<xsd:enumeration value="combination" />
++					<xsd:enumeration value="selector" />
++				</xsd:restriction>
++			</xsd:simpleType>
++		</xsd:attribute>
++		
++		<xsd:attribute name="maximum" type="xsd:integer"/>
++		<xsd:attribute name="minimum" type="xsd:integer"/>
++		<xsd:attribute name="template" type="xsd:boolean" default="false" use="optional" />
++		<xsd:attribute name="optional" type="xsd:boolean" default="true" />
++	</xsd:complexType>
++	
++	<xsd:complexType name="needstype">
++		<xsd:attribute name="type" type="xsd:string" use="required" />
++		<xsd:attribute name="name" type="xsd:string" use="required" />
++	
++		<xsd:attribute name="value" />
++		<xsd:attribute name="optional" type="xsd:boolean" />
++		<xsd:attribute name="minoccur" type="xsd:integer" />
++		<xsd:attribute name="maxoccur" type="xsd:string" />
++	</xsd:complexType>
++	
++	<xsd:complexType name="baseType">
++		<xsd:sequence minOccurs="0" maxOccurs="1">
++			<xsd:element name="help" type="helptype" />		
++		</xsd:sequence>
++		<xsd:attribute name="key" type="xsd:string" use="required" />
++	</xsd:complexType>
++	
++	<xsd:complexType name="helptype" mixed="true">
++		<xsd:choice minOccurs="0" maxOccurs="unbounded">
++			<xsd:element name="section" type="nameonly" />
++			<xsd:element name="replace" type="nameonly" />
++		</xsd:choice>
++	</xsd:complexType>
++	
++</xsd:schema>
+
+Property changes on: ../trunk-jpl/src/java/build/resources/config_schema.xsd
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/default_config.xml
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/default_config.xml	(revision 0)
++++ ../trunk-jpl/src/java/build/resources/default_config.xml	(revision 17993)
+@@ -0,0 +1,1284 @@
++<inishell_config application="ISSM prototype">
++
++<!-- mesh -->
++<parameter key ="Dimension" type="alternative" optional="false">
++     <section name="mesh" />
++     <option value="0" type="string" default="true">
++        <help> dimension is 0 </help>
++     </option>
++     <option value="3" type="string">
++        <help> dimension is 3 </help>
++       <!-- Elements and vertices of the original 2d mesh -->
++          <parameter key ="x2d" type="double" default="N/A">
++              <help> vertices x coordinate [m] </help>
++          </parameter>
++          <parameter key ="y2d" type="double" default="N/A">
++              <help> vertices y coordinate [m] </help>
++          </parameter>
++          <parameter key ="elements2d" type="double" default="N/A">
++              <help> vertex indices of the mesh elements </help>
++          </parameter>
++          <parameter key ="numberofvertices2d" type="double" default="0">
++              <help> number of vertices </help>
++          </parameter>
++          <parameter key ="numberofelements2d" type="double" default="0">
++              <help> number of elements </help>
++          </parameter>
++     </option>
++     <help> select a mesh dimension 0(default) or 3 </help>
++</parameter>
++<frame key="1" label="Elements and vertices">
++<section name="mesh" />
++  <parameter key ="numberofelements" type="double" default="0">
++     <section name="mesh" />
++     <help> number of elements </help>
++  </parameter>
++  <parameter key ="numberofvertices" type="double" default="0">
++     <section name="mesh" />
++     <help> number of verticies </help>
++  </parameter>
++  <parameter key ="elements" type="double" default="N/A">
++     <section name="mesh" />
++     <help> vertex indices of the mesh elements </help>
++  </parameter>
++  <parameter key ="x" type="double" default="N/A">
++     <section name="mesh" />
++     <help> vertices x coordinate [m] </help>
++  </parameter>
++  <parameter key ="y" type="double" default="N/A">
++     <section name="mesh" />
++     <help> vertices y coordinate [m] </help>
++  </parameter>
++  <parameter key ="z" type="double" default="N/A">
++     <section name="mesh" />
++     <help> vertices z coordinate [m] </help>
++  </parameter>
++  <parameter key ="edges" type="double" default="N/A">
++     <section name="mesh" />
++     <help> edges of the 2d mesh (vertex1 vertex2 element1 element2) </help>
++  </parameter>
++  <parameter key ="numberofedges" type="double" default="0">
++     <section name="mesh" />
++     <help> number of edges of the 2d mesh </help>
++  </parameter>
++</frame>
++<frame key="2" label="Properties">
++<section name="mesh" />
++  <parameter key ="selected dimension" type="double" default="0">
++     <section name="mesh" />
++     <help> mesh dimension </help>
++  </parameter>
++  <parameter key ="numberoflayers" type="double" default="0">
++     <section name="mesh" />
++     <help> number of extrusion layers </help>
++  </parameter>
++  <parameter key ="vertexonbed" type="double" default="N/A">
++     <section name="mesh" />
++     <help> lower vertices flags list </help>
++  </parameter>
++  <parameter key ="elementonbed" type="double" default="N/A">
++     <section name="mesh" />
++     <help> lower elements flags list </help>
++  </parameter>
++  <parameter key ="vertexonsurface" type="double" default="N/A">
++     <section name="mesh" />
++     <help> upper vertices flags list </help>
++  </parameter>
++  <parameter key ="elementonsurface" type="double" default="N/A">
++     <section name="mesh" />
++     <help> upper element flag list </help>
++  </parameter>
++  <parameter key ="uppervertex" type="double" default="N/A">
++     <section name="mesh" />
++     <help> upper vertex list (NaN for vertex on the upper surface) </help>
++  </parameter>
++  <parameter key ="upperelements" type="double" default="N/A">
++     <section name="mesh" />
++     <help> upper element list (NaN for element on the upper layer) </help>
++  </parameter>
++  <parameter key ="lowervertex" type="double" default="N/A">
++     <section name="mesh" />
++     <help> lower vertex list (NaN for vertex on the lower surface) </help>
++  </parameter>
++  <parameter key ="lowerelements" type="double" default="N/A">
++     <section name="mesh" />
++     <help> lower element list (NaN for element on the lower layer </help>
++  </parameter>
++  <parameter key ="vertexonboundary" type="double" default="N/A">
++     <section name="mesh" />
++     <help> vertices on the boundary of the domain flag list </help>
++  </parameter>
++  <parameter key ="segments" type="double" default="N/A">
++     <section name="mesh" />
++     <help> edges on domain boundary (vertex1 vertex2 element) </help>
++  </parameter>
++  <parameter key ="segmentmarkers" type="double" default="N/A">
++     <section name="mesh" />
++     <help> number associated to each segment </help>
++  </parameter>
++  <parameter key ="vertexconnectivity" type="double" default="N/A">
++     <section name="mesh" />
++     <help> list of vertices connected to vertex_i </help>
++  </parameter>
++  <parameter key ="elementconnectivity" type="double" default="N/A">
++     <section name="mesh" />
++     <help> list of vertices connected to element_i </help>
++  </parameter>
++  <parameter key ="average_vertex_connectivity" type="double" default="25">
++     <section name="mesh" />
++     <help> average number of vertices connected to one vertex </help>
++  </parameter>
++</frame>
++<frame key="3" label="Extracted Model">
++<section name="mesh" />
++  <parameter key ="extractedvertices" type="double" default="N/A">
++     <section name="mesh" />
++     <help> vertices extracted from the model </help>
++  </parameter>
++  <parameter key ="extractedelements" type="double" default="N/A">
++     <section name="mesh" />
++     <help> elements extracted from the model </help>
++  </parameter>
++</frame>
++<frame key="4" label="Projection">
++<section name="mesh" />
++  <parameter key ="lat" type="double" default="N/A">
++     <section name="mesh" />
++     <help> vertices latitude [degrees] </help>
++  </parameter>
++  <parameter key ="long" type="double" default="N/A">
++     <section name="mesh" />
++     <help> verticies longitude [degrees] </help>
++  </parameter>
++  <parameter key ="hemisphere" type="double" default="N/A">
++     <section name="mesh" />
++     <help> Indicate hemisphere 'n' or 's' </help>
++  </parameter></frame>
++
++
++<!-- mask -->
++<parameter key ="groundedice_levelset" type="double" default="NaN">
++     <section name="mask" />
++     <help> is ice grounded ? grounded ice if > 0, grounding line position if = 0, floating ice if &amp;lt; 0 </help>
++</parameter>
++<parameter key ="ice_levelset" type="double" default="NaN">
++     <section name="mask" />
++     <help> presence of ice if > 0, icefront position if = 0, no ice if &amp;lt; 0 </help>
++</parameter>
++
++<!-- geometry -->
++<frame key="1" label="Geometry parameters">
++<section name="geometry" />
++<parameter key ="surface" type="path" optional="false">
++     <section name="geometry" />
++     <help> surface elevation [m] </help>
++</parameter>
++<parameter key ="thickness" type="path" optional="false">
++     <section name="geometry" />
++     <help> ice thickness [m] </help>
++</parameter>
++<parameter key ="bed" type="path" optional="false">
++     <section name="geometry" />
++     <help> bed elevation [m] </help>
++</parameter>
++<parameter key ="bathymetry" type="double" default="N/A">
++     <section name="geometry" />
++     <help> bathymetry elevation [m] </help>
++</parameter>
++<parameter key ="hydrostatic_ratio" type="double" default="N/A">
++     <section name="geometry" />
++     <help> coefficient for ice shelves; thickness correction: hydrostatic_ratio H_obs+ (1-hydrostatic_ratio) H_hydro </help>
++</parameter></frame>
++
++
++<!-- constants -->
++<parameter key ="g" type="double" default="9.81">
++     <section name="constants" />
++     <help> gravitational acceleration [m/s^2] </help>
++</parameter>
++<parameter key ="yts" type="double" default="31536000">
++     <section name="constants" />
++     <help> number of seconds in a year [s/yr] </help>
++</parameter>
++<parameter key ="referencetemperature" type="double" default="223.15">
++     <section name="constants" />
++     <help> reference temperature used in the enthalpy model [K] </help>
++</parameter>
++
++<!-- surfaceforcings(SMB) -->
++<parameter key ="mass_balance" type="double" default="NaN">
++     <section name="surfaceforcings(SMB)" />
++     <help> surface mass balance [m/yr ice eq] </help>
++</parameter>
++
++<!-- basalforcings -->
++<parameter key ="melting_rate" type="double" default="NaN">
++     <section name="basalforcings" />
++     <help> basal melting rate (positive if melting) [m/yr] </help>
++</parameter>
++<parameter key ="melting_rate_correction" type="double" default="NaN">
++     <section name="basalforcings" />
++     <help> additional melting applied to compensate for dh/dt [m/yr] </help>
++</parameter>
++<parameter key ="geothermalflux" type="double" default="NaN">
++     <section name="basalforcings" />
++     <help> geothermal heat flux [W/m^2] </help>
++</parameter>
++
++<!-- materials -->
++<parameter key ="rho_ice" type="double" default="917">
++     <section name="materials" />
++     <help> ice density [kg/m^3] </help>
++</parameter>
++<parameter key ="rho_water" type="double" default="1023">
++     <section name="materials" />
++     <help> ocean water density [kg/m^3] </help>
++</parameter>
++<parameter key ="rho_freshwater" type="double" default="1000">
++     <section name="materials" />
++     <help> fresh water density [kg/m^3] </help>
++</parameter>
++<parameter key ="mu_water" type="double" default="0.001787">
++     <section name="materials" />
++     <help> water viscosity [N s/m^2] </help>
++</parameter>
++<parameter key ="heatcapacity" type="double" default="2093">
++     <section name="materials" />
++     <help> heat capacity [J/kg/K] </help>
++</parameter>
++<parameter key ="latentheat" type="double" default="334000">
++     <section name="materials" />
++     <help> latent heat of fusion [J/kg] </help>
++</parameter>
++<parameter key ="thermalconductivity" type="double" default="2.4">
++     <section name="materials" />
++     <help> ice thermal conductivity [W/m/K] </help>
++</parameter>
++<parameter key ="temperateiceconductivity" type="double" default="0.24">
++     <section name="materials" />
++     <help> temperate ice thermal conductivity [W/m/K] </help>
++</parameter>
++<parameter key ="meltingpoint" type="double" default="273.15">
++     <section name="materials" />
++     <help> melting point of ice at 1atm in K </help>
++</parameter>
++<parameter key ="beta" type="double" default="9.8e-08">
++     <section name="materials" />
++     <help> rate of change of melting point with pressure [K/Pa] </help>
++</parameter>
++<parameter key ="mixed_layer_capacity" type="double" default="3974">
++     <section name="materials" />
++     <help> mixed layer capacity [W/kg/K] </help>
++</parameter>
++<parameter key ="thermal_exchange_velocity" type="double" default="0.0001">
++     <section name="materials" />
++     <help> thermal exchange velocity [m/s] </help>
++</parameter>
++<parameter key ="rheology_B" type="double" default="N/A">
++     <section name="materials" />
++     <help> flow law parameter [Pa/s^(1/n)] </help>
++</parameter>
++<parameter key ="rheology_n" type="double" default="N/A">
++     <section name="materials" />
++     <help> Glens flow law exponent </help>
++</parameter>
++<parameter key ="rheology_law" type="char" default="'Paterson'">
++     <section name="materials" />
++     <help> law for the temperature dependance of the rheology: "None", "Paterson",  "Arrhenius" or "LliboutryDuval" </help>
++</parameter>
++<parameter key ="lithosphere_shear_modulus" type="double" default="67000000000">
++     <section name="materials" />
++     <help> Lithosphere shear modulus [Pa] </help>
++</parameter>
++<parameter key ="lithosphere_density" type="double" default="3.32">
++     <section name="materials" />
++     <help> Lithosphere density [g/cm^-3] </help>
++</parameter>
++<parameter key ="mantle_shear_modulus" type="double" default="145000000000">
++     <section name="materials" />
++     <help> Mantle shear modulus [Pa] </help>
++</parameter>
++<parameter key ="mantle_density" type="double" default="3.34">
++     <section name="materials" />
++     <help> Mantle density [g/cm^-3] </help>
++</parameter>
++
++
++<!-- damage -->
++<!-- Note: this class depends on different input of law -->
++<parameter key ="law" type="alternative" optional="false">
++	<section name="damage" />
++	<option value="undamage" type="string" default="true">
++		<help> law = undamage </help>
++	</option>
++	<option value="pralong" type="string" default="false">
++		<help> law = pralong </help>
++		<parameter key ="stress_threshold" type="double" default="0">
++			<help> damage stress threshold [Pa] </help>
++		</parameter>
++		<parameter key ="c1" type="double" default="0">
++			<help> damage parameter 1 </help>
++		</parameter>
++		<parameter key ="c2" type="double" default="0">
++			<help> damage parameter 2 </help>
++		</parameter>
++		<parameter key ="c3" type="double" default="0">
++			<help> damage parameter 3 [W/m^2] </help>
++		</parameter>
++		<parameter key ="c4" type="double" default="0">
++			<help> damage parameter 4 </help>
++		</parameter>
++		<parameter key ="healing" type="double" default="0">
++			<help> damage healing parameter 1 </help>
++		</parameter>
++		<parameter key ="equiv_stress" type="double" default="0">
++			<help> 0: von Mises </help>
++		</parameter>
++		<parameter key ="requested_outputs" type="cell" default="{'default'}">
++			<help> additional outputs requested </help>
++		</parameter>
++	</option>
++	<help> damage law (string) from {"undamaged","pralong"} </help>
++</parameter>
++<parameter key ="D" type="double" default="0">
++     <section name="damage" />
++     <help> damage tensor (scalar) </help>
++</parameter>
++<parameter key ="law" type="char" default="undamaged">
++     <section name="damage" />
++     <help> damage law (string) from {"undamaged","pralong"} </help>
++</parameter>
++<parameter key ="spcdamage" type="double" default="NaN">
++     <section name="damage" />
++     <help> damage constraints (NaN means no constraint) </help>
++</parameter>
++<parameter key ="max_damage" type="double" default="0.99999">
++     <section name="damage" />
++     <help> maximum possible damage (0&amp;lt;=max_damage&amp;lt;1) </help>
++</parameter>
++<parameter key ="stabilization" type="double" default="2">
++     <section name="damage" />
++     <help> 0: no, 1: artificial_diffusivity, 2: SUPG </help>
++</parameter>
++<parameter key ="maxiter" type="double" default="100">
++     <section name="damage" />
++     <help> maximum number of non linear iterations </help>
++</parameter>
++<parameter key ="penalty_lock" type="double" default="0">
++     <section name="damage" />
++     <help> stabilize unstable damage constraints that keep zigzagging after n iteration (default is 0, no stabilization) </help>
++</parameter>
++<parameter key ="penalty_threshold" type="double" default="0">
++     <section name="damage" />
++     <help> threshold to declare convergence of damage evolution solution (default is 0) </help>
++</parameter>
++<parameter key ="penalty_factor" type="double" default="3">
++     <section name="damage" />
++     <help> scaling exponent (default is 3) </help>
++</parameter>
++
++
++<!-- Friction: Sigma= drag^2 * Neff ^r * u ^s, with Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p -->
++<frame key="1" label="Friction: Sigma= drag^2 * Neff ^r * u ^s, with Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p">
++<section name="friction" />
++<parameter key ="coefficient" type="double" default="N/A">
++     <section name="friction" />
++     <help> friction coefficient [SI] </help>
++</parameter>
++<parameter key ="p" type="double" default="N/A">
++     <section name="friction" />
++     <help> p exponent </help>
++</parameter>
++<parameter key ="q" type="double" default="N/A">
++     <section name="friction" />
++     <help> q exponent </help>
++</parameter></frame>
++
++
++<!-- flowequation -->
++<frame key="1" label="Flow equation parameters">
++<section name="flowequation" />
++<parameter key ="isSIA" type="double" default="0">
++     <section name="flowequation" />
++     <help> is the Shallow Ice Approximation (SIA) used ? </help>
++</parameter>
++<parameter key ="isSSA" type="double" default="0">
++     <section name="flowequation" />
++     <help> is the Shelfy-Stream Approximation (SSA) used ? </help>
++</parameter>
++<parameter key ="isL1L2" type="double" default="0">
++     <section name="flowequation" />
++     <help> is the L1L2 approximation used ? </help>
++</parameter>
++<parameter key ="isHO" type="double" default="0">
++     <section name="flowequation" />
++     <help> is the Higher-Order (HO) approximation used ? </help>
++</parameter>
++<parameter key ="isFS" type="double" default="0">
++     <section name="flowequation" />
++     <help> are the Full-FS (FS) equations used ? </help>
++</parameter>
++<parameter key ="fe_SSA" type="char" default="'P1'">
++     <section name="flowequation" />
++     <help> Finite Element for SSA  "P1", "P1bubble" "P1bubblecondensed" "P2" </help>
++</parameter>
++<parameter key ="fe_HO" type="char" default="'P1'">
++     <section name="flowequation" />
++     <help> Finite Element for HO   "P1" "P1bubble" "P1bubblecondensed" "P1xP2" "P2xP1" "P2" </help>
++</parameter>
++<parameter key ="fe_FS" type="char" default="'MINIcondensed'">
++     <section name="flowequation" />
++     <help> Finite Element for FS   "P1P1" (debugging only) "P1P1GLS" "MINIcondensed" "MINI" "TaylorHood" </help>
++</parameter>
++<parameter key ="vertex_equation" type="double" default="N/A">
++     <section name="flowequation" />
++     <help> flow equation for each vertex </help>
++</parameter>
++<parameter key ="element_equation" type="double" default="N/A">
++     <section name="flowequation" />
++     <help> flow equation for each element </help>
++</parameter>
++<parameter key ="borderSSA" type="double" default="N/A">
++     <section name="flowequation" />
++     <help> vertices on SSAs border (for tiling) </help>
++</parameter>
++<parameter key ="borderHO" type="double" default="N/A">
++     <section name="flowequation" />
++     <help> vertices on HOs border (for tiling) </help>
++</parameter>
++<parameter key ="borderFS" type="double" default="N/A">
++     <section name="flowequation" />
++     <help> vertices on FS border (for tiling) </help>
++</parameter></frame>
++
++
++<!-- Timestepping -->
++<parameter key ="start_time" type="double" default="0">
++     <section name="timestepping" />
++     <help> simulation starting time [yr] </help>
++</parameter>
++<parameter key ="final_time" type="double" default="5">
++     <section name="timestepping" />
++     <help> final time to stop the simulation [yr] </help>
++</parameter>
++<parameter key ="time_step" type="double" default="0.5">
++     <section name="timestepping" />
++     <help> length of time steps [yr] </help>
++</parameter>
++<parameter key ="time_adapt" type="double" default="0">
++     <section name="timestepping" />
++     <help> use cfl condition to define time step ? (0 or 1)  </help>
++</parameter>
++<parameter key ="cfl_coefficient" type="double" default="0.5">
++     <section name="timestepping" />
++     <help> coefficient applied to cfl condition </help>
++</parameter>
++
++
++<!-- initialization -->
++<frame key="1" label="Initial field values">
++<section name="initialization" />
++<parameter key ="vx" type="double" default="NaN">
++     <section name="initialization" />
++     <help> x component of velocity [m/yr] </help>
++</parameter>
++<parameter key ="vy" type="double" default="NaN">
++     <section name="initialization" />
++     <help> y component of velocity [m/yr] </help>
++</parameter>
++<parameter key ="vz" type="double" default="NaN">
++     <section name="initialization" />
++     <help> z component of velocity [m/yr] </help>
++</parameter>
++<parameter key ="vel" type="double" default="NaN">
++     <section name="initialization" />
++     <help> velocity norm [m/yr] </help>
++</parameter>
++<parameter key ="pressure" type="double" default="NaN">
++     <section name="initialization" />
++     <help> pressure field [Pa] </help>
++</parameter>
++<parameter key ="temperature" type="double" default="NaN">
++     <section name="initialization" />
++     <help> fraction of water in the ice </help>
++</parameter>
++<parameter key ="waterfraction" type="double" default="NaN">
++     <section name="initialization" />
++     <help> ice thickness [m] </help>
++</parameter>
++<parameter key ="sediment_head" type="double" default="NaN">
++     <section name="initialization" />
++     <help> sediment water head of subglacial system [m] </help>
++</parameter>
++<parameter key ="epl_head" type="double" default="NaN">
++     <section name="initialization" />
++     <help> epl water head of subglacial system [m] </help>
++</parameter>
++<parameter key ="watercolumn" type="double" default="NaN">
++     <section name="initialization" />
++     <help> thickness of subglacial water [m] </help>
++</parameter></frame>
++
++
++<!-- rifts -->
++<parameter key ="riftstruct" type="double" default="NaN">
++     <section name="rifts" />
++     <help> structure containing all rift information (vertices coordinates, segments, type of melange, ...) </help>
++</parameter>
++<parameter key ="riftproperties" type="double" default="NaN">
++     <section name="rifts" />
++     <help> N/A </help>
++</parameter>
++
++
++<!-- Debug -->
++<parameter key ="valgrind" type="logical" optional="false">
++     <section name="debug" />
++        <option value="false" type="string" default="true"></option>
++     <help> use Valgrind to debug (0 or 1) </help>
++</parameter>
++<parameter key ="gprof" type="logical" optional="false">
++     <section name="debug" />
++        <option value="false" type="string" default="true"></option>
++     <help> use gnu-profiler to find out where the time is spent </help>
++</parameter>
++<parameter key ="profiling" type="logical" optional="false">
++     <section name="debug" />
++        <option value="false" type="string" default="true"></option>
++     <help> enables profiling (memory, flops, time) </help>
++</parameter>
++
++<!-- verbose -->
++<parameter key ="mprocessor" type="logical" optional="false">
++     <section name="verbose" />
++        <option value="false" type="string" default="true"></option>
++     <help>  </help>
++</parameter>
++<parameter key ="module" type="logical" optional="false">
++     <section name="verbose" />
++        <option value="false" type="string" default="true"></option>
++     <help>  </help>
++</parameter>
++<parameter key ="solution" type="logical" optional="false">
++     <section name="verbose" />
++        <option value="true" type="string" default="true"></option>
++     <help>  </help>
++</parameter>
++<parameter key ="solver" type="logical" optional="false">
++     <section name="verbose" />
++        <option value="false" type="string" default="true"></option>
++     <help>  </help>
++</parameter>
++<parameter key ="convergence" type="logical" optional="false">
++     <section name="verbose" />
++        <option value="false" type="string" default="true"></option>
++     <help>  </help>
++</parameter>
++<parameter key ="control" type="logical" optional="false">
++     <section name="verbose" />
++        <option value="true" type="string" default="true"></option>
++     <help>  </help>
++</parameter>
++<parameter key ="qmu" type="logical" optional="false">
++     <section name="verbose" />
++        <option value="true" type="string" default="true"></option>
++     <help>  </help>
++</parameter>
++<parameter key ="autodiff" type="logical" optional="false">
++     <section name="verbose" />
++        <option value="false" type="string" default="true"></option>
++     <help>  </help>
++</parameter>
++
++<!-- settings -->
++<parameter key ="results_on_nodes" type="double" default="0">
++     <section name="settings" />
++     <help> results are output for all the nodes of each element </help>
++</parameter>
++<parameter key ="io_gather" type="double" default="1">
++     <section name="settings" />
++     <help> I/O gathering strategy for result outputs (default 1) </help>
++</parameter>
++<parameter key ="lowmem" type="double" default="0">
++     <section name="settings" />
++     <help> is the memory limited ? (0 or 1) </help>
++</parameter>
++<parameter key ="output_frequency" type="double" default="1">
++     <section name="settings" />
++     <help> frequency at which results are saved in all solutions with multiple time_steps </help>
++</parameter>
++<parameter key ="waitonlock" type="double" default="Inf">
++     <section name="settings" />
++     <help> maximum number of minutes to wait for batch results (NaN to deactivate) </help>
++</parameter>
++<parameter key ="upload_server" type="char" default="N/A">
++     <section name="settings" />
++     <help> server hostname where model should be uploaded </help>
++</parameter>
++<parameter key ="upload_path" type="char" default="N/A">
++     <section name="settings" />
++     <help> path on server where model should be uploaded </help>
++</parameter>
++<parameter key ="upload_login" type="char" default="N/A">
++     <section name="settings" />
++     <help> server login </help>
++</parameter>
++<parameter key ="upload_port" type="double" default="0">
++     <section name="settings" />
++     <help> port login (default is 0) </help>
++</parameter>
++<parameter key ="upload_filename" type="char" default="N/A">
++     <section name="settings" />
++     <help> unique id generated when uploading the file to server </help>
++</parameter>
++
++<!-- generic -->
++<parameter key ="name" type="char" default="'XPS'">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="login" type="char" default="N/A">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="np" type="double" default="1">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="port" type="double" default="0">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="codepath" type="char" default=":/home/casper/work/issm/trunk:/home/casper/work/issm/trunk/bin">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="executionpath" type="char" default=":/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk/execution">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="etcpath" type="char" default=":/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk/etc">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="valgrind" type="char" default=":/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk/externalpackages/valgrind/install/bin/valgrind">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="valgrindlib" type="char" default=":/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk/externalpackages/valgrind/install/lib/libmpidebug.so">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="valgrindsup" type="char" default=":/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk/externalpackages/valgrind/issm.supp">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="verbose" type="double" default="1">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++
++<!-- balancethickness -->
++<parameter key ="spcthickness" type="double" default="N/A">
++     <section name="balancethickness" />
++     <help> thickness constraints (NaN means no constraint) [m] </help>
++</parameter>
++<parameter key ="thickening_rate" type="double" default="N/A">
++     <section name="balancethickness" />
++     <help> ice thickening rate used in the mass conservation (dh/dt) [m/yr] </help>
++</parameter>
++<parameter key ="stabilization" type="double" default="1">
++     <section name="balancethickness" />
++     <help> 0: None, 1: SU, 2: SSAs artificial diffusivity, 3:DG </help>
++</parameter>
++
++<!-- StressBalance solution parameters: -->
++<frame key="1" label="Convergence criteria">
++<section name="stressbalance" />
++<parameter key ="restol" type="double" default="0.0001">
++     <section name="stressbalance" />
++     <help> mechanical equilibrium residual convergence criterion </help>
++</parameter>
++<parameter key ="reltol" type="double" default="0.01">
++     <section name="stressbalance" />
++     <help> velocity relative convergence criterion, NaN: not applied </help>
++</parameter>
++<parameter key ="abstol" type="double" default="10">
++     <section name="stressbalance" />
++     <help> velocity absolute convergence criterion, NaN: not applied </help>
++</parameter>
++<parameter key ="isnewton" type="double" default="0">
++     <section name="stressbalance" />
++     <help> 0: Picards fixed point, 1: Newtons method, 2: hybrid </help>
++</parameter>
++<parameter key ="maxiter" type="double" default="100">
++     <section name="stressbalance" />
++     <help> maximum number of nonlinear iterations </help>
++</parameter>
++<parameter key ="viscosity_overshoot" type="double" default="0">
++     <section name="stressbalance" />
++     <help> over-shooting constant new=new+C*(new-old) </help>
++</parameter>
++</frame>
++<frame key="2" label="Boundary conditions">
++<section name="stressbalance" />
++<parameter key ="spcvx" type="double" default="N/A">
++     <section name="stressbalance" />
++     <help> x-axis velocity constraint (NaN means no constraint) [m/yr] </help>
++</parameter>
++<parameter key ="spcvy" type="double" default="N/A">
++     <section name="stressbalance" />
++     <help> y-axis velocity constraint (NaN means no constraint) [m/yr] </help>
++</parameter>
++<parameter key ="spcvz" type="double" default="N/A">
++     <section name="stressbalance" />
++     <help> z-axis velocity constraint (NaN means no constraint) [m/yr] </help>
++</parameter>
++</frame>
++<frame key="3" label="Rift options">
++<section name="stressbalance" />
++<parameter key ="rift_penalty_threshold" type="double" default="0">
++     <section name="stressbalance" />
++     <help> threshold for instability of mechanical constraints </help>
++</parameter>
++<parameter key ="rift_penalty_lock" type="double" default="10">
++     <section name="stressbalance" />
++     <help> number of iterations before rift penalties are locked </help>
++</parameter>
++</frame>
++<frame key="4" label="Other">
++<section name="stressbalance" />
++<parameter key ="shelf_dampening" type="double" default="0">
++     <section name="stressbalance" />
++     <help> use dampening for floating ice ? Only for FS model </help>
++</parameter>
++<parameter key ="FSreconditioning" type="double" default="10000000000000">
++     <section name="stressbalance" />
++     <help> multiplier for incompressibility equation. Only for FS model </help>
++</parameter>
++<parameter key ="referential" type="double" default="N/A">
++     <section name="stressbalance" />
++     <help> local referential </help>
++</parameter>
++<parameter key ="loadingforce" type="double" default="N/A">
++     <section name="stressbalance" />
++     <help> loading force applied on each point [N/m^3] </help>
++</parameter>
++<parameter key ="requested_outputs" type="cell" default="{'default'}">
++     <section name="stressbalance" />
++     <help> additional outputs requested </help>
++</parameter>
++</frame>
++
++
++<!-- groundingline -->
++<frame key="1" label="Grounding line migration parameters">
++<section name="groundingline" />
++<parameter key ="migration" type="char" default="'None'">
++     <section name="groundingline" />
++     <help> type of grounding line migration: "SoftMigration","AgressiveMigration" or "None" </help>
++</parameter>
++<parameter key ="melting_rate" type="double" default="0">
++     <section name="groundingline" />
++     <help> melting rate applied when previously grounded parts start floating [m/yr] </help>
++</parameter></frame>
++
++
++<!-- Hydrology -->
++<frame key="1" label="Hydrologyshreve solution parameters">
++<section name="hydrologyshreve" />
++<parameter key ="spcwatercolumn" type="double" default="N/A">
++     <section name="hydrologyshreve" />
++     <help> water thickness constraints (NaN means no constraint) [m] </help>
++</parameter>
++<parameter key ="n" type="double" default="0.02">
++     <section name="hydrologyshreve" />
++     <help> Manning roughness coefficient </help>
++</parameter>
++<parameter key ="CR" type="double" default="0.01">
++     <section name="hydrologyshreve" />
++     <help> tortuosity parameter </help>
++</parameter>
++<parameter key ="p" type="double" default="2">
++     <section name="hydrologyshreve" />
++     <help> dimensionless exponent in Manning velocity formula </help>
++</parameter>
++<parameter key ="q" type="double" default="1">
++     <section name="hydrologyshreve" />
++     <help> dimensionless exponent in Manning velocity formula </help>
++</parameter>
++<parameter key ="kn" type="double" default="0">
++     <section name="hydrologyshreve" />
++     <help> parameter in effective pressure formula </help>
++</parameter>
++<parameter key ="stabilization" type="double" default="1">
++     <section name="hydrologyshreve" />
++     <help> artificial diffusivity (default is 1). can be more than 1 to increase diffusivity. </help>
++</parameter>
++</frame>
++<!-- masstransport -->
++<frame key="1" label="Masstransport solution parameters">
++<section name="masstransport" />
++  <parameter key ="spcthickness" type="double" default="N/A">
++     <section name="masstransport" />
++     <help> thickness constraints (NaN means no constraint) [m] </help>
++  </parameter>
++  <parameter key ="calvingrate" type="double" default="N/A">
++     <section name="masstransport" />
++     <help> calving rate at given location [m/a] </help>
++  </parameter>
++  <parameter key ="isfreesurface" type="double" default="0">
++     <section name="masstransport" />
++     <help> do we use free surfaces (FS only) are mass conservation </help>
++  </parameter>
++  <parameter key ="min_thickness" type="double" default="1">
++     <section name="masstransport" />
++     <help> minimum ice thickness allowed [m] </help>
++  </parameter>
++  <parameter key ="hydrostatic_adjustment" type="char" default="'Absolute'">
++     <section name="masstransport" />
++     <help> adjustment of ice shelves surface and bed elevations: 'Incremental' or 'Absolute'  </help>
++  </parameter>
++  <parameter key ="stabilization" type="double" default="1">
++     <section name="masstransport" />
++     <help> 0: no, 1:  artificial_diffusivity, 2: streamline upwinding, 3: discontinuous Galerkin </help>
++  </parameter>
++</frame>
++<frame key="2" label="Penalty options">
++<section name="masstransport" />
++  <parameter key ="vertex_pairing" type="double" default="N/A">
++     <section name="masstransport" />
++     <help> offset used by penalties: penalty = Kmax*10^offset </help>
++  </parameter>
++  <parameter key ="penalty_factor" type="double" default="3">
++     <section name="masstransport" />
++     <help> pairs of vertices that are penalized </help>
++  </parameter>
++  <parameter key ="requested_outputs" type="cell" default="{'default'}">
++     <section name="masstransport" />
++     <help> additional outputs requested </help>
++  </parameter>
++</frame>
++<!-- thermal -->
++<frame key="1" label="Thermal solution parameters">
++<section name="thermal" />
++  <parameter key ="spctemperature" type="double" default="N/A">
++     <section name="thermal" />
++     <help> temperature constraints (NaN means no constraint) [K] </help>
++  </parameter>
++  <parameter key ="penalty_threshold" type="double" default="0">
++     <section name="thermal" />
++     <help> 0: no, 1: artificial_diffusivity, 2: SUPG </help>
++  </parameter>
++  <parameter key ="stabilization" type="double" default="1">
++     <section name="thermal" />
++     <help> maximum number of non linear iterations </help>
++  </parameter>
++  <parameter key ="maxiter" type="double" default="100">
++     <section name="thermal" />
++     <help> stabilize unstable thermal constraints that keep zigzagging after n iteration (default is 0, no stabilization) </help>
++  </parameter>
++  <parameter key ="penalty_lock" type="double" default="0">
++     <section name="thermal" />
++     <help> threshold to declare convergence of thermal solution (default is 0)  </help>
++  </parameter>
++  <parameter key ="penalty_factor" type="double" default="3">
++     <section name="thermal" />
++     <help> scaling exponent (default is 3) </help>
++  </parameter>
++  <parameter key ="isenthalpy" type="double" default="0">
++     <section name="thermal" />
++     <help> use an enthalpy formulation to include temperate ice (default is 0) </help>
++  </parameter>
++  <parameter key ="isdynamicbasalspc" type="double" default="0">
++     <section name="thermal" />
++     <help> enable dynamic setting of basal forcing. required for enthalpy formulation (default is 0)  </help>
++  </parameter>
++  <parameter key ="requested_outputs" type="cell" default="{'default'}">
++     <section name="thermal" />
++     <help> additional outputs requested </help>
++  </parameter>
++</frame>
++<!-- steadystate -->
++<frame key="1" label="steadystate solution parameters">
++<section name="steadystate" />
++  <parameter key ="reltol" type="double" default="0.01">
++     <section name="steadystate" />
++     <help> relative tolerance criterion [K] </help>
++  </parameter>
++  <parameter key ="maxiter" type="double" default="100">
++     <section name="steadystate" />
++     <help> maximum number of iterations </help>
++  </parameter>
++  <parameter key ="requested_outputs" type="cell" default="{'default'}">
++     <section name="steadystate" />
++     <help> additional requested outputs </help>
++  </parameter>
++</frame>
++<!-- transient -->
++<frame key="1" label="transient solution parameters">
++<section name="transient" />
++  <parameter key ="ismasstransport" type="double" default="1">
++     <section name="transient" />
++     <help> indicates whether a masstransport solution is used in the transient </help>
++  </parameter>
++  <parameter key ="isstressbalance" type="double" default="1">
++     <section name="transient" />
++     <help> indicates whether a stressbalance solution is used in the transient </help>
++  </parameter>
++  <parameter key ="isthermal" type="double" default="1">
++     <section name="transient" />
++     <help> indicates whether a thermal solution is used in the transient </help>
++  </parameter>
++  <parameter key ="isgroundingline" type="double" default="0">
++     <section name="transient" />
++     <help> indicates whether a groundingline migration is used in the transient </help>
++  </parameter>
++  <parameter key ="isgia" type="double" default="0">
++     <section name="transient" />
++     <help> indicates whether a postglacial rebound model is used in the transient </help>
++  </parameter>
++  <parameter key ="isdamage" type="double" default="0">
++     <section name="transient" />
++     <help> indicates whether damage evolution is used in the transient </help>
++  </parameter>
++  <parameter key ="islevelset" type="double" default="0">
++     <section name="transient" />
++     <help> LEVEL SET DESCRIPTION...  </help>
++  </parameter>
++  <parameter key ="requested_outputs" type="cell" default="{'default'}">
++     <section name="transient" />
++     <help> list of additional outputs requested </help>
++  </parameter>
++</frame>
++<!-- gia -->
++<frame key="1" label="gia parameters">
++<section name="gia" />
++  <parameter key ="mantle_viscosity" type="double" default="N/A">
++     <section name="gia" />
++     <help> mantle viscosity[Pa s] </help>
++  </parameter>
++  <parameter key ="lithosphere_thickness" type="double" default="N/A">
++     <section name="gia" />
++     <help> lithosphere thickness (km) </help>
++  </parameter>
++  <parameter key ="cross_section_shape" type="double" default="1">
++     <section name="gia" />
++     <help> 1: square-edged (default). 2: elliptical.  See iedge in GiaDeflectionCore </help>
++  </parameter>
++</frame>
++<!-- autodiff -->
++<frame key="1" label="automatic differentiation parameters">
++<section name="autodiff" />
++  <parameter key ="isautodiff" type="logical" optional="false">
++     <section name="autodiff" />
++         <option value="false" type="string" default="true"></option>
++     <help> indicates if the automatic differentiation is activated </help>
++  </parameter>
++  <parameter key ="dependents" type="cell" default="(0x0)">
++     <section name="autodiff" />
++     <help> list of dependent variables </help>
++  </parameter>
++  <parameter key ="independents" type="cell" default="(0x0)">
++     <section name="autodiff" />
++     <help> list of independent variables </help>
++  </parameter>
++  <parameter key ="driver" type="char" default="'fos_forward'">
++     <section name="autodiff" />
++     <help> ADOLC driver ('fos_forward' or 'fov_forward') </help>
++  </parameter>
++  <parameter key ="obufsize" type="double" default="524288">
++     <section name="autodiff" />
++     <help> Number of operations per buffer (==OBUFSIZE in usrparms.h)  </help>
++  </parameter>
++  <parameter key ="lbufsize" type="double" default="524288">
++     <section name="autodiff" />
++     <help> Number of locations per buffer (==LBUFSIZE in usrparms.h) </help>
++  </parameter>
++  <parameter key ="cbufsize" type="double" default="524288">
++     <section name="autodiff" />
++     <help> Number of values per buffer (==CBUFSIZE in usrparms.h) </help>
++  </parameter>
++  <parameter key ="tbufsize" type="double" default="524288">
++     <section name="autodiff" />
++     <help> Number of taylors per buffer (&amp;lt;=TBUFSIZE in usrparms.h) </help>
++  </parameter>
++  <parameter key ="gcTriggerRatio" type="double" default="2">
++     <section name="autodiff" />
++     <help> free location block sorting/consolidation triggered if the ratio between allocated and used locations exceeds gcTriggerRatio </help>
++  </parameter>
++  <parameter key ="gcTriggerRatio" type="double" default="2">
++     <section name="autodiff" />
++     <help> free location block sorting/consolidation triggered if the allocated locations exceed gcTriggerMaxSize </help>
++  </parameter>
++</frame>
++<!-- flaim -->
++<frame key="1" label="Input:">
++<section name="flaim" />
++  <parameter key ="targets" type="char" default="N/A">
++     <section name="flaim" />
++     <help> name of kml output targets file </help>
++  </parameter>
++  <parameter key ="tracks" type="char" default="N/A">
++     <section name="flaim" />
++     <help> name of kml input tracks file </help>
++  </parameter>
++  <parameter key ="flightreqs" type="struct" default="N/A">
++     <section name="flaim" />
++     <help> structure of kml flight requirements (not used yet) </help>
++  </parameter>
++  <parameter key ="criterion" type="double" default="N/A">
++     <section name="flaim" />
++     <help> element or nodal criterion for flight path evaluation (metric) </help>
++  </parameter>
++</frame>
++<frame key="2" label="Arguments:">
++<section name="flaim" />
++  <parameter key ="gridsatequator" type="double" default="200000">
++     <section name="flaim" />
++     <help> number of grids at equator (determines resolution) </help>
++  </parameter>
++  <parameter key ="usevalueordering" type="logical" optional="false">
++     <section name="flaim" />
++         <option value="true" type="string" default="true"></option>
++     <help> flag to consider target values for flight path evaluation </help>
++  </parameter>
++  <parameter key ="split_antimeridian" type="logical" optional="false">
++     <section name="flaim" />
++         <option value="true" type="string" default="true"></option>
++     <help> flag to split polygons on the antimeridian </help>
++  </parameter>
++</frame>
++<frame key="3" label="Optimization:">
++<section name="flaim" />
++  <parameter key ="path_optimize" type="logical" optional="false">
++     <section name="flaim" />
++         <option value="false" type="string" default="true"></option>
++     <help> optimize? (default false) </help>
++  </parameter>
++  <parameter key ="opt_ndir" type="double" default="1">
++     <section name="flaim" />
++     <help> number of directions to test when moving a point.  If this value = 1, a random direction is tested. A value > 1 results in directions equally spaced from [0, 2*PI] being tested. For example, 4 would result in directions [0, PI/2, PI, 3PI/2] </help>
++  </parameter>
++  <parameter key ="opt_dist" type="double" default="25">
++     <section name="flaim" />
++     <help> specifies the distance in km (default 25) to move a randomly selected path point on each iteration </help>
++  </parameter>
++  <parameter key ="opt_niter" type="double" default="30000">
++     <section name="flaim" />
++     <help> number of iterations (default 30,000) to run for flightplan optimization, i.e. the number of times to randomly select a point and move it. </help>
++  </parameter>
++</frame>
++<frame key="4" label="Output:">
++<section name="flaim" />
++  <parameter key ="solution" type="char" default="N/A">
++     <section name="flaim" />
++     <help> name of kml solution file </help>
++  </parameter>
++  <parameter key ="quality" type="double" default="0">
++     <section name="flaim" />
++     <help> quality of kml solution </help>
++  </parameter>
++</frame>
++<!-- inversion -->
++<frame key="1" label="inversion parameters">
++<section name="inversion" />
++  <parameter key ="iscontrol" type="double" default="0">
++     <section name="inversion" />
++     <help> is inversion activated? </help>
++  </parameter>
++  <parameter key ="incomplete_adjoint" type="double" default="1">
++     <section name="inversion" />
++     <help> 1: linear viscosity, 0: non-linear viscosity </help>
++  </parameter>
++  <parameter key ="control_parameters" type="cell" default="{'FrictionCoefficient'}">
++     <section name="inversion" />
++     <help> ex: {'FrictionCoefficient'}, or {'MaterialsRheologyBbar'} </help>
++  </parameter>
++  <parameter key ="nsteps" type="double" default="20">
++     <section name="inversion" />
++     <help> number of optimization searches </help>
++  </parameter>
++  <parameter key ="cost_functions" type="double" default="101">
++     <section name="inversion" />
++     <help> indicate the type of response for each optimization step  </help>
++  </parameter>
++  <parameter key ="cost_functions_coefficients" type="double" default="N/A">
++     <section name="inversion" />
++     <help> cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter </help>
++  </parameter>
++  <parameter key ="cost_function_threshold" type="double" default="N/A">
++     <section name="inversion" />
++     <help> misfit convergence criterion. Default is 1%, NaN if not applied </help>
++  </parameter>
++  <parameter key ="maxiter_per_step" type="double" default="(20x1)">
++     <section name="inversion" />
++     <help> maximum iterations during each optimization step  </help>
++  </parameter>
++  <parameter key ="gradient_scaling" type="double" default="(20x1)">
++     <section name="inversion" />
++     <help> scaling factor on gradient direction during optimization, for each optimization step </help>
++  </parameter>
++  <parameter key ="step_threshold" type="double" default="(20x1)">
++     <section name="inversion" />
++     <help> decrease threshold for misfit, default is 30% </help>
++  </parameter>
++  <parameter key ="min_parameters" type="double" default="N/A">
++     <section name="inversion" />
++     <help> absolute minimum acceptable value of the inversed parameter on each vertex </help>
++  </parameter>
++  <parameter key ="max_parameters" type="double" default="N/A">
++     <section name="inversion" />
++     <help> absolute maximum acceptable value of the inversed parameter on each vertex </help>
++  </parameter>
++  <parameter key ="vx_obs" type="double" default="N/A">
++     <section name="inversion" />
++     <help> observed velocity x component [m/yr] </help>
++  </parameter>
++  <parameter key ="vy_obs" type="double" default="N/A">
++     <section name="inversion" />
++     <help> observed velocity y component [m/yr]  </help>
++  </parameter>
++  <parameter key ="vel_obs" type="double" default="N/A">
++     <section name="inversion" />
++     <help> observed velocity magnitude [m/yr] </help>
++  </parameter>
++  <parameter key ="thickness_obs" type="double" default="N/A">
++     <section name="inversion" />
++     <help> observed thickness [m]) </help>
++  </parameter>
++</frame>
++<frame key="2" label="Available cost functions">
++<section name="inversion" />
++  <parameter key ="SurfaceAbsVelMisfit" type="string" default="101">
++     <section name="inversion" />
++     <help>  </help>
++  </parameter>
++  <parameter key ="SurfaceRelVelMisfit" type="string" default="102">
++     <section name="inversion" />
++     <help>   </help>
++  </parameter>
++  <parameter key ="SurfaceLogVelMisfit" type="string" default="103">
++     <section name="inversion" />
++     <help>  </help>
++  </parameter>
++  <parameter key ="SurfaceLogVxVyMisfit" type="string" default="104">
++     <section name="inversion" />
++     <help>  </help>
++  </parameter>
++  <parameter key ="SurfaceAverageVelMisfit" type="string" default="105">
++     <section name="inversion" />
++     <help>   </help>
++  </parameter>
++  <parameter key ="ThicknessAbsMisfit" type="string" default="106">
++     <section name="inversion" />
++     <help>  </help>
++  </parameter>
++  <parameter key ="DragCoefficientAbsGradient" type="string" default="107">
++     <section name="inversion" />
++     <help>  </help>
++  </parameter>
++  <parameter key ="RheologyBbarAbsGradient" type="string" default="108">
++     <section name="inversion" />
++     <help>  </help>
++  </parameter>
++  <parameter key ="ThicknessAbsGradient" type="string" default="109">
++     <section name="inversion" />
++     <help> </help>
++  </parameter>
++</frame>
++<!-- qmu -->
++<frame key="1" label="qmu parameters">
++<section name="qmu" />
++  <parameter key ="isdakota" type="double" default="0">
++     <section name="qmu" />
++     <help> is qmu analysis activated? </help>
++  </parameter>
++  <parameter key ="variables" type="struct" default="N/A">
++     <section name="qmu" />
++     <help> (arrays of each variable class) </help>
++  </parameter>
++  <parameter key ="responses" type="struct" default="N/A">
++     <section name="qmu" />
++     <help> (arrays of each response class) </help>
++  </parameter>
++  <parameter key ="numberofresponses" type="double" default="0">
++     <section name="qmu" />
++     <help> number of responses </help>
++  </parameter>
++  <parameter key ="params" type="struct" default="N/A">
++     <section name="qmu" />
++     <help> (array of method-independent parameters)  </help>
++  </parameter>
++  <parameter key ="results" type="struct" default="N/A">
++     <section name="qmu" />
++     <help> (information from dakota files) </help>
++  </parameter>
++  <parameter key ="partition" type="double" default="N/A">
++     <section name="qmu" />
++     <help> user provided mesh partitioning, defaults to metis if not specified </help>
++  </parameter>
++  <parameter key ="numberofpartitions" type="double" default="0">
++     <section name="qmu" />
++     <help> number of partitions for semi-discrete qmu  </help>
++  </parameter>
++  <parameter key ="variabledescriptors" type="cell" default="(0x0)">
++     <section name="qmu" />
++     <help>  </help>
++  </parameter>
++  <parameter key ="responsedescriptors" type="cell" default="(0x0)">
++     <section name="qmu" />
++     <help> use an enthalpy formulation to include temperate ice (default is 0) </help>
++  </parameter>
++  <parameter key ="method" type="struct" default="N/A">
++     <section name="qmu" />
++     <help> array of dakota_method class </help>
++  </parameter>
++  <parameter key ="mass_flux_profile_directory" type="double" default="N/A">
++     <section name="qmu" />
++     <help> directory for mass flux profiles </help>
++  </parameter>
++  <parameter key ="mass_flux_profiles" type="double" default="N/A">
++     <section name="qmu" />
++     <help>  </help>
++  </parameter>
++  <parameter key ="mass_flux_segments" type="cell" default="(0x0)">
++     <section name="qmu" />
++     <help>  </help>
++  </parameter>
++  <parameter key ="adjacency" type="double" default="N/A">
++     <section name="qmu" />
++     <help> additional outputs requested </help>
++  </parameter>
++  <parameter key ="vertex_weight" type="double" default="N/A">
++     <section name="qmu" />
++     <help> weight applied to each mesh vertex </help>
++  </parameter>
++</frame>
++<!-- outputdefinition -->
++<frame key="1" label="outputdefinition">
++<section name="outputdefinition" />
++  <parameter key ="definitions" type="cell" default="(0x0)">
++     <section name="outputdefinition" />
++     <help> list of potential outputs that can be requested, but which need additional data to be defined </help>
++  </parameter>
++</frame>
++<!-- miscellaneous -->
++<frame key="1" label="miscellaneous parameters">
++<section name="miscellaneous" />
++  <parameter key ="notes" type="char" default="N/A">
++     <section name="miscellaneous" />
++     <help> notes in a cell of strings </help>
++  </parameter>
++  <parameter key ="name" type="char" default="N/A">
++     <section name="miscellaneous" />
++     <help> model name </help>
++  </parameter>
++  <parameter key ="dummy" type="struct" default="N/A">
++     <section name="miscellaneous" />
++     <help> empty field to store some data </help>
++  </parameter>
++</frame>
++
++
++</inishell_config>
+\ No newline at end of file
+
+Property changes on: ../trunk-jpl/src/java/build/resources/default_config.xml
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/icons/file_ops.xcf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/resources/icons/file_ops.xcf
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/icons/file_ops.xcf	(revision 17992)
++++ ../trunk-jpl/src/java/build/resources/icons/file_ops.xcf	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/resources/icons/file_ops.xcf
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/icons/filesave.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/resources/icons/filesave.png
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/icons/filesave.png	(revision 17992)
++++ ../trunk-jpl/src/java/build/resources/icons/filesave.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/resources/icons/filesave.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/icons/viewmag.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/resources/icons/viewmag.png
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/icons/viewmag.png	(revision 17992)
++++ ../trunk-jpl/src/java/build/resources/icons/viewmag.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/resources/icons/viewmag.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/icons/ini_open.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/resources/icons/ini_open.png
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/icons/ini_open.png	(revision 17992)
++++ ../trunk-jpl/src/java/build/resources/icons/ini_open.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/resources/icons/ini_open.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/icons/fileopen.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/resources/icons/fileopen.png
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/icons/fileopen.png	(revision 17992)
++++ ../trunk-jpl/src/java/build/resources/icons/fileopen.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/resources/icons/fileopen.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/icons/xml_open.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/resources/icons/xml_open.png
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/icons/xml_open.png	(revision 17992)
++++ ../trunk-jpl/src/java/build/resources/icons/xml_open.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/resources/icons/xml_open.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/icons/filesaveas.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/resources/icons/filesaveas.png
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/icons/filesaveas.png	(revision 17992)
++++ ../trunk-jpl/src/java/build/resources/icons/filesaveas.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/resources/icons/filesaveas.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/icons/opensettings.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/resources/icons/opensettings.png
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/icons/opensettings.png	(revision 17992)
++++ ../trunk-jpl/src/java/build/resources/icons/opensettings.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/resources/icons/opensettings.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/icons/reset.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/resources/icons/reset.png
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/icons/reset.png	(revision 17992)
++++ ../trunk-jpl/src/java/build/resources/icons/reset.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/resources/icons/reset.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/icons/advancedsettings.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/resources/icons/advancedsettings.png
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/icons/advancedsettings.png	(revision 17992)
++++ ../trunk-jpl/src/java/build/resources/icons/advancedsettings.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/resources/icons/advancedsettings.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/icons/mydocuments.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/resources/icons/mydocuments.png
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/icons/mydocuments.png	(revision 17992)
++++ ../trunk-jpl/src/java/build/resources/icons/mydocuments.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/resources/icons/mydocuments.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/icons/readme.txt
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/icons/readme.txt	(revision 0)
++++ ../trunk-jpl/src/java/build/resources/icons/readme.txt	(revision 17993)
+@@ -0,0 +1,10 @@
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++This copyright and license notice covers the images in this directory.
++************************************************************************
++
++TITLE:	Crystal Project Icons
++AUTHOR:	Everaldo Coelho
++SITE:	http://www.everaldo.com
++CONTACT: everaldo@everaldo.com
++
++Copyright (c)  2006-2007  Everaldo Coelho.
+
+Property changes on: ../trunk-jpl/src/java/build/resources/icons/readme.txt
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/icons/kghostview.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/build/resources/icons/kghostview.png
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/icons/kghostview.png	(revision 17992)
++++ ../trunk-jpl/src/java/build/resources/icons/kghostview.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/build/resources/icons/kghostview.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build/resources/config_schema-0.1.1.xsd
+===================================================================
+--- ../trunk-jpl/src/java/build/resources/config_schema-0.1.1.xsd	(revision 0)
++++ ../trunk-jpl/src/java/build/resources/config_schema-0.1.1.xsd	(revision 17993)
+@@ -0,0 +1,154 @@
++<?xml version="1.0"?>
++<!-- 
++*   
++*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*    	
++* -->
++<xsd:schema version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
++  <xsd:element name="inishell_config" type="general" />
++  
++  <xsd:complexType name="general">
++    <xsd:choice maxOccurs="unbounded">
++      <xsd:element name="parameter" type="parametertype" />
++      <xsd:element name="parametergroup" type="pargroup" />
++      <xsd:element name="include" type="pathonly" /> 
++      <xsd:element name="frame" type="framegroup" /> 
++    </xsd:choice>
++    <xsd:attribute name="application" />
++  </xsd:complexType>
++
++  <xsd:complexType name="framegroup">
++    <xsd:choice minOccurs="1" maxOccurs="unbounded">
++      <xsd:element name="parameter" type="parametertype" />
++      <xsd:element name="reference" type="nameonly" />
++      <xsd:element name="section" type="nameonly"/>
++    </xsd:choice>
++    <xsd:attribute name="key" />
++    <xsd:attribute name="label" />
++  </xsd:complexType>
++  
++  <xsd:complexType name="parametertype">
++    <xsd:complexContent>
++      <xsd:extension base="parbasetype">
++		<xsd:attribute name="key" type="xsd:string" use="required"/> 
++		<xsd:attribute name="default" type="xsd:string" />
++		<xsd:attribute name="counter" type="xsd:integer" />
++      </xsd:extension>
++    </xsd:complexContent>		
++  </xsd:complexType>
++  
++  <xsd:complexType name="nameonly">
++	<xsd:attribute name="name" />   
++  </xsd:complexType>
++
++  <xsd:complexType name="optionvalue">
++	<xsd:attribute name="value" />   
++  </xsd:complexType>
++
++  <xsd:complexType name="pathonly">
++	<xsd:attribute name="path" />   
++  </xsd:complexType>
++  
++  <xsd:complexType name="pargroup">
++	<xsd:choice minOccurs="1" maxOccurs="unbounded">
++	  <xsd:element name="parameter" type="parametertype" />
++	  <xsd:element name="reference" type="nameonly" />
++	  <xsd:element name="option" type="optionvalue" />
++	  <xsd:element name="frame" type="framegroup" /> 
++	</xsd:choice>
++	<xsd:attribute name="name" />
++  </xsd:complexType>
++
++  <xsd:complexType name="parbasetype">
++	<xsd:sequence>
++	  <xsd:sequence minOccurs="0" maxOccurs="unbounded">
++		<xsd:element name="section" type="nameonly"/>
++	  </xsd:sequence>
++	  <xsd:sequence minOccurs="0" maxOccurs="unbounded">
++		<xsd:element name="replace" type="nameonly"/>
++	  </xsd:sequence>
++	  <xsd:sequence minOccurs="0" maxOccurs="unbounded">
++		<xsd:element name="parameter" type="parametertype" />
++	  </xsd:sequence>
++	  <xsd:choice minOccurs="0" maxOccurs="unbounded">				
++		<xsd:element name="option" minOccurs="0">
++		  <xsd:complexType>
++			<xsd:complexContent>
++			  <xsd:extension base="parbasetype">
++				<xsd:attribute name="value" type="xsd:string" use="required" />
++				<xsd:attribute name="label" type="xsd:string" use="optional" />
++				<xsd:attribute name="default" type="xsd:boolean" use="optional"/>
++			  </xsd:extension>
++			</xsd:complexContent>
++		  </xsd:complexType>
++		</xsd:element>
++	  </xsd:choice>
++	  <xsd:sequence minOccurs="0" maxOccurs="unbounded">
++		<xsd:element name="reference" type="nameonly" />
++	  </xsd:sequence>
++	  <xsd:sequence minOccurs="0" maxOccurs="unbounded">
++		<xsd:element name="help" type="helptype"/>	
++	  </xsd:sequence>
++	</xsd:sequence>
++	
++	<xsd:attribute name="type" use="required">
++	  <xsd:simpleType>
++		<xsd:restriction base="xsd:string">
++		  <xsd:enumeration value="integer" />
++		  <xsd:enumeration value="integer+" />
++		  <xsd:enumeration value="decimal" />
++		  <xsd:enumeration value="path" />
++		  <xsd:enumeration value="file" />
++		  <xsd:enumeration value="choice" />
++		  <xsd:enumeration value="alternative" />
++		  <xsd:enumeration value="dropdown" />
++		  <xsd:enumeration value="string" />
++		  <xsd:enumeration value="combination" />
++		  <xsd:enumeration value="selector" />
++		</xsd:restriction>
++	  </xsd:simpleType>
++	</xsd:attribute>
++	
++	<xsd:attribute name="maximum" type="xsd:integer"/>
++	<xsd:attribute name="minimum" type="xsd:integer"/>
++	<xsd:attribute name="template" type="xsd:boolean" default="false" use="optional" />
++	<xsd:attribute name="optional" type="xsd:boolean" default="true" />
++  </xsd:complexType>
++  
++  <xsd:complexType name="needstype">
++	<xsd:attribute name="type" type="xsd:string" use="required" />
++	<xsd:attribute name="name" type="xsd:string" use="required" />
++	
++	<xsd:attribute name="value" />
++	<xsd:attribute name="optional" type="xsd:boolean" />
++	<xsd:attribute name="minoccur" type="xsd:integer" />
++	<xsd:attribute name="maxoccur" type="xsd:string" />
++  </xsd:complexType>
++  
++  <xsd:complexType name="baseType">
++	<xsd:sequence minOccurs="0" maxOccurs="1">
++	  <xsd:element name="help" type="helptype" />		
++	</xsd:sequence>
++	<xsd:attribute name="key" type="xsd:string" use="required" />
++  </xsd:complexType>
++  
++  <xsd:complexType name="helptype" mixed="true">
++	<xsd:choice minOccurs="0" maxOccurs="unbounded">
++	  <xsd:element name="section" type="nameonly" />
++	  <xsd:element name="replace" type="nameonly" />
++	</xsd:choice>
++  </xsd:complexType> 
++</xsd:schema>
+
+Property changes on: ../trunk-jpl/src/java/build/resources/config_schema-0.1.1.xsd
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/License.txt
+===================================================================
+--- ../trunk-jpl/src/java/License.txt	(revision 0)
++++ ../trunk-jpl/src/java/License.txt	(revision 17993)
+@@ -0,0 +1,674 @@
++                    GNU GENERAL PUBLIC LICENSE
++                       Version 3, 29 June 2007
++
++ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
++ Everyone is permitted to copy and distribute verbatim copies
++ of this license document, but changing it is not allowed.
++
++                            Preamble
++
++  The GNU General Public License is a free, copyleft license for
++software and other kinds of works.
++
++  The licenses for most software and other practical works are designed
++to take away your freedom to share and change the works.  By contrast,
++the GNU General Public License is intended to guarantee your freedom to
++share and change all versions of a program--to make sure it remains free
++software for all its users.  We, the Free Software Foundation, use the
++GNU General Public License for most of our software; it applies also to
++any other work released this way by its authors.  You can apply it to
++your programs, too.
++
++  When we speak of free software, we are referring to freedom, not
++price.  Our General Public Licenses are designed to make sure that you
++have the freedom to distribute copies of free software (and charge for
++them if you wish), that you receive source code or can get it if you
++want it, that you can change the software or use pieces of it in new
++free programs, and that you know you can do these things.
++
++  To protect your rights, we need to prevent others from denying you
++these rights or asking you to surrender the rights.  Therefore, you have
++certain responsibilities if you distribute copies of the software, or if
++you modify it: responsibilities to respect the freedom of others.
++
++  For example, if you distribute copies of such a program, whether
++gratis or for a fee, you must pass on to the recipients the same
++freedoms that you received.  You must make sure that they, too, receive
++or can get the source code.  And you must show them these terms so they
++know their rights.
++
++  Developers that use the GNU GPL protect your rights with two steps:
++(1) assert copyright on the software, and (2) offer you this License
++giving you legal permission to copy, distribute and/or modify it.
++
++  For the developers' and authors' protection, the GPL clearly explains
++that there is no warranty for this free software.  For both users' and
++authors' sake, the GPL requires that modified versions be marked as
++changed, so that their problems will not be attributed erroneously to
++authors of previous versions.
++
++  Some devices are designed to deny users access to install or run
++modified versions of the software inside them, although the manufacturer
++can do so.  This is fundamentally incompatible with the aim of
++protecting users' freedom to change the software.  The systematic
++pattern of such abuse occurs in the area of products for individuals to
++use, which is precisely where it is most unacceptable.  Therefore, we
++have designed this version of the GPL to prohibit the practice for those
++products.  If such problems arise substantially in other domains, we
++stand ready to extend this provision to those domains in future versions
++of the GPL, as needed to protect the freedom of users.
++
++  Finally, every program is threatened constantly by software patents.
++States should not allow patents to restrict development and use of
++software on general-purpose computers, but in those that do, we wish to
++avoid the special danger that patents applied to a free program could
++make it effectively proprietary.  To prevent this, the GPL assures that
++patents cannot be used to render the program non-free.
++
++  The precise terms and conditions for copying, distribution and
++modification follow.
++
++                       TERMS AND CONDITIONS
++
++  0. Definitions.
++
++  "This License" refers to version 3 of the GNU General Public License.
++
++  "Copyright" also means copyright-like laws that apply to other kinds of
++works, such as semiconductor masks.
++
++  "The Program" refers to any copyrightable work licensed under this
++License.  Each licensee is addressed as "you".  "Licensees" and
++"recipients" may be individuals or organizations.
++
++  To "modify" a work means to copy from or adapt all or part of the work
++in a fashion requiring copyright permission, other than the making of an
++exact copy.  The resulting work is called a "modified version" of the
++earlier work or a work "based on" the earlier work.
++
++  A "covered work" means either the unmodified Program or a work based
++on the Program.
++
++  To "propagate" a work means to do anything with it that, without
++permission, would make you directly or secondarily liable for
++infringement under applicable copyright law, except executing it on a
++computer or modifying a private copy.  Propagation includes copying,
++distribution (with or without modification), making available to the
++public, and in some countries other activities as well.
++
++  To "convey" a work means any kind of propagation that enables other
++parties to make or receive copies.  Mere interaction with a user through
++a computer network, with no transfer of a copy, is not conveying.
++
++  An interactive user interface displays "Appropriate Legal Notices"
++to the extent that it includes a convenient and prominently visible
++feature that (1) displays an appropriate copyright notice, and (2)
++tells the user that there is no warranty for the work (except to the
++extent that warranties are provided), that licensees may convey the
++work under this License, and how to view a copy of this License.  If
++the interface presents a list of user commands or options, such as a
++menu, a prominent item in the list meets this criterion.
++
++  1. Source Code.
++
++  The "source code" for a work means the preferred form of the work
++for making modifications to it.  "Object code" means any non-source
++form of a work.
++
++  A "Standard Interface" means an interface that either is an official
++standard defined by a recognized standards body, or, in the case of
++interfaces specified for a particular programming language, one that
++is widely used among developers working in that language.
++
++  The "System Libraries" of an executable work include anything, other
++than the work as a whole, that (a) is included in the normal form of
++packaging a Major Component, but which is not part of that Major
++Component, and (b) serves only to enable use of the work with that
++Major Component, or to implement a Standard Interface for which an
++implementation is available to the public in source code form.  A
++"Major Component", in this context, means a major essential component
++(kernel, window system, and so on) of the specific operating system
++(if any) on which the executable work runs, or a compiler used to
++produce the work, or an object code interpreter used to run it.
++
++  The "Corresponding Source" for a work in object code form means all
++the source code needed to generate, install, and (for an executable
++work) run the object code and to modify the work, including scripts to
++control those activities.  However, it does not include the work's
++System Libraries, or general-purpose tools or generally available free
++programs which are used unmodified in performing those activities but
++which are not part of the work.  For example, Corresponding Source
++includes interface definition files associated with source files for
++the work, and the source code for shared libraries and dynamically
++linked subprograms that the work is specifically designed to require,
++such as by intimate data communication or control flow between those
++subprograms and other parts of the work.
++
++  The Corresponding Source need not include anything that users
++can regenerate automatically from other parts of the Corresponding
++Source.
++
++  The Corresponding Source for a work in source code form is that
++same work.
++
++  2. Basic Permissions.
++
++  All rights granted under this License are granted for the term of
++copyright on the Program, and are irrevocable provided the stated
++conditions are met.  This License explicitly affirms your unlimited
++permission to run the unmodified Program.  The output from running a
++covered work is covered by this License only if the output, given its
++content, constitutes a covered work.  This License acknowledges your
++rights of fair use or other equivalent, as provided by copyright law.
++
++  You may make, run and propagate covered works that you do not
++convey, without conditions so long as your license otherwise remains
++in force.  You may convey covered works to others for the sole purpose
++of having them make modifications exclusively for you, or provide you
++with facilities for running those works, provided that you comply with
++the terms of this License in conveying all material for which you do
++not control copyright.  Those thus making or running the covered works
++for you must do so exclusively on your behalf, under your direction
++and control, on terms that prohibit them from making any copies of
++your copyrighted material outside their relationship with you.
++
++  Conveying under any other circumstances is permitted solely under
++the conditions stated below.  Sublicensing is not allowed; section 10
++makes it unnecessary.
++
++  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
++
++  No covered work shall be deemed part of an effective technological
++measure under any applicable law fulfilling obligations under article
++11 of the WIPO copyright treaty adopted on 20 December 1996, or
++similar laws prohibiting or restricting circumvention of such
++measures.
++
++  When you convey a covered work, you waive any legal power to forbid
++circumvention of technological measures to the extent such circumvention
++is effected by exercising rights under this License with respect to
++the covered work, and you disclaim any intention to limit operation or
++modification of the work as a means of enforcing, against the work's
++users, your or third parties' legal rights to forbid circumvention of
++technological measures.
++
++  4. Conveying Verbatim Copies.
++
++  You may convey verbatim copies of the Program's source code as you
++receive it, in any medium, provided that you conspicuously and
++appropriately publish on each copy an appropriate copyright notice;
++keep intact all notices stating that this License and any
++non-permissive terms added in accord with section 7 apply to the code;
++keep intact all notices of the absence of any warranty; and give all
++recipients a copy of this License along with the Program.
++
++  You may charge any price or no price for each copy that you convey,
++and you may offer support or warranty protection for a fee.
++
++  5. Conveying Modified Source Versions.
++
++  You may convey a work based on the Program, or the modifications to
++produce it from the Program, in the form of source code under the
++terms of section 4, provided that you also meet all of these conditions:
++
++    a) The work must carry prominent notices stating that you modified
++    it, and giving a relevant date.
++
++    b) The work must carry prominent notices stating that it is
++    released under this License and any conditions added under section
++    7.  This requirement modifies the requirement in section 4 to
++    "keep intact all notices".
++
++    c) You must license the entire work, as a whole, under this
++    License to anyone who comes into possession of a copy.  This
++    License will therefore apply, along with any applicable section 7
++    additional terms, to the whole of the work, and all its parts,
++    regardless of how they are packaged.  This License gives no
++    permission to license the work in any other way, but it does not
++    invalidate such permission if you have separately received it.
++
++    d) If the work has interactive user interfaces, each must display
++    Appropriate Legal Notices; however, if the Program has interactive
++    interfaces that do not display Appropriate Legal Notices, your
++    work need not make them do so.
++
++  A compilation of a covered work with other separate and independent
++works, which are not by their nature extensions of the covered work,
++and which are not combined with it such as to form a larger program,
++in or on a volume of a storage or distribution medium, is called an
++"aggregate" if the compilation and its resulting copyright are not
++used to limit the access or legal rights of the compilation's users
++beyond what the individual works permit.  Inclusion of a covered work
++in an aggregate does not cause this License to apply to the other
++parts of the aggregate.
++
++  6. Conveying Non-Source Forms.
++
++  You may convey a covered work in object code form under the terms
++of sections 4 and 5, provided that you also convey the
++machine-readable Corresponding Source under the terms of this License,
++in one of these ways:
++
++    a) Convey the object code in, or embodied in, a physical product
++    (including a physical distribution medium), accompanied by the
++    Corresponding Source fixed on a durable physical medium
++    customarily used for software interchange.
++
++    b) Convey the object code in, or embodied in, a physical product
++    (including a physical distribution medium), accompanied by a
++    written offer, valid for at least three years and valid for as
++    long as you offer spare parts or customer support for that product
++    model, to give anyone who possesses the object code either (1) a
++    copy of the Corresponding Source for all the software in the
++    product that is covered by this License, on a durable physical
++    medium customarily used for software interchange, for a price no
++    more than your reasonable cost of physically performing this
++    conveying of source, or (2) access to copy the
++    Corresponding Source from a network server at no charge.
++
++    c) Convey individual copies of the object code with a copy of the
++    written offer to provide the Corresponding Source.  This
++    alternative is allowed only occasionally and noncommercially, and
++    only if you received the object code with such an offer, in accord
++    with subsection 6b.
++
++    d) Convey the object code by offering access from a designated
++    place (gratis or for a charge), and offer equivalent access to the
++    Corresponding Source in the same way through the same place at no
++    further charge.  You need not require recipients to copy the
++    Corresponding Source along with the object code.  If the place to
++    copy the object code is a network server, the Corresponding Source
++    may be on a different server (operated by you or a third party)
++    that supports equivalent copying facilities, provided you maintain
++    clear directions next to the object code saying where to find the
++    Corresponding Source.  Regardless of what server hosts the
++    Corresponding Source, you remain obligated to ensure that it is
++    available for as long as needed to satisfy these requirements.
++
++    e) Convey the object code using peer-to-peer transmission, provided
++    you inform other peers where the object code and Corresponding
++    Source of the work are being offered to the general public at no
++    charge under subsection 6d.
++
++  A separable portion of the object code, whose source code is excluded
++from the Corresponding Source as a System Library, need not be
++included in conveying the object code work.
++
++  A "User Product" is either (1) a "consumer product", which means any
++tangible personal property which is normally used for personal, family,
++or household purposes, or (2) anything designed or sold for incorporation
++into a dwelling.  In determining whether a product is a consumer product,
++doubtful cases shall be resolved in favor of coverage.  For a particular
++product received by a particular user, "normally used" refers to a
++typical or common use of that class of product, regardless of the status
++of the particular user or of the way in which the particular user
++actually uses, or expects or is expected to use, the product.  A product
++is a consumer product regardless of whether the product has substantial
++commercial, industrial or non-consumer uses, unless such uses represent
++the only significant mode of use of the product.
++
++  "Installation Information" for a User Product means any methods,
++procedures, authorization keys, or other information required to install
++and execute modified versions of a covered work in that User Product from
++a modified version of its Corresponding Source.  The information must
++suffice to ensure that the continued functioning of the modified object
++code is in no case prevented or interfered with solely because
++modification has been made.
++
++  If you convey an object code work under this section in, or with, or
++specifically for use in, a User Product, and the conveying occurs as
++part of a transaction in which the right of possession and use of the
++User Product is transferred to the recipient in perpetuity or for a
++fixed term (regardless of how the transaction is characterized), the
++Corresponding Source conveyed under this section must be accompanied
++by the Installation Information.  But this requirement does not apply
++if neither you nor any third party retains the ability to install
++modified object code on the User Product (for example, the work has
++been installed in ROM).
++
++  The requirement to provide Installation Information does not include a
++requirement to continue to provide support service, warranty, or updates
++for a work that has been modified or installed by the recipient, or for
++the User Product in which it has been modified or installed.  Access to a
++network may be denied when the modification itself materially and
++adversely affects the operation of the network or violates the rules and
++protocols for communication across the network.
++
++  Corresponding Source conveyed, and Installation Information provided,
++in accord with this section must be in a format that is publicly
++documented (and with an implementation available to the public in
++source code form), and must require no special password or key for
++unpacking, reading or copying.
++
++  7. Additional Terms.
++
++  "Additional permissions" are terms that supplement the terms of this
++License by making exceptions from one or more of its conditions.
++Additional permissions that are applicable to the entire Program shall
++be treated as though they were included in this License, to the extent
++that they are valid under applicable law.  If additional permissions
++apply only to part of the Program, that part may be used separately
++under those permissions, but the entire Program remains governed by
++this License without regard to the additional permissions.
++
++  When you convey a copy of a covered work, you may at your option
++remove any additional permissions from that copy, or from any part of
++it.  (Additional permissions may be written to require their own
++removal in certain cases when you modify the work.)  You may place
++additional permissions on material, added by you to a covered work,
++for which you have or can give appropriate copyright permission.
++
++  Notwithstanding any other provision of this License, for material you
++add to a covered work, you may (if authorized by the copyright holders of
++that material) supplement the terms of this License with terms:
++
++    a) Disclaiming warranty or limiting liability differently from the
++    terms of sections 15 and 16 of this License; or
++
++    b) Requiring preservation of specified reasonable legal notices or
++    author attributions in that material or in the Appropriate Legal
++    Notices displayed by works containing it; or
++
++    c) Prohibiting misrepresentation of the origin of that material, or
++    requiring that modified versions of such material be marked in
++    reasonable ways as different from the original version; or
++
++    d) Limiting the use for publicity purposes of names of licensors or
++    authors of the material; or
++
++    e) Declining to grant rights under trademark law for use of some
++    trade names, trademarks, or service marks; or
++
++    f) Requiring indemnification of licensors and authors of that
++    material by anyone who conveys the material (or modified versions of
++    it) with contractual assumptions of liability to the recipient, for
++    any liability that these contractual assumptions directly impose on
++    those licensors and authors.
++
++  All other non-permissive additional terms are considered "further
++restrictions" within the meaning of section 10.  If the Program as you
++received it, or any part of it, contains a notice stating that it is
++governed by this License along with a term that is a further
++restriction, you may remove that term.  If a license document contains
++a further restriction but permits relicensing or conveying under this
++License, you may add to a covered work material governed by the terms
++of that license document, provided that the further restriction does
++not survive such relicensing or conveying.
++
++  If you add terms to a covered work in accord with this section, you
++must place, in the relevant source files, a statement of the
++additional terms that apply to those files, or a notice indicating
++where to find the applicable terms.
++
++  Additional terms, permissive or non-permissive, may be stated in the
++form of a separately written license, or stated as exceptions;
++the above requirements apply either way.
++
++  8. Termination.
++
++  You may not propagate or modify a covered work except as expressly
++provided under this License.  Any attempt otherwise to propagate or
++modify it is void, and will automatically terminate your rights under
++this License (including any patent licenses granted under the third
++paragraph of section 11).
++
++  However, if you cease all violation of this License, then your
++license from a particular copyright holder is reinstated (a)
++provisionally, unless and until the copyright holder explicitly and
++finally terminates your license, and (b) permanently, if the copyright
++holder fails to notify you of the violation by some reasonable means
++prior to 60 days after the cessation.
++
++  Moreover, your license from a particular copyright holder is
++reinstated permanently if the copyright holder notifies you of the
++violation by some reasonable means, this is the first time you have
++received notice of violation of this License (for any work) from that
++copyright holder, and you cure the violation prior to 30 days after
++your receipt of the notice.
++
++  Termination of your rights under this section does not terminate the
++licenses of parties who have received copies or rights from you under
++this License.  If your rights have been terminated and not permanently
++reinstated, you do not qualify to receive new licenses for the same
++material under section 10.
++
++  9. Acceptance Not Required for Having Copies.
++
++  You are not required to accept this License in order to receive or
++run a copy of the Program.  Ancillary propagation of a covered work
++occurring solely as a consequence of using peer-to-peer transmission
++to receive a copy likewise does not require acceptance.  However,
++nothing other than this License grants you permission to propagate or
++modify any covered work.  These actions infringe copyright if you do
++not accept this License.  Therefore, by modifying or propagating a
++covered work, you indicate your acceptance of this License to do so.
++
++  10. Automatic Licensing of Downstream Recipients.
++
++  Each time you convey a covered work, the recipient automatically
++receives a license from the original licensors, to run, modify and
++propagate that work, subject to this License.  You are not responsible
++for enforcing compliance by third parties with this License.
++
++  An "entity transaction" is a transaction transferring control of an
++organization, or substantially all assets of one, or subdividing an
++organization, or merging organizations.  If propagation of a covered
++work results from an entity transaction, each party to that
++transaction who receives a copy of the work also receives whatever
++licenses to the work the party's predecessor in interest had or could
++give under the previous paragraph, plus a right to possession of the
++Corresponding Source of the work from the predecessor in interest, if
++the predecessor has it or can get it with reasonable efforts.
++
++  You may not impose any further restrictions on the exercise of the
++rights granted or affirmed under this License.  For example, you may
++not impose a license fee, royalty, or other charge for exercise of
++rights granted under this License, and you may not initiate litigation
++(including a cross-claim or counterclaim in a lawsuit) alleging that
++any patent claim is infringed by making, using, selling, offering for
++sale, or importing the Program or any portion of it.
++
++  11. Patents.
++
++  A "contributor" is a copyright holder who authorizes use under this
++License of the Program or a work on which the Program is based.  The
++work thus licensed is called the contributor's "contributor version".
++
++  A contributor's "essential patent claims" are all patent claims
++owned or controlled by the contributor, whether already acquired or
++hereafter acquired, that would be infringed by some manner, permitted
++by this License, of making, using, or selling its contributor version,
++but do not include claims that would be infringed only as a
++consequence of further modification of the contributor version.  For
++purposes of this definition, "control" includes the right to grant
++patent sublicenses in a manner consistent with the requirements of
++this License.
++
++  Each contributor grants you a non-exclusive, worldwide, royalty-free
++patent license under the contributor's essential patent claims, to
++make, use, sell, offer for sale, import and otherwise run, modify and
++propagate the contents of its contributor version.
++
++  In the following three paragraphs, a "patent license" is any express
++agreement or commitment, however denominated, not to enforce a patent
++(such as an express permission to practice a patent or covenant not to
++sue for patent infringement).  To "grant" such a patent license to a
++party means to make such an agreement or commitment not to enforce a
++patent against the party.
++
++  If you convey a covered work, knowingly relying on a patent license,
++and the Corresponding Source of the work is not available for anyone
++to copy, free of charge and under the terms of this License, through a
++publicly available network server or other readily accessible means,
++then you must either (1) cause the Corresponding Source to be so
++available, or (2) arrange to deprive yourself of the benefit of the
++patent license for this particular work, or (3) arrange, in a manner
++consistent with the requirements of this License, to extend the patent
++license to downstream recipients.  "Knowingly relying" means you have
++actual knowledge that, but for the patent license, your conveying the
++covered work in a country, or your recipient's use of the covered work
++in a country, would infringe one or more identifiable patents in that
++country that you have reason to believe are valid.
++
++  If, pursuant to or in connection with a single transaction or
++arrangement, you convey, or propagate by procuring conveyance of, a
++covered work, and grant a patent license to some of the parties
++receiving the covered work authorizing them to use, propagate, modify
++or convey a specific copy of the covered work, then the patent license
++you grant is automatically extended to all recipients of the covered
++work and works based on it.
++
++  A patent license is "discriminatory" if it does not include within
++the scope of its coverage, prohibits the exercise of, or is
++conditioned on the non-exercise of one or more of the rights that are
++specifically granted under this License.  You may not convey a covered
++work if you are a party to an arrangement with a third party that is
++in the business of distributing software, under which you make payment
++to the third party based on the extent of your activity of conveying
++the work, and under which the third party grants, to any of the
++parties who would receive the covered work from you, a discriminatory
++patent license (a) in connection with copies of the covered work
++conveyed by you (or copies made from those copies), or (b) primarily
++for and in connection with specific products or compilations that
++contain the covered work, unless you entered into that arrangement,
++or that patent license was granted, prior to 28 March 2007.
++
++  Nothing in this License shall be construed as excluding or limiting
++any implied license or other defenses to infringement that may
++otherwise be available to you under applicable patent law.
++
++  12. No Surrender of Others' Freedom.
++
++  If conditions are imposed on you (whether by court order, agreement or
++otherwise) that contradict the conditions of this License, they do not
++excuse you from the conditions of this License.  If you cannot convey a
++covered work so as to satisfy simultaneously your obligations under this
++License and any other pertinent obligations, then as a consequence you may
++not convey it at all.  For example, if you agree to terms that obligate you
++to collect a royalty for further conveying from those to whom you convey
++the Program, the only way you could satisfy both those terms and this
++License would be to refrain entirely from conveying the Program.
++
++  13. Use with the GNU Affero General Public License.
++
++  Notwithstanding any other provision of this License, you have
++permission to link or combine any covered work with a work licensed
++under version 3 of the GNU Affero General Public License into a single
++combined work, and to convey the resulting work.  The terms of this
++License will continue to apply to the part which is the covered work,
++but the special requirements of the GNU Affero General Public License,
++section 13, concerning interaction through a network will apply to the
++combination as such.
++
++  14. Revised Versions of this License.
++
++  The Free Software Foundation may publish revised and/or new versions of
++the GNU General Public License from time to time.  Such new versions will
++be similar in spirit to the present version, but may differ in detail to
++address new problems or concerns.
++
++  Each version is given a distinguishing version number.  If the
++Program specifies that a certain numbered version of the GNU General
++Public License "or any later version" applies to it, you have the
++option of following the terms and conditions either of that numbered
++version or of any later version published by the Free Software
++Foundation.  If the Program does not specify a version number of the
++GNU General Public License, you may choose any version ever published
++by the Free Software Foundation.
++
++  If the Program specifies that a proxy can decide which future
++versions of the GNU General Public License can be used, that proxy's
++public statement of acceptance of a version permanently authorizes you
++to choose that version for the Program.
++
++  Later license versions may give you additional or different
++permissions.  However, no additional obligations are imposed on any
++author or copyright holder as a result of your choosing to follow a
++later version.
++
++  15. Disclaimer of Warranty.
++
++  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
++APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
++HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
++OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
++THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
++IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
++ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
++
++  16. Limitation of Liability.
++
++  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
++THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
++GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
++USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
++DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
++PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
++EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
++SUCH DAMAGES.
++
++  17. Interpretation of Sections 15 and 16.
++
++  If the disclaimer of warranty and limitation of liability provided
++above cannot be given local legal effect according to their terms,
++reviewing courts shall apply local law that most closely approximates
++an absolute waiver of all civil liability in connection with the
++Program, unless a warranty or assumption of liability accompanies a
++copy of the Program in return for a fee.
++
++                     END OF TERMS AND CONDITIONS
++
++            How to Apply These Terms to Your New Programs
++
++  If you develop a new program, and you want it to be of the greatest
++possible use to the public, the best way to achieve this is to make it
++free software which everyone can redistribute and change under these terms.
++
++  To do so, attach the following notices to the program.  It is safest
++to attach them to the start of each source file to most effectively
++state the exclusion of warranty; and each file should have at least
++the "copyright" line and a pointer to where the full notice is found.
++
++    <one line to give the program's name and a brief idea of what it does.>
++    Copyright (C) <year>  <name of author>
++
++    This program is free software: you can redistribute it and/or modify
++    it under the terms of the GNU General Public License as published by
++    the Free Software Foundation, either version 3 of the License, or
++    (at your option) any later version.
++
++    This program is distributed in the hope that it will be useful,
++    but WITHOUT ANY WARRANTY; without even the implied warranty of
++    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++    GNU General Public License for more details.
++
++    You should have received a copy of the GNU General Public License
++    along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++Also add information on how to contact you by electronic and paper mail.
++
++  If the program does terminal interaction, make it output a short
++notice like this when it starts in an interactive mode:
++
++    <program>  Copyright (C) <year>  <name of author>
++    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
++    This is free software, and you are welcome to redistribute it
++    under certain conditions; type `show c' for details.
++
++The hypothetical commands `show w' and `show c' should show the appropriate
++parts of the General Public License.  Of course, your program's commands
++might be different; for a GUI interface, you would use an "about box".
++
++  You should also get your employer (if you work as a programmer) or school,
++if any, to sign a "copyright disclaimer" for the program, if necessary.
++For more information on this, and how to apply and follow the GNU GPL, see
++<http://www.gnu.org/licenses/>.
++
++  The GNU General Public License does not permit incorporating your program
++into proprietary programs.  If your program is a subroutine library, you
++may consider it more useful to permit linking proprietary applications with
++the library.  If this is what you want to do, use the GNU Lesser General
++Public License instead of this License.  But first, please read
++<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+
+Property changes on: ../trunk-jpl/src/java/License.txt
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/inishell.sh
+===================================================================
+--- ../trunk-jpl/src/java/inishell.sh	(revision 0)
++++ ../trunk-jpl/src/java/inishell.sh	(revision 17993)
+@@ -0,0 +1,8 @@
++#/bin/bash
++#This is just the necessary command line to run a jar file
++
++#recover file name: 
++xmlfilename=$1
++
++#call inishell
++java -jar dist/inishell.jar $xmlfilename
+
+Property changes on: ../trunk-jpl/src/java/inishell.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/Changelog_1.0.0.txt
+===================================================================
+--- ../trunk-jpl/src/java/Changelog_1.0.0.txt	(revision 0)
++++ ../trunk-jpl/src/java/Changelog_1.0.0.txt	(revision 17993)
+@@ -0,0 +1,29 @@
++This is the changelog for Inishell release 1.0.0
++	*editing existing ini file:
++		+populate the GUI according to the values in an existing ini file
++		+show progress bar while loading
++		+Comments are preserved, nested template parameters properly handled, unknown keys are preserved
++
++	*usability improvements:
++		+the file dialogs remember the last path they pointed to
++		+add ".ini" extension when saving to a config file if necessary
++		+new icons, hoping to make their meaning clearer
++		+reset button on the GUI to revert to defaults
++
++	*layout improvements:
++		+fixed help text horizontal alignements issues
++		+the help text is now verticaly aligned with the top of the widget
++		+Notion of hierarchy for an easier handling of layout issues
++		+layout now consistent between Linux and Windows, still some small spacing differences with osX
++		+possibility to group parameters in a frame with a frame title
++
++	*bug fixes:
++		+default value in comboBox is honored
++		+mandatory comboBox properly handled on osX
++		+better help text handling
++
++	*others:
++		+keys are printed in the order they appear on the GUI
++		+code cleanup and optimizations
++		+add version information in MANIFEST and title bar
++		+clean up and reorganization in build.xml, add help and pack targets
+
+Property changes on: ../trunk-jpl/src/java/Changelog_1.0.0.txt
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/dist/inishell.jar
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/dist/inishell.jar
+===================================================================
+--- ../trunk-jpl/src/java/dist/inishell.jar	(revision 17992)
++++ ../trunk-jpl/src/java/dist/inishell.jar	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/dist/inishell.jar
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/doc/examples/io.ini
+===================================================================
+--- ../trunk-jpl/src/java/doc/examples/io.ini	(revision 0)
++++ ../trunk-jpl/src/java/doc/examples/io.ini	(revision 17993)
+@@ -0,0 +1,180 @@
++[General]
++PLUGINPATH	= ../../lib/plugins ;super
++BUFF_CHUNK_SIZE = 30
++BUFF_BEFORE	= 1.5
++
++[Input]
++COORDSYS	= CH1903
++TIME_ZONE	= 1
++; COORDSYS	= PROJ4
++; COORDPARAM	= 21781
++
++#reading ARC dem
++DEM		= ARC
++DEMFILE  	= ./input/surface-grids/Switzerland_1000m.asc
++
++#reading ARPS dem
++; DEM		= ARPS
++; DEMFILE 	= ./wgrt10r2_vw4.asc
++; ARPS_X 	= 653400
++; ARPS_Y 	= 112204
++
++#reading PGM image as dem
++; DEM		= PGM
++; DEMFILE	= ./Switzerland.pgm
++; PGM_XCOORD	= 479500.
++; PGM_YCOORD	= 73500.
++; PGM_CELLSIZE	= 1000.
++; PGM_MIN	= 193.
++; PGM_MAX	= 4204.
++
++; LANDUSE	= ARC
++; LANDUSEFILE	= ch_as97.asc
++
++#Alpine3D traditional inputs -> A3D plugin
++; METEO		= A3D
++; METEOPATH	= ./input/meteo
++
++#Borma
++; METEO		= BORMA
++; METEOPATH	= ./input/xml
++; NROFSTATIONS	= 1
++; STATION1	= 00.00.00.2
++
++#Snowpack input
++; METEO		= SNOWPACK
++; METEOPATH	= input
++; METAFILE	= IMIS_Extracted_Info.txt ;metadata for all stations
++; STATION1  	= MST96_RR.inp
++
++#SMET meteorological file format
++METEO		= SMET
++METEOPATH	= ./input/meteo
++STATION1	= FLU2.smet
++STATION2	= FIR2.smet
++STATION3	= FRA2.smet
++STATION4	= GLA2.smet
++STATION5	= ILI2.smet
++STATION6	= OTT2.smet
++STATION7	= TUJ3.smet
++
++#IMIS network database input -> IMIS plugin
++; METEO		= IMIS
++; DBNAME		= sdbo
++; DBUSER		= XXX
++; DBPASS		= XXX
++; NROFSTATIONS	= 4
++; STATION1	= MORN2
++; STATION2	= DAV3
++; STATION3	= KLO2
++; STATION4	= *SAM0
++
++#GEOtop traditional inputs -> GEOTOP plugin
++; METEO		 = GEOTOP
++; METEOPATH       = meteo/
++; METEOPREFIX     = _meteo
++
++#GSN direct input -> GSN plugin
++; METEO		= GSN
++; ENDPOINT	= http://montblanc.slf.ch:22001/services/A3DWebService
++; STATION1	= wan_sen14_2008
++; STATION2	= wan2
++
++[Output]
++COORDSYS	= CH1903
++TIME_ZONE 	= 1
++
++GRID2D		= ARC
++GRID2DPATH	= ./
++
++; GRID2D		= PNG
++; GRID2DPATH	= ./
++; PNG_MIN_SIZE	= 800x600
++; PNG_WORLD_FILE	= true
++; PNG_AUTOSCALE	= false
++; PNG_SCALING	= nearest
++
++METEO		= SMET
++METEOPATH	= ./
++
++[Filters]
++TA::filter1	= min_max
++TA::arg1	= 240 320
++
++RH::filter1	= min_max
++RH::arg1 	= 0.01 1.2
++RH::filter2	= min_max
++RH::arg2	= soft 0.05 1.0
++
++HNW::filter1	= min
++HNW::arg1	= -0.1
++HNW::filter2	= min
++HNW::arg2	= soft 0.
++
++ISWR::filter1	= min_max
++ISWR::arg1	= -10. 1500.
++ISWR::filter2	= min
++ISWR::arg2	= soft 0.
++
++RSWR::filter1	= min_max
++RSWR::arg1 	= -10 1500
++RSWR::filter2	= min
++RSWR::arg2	= soft 0
++
++#for TA between 240 and 320 K
++ILWR::filter1	= min_max
++ILWR::arg1	= 188 600
++ILWR::filter2	= min_max
++ILWR::arg2	= soft 200 400
++
++#we need to consider time with no snow -> TSS>0
++#min(TSS) in db since 1998: -50C
++TSS::filter1	= min_max
++TSS::arg1	= 200 320
++
++#idem
++TSG::filter1	= min_max
++TSG::arg1	= 200 320
++
++HS::filter1	= min
++HS::arg1	= soft 0.0
++HS::filter2	= rate
++HS::arg2	= 5.55e-5 ;0.20 m/h
++
++VW::filter1	= min_max
++VW::arg1	= -2 70
++VW::filter2	= min_max
++VW::arg2	= soft 0.2 50.0
++
++[Interpolations1D]
++WINDOW_SIZE	= 86400
++
++TA::resample	= linear
++
++RH::resample	= linear
++
++HS::resample	= linear
++
++VW::resample	= nearest_neighbour
++VW::args	= extrapolate
++
++HNW::resample	= linear
++
++[Interpolations2D]
++TA::algorithms	= IDW_LAPSE CST_LAPSE
++TA::cst_lapse	= -0.008
++TA::idw_lapse	= -0.008 soft
++
++RH::algorithms	= RH IDW_LAPSE CST
++
++HNW::algorithms	= IDW_LAPSE CST_LAPSE CST
++HNW::cst_lapse	= 0.0005 frac
++
++VW::algorithms	= IDW_LAPSE CST
++
++P::algorithms	= STD_PRESS
++
++ILWR::algorithms = CST_LAPSE
++ILWR::cst_lapse = -0.03125
++
++RSWR::algorithms = IDW CST
+
+Property changes on: ../trunk-jpl/src/java/doc/examples/io.ini
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/doc/examples/meteoio_config.xml
+===================================================================
+--- ../trunk-jpl/src/java/doc/examples/meteoio_config.xml	(revision 0)
++++ ../trunk-jpl/src/java/doc/examples/meteoio_config.xml	(revision 17993)
+@@ -0,0 +1,919 @@
++<inishell_config application="Meteo IO">
++
++	<!-- General Parameters -->
++	<parameter key="BUFF_CHUNK_SIZE" type="integer" default="30">
++		<section name="general" />
++		<help>Size in days of a chunk of data to read at once.</help>
++	</parameter>
++
++	<parameter key="BUFF_BEFORE" type="decimal" default="1.5">
++		<section name="general" />
++		<help>Alternate way of buffer centering: When rebuffering, the new date will be located BUFF_BEFORE days from the
++		beginning of the buffer (therefore, it takes a value in days).</help>
++	</parameter>
++
++	<!-- Coordinate systems, time zones -->
++	<parameter key="COORDSYS" type="alternative" optional="false">
++		<section name="input" />
++		<section name="output" />
++		<option value="CH1903" type="string" default="true">
++			<help>coordinates in the Swiss Grid &lt;a href="http://geomatics.ladetto.ch/ch1903_wgs84_de.pdf"&gt;http://geomatics.ladetto.ch/ch1903_wgs84_de.pdf&lt;/a&gt;</help>
++		</option>
++		<option value="UTM" type="string">
++			<parameter key="COORDPARAM" type="string">
++				<help>specify the zone with the zone letter (for example, 32T)</help>
++			</parameter>
++			<help>UTM coordinates, see &lt;a href="http://www.oc.nps.edu/oc2902w/maps/utmups.pdf"&gt;http://www.oc.nps.edu/oc2902w/maps/utmups.pdf&lt;/a&gt;</help>
++		</option>
++		<option value="UPS" type="string">
++			<parameter key="COORDPARAM" type="string">
++				<help>specify the hemisphere (either N or S)</help>
++			</parameter>
++			<help>Universal Polar Stereographic coordinates, see &lt;a href="https://en.wikipedia.org/wiki/Universal_Polar_Stereographic_coordinate_system"&gt;https://en.wikipedia.org/wiki/Universal_Polar_Stereographic_coordinate_system&lt;/a&gt;</help>
++		</option>
++		<option value="PROJ4" type="string">
++			<parameter key="COORDPARAM" type="string" optional="false" />
++			<help>external library: see &lt;a href="http://trac.osgeo.org/proj/"&gt;http://trac.osgeo.org/proj/&lt;/a&gt;</help>
++		</option>
++		<option value="LOCAL"  type="string">
++			<help>uses the horizontal and vertical distance from a reference point</help>
++		</option>
++		<help>coordinate system</help>
++	</parameter>
++
++	<parameter key="TIME_ZONE" type="integer+" default="+1" maximum="14" minimum="-12" optional="false">
++		<section name="input" />
++		<section name="output" />
++	</parameter>
++
++	<!-- Datatypes: special pts -->
++	<parameter key="SPECIALPTS" type="alternative">
++		<section name="input" />
++		<option value="A3D" type="string">
++			<parameter key="SPECIALPTSFILE" type="file" optional="false">
++				<help>a path+file name to the a file containing grid coordinates of special points of interest (for special outputs)</help>
++			</parameter>
++		</option>
++		<option value="SMET" type="string">
++			<parameter key="SPECIALPTSFILE" type="file" optional="false">
++				<help>a path+file name to the a file containing grid coordinates of special points of interest (for special outputs)</help>
++			</parameter>
++		</option>
++	</parameter>
++
++	<!-- Datatypes: Meteo Data -->
++	<parameter key="METEO" type="alternative">
++		<section name="input" />
++		<section name="output" />
++
++		<option value="A3D" type="string">
++			<parameter key="METEOPATH" type="path" optional="false">
++				<help>string containing the path to the meteorological files</help>
++			</parameter>
++		</option>
++		<option value="BORMA" type="string">
++			<section name="input" />
++			<reference name="BORMA" />
++		</option>
++		<option value="COSMO" type="string">
++			<parameter key="METEOPATH" type="path" optional="false">
++				<help>string containing the path to the meteorological files</help>
++			</parameter>
++		</option>
++		<option value="GEOTOP" type="string">
++			<section name="input" />
++			<reference name="GEOTOP_IN" />
++		</option>
++		<option value="GEOTOP" type="string">
++			<section name="output" />
++			<reference name="GEOTOP_OUT" />
++		</option>
++		<option value="GRIB" type="string">
++			<section name="input" />
++			<reference name="GRIB_METEO" />
++		</option>
++		<option value="GSN" type="string">
++			<section name="input" />
++			<reference name="GSN" />
++		</option>
++		<option value="IMIS" type="string">
++			<section name="input" />
++			<reference name="IMIS" />
++		</option>
++		<option value="SMET" type="string">
++			<section name="input" />
++			<reference name="SMET_IN" />
++		</option>
++		<option value="SMET" type="string">
++			<section name="output" />
++			<reference name="SMET_OUT" />
++		</option>
++		<option value="SNOWPACK" type="string">
++			<section name="input" />
++			<reference name="SNIO_IN" />
++		</option>
++		<option value="SNOWPACK" type="string">
++			<section name="output" />
++			<parameter key="METEOPATH" type="path" optional="false">
++				<help>string representing path where SNOWPACK files should be saved</help>
++			</parameter>
++		</option>
++
++		<help>plugin for METEO data </help>
++	</parameter>
++
++	<parameter key="Add Meteo parameter copy" type="selector">
++		<section name="input"/>
++		<parameter key="COPY::%" type="string" optional="false" template="true">
++		  <help>The name of the parameter to copy (e.g. TA, RH, VW, ISWR, etc)</help>
++		</parameter>
++	</parameter>
++
++	<!-- Datatypes: DEM -->
++	<frame key="dem_frame" label="Digital Elevation Model">
++	<section name="input"/>
++		<parameter key="DEM" type="alternative">
++			<section name="input" />
++			<option value="ARC" type="string">
++				<parameter key="DEMFILE" type="file" optional="false">
++					<help>For reading the data as a DEMObject</help>
++				</parameter>
++			</option>
++			<option value="ARPS" type="string">
++				<parameter key="DEMFILE" type="file" optional="false">
++					<help>For reading the data as a DEMObject</help>
++				</parameter>
++				<parameter key="ARPS_XCOORD" type="decimal" optional="false">
++					<help>x coordinate of the lower left corner of the grids</help>
++				</parameter>
++				<parameter key="ARPS_YCOORD" type="decimal" optional="false">
++					<help>y coordinate of the lower left corner of the grids</help>
++				</parameter>
++			</option>
++			<option value="GRASS" type="string">
++				<parameter key="DEMFILE" type="file" optional="false">
++					<help>For reading the data as a DEMObject</help>
++				</parameter>
++			</option>
++			<option value="GRIB" type="string">
++				<parameter key="DEMFILE" type="file" optional="false">
++					<help>For reading the data as a DEMObject</help>
++				</parameter>
++				<parameter key="GRIB_DEM_UPDATE" type="alternative" optional="true">
++					<option value="TRUE" type="string" />
++					<option value="FALSE" type="string" />
++					<help>recompute slope/azimuth from the elevations when reading a DEM (default=false, that is we use the slope and azimuth included in the GRIB file)</help>
++				</parameter>
++			</option>
++			<option value="PGM" type="string">
++				<parameter key="DEMFILE" type="file" optional="false">
++					<help>For reading the data as a DEMObject</help>
++				</parameter>
++				<reference name="PGM_IN" />
++			</option>
++
++			<help>plugin for Digital Elevation Model data </help>
++		</parameter>
++	</frame>
++
++	<!-- Datatypes: Landuse -->
++	<parameter key="LANDUSE" type="alternative">
++		<section name="input" />
++		<option value="ARC" type="string">
++			<parameter key="LANDUSEFILE" type="file" optional="false">
++				<help>File containing a grid of landuse codes</help>
++			</parameter>
++		</option>
++
++		<help>plugin for land cover data </help>
++	</parameter>
++
++	<!-- Datatypes: Grids -->
++	<parameter key="GRID2D" type="alternative">
++		<section name="input" />
++		<section name="output" />
++		<option value="ARC" type="string">
++			<parameter key="GRID2DPATH" type="path" optional="false">
++				<help>string representing path where grid files should be read from</help>
++			</parameter>
++			<reference name="ARC" />
++		</option>
++		<option value="ARPS" type="string">
++			<section name="input" />
++			<parameter key="GRID2DPATH" type="path" optional="false">
++				<help>string representing path where grid files should be read from</help>
++			</parameter>
++			<reference name="ARPS" />
++		</option>
++		<option value="GRASS" type="string">
++			<section name="input" />
++			<parameter key="GRID2DPATH" type="path" optional="false">
++				<help>string representing path where grid files should be read from</help>
++			</parameter>
++		</option>
++		<option value="GRIB" type="string">
++			<section name="input" />
++			<parameter key="GRID2DPATH" type="path" optional="false">
++				<help>string representing path where grid files should be read from</help>
++			</parameter>
++			<reference name="GRIB_GRIDS" />
++		</option>
++		<option value="PGM" type="string">
++			<section name="input" />
++			<parameter key="GRID2DPATH" type="path" optional="false">
++				<help>string representing path where grid files should be read from</help>
++			</parameter>
++			<reference name="PGM_IN" />
++		</option>
++		<option value="PGM" type="string">
++			<section name="output" />
++			<parameter key="GRID2DPATH" type="path" optional="false">
++				<help>string representing path where grid files should be read from</help>
++			</parameter>
++		</option>
++		<option value="PNG" type="string">
++			<section name="output" />
++			<parameter key="GRID2DPATH" type="path" optional="false">
++				<help>string representing path where grid files should be read from</help>
++			</parameter>
++			<reference name="PNG" />
++		</option>
++		<help>plugin for 2D gridded data </help>
++	</parameter>
++
++	<!--Parameter group for list of stations -->
++	<parametergroup name="stationgroup_files">
++		<parameter key="STATION#" type="file" counter="1" optional="false">
++			<help>filename for station number # </help>
++		</parameter>
++	</parametergroup>
++	<parametergroup name="stationgroup_names">
++		<parameter key="STATION#" type="string" counter="1" optional="false">
++			<help>station id for the given station number # </help>
++		</parameter>
++	</parametergroup>
++	<parametergroup name="stationgroup_pos">
++		<parameter key="STATION#" type="string" counter="1">
++			<help>Coordinates are given as "lat lon" or "xcoord ycoord epsg_code"</help>
++		</parameter>
++	</parametergroup>
++
++	<!-- Plugins for Meteo Data-->
++	<parametergroup name="BORMA">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string containing the path to the xml files</help>
++		</parameter>
++		<reference name="stationgroup_names" />
++	</parametergroup>
++
++	<parametergroup name="IMIS">
++		<parameter key="DBNAME" type="string" optional="false">
++			<help>database name, as provided by your database administrator</help>
++		</parameter>
++		<parameter key="DBUSER" type="string" optional="false">
++			<help>database user name</help>
++		</parameter>
++		<parameter key="DBPASS" type="string" optional="false">
++			<help>database password associated with the user name</help>
++		</parameter>
++		<parameter key="USEANETZ" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		  <help>OPTIONAL: use ANETZ stations to provide precipitations for normal IMIS stations.
++		  Each IMIS station is associated with one or two ANETZ stations and does a weighted
++		  average to get what should be its local precipitations</help>
++		</parameter>
++		<parameter key="USE_IMIS_HNW" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		  <help>OPTIONAL: if set to false (default), all IMIS precipitation will be deleted (since IMIS stations don't have heated rain gauges, their precipitation measurements are not good in winter conditions). If set to true, it is strongly advised to use a FilterHNWMelt filter to detect snow melting in the rain gauge and perform winter conditions detection in the application.</help>
++		</parameter>
++		<parameter key="USE_SNOWPACK_HNW" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		  <help>if set to true, the SNOWPACK simulated Snow Water Equivalent from the database will be used to compute HNW. Data gaps greater than 3 hours on SWE will lead to unchanged hnw while all data that can properly be computed will overwrite hnw. (default=false)</help>
++		</parameter>
++
++		<reference name="stationgroup_names" />
++	</parametergroup>
++
++	<parametergroup name="GRIB_METEO">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string containing the path to the grib files</help>
++		</parameter>
++		<parameter key="METEOEXT" type="string" optional="true">
++			<help>grib file extension, or none for no file extension (default: .grb)</help>
++		</parameter>
++
++		<reference name="stationgroup_pos" />
++	</parametergroup>
++
++	<parametergroup name="GEOTOP_IN">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string containing the path to the data files</help>
++		</parameter>
++		<parameter key="METAFILE" type="file" optional="false">
++			<help>absolute filename of the geotop.inpts file</help>
++		</parameter>
++		<parameter key="METEOPREFIX" type="string" optional="true">
++			<help>prefix to append when generating a file name for reading</help>
++		</parameter>
++	</parametergroup>
++
++	<parametergroup name="GEOTOP_OUT">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string containing the path to the data files</help>
++		</parameter>
++		<parameter key="METEOSEQ" type="string" optional="false">
++			<help>specifiy in which order the columns should be printed out</help>
++		</parameter>
++	</parametergroup>
++
++	<parametergroup name="GSN">
++		<parameter key="ENDPOINT" type="string" optional="false">
++			<help>webserver running GSN with its port number and full path. For example:
++			http://montblanc.slf.ch:22001/services/A3DWebService</help>
++		</parameter>
++		<parameter key="PROXY" type="string" optional="true">
++			<help>Should the connection go through a proxy? This is useful for servers
++			filtering on domains but usually not necessary.</help>
++		</parameter>
++		<parameter key="PROXYPORT" type="string" optional="true" />
++		<parameter key="PROXYUSER" type="string" optional="true" />
++		<parameter key="PROXYPASS" type="string" optional="true" />
++
++		<reference name="stationgroup_names" />
++	</parametergroup>
++
++	<parametergroup name="SMET_IN">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string containing the path to the smet files</help>
++		</parameter>
++		<reference name="stationgroup_files" />
++	</parametergroup>
++
++	<parametergroup name="SMET_OUT">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string representing path where SMET files should be saved</help>
++		</parameter>
++		<parameter key="METEOPARAM" type="alternative">
++		  <option value="ASCII" type="string" default="true">
++		    <help>Write ASCII SMET files</help>
++		  </option>
++		  <option value="BINARY" type="string">
++		    <help>Write BINARY SMET files</help>
++		  </option>
++		</parameter>
++	</parametergroup>
++
++	<parametergroup name="SNIO_IN">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string containing the path to the SNOWPACK files</help>
++		</parameter>
++		<parameter key="METAFILE" type="file" optional="true">
++			<help>filename of the meta data file (in METEOPATH)</help>
++		</parameter>
++
++		<parameter key="NUMBER_MEAS_TEMPERATURES" type="integer+" minimum="0" default="0">
++		  <help>the number of measured snow temperatures provided</help>
++		</parameter>
++
++		<parameter key="NUMBER_OF_SOLUTES" type="integer+" minimum="0" default="0">
++		  <help>the number of solutes for which input data are provided</help>
++		</parameter>
++
++		<parameter key="RSWR_INP" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		</parameter>
++		<parameter key="ISWR_INP" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		</parameter>
++		<parameter key="VW_DRIFT" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		  <help>OPTIONAL: wind velocity to use for blowing and drifting snow is provided</help>
++		</parameter>
++		<parameter key="RHO_HN" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		  <help>OPTIONAL: measured new snow density is provided</help>
++		</parameter>
++
++		<reference name="stationgroup_files" />
++	</parametergroup>
++
++	<!-- Plugins for Gridded Data-->
++	<parametergroup name="ARC">
++		<parameter key="A3D_VIEW" type="alternative" optional="true">
++			<option value="TRUE" type="string" />
++			<option value="FALSE" type="string" />
++			<help>generate names compatible with Alpine3D's grid viewer?</help>
++		</parameter>
++		<parameter key="GRID2DEXT" type="string" optional="true">
++			<help>grid file extension, or none for no file extension (default: .asc)</help>
++		</parameter>
++	</parametergroup>
++
++	<parametergroup name="ARPS">
++		<parameter key="ARPS_XCOORD" type="decimal" optional="false">
++			<help>x coordinate of the lower left corner of the grids</help>
++		</parameter>
++		<parameter key="ARPS_YCOORD" type="decimal" optional="false">
++			<help>y coordinate of the lower left corner of the grids</help>
++		</parameter>
++		<parameter key="GRID2DEXT" type="string" optional="true">
++			<help>grid file extension, or none for no file extension (default: .asc)</help>
++		</parameter>
++	</parametergroup>
++
++	<parametergroup name="GRIB_GRIDS">
++		<parameter key="GRID2DPREFIX" type="string" optional="true">
++			<help>prefix to append when generating a file name for reading (ie: something like "laf" for Cosmo-Analysis-full domain)</help>
++		</parameter>
++		<parameter key="GRID2DEXT" type="string" optional="true">
++			<help>grib file extension, or none for no file extension (default: .grb)</help>
++		</parameter>
++	</parametergroup>
++
++	<parametergroup name="PNG">
++		<parameter key="PNG_WORLD_FILE" type="alternative" optional="true">
++			<option value="TRUE" type="string" />
++			<option value="FALSE" type="string" />
++			<help>generate a world file for each output file? This file contains the geolocalization information</help>
++		</parameter>
++		<parameter key="PNG_LEGEND" type="alternative" optional="true">
++			<option value="TRUE" type="string" />
++			<option value="FALSE" type="string" />
++			<help>generate a legend?</help>
++		</parameter>
++		<parameter key="PNG_AUTOSCALE" type="alternative" optional="true">
++			<option value="TRUE" type="string" />
++			<option value="FALSE" type="string" />
++			<help>autoscale color scale?</help>
++		</parameter>
++		<parameter key="PNG_SCALING" type="alternative" optional="true">
++			<option value="nearest" type="string" />
++			<option value="bilinear" type="string" />
++			<help>scaling algorithm (default=bilinear)</help>
++		</parameter>
++		<parameter key="PNG_MIN_SIZE" type="string" optional="false">
++			<help>minimum dimensions of the PNG, like 640x480</help>
++		</parameter>
++		<parameter key="PNG_MAX_SIZE" type="string" optional="false">
++			<help>maximum dimensions of the PNG, like 1024x768</help>
++		</parameter>
++		<parameter key="PNG_INDEXED" type="alternative" optional="true">
++			<option value="TRUE" type="string" />
++			<option value="FALSE" type="string" />
++			<help>generate a color indexed file (default=true)</help>
++		</parameter>
++		<parameter key="PNG_SPEED_OPTIMIZE" type="alternative" optional="true">
++			<option value="TRUE" type="string" />
++			<option value="FALSE" type="string" />
++			<help>optimize for speed (default=false)</help>
++		</parameter>
++		<parameter key="PNG_NR_LEVELS" type="integer+" default="+30" maximum="255" minimum="6" optional="true">
++			<help>number of colors in the palette (default=30)</help>
++		</parameter>
++	</parametergroup>
++
++	<parametergroup name="PGM_IN">
++		<parameter key="PGM_XCOORD" type="decimal" optional="false">
++			<help>lower left x coordinate</help>
++		</parameter>
++		<parameter key="PGM_YCOORD" type="decimal" optional="false">
++			<help>lower left y coordinate</help>
++		</parameter>
++		<parameter key="PGM_CELLSIZE" type="decimal" optional="false">
++			<help>cellsize in meters</help>
++		</parameter>
++		<parameter key="PGM_MIN" type="decimal" optional="false">
++			<help>minimum value in real world coordinates to match with the minimum value read out of the PGM file (such minimum being greater than 0 because 0 is NODATA)</help>
++		</parameter>
++		<parameter key="PGM_MAX" type="decimal" optional="false">
++			<help>maximum value in real world coordinates to match with the maximum value read out of the PGM file</help>
++		</parameter>
++	</parametergroup>
++
++	<!-- Meteo Parameters for Filters, resampling, spatial interpolations-->
++	<parametergroup name="METEOIOPARAMETERS">
++		<option value="TA"/>
++		<option value="RH"/>
++		<option value="VW"/>
++		<option value="DW"/>
++		<option value="VW_MAX"/>
++		<option value="ISWR"/>
++		<option value="RSWR"/>
++		<option value="ILWR"/>
++		<option value="HS"/>
++		<option value="HNW"/>
++		<option value="TSG"/>
++		<option value="TSS"/>
++		<option value="P"/>
++	</parametergroup>
++
++	<!-- Filters -->
++	<parameter key="Add/Remove Filter" type="selector">
++		<section name="filters" />
++
++		<parameter key="%::filter#" type="alternative" counter="1" template="true">
++			<section name="filters" />
++
++			<option label="MeanAvg" value="mean_avg" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			    </help>
++			  </parameter>
++			  <help>Mean average processing. The mean average filter returns the mean value of all values within a user given time window.</help>
++			</option>
++
++			<option label="MedianAvg" value="median_avg" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="decimal" minimum="0" />
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			    </help>
++			  </parameter>
++			  <help>Median average processing. The median average filter returns the median value of all values within a user given time window.</help>
++			</option>
++
++			<option label="Std Deviation Filter" value="std_dev" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			    </help>
++			  </parameter>
++			  <help>Standard deviation filter. Values outside of mean ± 2 std_dev are rejected.</help>
++			</option>
++
++			<option label="MAD" value="mad" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			    </help>
++			  </parameter>
++			  <help>Median Absolute Deviation. Values outside of median ± 3 σ_MAD are rejected. &lt;br&gt;
++			  See http://en.wikipedia.org/wiki/Median_absolute_deviation for more information.</help>
++			</option>
++
++			<option label="Tukey 53H Filter" value="Tukey" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <help>
++			      The keyword "soft" maybe added, if the window position is allowed to be adjusted to the data present.
++			      The two arguments may be preceded by the keywords "left", "center" or "right", indicating the window position.
++			    </help>
++			  </parameter>
++			  <help>Tukey 53H method A smooth time sequence is generated from the median, substracted from the original signal and
++			  compared with the standard deviation. see "Despiking Acoustic Doppler Velocimeter Data", Derek G. Goring and Vladimir
++			  L. Nikora, Journal of Hydraulic Engineering, 128, 1, 2002 The deviation factor coeffecient is currently hard-coded as k=1.5. </help>
++			</option>
++
++			<option label="Wind Averaging Filter" value="wind_avg" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			    </help>
++			  </parameter>
++			  <help>Wind vector averaging. This calculates the vector average over a user given time period. Each wind vector
++			  within this period is added and the final sum is normalized by the number of vectors that have been added. </help>
++			</option>
++
++			<option label="Exponential Smoothing" value="exp_smoothing" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <option label="alpha:" value="0.8" type="decimal" minimum="0" maximum="1"/>
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			      Alpha needs to be provided as last argument. Please note that the standard filter works with a left window!
++			    </help>
++			  </parameter>
++			  <help>Exponential smooting processing, exponential moving average s_0 = x_0 s_n = alpha*x_(t-1) + (1-alpha)*s_t-1</help>
++			</option>
++
++			<option label="Weighted Moving Average Smoothing" value="wma_smoothing" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			      Please note that the standard filter works with a left window!
++			    </help>
++			  </parameter>
++			  <help>Weighted moving average smoothing such as: WMA = (1*X1 + 2*X2 + ... + n*Xn) / sum_of_weights</help>
++			</option>
++
++			<option label="Min Range Filter" value="min" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option label="Min:" value="" type="decimal" />
++			    <option label="Adjust to:" value="" type="decimal" />
++			    <help>The keyword "soft" maybe added, in such a case all data smaller than the min would be
++			    assigned the minimum permissible value or another value given as an extra argument</help>
++			  </parameter>
++			  <help>Min range filter. Reject all values smaller than the min.</help>
++			</option>
++
++			<option label="Max Range Filter" value="max" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option label="Max:" value="" type="decimal" />
++			    <option label="Adjust to:" value="" type="decimal" />
++			    <help>The keyword "soft" maybe added, in such a case all data greater than the max would be
++			    assigned the maximum permissible value or another value given as an extra argument</help>
++			  </parameter>
++			  <help>Max range filter. Reject all values greater than the max.</help>
++			</option>
++
++			<option label="MinMax (2 or 4 arguments)" value="min_max" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option label="Min:" value="" type="decimal" />
++			    <option label="Max:" value="" type="decimal" />
++			    <option label="Min adjust to:" value="" type="decimal" />
++			    <option label="Max adjust to:" value="" type="decimal" />
++			    <help>The keyword "soft" maybe added, in such a case all data greater than the max would be assigned
++			    the maximum permissible value and all data smaller than the min would be assigned the minimum
++			    permissible value or an optional extra set of two user provided values</help>
++			  </parameter>
++			  <help>Reject all values greater than the max or smaller than the min. &lt;br&gt;</help>
++			</option>
++
++			<option label="Rate Filter (1 argument)" value="rate" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option label="Max:" value="1.0" type="decimal" minimum="0" maximum="1" />
++			    <help>the absolute value of the maximum permissible rate of change (per seconds)</help>
++			  </parameter>
++			  <help>Rate of change filter. Calculate the change rate (ie: slope) between two points, if it is above a user given value, reject the point.</help>
++			</option>
++
++			<option label="Rate Filter (2 arguments)" value="rate" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option label="Min:" value="0.0" type="decimal" minimum="0" maximum="1" />
++			    <option label="Max:" value="1.0" type="decimal" minimum="0" maximum="1" />
++			    <help>the minimum and maximum permissible rate of change (per second)</help>
++			  </parameter>
++			  <help>Rate of change filter. Calculate the change rate (ie: slope) between two points, if it is above a user given value, reject the point.</help>
++			</option>
++
++			<option label="Unheated Rain Gauge Filter" value="Unheated_RainGauge" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option label="RH threshold:" value="0.5" type="decimal" minimum="0" maximum="1" />
++			    <option label="Delta_T threshold:" value="3.0" type="decimal" minimum="0" maximum="20" />
++			  </parameter>
++			  <help>Filters out snow melting in an unheated rain gauge. This filter can ONLY be applied to precipitation. Non-zero measurements are accepted only if they take place when the relative humidity is greater than RH_threshold and (TA-TSS) smaller than Delta_T_threshold, otherwise they get reset to 0. If none of these conditions could be tested (for lack of data), then the precipitation is reset to nodata (or left unchanged if "soft" has been selected).</help>
++			</option>
++
++			<option label="WMO Undercatch Filter" value="undercatch_wmo" type="string">
++			  <parameter key="%::arg#" type="combination">
++				<option value="Gage type" type="dropdown">
++					<option value="Nipher" type="string" />
++					<option value="Tretyakov" type="string" />
++					<option value="US8sh" type="string" />
++					<option value="US8unsh" type="string" />
++					<option value="Hellmann" type="string" />
++					<option value="Hellmannsh" type="string" />
++				</option>
++			  </parameter>
++			  <help>This implements the standard methods for precipitation correction as described in "WMO Solid Precipitation Measurement Intercomparison", B. Goodison, P. Louie and D. Yang, 872, 1998 as well as the overview given by "Literature Study on the Correction of Precipitation Measurements", Annette Wagner, 2009. The correction parameters for the shielded Hellmann gauge (German version) are from "Wind-induced Precipitation Undercatch of the Hellmann Gauges", Daqing Yang et al, Nordic Hydrology, 30, 1999, pp 57-80.</help>
++			</option>
++
++			<option label="WMO Undercatch Filter - simplified" value="undercatch_wmo" type="string">
++			  <parameter key="%::arg#" type="combination">
++				<option value="Kind" type="dropdown">
++					<option value="Cst" type="string" />
++				</option>
++				<option label="Snow factor:" value="1.3" type="decimal" minimum="0" maximum="5" />
++				<option label="Mixed prec factor:" value="1.1" type="decimal" minimum="0" maximum="5" />
++			  </parameter>
++			  <help>This applies a constant correction factor to the precipitation, one for pure snow and one for mixed precipitation. The following thresholds are used: pure snow below -2 C; mixed precipitation between -2 and +2 C; pure rain above 2 C. These threshold can be changed (see online documentation).</help>
++			</option>
++
++			<option label="Unventillated temperature sensor" value="Unventilated_T" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option label="albedo:" value="0.23" type="decimal" />
++			    <option value="soft" type="choice" />
++			    <help>If the "soft" option is given, the albedo has a value different according to snow (or no snow) on the ground</help>
++			  </parameter>
++			  <help>This implements the correction described in (Reina Nakamura, 2005) with an albedo dependency as introduced in (Huwald, 2009)</help>
++			</option>
++
++			<option label="Add an offset" value="add" type="string">
++			  <parameter key="%::arg#" type="combination">
++				<option label="offset:" value="0." type="decimal" />
++			  </parameter>
++			  <help>This adds a given offset to the data.</help>
++			</option>
++
++			<option label="Multiply by a factor" value="mult" type="string">
++			  <parameter key="%::arg#" type="combination">
++				<option label="factor:" value="1." type="decimal" />
++			  </parameter>
++			  <help>This multiplies the data by a given factor.</help>
++			</option>
++
++		</parameter>
++
++		<reference name="METEOIOPARAMETERS" />
++	</parameter>
++
++	<!-- 1D Interpolation -->
++	<parameter key="WINDOW_SIZE" type="integer+" minimum="1" default="43200">
++		<section name="Interpolations1D" />
++		<help>Affects resampling: expresses (in seconds) how far a valid point can be
++		searched for when re-interpolating a missing value</help>
++	</parameter>
++
++	<parameter key="Add/Remove 1D Interpolation" type="selector">
++		<section name="Interpolations1D" />
++
++		<parameter key="%::resample" type="alternative" template="true">
++			<section name="Interpolations1D" />
++			<option label="No Interpolation" value="none" type="string" />
++			<option label="Nearest Neighbour" value="nearest_neighbour" type="string" />
++			<option label="Linear" value="linear" type="string">
++			  <parameter key="%::args" type="combination">
++			    <option value="extrapolate" type="choice" />
++			    <help>
++			      If "extrapolate" is added, then data *outside* of the original date range can be interpolated.
++			      Otherwise, a data point will only be calculated between the original date range.
++			    </help>
++			  </parameter>
++			  <help>Mean average processing. The mean average filter returns the mean value of all values within a user given time window.</help>
++			</option>
++			<option label="Accumulate" value="accumulate" type="string">
++			  <parameter key="%::args" type="combination">
++			    <option value="strict" type="choice" />
++			    <option label="Seconds:" value="900" type="integer" minimum="1" />
++			    <help>Accumulation period (in seconds). This must usually match the model time step. if enabling "strict", nodatas will propagate (ie. a single nodata in the input will force the re-accumulated value to be nodata). Otherwise, all valid values are aggregated and only pure nodata intervals produce a nodata in the output.</help>
++			  </parameter>
++			  <help>Accumulation over a user given period (filter argument, in seconds -
++			  should coincide with your calculation step!).</help>
++			</option>
++		</parameter>
++
++		<reference name="METEOIOPARAMETERS" />
++	</parameter>
++
++	<!-- 2D Interpolation -->
++	<parameter key="Add/Remove 2D Interpolation" type="selector">
++		<section name="Interpolations2D" />
++
++		<parameter key="%::algorithms" type="choice" template="true">
++			<section name="Interpolations2D" />
++			<option value="STD_PRESS" type="choice">
++				<help>Generate a standard atmosphere pressure as a function of the cell's elevation</help>
++			</option>
++			<option value="CST" type="choice">
++				<help>Fill the grid with the average over all the stations</help>
++			</option>
++			<option value="CST_LAPSE" type="choice">
++			  <parameter key="%::cst_lapse" type="combination">
++			    <option label="Lapse Rate:" value="0.008" type="decimal" optional="false" />
++			    <option value="" type="dropdown">
++			      <option value="" type="string" />
++			      <option value="soft" type="string" />
++			      <option value="frac" type="string" />
++			    </option>
++			  </parameter>
++			  <help>Detrend the measured data, fill the grid with the average over all the stations, reapply the elevation trend</help>
++			</option>
++			<option value="IDW" type="choice">
++				<help>Inverse Distance Weighted average</help>
++			</option>
++			<option value="IDW_LAPSE" type="choice">
++			  <parameter key="%::idw_lapse" type="combination">
++			    <option label="Lapse Rate:" value="0.008" type="decimal" optional="false" />
++			    <option value="" type="dropdown">
++			      <option value="" type="string" />
++			      <option value="soft" type="string" />
++			      <option value="frac" type="string" />
++			    </option>
++			  </parameter>
++			  <help>Detrend the measured data, apply Inverse Distance Weighted average, reapply elevation trend</help>
++			</option>
++			<option value="LIDW_LAPSE" type="choice">
++			  <parameter key="%::lidw_lapse" type="combination">
++			    <option label="Lapse Rate:" value="0.008" type="decimal" optional="false" />
++			    <option value="" type="dropdown">
++			      <option value="" type="string" />
++			      <option value="soft" type="string" />
++			      <option value="frac" type="string" />
++			    </option>
++			  </parameter>
++			  <help>Same as IDW_LAPSE, but only considering a given number of neighboring stations</help>
++			</option>
++			<option value="RH" type="choice">
++				<help>Computes the dew point temperature, distribute it with IDW_LAPSE, recompute RH at each pixel</help>
++			</option>
++			<option value="ILWR" type="choice">
++				<help>Compute emissivity, distribute it with IDW_LAPSE, recompute ILWR at each pixel</help>
++			</option>
++			<option value="WIND_CURV" type="choice">
++				<help>Distribute wind velocity with IDW_LAPSE, then apply correction factors as a function of local slope and curvature</help>
++			</option>
++			<option value="HNW_SNOW" type="choice">
++				<parameter key="%::hnw_snow" type="combination">
++				<option value="IDW_LAPSE" type="dropdown">
++					<option value="CST" type="string" />
++					<option value="CST_LAPSE" type="string" />
++					<option value="IDW" type="string" />
++					<option value="IDW_LAPSE" type="string" />
++					<option value="ODKRIG" type="string" />
++				</option>
++				<help>Base algorithm (do not forget to add the options for the base algorithm)</help>
++				</parameter>
++				<help>Distribute precipitation with a base algorithm (IDW_LAPSE by default), then reduce/remove precipitation on
++				steep slopes and correct with the local curvature. This is to simulate snow redistribution processes.</help>
++			</option>
++			<option value="USER" type="choice">
++			  <parameter key="%::user" type="path" optional="false"/>
++			  <help>User provided grids, named as {numeric date}_{capitalized meteo parameter}.asc</help>
++			</option>
++			<option value="ODKRIG" type="choice">
++			  <parameter key="%::odkrig" type="combination">
++			  	<option value="" type="dropdown">
++					<option value="LINVARIO" type="string" />
++					<option value="EXPVARIO" type="string" />
++					<option value="SPHERICVARIO" type="string" />
++					<option value="RATQUADVARIO" type="string" />
++				</option>
++				<help>Variogram model</help>
++			  </parameter>
++			  <help>Ordinary kriging (EXPERIMENTAL)</help>
++			</option>
++		</parameter>
++
++		<reference name="METEOIOPARAMETERS" />
++	</parameter>
++</inishell_config>
+\ No newline at end of file
+
+Property changes on: ../trunk-jpl/src/java/doc/examples/meteoio_config.xml
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/doc/examples/snowpack_config.xml
+===================================================================
+--- ../trunk-jpl/src/java/doc/examples/snowpack_config.xml	(revision 0)
++++ ../trunk-jpl/src/java/doc/examples/snowpack_config.xml	(revision 17993)
+@@ -0,0 +1,1084 @@
++<inishell_config application="SNOWPACK">
++	<!-- <include path="doc/examples/meteoio_config.xml" /> -->
++
++	<!-- General Parameters -->
++	<parameter key="BUFF_CHUNK_SIZE" type="integer" default="30">
++		<section name="general" />
++		<help>Size in days of a chunk of data to read at once.</help>
++	</parameter>
++
++	<parameter key="BUFF_BEFORE" type="decimal" default="1.5">
++		<section name="general" />
++		<help>Alternate way of buffer centering: When rebuffering, the new date will be located BUFF_BEFORE days from the
++		beginning of the buffer (therefore, it takes a value in days).</help>
++	</parameter>
++
++	<!-- Coordinate systems, time zones -->
++	<parameter key="COORDSYS" type="alternative" optional="false">
++		<section name="input" />
++		<section name="output" />
++		<option value="CH1903" type="string">
++			<help>coordinates in the Swiss Grid &lt;a href="http://geomatics.ladetto.ch/ch1903_wgs84_de.pdf"&gt;http://geomatics.ladetto.ch/ch1903_wgs84_de.pdf&lt;/a&gt;</help>
++		</option>
++		<option value="UTM" type="string">
++			<parameter key="COORDPARAM" type="string">
++				<help>specify the zone with the zone letter (for example, 32T)</help>
++			</parameter>
++			<help>UTM coordinates, see &lt;a href="http://www.oc.nps.edu/oc2902w/maps/utmups.pdf"&gt;http://www.oc.nps.edu/oc2902w/maps/utmups.pdf&lt;/a&gt;</help>
++		</option>
++		<option value="UPS" type="string">
++			<parameter key="COORDPARAM" type="string">
++				<help>specify the hemisphere (either N or S)</help>
++			</parameter>
++			<help>Universal Polar Stereographic coordinates, see &lt;a href="https://en.wikipedia.org/wiki/Universal_Polar_Stereographic_coordinate_system"&gt;https://en.wikipedia.org/wiki/Universal_Polar_Stereographic_coordinate_system&lt;/a&gt;</help>
++		</option>
++		<option value="PROJ4" type="string">
++			<parameter key="COORDPARAM" type="string" optional="false" />
++			<help>external library: see &lt;a href="http://trac.osgeo.org/proj/"&gt;http://trac.osgeo.org/proj/&lt;/a&gt;</help>
++		</option>
++		<option value="LOCAL"  type="string">
++			<help>uses the horizontal and vertical distance from a reference point</help>
++		</option>
++		<help>coordinate system</help>
++	</parameter>
++
++	<parameter key="TIME_ZONE" type="integer+" default="+1" maximum="14" minimum="-12" optional="false">
++		<section name="input" />
++		<section name="output" />
++	</parameter>
++
++	<!-- Datatypes: Meteo Data -->
++	<frame key="meteo_frame" label="Meteorological Data">
++	<section name="input"/>
++	<parameter key="METEO" type="alternative" optional="false">
++		<section name="input" />
++
++		<option value="A3D" type="string">
++			<parameter key="METEOPATH" type="path" optional="false">
++				<help>string containing the path to the meteorological files</help>
++			</parameter>
++		</option>
++		<option value="BORMA" type="string">
++			<section name="input" />
++			<reference name="BORMA" />
++		</option>
++		<option value="COSMO" type="string">
++			<parameter key="METEOPATH" type="path" optional="false">
++				<help>string containing the path to the meteorological files</help>
++			</parameter>
++		</option>
++		<option value="GEOTOP" type="string">
++			<section name="input" />
++			<reference name="GEOTOP_IN" />
++		</option>
++		<option value="GRIB" type="string">
++			<section name="input" />
++			<reference name="GRIB_METEO" />
++		</option>
++		<option value="GSN" type="string">
++			<section name="input" />
++			<reference name="GSN" />
++		</option>
++		<option value="IMIS" type="string">
++			<section name="input" />
++			<reference name="IMIS" />
++		</option>
++		<option value="SMET" type="string">
++			<section name="input" />
++			<reference name="SMET_IN" />
++		</option>
++		<option value="SNOWPACK" type="string">
++			<section name="input" />
++			<reference name="SNIO_IN" />
++		</option>
++
++		<help>plugin for METEO data </help>
++	</parameter>
++	<parameter key="Add Meteo parameter copy" type="selector">
++		<section name="input"/>
++		<parameter key="COPY::%" type="string" optional="false" template="true">
++			<help>The name of the parameter to copy (e.g. TA, RH, VW, ISWR, etc)</help>
++		</parameter>
++		<help>Copy a meteo parameter into a new one (you should not need this)</help>
++	</parameter>
++	</frame>
++
++	<!-- Extra Input Parameters -->
++	<frame key="snow_frame" label="Initial Snow Profiles">
++	<section name="input"/>
++	<parameter key="SNOWPATH" type="path" default="./current_snow">
++		<section name="input" />
++		<help>Path to the land surface and snow input parameters</help>
++	</parameter>
++	<parameter key="SNOW" type="alternative" default="SMET" optional="true">
++		<section name="input" />
++		<option value="SNOWPACK" type="string" />
++		<option value="SMET" type="string" />
++		<help>Plugin to use for reading SNO data</help>
++	</parameter>
++	<parameter key="SNOWFILE#" type="file" counter="1" optional="false">
++		<section name="input" />
++		<help>file name for the initial profile for station number #</help>
++	</parameter>
++	<!-- <parameter key="NUMBER_OF_SOLUTES" type="integer" default="0" minimum="0" maximum="0">
++		<section name="input" />
++		<help>SNOWPACK can transport an arbitrary number of trace components in its snow and water phases [special use]</help>
++	</parameter> -->
++	</frame>
++
++	<!-- Output Parameters -->
++	<parameter key="METEOPATH" type="path" default="./output">
++		<section name="output" />
++		<help>Path to the outputs (this path MUST exist, it won't be created)</help>
++	</parameter>
++	<parameter key="EXPERIMENT" type="string" optional="false">
++		<section name="output" />
++		<help>Option to give an additional simulation specific output name to the run in addition to "STATION_NAME")</help>
++	</parameter>
++	<frame key="TS_frame" label="Time Series">
++	<section name="output"/>
++	<parameter key="TS_WRITE" type="alternative" optional="false">
++		<section name="output" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Write meteo data out?</help>
++	</parameter>
++	<parameter key="TS_START" type="decimal" default="0" minimum="0" maximum="360">
++		<section name="output" />
++		<help>When to start writing meteo data out (offset, in days)</help>
++	</parameter>
++	<parameter key="TS_DAYS_BETWEEN" type="decimal" default="4.1666e-2" minimum="0" maximum="360">
++		<section name="output" />
++		<help>How often to write meteo data out (in days: 3 hours=.125, 1 hour=4.1666e-2)</help>
++	</parameter>
++	<parameter key="AVGSUM_TIME_SERIES" type="alternative" default="TRUE" optional="true">
++		<section name="output" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>If AVGSUM_TIME_SERIES is set, mean fluxes and cumulated masses since last dump are written, else current energy fluxes, cumulated masses over last COMPUTATION_STEP_LENGTH (recommended setting in operational mode).</help>
++	</parameter>
++	<parameter key="CUMSUM_MASS" type="alternative" default="TRUE" optional="true">
++		<section name="output" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>If CUMSUM_MASS is set, current value of cumulated masses since begin of run are dumped. Precipitations (rain and snow, rain) are always dumped as rates (kg m-2 h-1).</help>
++	</parameter>
++	<parameter key="PRECIP_RATES" type="alternative" optional="true" default="TRUE">
++		<section name="output" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Write precipitation as rates (kg m-2 h-1, default) or as sums over the output time step. Please note that the units label in the output file and in SN_GUI &lt;b&gt;will remain kg m-2 h-1&lt;/b&gt; and will therefore not match sums.</help>
++	</parameter>
++	</frame>
++	<frame key="profiles_frame" label="Snow Profiles">
++	<section name="output"/>
++	<parameter key="PROFILE" type="alternative" default="ASCII" optional="false">
++		<section name="output" />
++		<option value="ASCII" type="string" />
++		<option value="IMIS" type="string" />
++		<option value="ASCII IMIS" type="string" />
++		<help>How to write the profiles (default: ASCII)</help>
++	</parameter>
++	<parameter key="PROF_WRITE" type="alternative" optional="false">
++		<section name="output" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Write profile data out?</help>
++	</parameter>
++	<parameter key="PROF_START" type="decimal" default="0" minimum="0" maximum="360">
++		<section name="output" />
++		<help>When to start writing profile data out (offset, in days)</help>
++	</parameter>
++	<parameter key="PROF_DAYS_BETWEEN" type="decimal" default="4.1666e-2" minimum="0" maximum="360">
++		<section name="output" />
++		<help>How often to write profile data out (in days: 3 hours=.125, 1 hour=4.1666e-2)</help>
++	</parameter>
++	<parameter key="HARDNESS_IN_NEWTON" type="alternative" default="true">
++		<section name="output" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Write the hand hardness in newtons (default) or as index</help>
++	</parameter>
++	<parameter key="CLASSIFY_PROFILE" type="alternative" default="false">
++		<section name="output" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Classify the profile (default=false)? This is according to Schweizer, J. and M. Luetschg, &lt;i&gt;Characteristics of human-triggered avalanches&lt;/i&gt;, 2001, Cold Reg. Sci. Technol. &lt;b&gt;33&lt;/b&gt;(2-3)</help>
++	</parameter>
++	</frame>
++	<frame key="sno_frame" label="Status files">
++	<section name="output"/>
++	<parameter key="SNOW" type="alternative" default="SMET" optional="true">
++		<section name="output" />
++		<option value="SNOWPACK" type="string" />
++		<option value="SMET" type="string" />
++		<help>Plugin to use for reading SNO data</help>
++	</parameter>
++	<parameter key="BACKUP_DAYS_BETWEEN" type="decimal" default="365" minimum="0">
++		<section name="output" />
++		<help>Dump snow files every BACKUP_DAYS_BETWEEN days</help>
++	</parameter>
++	<parameter key="FIRST_BACKUP" type="decimal" default="400" minimum="0">
++		<section name="output" />
++		<help>First dump of sno files happens at end of run or after FIRST_BACKUP days, whichever happens first</help>
++	</parameter>
++	</frame>
++
++	<frame key="switch_frame" label="Outputs Selection">
++	<section name="output"/>
++	<parameter key="OUT_CANOPY" type="alternative" default="FALSE" optional="true">
++		<section name="output" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Write canopy data out? To be set to TRUE only if CANOPY=TRUE</help>
++	</parameter>
++	<parameter key="OUT_HAZ" type="alternative" default="TRUE" optional="true">
++		<section name="output" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Write hazard data out? This must be FALSE for Alpine3D</help>
++	</parameter>
++	<parameter key="OUT_HEAT" type="alternative" default="TRUE" optional="true">
++		<section name="output" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Write turbulent fluxes out?</help>
++	</parameter>
++	<parameter key="OUT_T" type="alternative" default="TRUE" optional="true">
++		<section name="output" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Write snow/soil temperatures out?</help>
++	</parameter>
++	<!-- <parameter key="OUT_LOAD" type="alternative" default="FALSE" optional="true">
++		<section name="output" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Write solutes load data out?</help>
++	</parameter> -->
++	<parameter key="OUT_LW" type="alternative" default="TRUE" optional="true">
++		<section name="output" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Write long wave radiation out?</help>
++	</parameter>
++	<parameter key="OUT_SW" type="alternative" default="TRUE" optional="true">
++		<section name="output" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Write short wave radiation out?</help>
++	</parameter>
++	<parameter key="OUT_MASS" type="alternative" default="TRUE" optional="true">
++		<section name="output" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Write mass balance terms out?</help>
++	</parameter>
++	<parameter key="OUT_METEO" type="alternative" default="TRUE" optional="true">
++		<section name="output" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Write meteo parameters out?</help>
++	</parameter>
++	<parameter key="OUT_STAB" type="alternative" default="TRUE" optional="true">
++		<section name="output" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Write stability parameters out?</help>
++	</parameter>
++	</frame>
++
++
++	<!-- Snowpack Parameters -->
++	<frame key="sn_parameters_frame" label="Model Parameters">
++	<section name="Snowpack"/>
++	<parameter key="CALCULATION_STEP_LENGTH" type="decimal" default="15" minimum="5" maximum="180">
++		<section name="Snowpack" />
++		<help>Internal time step (in minutes) used for model simulation. Please note that this MUST be the same as HNW::accumulate (the latter being in seconds) if re-acumulating precipitation, otherwise it would lead to wrong results.</help>
++	</parameter>
++	<parameter key="ROUGHNESS_LENGTH" type="decimal" default="0.002">
++		<section name="Snowpack" />
++		<help>Aerodynamic roughness length as a parameter for the Monin-Obukhov bulk formulation; A typical value for complex terrain is 0.01 m and for snow covered flat sites 0.001 m.</help>
++	</parameter>
++	<parameter key="HEIGHT_OF_METEO_VALUES" type="decimal" default="5.0">
++		<section name="Snowpack" />
++		<help>The instrument height (or model layer height) for meteorological input data except for wind, which may be at a different height; note that height is above ground for a standard SNOWPACK application but above surface (snow or ground) for Alpine3D applications.</help>
++	</parameter>
++	<parameter key="HEIGHT_OF_WIND_VALUE" type="decimal" default="5.0">
++		<section name="Snowpack" />
++		<help>The instrument height (or model layer height) for wind input data; note that height is above ground for a standard SNOWPACK application but above surface (snow or ground) for Alpine3D applications</help>
++	</parameter>
++	</frame>
++	<frame key="sn_switch_frame" label="Models Selection">
++	<section name="Snowpack"/>
++	<parameter key="ENFORCE_MEASURED_SNOW_HEIGHTS" type="alternative" optional="false">
++		<section name="Snowpack" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Input mode by which a measurement of snow depth is used to drive the snow cover mass balance</help>
++	</parameter>
++	<parameter key="SW_MODE" type="integer" default="0" minimum="0" maximum="2" optional="false">
++		<section name="Snowpack" />
++		<help>Define the shortwave radiation input: &lt;ol&gt; &lt;li value="0"&gt;Incoming shortwave radiation is measured and albedo estimated by the model;&lt;/li&gt; &lt;li&gt;Reflected shortwave radiation is available as input and albedo is estimated by the model (IMIS standard);&lt;/li&gt; &lt;li&gt;Incoming and reflected shortwave radiation are both measured and the albedo is estimated from both measurements subject to plausibility checks.&lt;/li&gt; &lt;/ol&gt;</help>
++	</parameter>
++	<parameter key="NEUTRAL" type="integer" default="1" minimum="-1" maximum="1" optional="false">
++		<section name="Snowpack" />
++		<help>Select the atmospheric stability correction model:&lt;ol&gt; &lt;li value="-1"&gt; use a simplified Richardson number stability correction;&lt;/li&gt; &lt;li&gt;assume standard Monin-Obukhov bulk formulation for surface exchange iteration with Paulson, Stearns and Weidner (can be used with BC_CHANGE=0); &lt;/li&gt; &lt;li&gt; force Monin-Obukhov formulation to assume neutral conditions regardless of the actual stratification; it has been shown to work well in complex terrain settings. It should be used with BC_CHANGE=1, i.e., Dirichlet bc but also is recommended with Neumann b.c., i.e., BC_CHANGE=0.&lt;/li&gt; &lt;/ol&gt;</help>
++	</parameter>
++	<parameter key="CANOPY" type="alternative" default="FALSE" optional="false">
++		<section name="Snowpack" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Switch to tell the model that canopy is present (note that Canopy parameters should then be provided in the *.sno file)</help>
++	</parameter>
++	<parameter key="MEAS_TSS" type="alternative" default="TRUE" optional="false">
++		<section name="Snowpack" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>A measured surface temperature is available and can be reliably used for various consistency tests (it needs to be set to true if enabling CHANGE_BC).</help>
++	</parameter>
++	<parameter key="CHANGE_BC" type="alternative" optional="false">
++		<section name="Snowpack" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Use measured surface temperature as Dirichlet temperature BC for sub-freezing snowpacks and switch to Neumann only for melting snowpacks. If set to false, assumes Neumann boundary conditions.</help>
++	</parameter>
++	<parameter key="THRESH_CHANGE_BC" type="decimal" default="-1.3">
++		<section name="Snowpack" />
++		<help>Threshold value (small number below freezing), which switches from Dirichlet to Neumann BCs if CHANGE_BC is selected</help>
++	</parameter>
++	</frame>
++	<frame key="sn_slopes_frame" label="Virtual slopes">
++	<section name="Snowpack"/>
++	<parameter key="NUMBER_SLOPES" type="alternative" default="1" optional="false">
++		<section name="Snowpack" />
++		<option value="1" type="string" />
++		<option value="5" type="string" />
++		<option value="3" type="string" />
++		<option value="9" type="string" />
++		<help>Based on meteorological input from a (flat field) automatic station or numerical weather model, up to 8 expositions can be calculated in addition to the flat field if the corresponding *.sno files are provided. For example, if you provide a flat field *.snow file (mandatory), which is named KLO3.sno and you want 4 slopes to be calculated the corresponding slope files should be named KLO21.sno, …,KLO24.sno</help>
++	</parameter>
++	<parameter key="INCOMING_LONGWAVE" type="alternative" default="FALSE" optional="false">
++		<section name="Snowpack" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Use the provided incoming long wave on the virtual slopes?</help>
++	</parameter>
++	<parameter key="SNOW_REDISTRIBUTION" type="alternative" default="FALSE" optional="false">
++		<section name="Snowpack" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Specifies if redistribution of snow is allowed from (upwind) expositions to lee slopes. In case just the flat field is calculated, snow erosion is enabled but only for "ENFORCE_MEASURED_SNOW_HEIGHTS".</help>
++	</parameter>
++	</frame>
++	<frame key="soil_frame" label="Soil Modeling">
++	<section name="Snowpack"/>
++	<parameter key="SNP_SOIL" type="alternative" default="TRUE" optional="false">
++		<section name="Snowpack" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Soil layers as defined by the *.sno files are included in the simulation</help>
++	</parameter>
++	<parameter key="SOIL_FLUX" type="alternative" default="FALSE" optional="false">
++		<section name="Snowpack" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Assume that the lower temperature boundary condition is given by GEO_HEAT (Neumann) and not by a measured temperature</help>
++	</parameter>
++	<parameter key="GEO_HEAT" type="decimal" default="0.06">
++		<section name="Snowpack" />
++		<help>Constant geothermal heat flux at great) depth W m-2): Lower flux boundary condition for temperature equation if BC is Neumann</help>
++	</parameter>
++	</frame>
++
++
++	<!-- SnowpackAdvanced Parameters -->
++	<parameter key="ASSUME_RESPONSIBILITY" type="alternative" default="AGREE">
++		<section name="SnowpackAdvanced" />
++		<option value="AGREE" type="string" />
++		<help>&lt;font color="FF0000"&gt;The keys in this section deeply affect the operation of the SNOWPACK model. This could lead to unexpected behavior or surprising results. If you are not an experienced Snowpack user, please do NOT change any keys below!&lt;/font&gt;</help>
++	</parameter>
++	<parameter key="VARIANT" type="alternative">
++		<section name="SnowpackAdvanced" />
++		<option value="DEFAULT" type="string" />
++		<option value="JAPAN" type="string" />
++		<option value="ANTARTICA" type="string" />
++		<!-- <option value="CALIBRATION" type="string" /> -->
++		<help>variant selection (includes a choice of specific models)</help>
++	</parameter>
++	<!-- <parameter key="RESEARCH" type="alternative" optional="true" default="TRUE">
++		<section name="SnowpackAdvanced" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>research_mode</help>
++	</parameter> -->
++	<!-- <parameter key="NUMBER_FIXED_RATES" type="integer" default="0">
++		<section name="SnowpackAdvanced" />
++		<help>number_fixed_rates</help>
++	</parameter> -->
++	<parameter key="PERP_TO_SLOPE" type="alternative" optional="true" default="FALSE">
++		<section name="SnowpackAdvanced" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>perp_to_slope</help>
++	</parameter>
++	<frame key="wind_frame" label="Wind Handling">
++	<section name="SnowpackAdvanced"/>
++	<parameter key="PREVAILING_WIND_DIR" type="decimal" default="0">
++		<section name="SnowpackAdvanced" />
++		<help>Shifts the origin of the wind rose for snow redistribution and slope simulations: e.g. choose 45° to have NE/SE/SW/NW</help>
++	</parameter>
++	<parameter key="WIND_SCALING_FACTOR" type="decimal" default="1.0" minimum="0" maximum="2">
++		<section name="SnowpackAdvanced" />
++		<help>Scaling factor to apply to wind values in case of drifting snow</help>
++	</parameter>
++	</frame>
++	<frame key="hnw_frame" label="Precipitation Handling">
++	<section name="SnowpackAdvanced"/>
++	<parameter key="FORCE_RH_WATER" type="alternative" optional="true">
++		<section name="SnowpackAdvanced" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Tell the model that relative humidity values are with respect to water regardless of the temperature</help>
++	</parameter>
++	<parameter key="THRESH_RAIN" type="decimal" default="1.2">
++		<section name="SnowpackAdvanced" />
++		<help>Temperature threshold for rain/snow transition</help>
++	</parameter>
++	<parameter key="THRESH_RH" type="decimal" default="0.5">
++		<section name="SnowpackAdvanced" />
++		<help>If ENFORCE_MEASURED_SNOW_HEIGHTS, relative humidity threshold for precipitation to occur</help>
++	</parameter>
++	<parameter key="THRESH_DT_AIR_SNOW" type="decimal" default="3.0">
++		<section name="SnowpackAdvanced" />
++		<help>If ENFORCE_MEASURED_SNOW_HEIGHTS, (TA-TSS) threshold for precipitation to occur</help>
++	</parameter>
++	</frame>
++	<frame key="hoar_frame" label="Hoar Handling">
++	<section name="SnowpackAdvanced"/>
++	<parameter key="HOAR_THRESH_RH" type="decimal" default="0.97">
++		<section name="SnowpackAdvanced" />
++		<help>Relative humidity threshold above which no surface hoar is allowed to form (because at very high humidity, typically no hoar crystals can form)</help>
++	</parameter>
++	<parameter key="HOAR_THRESH_VW" type="decimal" default="3.5">
++		<section name="SnowpackAdvanced" />
++		<help>Wind speed threshold above which no surface hoar is allowed to form (because it will drift away)</help>
++	</parameter>
++	<parameter key="HOAR_DENSITY_BURIED" type="decimal" default="125.0">
++		<section name="SnowpackAdvanced" />
++		<help>Define the initial density for surface hoar at the time it gets buried by new snow</help>
++	</parameter>
++	<parameter key="HOAR_MIN_SIZE_BURIED" type="decimal" default="2.0">
++		<section name="SnowpackAdvanced" />
++		<help>Define a threshold below which any traces of surface hoar will not be given a separate hoar layer when buried.</help>
++	</parameter>
++	<parameter key="HOAR_DENSITY_SURF" type="decimal" default="100.0">
++		<section name="SnowpackAdvanced" />
++		<help>Assumed density of surface hoar while exposed at the surface and not buried</help>
++	</parameter>
++	</frame>
++	<frame key="temps_frame" label="Temperatures Handling">
++	<section name="SnowpackAdvanced"/>
++	<parameter key="FIXED_POSITIONS" type="string" default="">
++		<section name="SnowpackAdvanced" />
++		<help>positions of temperatur sensors in snow or soil: positive values refer to heigths measured from the ground surface (snow only), negative values refer to depths measured from either the ground surface or the snow surface in case no soil layers are present. A sensor must at least be covered by MIN_DEPTH_SUBSURF (m) snow for its temperature to be output.</help>
++	</parameter>
++	<!-- <parameter key="MAX_NUMBER_MEAS_TEMPERATURES" type="integer" default="5">
++		<section name="SnowpackAdvanced" />
++		<help></help>
++	</parameter> -->
++	<parameter key="MIN_DEPTH_SUBSURF" type="decimal" default="0.07">
++		<section name="SnowpackAdvanced" />
++		<help>Minimum snow depth above a temperature sensor to accept the measurement</help>
++	</parameter>
++	<parameter key="T_CRAZY_MIN" type="decimal" default="210.">
++		<section name="SnowpackAdvanced" />
++		<help>If you go to Antarctica or the tropics you may expect different reasonable temperatures</help>
++	</parameter>
++	<parameter key="T_CRAZY_MAX" type="decimal" default="340.">
++		<section name="SnowpackAdvanced" />
++		<help>If you go to Antarctica or the tropics you may expect different reasonable temperatures</help>
++	</parameter>
++	</frame>
++	<frame key="sn_models_frame" label="Models Selection">
++	<section name="SnowpackAdvanced"/>
++	<parameter key="HN_DENSITY_MODEL" type="alternative" default="LEHNING_NEW">
++		<section name="SnowpackAdvanced" />
++		<option value="LEHNING_NEW" type="string" />
++		<option value="ZWART" type="string" />
++		<option value="BELLAIRE" type="string" />
++		<option value="LEHNING_OLD" type="string" />
++		<option value="PAHAUT" type="string" />
++		<help>Choice of new snow density model (diverse statistical models)</help>
++	</parameter>
++	<parameter key="HN_DENSITY" type="string" default="PARAMETERIZED">
++		<section name="SnowpackAdvanced" />
++		<help>Fixed value to be used as new snow density if a constant density model is chosen, otherwise the choices are "PARAMETERIZED" "EVENT" "MEASURED"</help>
++	</parameter>
++	<parameter key="METAMORPHISM_MODEL" type="alternative">
++		<section name="SnowpackAdvanced" />
++		<option value="DEFAULT" type="string" />
++		<option value="NIED" type="string" />
++		<help>metamorphism_model</help>
++	</parameter>
++	<parameter key="NEW_SNOW_GRAIN_RAD" type="decimal" default="0.15">
++		<section name="SnowpackAdvanced" />
++		<help>new_snow_grain_rad</help>
++	</parameter>
++	<parameter key="STRENGTH_MODEL" type="alternative">
++		<section name="SnowpackAdvanced" />
++		<option value="DEFAULT" type="string" />
++		<option value="NIED" type="string" />
++		<help>strength_model</help>
++	</parameter>
++	<parameter key="VISCOSITY_MODEL" type="alternative">
++		<section name="SnowpackAdvanced" />
++		<option value="DEFAULT" type="string" />
++		<option value="NIED" type="string" />
++		<help>viscosity_model</help>
++	</parameter>
++	<parameter key="HARDNESS_MODEL" type="alternative">
++		<section name="SnowpackAdvanced" />
++		<option value="MONTI" type="string" />
++		<option value="BELLAIRE" type="string" />
++		<option value="ASARC" type="string" />
++		<help>hardness_model</help>
++	</parameter>
++	<parameter key="DOORSCHOT" type="alternative" optional="true" default="FALSE">
++		<section name="SnowpackAdvanced" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Choose the Doorschot saltation model over the simple Sorenson parameterization</help>
++	</parameter>
++	<parameter key="MULTISTREAM" type="alternative" optional="true">
++		<section name="SnowpackAdvanced" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Select a multi stream model for shortwave radiation penetration into the snow cover</help>
++	</parameter>
++	<parameter key="FIXED_ALBEDO" type="alternative" optional="true">
++		<section name="SnowpackAdvanced" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Force the model to work with a fixed albedo</help>
++	</parameter>
++	<!-- <parameter key="SURFACECODE" type="alternative" optional="true">
++		<section name="SnowpackAdvanced" />
++		<option value="NEUMANN_BC" type="string" />
++		<option value="DIRICHLET_BC" type="string" />
++		<help>Select the boundary conditions to use</help>
++	</parameter> -->
++	</frame>
++	<frame key="sn_extra_frame" label="Extra Models Selection">
++	<section name="SnowpackAdvanced"/>
++	<parameter key="DETECT_GRASS" type="alternative" optional="true" default="TRUE">
++		<section name="SnowpackAdvanced" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Identify grass growing under the snow height sensor. This usually works well but might sometimes lead to problems</help>
++	</parameter>
++	<parameter key="PLASTIC" type="alternative" optional="true" default="FALSE">
++		<section name="SnowpackAdvanced" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Switch to tell the model that a impermeable layer should be simulated on top of some snow or ice: this requires that the *.sno file contains this layer, which is characterized via the soil parameters; the option has successfully been used to simulate snow and ice protection using geo-textiles and saw dust.</help>
++	</parameter>
++	<parameter key="JAM" type="alternative" optional="true" default="FALSE">
++		<section name="SnowpackAdvanced" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>If switched on, you can also simulate ponding on impermeable ice surfaces below the snow cover</help>
++	</parameter>
++	<parameter key="WATER_LAYER" type="alternative" optional="true" default="FALSE">
++		<section name="SnowpackAdvanced" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Assuming an impermeable surface such as on a road or on geo-textiles (e.g. for snow farming), a liquid water layer is allowed to form on this surface</help>
++	</parameter>
++	</frame>
++	<frame key="elements_frame" label="Elements Handling">
++	<section name="SnowpackAdvanced"/>
++	<parameter key="HEIGHT_NEW_ELEM" type="decimal" default="0.02">
++		<section name="SnowpackAdvanced" />
++		<help>Standard size of a new element added to the stack of elements (layers) during snowfall events</help>
++	</parameter>
++	<parameter key="MINIMUM_L_ELEMENT" type="decimal" default="0">
++		<section name="SnowpackAdvanced" />
++		<help>Threshold value for enforcing the layer to be merged with the layer above or below</help>
++	</parameter>
++	<parameter key="COMBINE_ELEMENTS" type="alternative" optional="true">
++		<section name="SnowpackAdvanced" />
++		<option value="TRUE" type="string" />
++		<option value="FALSE" type="string" />
++		<help>Combine neighboring elements based on a set of similarity conditions which are hard-coded</help>
++	</parameter>
++	</frame>
++
++	<!--Parameter group for list of stations -->
++	<parametergroup name="stationgroup_files">
++		<parameter key="STATION#" type="file" counter="1" optional="false">
++			<help>filename for station number # </help>
++		</parameter>
++	</parametergroup>
++	<parametergroup name="stationgroup_names">
++		<parameter key="STATION#" type="string" counter="1" optional="false">
++			<help>station id for the given station number # </help>
++		</parameter>
++	</parametergroup>
++	<parametergroup name="stationgroup_pos">
++		<parameter key="STATION#" type="string" counter="1">
++			<help>Coordinates are given as "lat lon" or "xcoord ycoord epsg_code"</help>
++		</parameter>
++	</parametergroup>
++
++	<!-- Plugins for Meteo Data-->
++	<parametergroup name="BORMA">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string containing the path to the xml files</help>
++		</parameter>
++		<reference name="stationgroup_names" />
++	</parametergroup>
++
++	<parametergroup name="IMIS">
++		<parameter key="DBNAME" type="string" optional="false">
++			<help>database name, as provided by your database administrator</help>
++		</parameter>
++		<parameter key="DBUSER" type="string" optional="false">
++			<help>database user name</help>
++		</parameter>
++		<parameter key="DBPASS" type="string" optional="false">
++			<help>database password associated with the user name</help>
++		</parameter>
++		<parameter key="USEANETZ" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		  <help>OPTIONAL: use ANETZ stations to provide precipitations for normal IMIS stations.
++		  Each IMIS station is associated with one or two ANETZ stations and does a weighted
++		  average to get what should be its local precipitations</help>
++		</parameter>
++		<parameter key="USE_IMIS_HNW" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		  <help>OPTIONAL: if set to false (default), all IMIS precipitation will be deleted (since IMIS stations don't have heated rain gauges, their precipitation measurements are not good in winter conditions). If set to true, it is strongly advised to use a FilterHNWMelt filter to detect snow melting in the rain gauge and perform winter conditions detection in the application.</help>
++		</parameter>
++		<parameter key="USE_SNOWPACK_HNW" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		  <help>if set to true, the SNOWPACK simulated Snow Water Equivalent from the database will be used to compute HNW. Data gaps greater than 3 hours on SWE will lead to unchanged hnw while all data that can properly be computed will overwrite hnw. (default=false)</help>
++		</parameter>
++
++		<reference name="stationgroup_names" />
++	</parametergroup>
++
++	<parametergroup name="GRIB_METEO">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string containing the path to the grib files</help>
++		</parameter>
++		<parameter key="METEOEXT" type="string" optional="true">
++			<help>grib file extension, or none for no file extension (default: .grb)</help>
++		</parameter>
++
++		<reference name="stationgroup_pos" />
++	</parametergroup>
++
++	<parametergroup name="GEOTOP_IN">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string containing the path to the data files</help>
++		</parameter>
++		<parameter key="METAFILE" type="file" optional="false">
++			<help>absolute filename of the geotop.inpts file</help>
++		</parameter>
++		<parameter key="METEOPREFIX" type="string" optional="true">
++			<help>prefix to append when generating a file name for reading</help>
++		</parameter>
++	</parametergroup>
++
++	<parametergroup name="GSN">
++		<parameter key="ENDPOINT" type="string" optional="false">
++			<help>webserver running GSN with its port number and full path. For example:
++			http://montblanc.slf.ch:22001/services/A3DWebService</help>
++		</parameter>
++		<parameter key="PROXY" type="string" optional="true">
++			<help>Should the connection go through a proxy? This is useful for servers
++			filtering on domains but usually not necessary.</help>
++		</parameter>
++		<parameter key="PROXYPORT" type="string" optional="true" />
++		<parameter key="PROXYUSER" type="string" optional="true" />
++		<parameter key="PROXYPASS" type="string" optional="true" />
++
++		<reference name="stationgroup_names" />
++	</parametergroup>
++
++	<parametergroup name="SMET_IN">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string containing the path to the smet files</help>
++		</parameter>
++		<reference name="stationgroup_files" />
++	</parametergroup>
++
++	<parametergroup name="SNIO_IN">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string containing the path to the SNOWPACK files</help>
++		</parameter>
++		<parameter key="METAFILE" type="file" optional="true">
++			<help>filename of the meta data file (in METEOPATH)</help>
++		</parameter>
++		<parameter key="NUMBER_MEAS_TEMPERATURES" type="integer+" minimum="0" default="0">
++		  <help>the number of measured snow temperatures that are provided</help>
++		</parameter>
++		<parameter key="NUMBER_OF_SOLUTES" type="integer+" minimum="0" default="0">
++		  <help>the number of solutes for which input data are provided</help>
++		</parameter>
++
++		<parameter key="RSWR_INP" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		</parameter>
++		<parameter key="ISWR_INP" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		</parameter>
++		<parameter key="VW_DRIFT" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		  <help>OPTIONAL: wind velocity to use for blowing and drifting snow is provided</help>
++		</parameter>
++		<parameter key="RHO_HN" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		  <help>OPTIONAL: measured new snow density is provided</help>
++		</parameter>
++
++		<reference name="stationgroup_files" />
++	</parametergroup>
++
++	<!-- Meteo Parameters for Filters, resampling, spatial interpolations-->
++	<parametergroup name="METEOIOPARAMETERS">
++		<option value="TA"/>
++		<option value="RH"/>
++		<option value="VW"/>
++		<option value="DW"/>
++		<option value="VW_MAX"/>
++		<option value="ISWR"/>
++		<option value="RSWR"/>
++		<option value="ILWR"/>
++		<option value="HS"/>
++		<option value="HNW"/>
++		<option value="TSG"/>
++		<option value="TSS"/>
++		<option value="P"/>
++	</parametergroup>
++
++	<!-- Filters -->
++	<parameter key="Add/Remove Filter" type="selector">
++		<section name="filters" />
++
++		<parameter key="%::filter#" type="alternative" counter="1" template="true">
++			<section name="filters" />
++
++			<option label="MeanAvg" value="mean_avg" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			    </help>
++			  </parameter>
++			  <help>Mean average processing. The mean average filter returns the mean value of all values within a user given time window.</help>
++			</option>
++
++
++			<option label="MedianAvg" value="median_avg" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="decimal" minimum="0" />
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			    </help>
++			  </parameter>
++			  <help>Median average processing. The median average filter returns the median value of all values within a user given time window.</help>
++			</option>
++
++			<option label="Std Deviation Filter" value="std_dev" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			    </help>
++			  </parameter>
++			  <help>Standard deviation filter. Values outside of mean ± 2 std_dev are rejected.</help>
++			</option>
++
++			<option label="MAD" value="mad" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			    </help>
++			  </parameter>
++			  <help>Median Absolute Deviation. Values outside of median ± 3 σ_MAD are rejected. &lt;br&gt;
++			  See http://en.wikipedia.org/wiki/Median_absolute_deviation for more information.</help>
++			</option>
++
++			<option label="Tukey 53H Filter" value="Tukey" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <help>
++			      The keyword "soft" maybe added, if the window position is allowed to be adjusted to the data present.
++			      The two arguments may be preceded by the keywords "left", "center" or "right", indicating the window position.
++			    </help>
++			  </parameter>
++			  <help>Tukey 53H method A smooth time sequence is generated from the median, substracted from the original signal and
++			  compared with the standard deviation. see "Despiking Acoustic Doppler Velocimeter Data", Derek G. Goring and Vladimir
++			  L. Nikora, Journal of Hydraulic Engineering, 128, 1, 2002 The deviation factor coeffecient is currently hard-coded as k=1.5. </help>
++			</option>
++
++			<option label="Wind Averaging Filter" value="wind_avg" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			    </help>
++			  </parameter>
++			  <help>Wind vector averaging. This calculates the vector average over a user given time period. Each wind vector
++			  within this period is added and the final sum is normalized by the number of vectors that have been added. </help>
++			</option>
++
++			<option label="Exponential Smoothing" value="exp_smoothing" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <option label="alpha:" value="0.8" type="decimal" minimum="0" maximum="1"/>
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			      Alpha needs to be provided as last argument. Please note that the standard filter works with a left window!
++			    </help>
++			  </parameter>
++			  <help>Exponential smooting processing, exponential moving average s_0 = x_0 s_n = alpha*x_(t-1) + (1-alpha)*s_t-1</help>
++			</option>
++
++			<option label="Weighted Moving Average Smoothing" value="wma_smoothing" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			      Please note that the standard filter works with a left window!
++			    </help>
++			  </parameter>
++			  <help>Weighted moving average smoothing such as: WMA = (1*X1 + 2*X2 + ... + n*Xn) / sum_of_weights</help>
++			</option>
++
++			<option label="Min Range Filter" value="min" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option label="Min:" value="" type="decimal" />
++			    <option label="Adjust to:" value="" type="decimal" />
++			    <help>The keyword "soft" maybe added, in such a case all data smaller than the min would be
++			    assigned the minimum permissible value or another value given as an extra argument</help>
++			  </parameter>
++			  <help>Min range filter. Reject all values smaller than the min.</help>
++			</option>
++
++			<option label="Max Range Filter" value="max" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option label="Max:" value="" type="decimal" />
++			    <option label="Adjust to:" value="" type="decimal" />
++			    <help>The keyword "soft" maybe added, in such a case all data greater than the max would be
++			    assigned the maximum permissible value or another value given as an extra argument</help>
++			  </parameter>
++			  <help>Max range filter. Reject all values greater than the max.</help>
++			</option>
++
++			<option label="MinMax (2 or 4 arguments)" value="min_max" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option label="Min:" value="" type="decimal" />
++			    <option label="Max:" value="" type="decimal" />
++			    <option label="Min adjust to:" value="" type="decimal" />
++			    <option label="Max adjust to:" value="" type="decimal" />
++			    <help>The keyword "soft" maybe added, in such a case all data greater than the max would be assigned
++			    the maximum permissible value and all data smaller than the min would be assigned the minimum
++			    permissible value or an optional extra set of two user provided values</help>
++			  </parameter>
++			  <help>Reject all values greater than the max or smaller than the min. &lt;br&gt;</help>
++			</option>
++
++			<option label="Rate Filter (1 argument)" value="rate" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option label="Max:" value="1.0" type="decimal" minimum="0" maximum="1" />
++			    <help>the absolute value of the maximum permissible rate of change (per seconds)</help>
++			  </parameter>
++			  <help>Rate of change filter. Calculate the change rate (ie: slope) between two points, if it is above a user given value, reject the point.</help>
++			</option>
++
++			<option label="Rate Filter (2 arguments)" value="rate" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option label="Min:" value="0.0" type="decimal" minimum="0" maximum="1" />
++			    <option label="Max:" value="1.0" type="decimal" minimum="0" maximum="1" />
++			    <help>the minimum and maximum permissible rate of change (per second)</help>
++			  </parameter>
++			  <help>Rate of change filter. Calculate the change rate (ie: slope) between two points, if it is above a user given value, reject the point.</help>
++			</option>
++
++			<option label="Unheated Rain Gauge Filter" value="Unheated_RainGauge" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option label="RH threshold:" value="0.5" type="decimal" minimum="0" maximum="1" />
++			    <option label="Delta_T threshold:" value="3.0" type="decimal" minimum="0" maximum="20" />
++			  </parameter>
++			  <help>Filters out snow melting in an unheated rain gauge. This filter can ONLY be applied to precipitation. Non-zero measurements are accepted only if they take place when the relative humidity is greater than RH_threshold and (TA-TSS) smaller than Delta_T_threshold, otherwise they get reset to 0. If none of these conditions could be tested (for lack of data), then the precipitation is reset to nodata (or left unchanged if "soft" has been selected).</help>
++			</option>
++
++			<option label="WMO Undercatch Filter" value="undercatch_wmo" type="string">
++			  <parameter key="%::arg#" type="combination">
++				<option value="Gage type" type="dropdown">
++					<option value="Nipher" type="string" />
++					<option value="Tretyakov" type="string" />
++					<option value="US8sh" type="string" />
++					<option value="US8unsh" type="string" />
++					<option value="Hellmann" type="string" />
++					<option value="Hellmannsh" type="string" />
++				</option>
++			  </parameter>
++			  <help>This implements the standard methods for precipitation correction as described in "WMO Solid Precipitation Measurement Intercomparison", B. Goodison, P. Louie and D. Yang, 872, 1998 as well as the overview given by "Literature Study on the Correction of Precipitation Measurements", Annette Wagner, 2009. The correction parameters for the shielded Hellmann gauge (German version) are from "Wind-induced Precipitation Undercatch of the Hellmann Gauges", Daqing Yang et al, Nordic Hydrology, 30, 1999, pp 57-80.</help>
++			</option>
++
++			<option label="WMO Undercatch Filter - simplified" value="undercatch_wmo" type="string">
++			  <parameter key="%::arg#" type="combination">
++				<option value="Kind" type="dropdown">
++					<option value="Cst" type="string" />
++				</option>
++				<option label="Snow factor:" value="1.3" type="decimal" minimum="0" maximum="5" />
++				<option label="Mixed precipitation factor:" value="1.1" type="decimal" minimum="0" maximum="5" />
++			  </parameter>
++			  <help>This applies a constant correction factor to the precipitation, one for pure snow and one for mixed precipitation. The following thresholds are used: pure snow below -2 C; mixed precipitation between -2 and +2 C; pure rain above 2 C. These threshold can be changed (see online documentation).</help>
++			</option>
++
++			<option label="Unventillated temperature sensor" value="Unventilated_T" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option label="albedo:" value="0.23" type="decimal" />
++			    <option value="soft" type="choice" />
++			    <help>If the "soft" option is given, the albedo has a value different according to snow (or no snow) on the ground</help>
++			  </parameter>
++			  <help>This implements the correction described in (Reina Nakamura, 2005) with an albedo dependency as introduced in (Huwald, 2009)</help>
++			</option>
++
++			<option label="Add an offset" value="add" type="string">
++			  <parameter key="%::arg#" type="combination">
++				<option label="offset:" value="0." type="decimal" />
++			  </parameter>
++			  <help>This adds a given offset to the data.</help>
++			</option>
++
++			<option label="Multiply by a factor" value="mult" type="string">
++			  <parameter key="%::arg#" type="combination">
++				<option label="factor:" value="1." type="decimal" />
++			  </parameter>
++			  <help>This multiplies the data by a given factor.</help>
++			</option>
++
++		</parameter>
++
++		<reference name="METEOIOPARAMETERS" />
++	</parameter>
++
++	<!-- 1D Interpolation -->
++	<parameter key="WINDOW_SIZE" type="integer+" minimum="1" default="43200">
++		<section name="Interpolations1D" />
++		<help>Affects resampling: expresses (in seconds) how far a valid point can be
++		searched for when re-interpolating a missing value</help>
++	</parameter>
++
++	<parameter key="Add/Remove 1D Interpolation" type="selector">
++		<section name="Interpolations1D" />
++
++		<parameter key="%::resample" type="alternative" template="true">
++			<section name="Interpolations1D" />
++			<option label="No Interpolation" value="none" type="string" />
++			<option label="Nearest Neighbour" value="nearest_neighbour" type="string" />
++			<option label="Linear" value="linear" type="string">
++			  <parameter key="%::args" type="combination">
++			    <option value="extrapolate" type="choice" />
++			    <help>
++			      If "extrapolate" is added, then data *outside* of the original date range can be interpolated.
++			      Otherwise, a data point will only be calculated between the original date range.
++			    </help>
++			  </parameter>
++			  <help>Mean average processing. The mean average filter returns the mean value of all values within a user given time window.</help>
++			</option>
++			<option label="Accumulate" value="accumulate" type="string">
++			  <parameter key="%::args" type="combination">
++			    <option value="strict" type="choice" />
++			    <option label="Seconds:" value="900" type="integer" minimum="1" />
++			    <help>Accumulation period (in seconds). This must usually match the model time step. if enabling "strict", nodatas will propagate (ie. a single nodata in the input will force the re-accumulated value to be nodata). Otherwise, all valid values are aggregated and only pure nodata intervals produce a nodata in the output.</help>
++			  </parameter>
++			  <help>Accumulation over a user given period (filter argument, in seconds -
++			  should coincide with your calculation step!).</help>
++			</option>
++		</parameter>
++
++		<reference name="METEOIOPARAMETERS" />
++	</parameter>
++
++</inishell_config>
+\ No newline at end of file
+
+Property changes on: ../trunk-jpl/src/java/doc/examples/snowpack_config.xml
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/doc/examples/issm.xml
+===================================================================
+--- ../trunk-jpl/src/java/doc/examples/issm.xml	(revision 0)
++++ ../trunk-jpl/src/java/doc/examples/issm.xml	(revision 17993)
+@@ -0,0 +1,1284 @@
++<inishell_config application="ISSM prototype">
++
++<!-- mesh -->
++<parameter key ="Dimension" type="alternative" optional="false">
++     <section name="mesh" />
++     <option value="0" type="string" default="true">
++        <help> dimension is 0 </help>
++     </option>
++     <option value="3" type="string">
++        <help> dimension is 3 </help>
++       <!-- Elements and vertices of the original 2d mesh -->
++          <parameter key ="x2d" type="double" default="N/A">
++              <help> vertices x coordinate [m] </help>
++          </parameter>
++          <parameter key ="y2d" type="double" default="N/A">
++              <help> vertices y coordinate [m] </help>
++          </parameter>
++          <parameter key ="elements2d" type="double" default="N/A">
++              <help> vertex indices of the mesh elements </help>
++          </parameter>
++          <parameter key ="numberofvertices2d" type="double" default="0">
++              <help> number of vertices </help>
++          </parameter>
++          <parameter key ="numberofelements2d" type="double" default="0">
++              <help> number of elements </help>
++          </parameter>
++     </option>
++     <help> select a mesh dimension 0(default) or 3 </help>
++</parameter>
++<frame key="1" label="Elements and vertices">
++<section name="mesh" />
++  <parameter key ="numberofelements" type="double" default="0">
++     <section name="mesh" />
++     <help> number of elements </help>
++  </parameter>
++  <parameter key ="numberofvertices" type="double" default="0">
++     <section name="mesh" />
++     <help> number of verticies </help>
++  </parameter>
++  <parameter key ="elements" type="double" default="N/A">
++     <section name="mesh" />
++     <help> vertex indices of the mesh elements </help>
++  </parameter>
++  <parameter key ="x" type="double" default="N/A">
++     <section name="mesh" />
++     <help> vertices x coordinate [m] </help>
++  </parameter>
++  <parameter key ="y" type="double" default="N/A">
++     <section name="mesh" />
++     <help> vertices y coordinate [m] </help>
++  </parameter>
++  <parameter key ="z" type="double" default="N/A">
++     <section name="mesh" />
++     <help> vertices z coordinate [m] </help>
++  </parameter>
++  <parameter key ="edges" type="double" default="N/A">
++     <section name="mesh" />
++     <help> edges of the 2d mesh (vertex1 vertex2 element1 element2) </help>
++  </parameter>
++  <parameter key ="numberofedges" type="double" default="0">
++     <section name="mesh" />
++     <help> number of edges of the 2d mesh </help>
++  </parameter>
++</frame>
++<frame key="2" label="Properties">
++<section name="mesh" />
++  <parameter key ="selected dimension" type="double" default="0">
++     <section name="mesh" />
++     <help> mesh dimension </help>
++  </parameter>
++  <parameter key ="numberoflayers" type="double" default="0">
++     <section name="mesh" />
++     <help> number of extrusion layers </help>
++  </parameter>
++  <parameter key ="vertexonbed" type="double" default="N/A">
++     <section name="mesh" />
++     <help> lower vertices flags list </help>
++  </parameter>
++  <parameter key ="elementonbed" type="double" default="N/A">
++     <section name="mesh" />
++     <help> lower elements flags list </help>
++  </parameter>
++  <parameter key ="vertexonsurface" type="double" default="N/A">
++     <section name="mesh" />
++     <help> upper vertices flags list </help>
++  </parameter>
++  <parameter key ="elementonsurface" type="double" default="N/A">
++     <section name="mesh" />
++     <help> upper element flag list </help>
++  </parameter>
++  <parameter key ="uppervertex" type="double" default="N/A">
++     <section name="mesh" />
++     <help> upper vertex list (NaN for vertex on the upper surface) </help>
++  </parameter>
++  <parameter key ="upperelements" type="double" default="N/A">
++     <section name="mesh" />
++     <help> upper element list (NaN for element on the upper layer) </help>
++  </parameter>
++  <parameter key ="lowervertex" type="double" default="N/A">
++     <section name="mesh" />
++     <help> lower vertex list (NaN for vertex on the lower surface) </help>
++  </parameter>
++  <parameter key ="lowerelements" type="double" default="N/A">
++     <section name="mesh" />
++     <help> lower element list (NaN for element on the lower layer </help>
++  </parameter>
++  <parameter key ="vertexonboundary" type="double" default="N/A">
++     <section name="mesh" />
++     <help> vertices on the boundary of the domain flag list </help>
++  </parameter>
++  <parameter key ="segments" type="double" default="N/A">
++     <section name="mesh" />
++     <help> edges on domain boundary (vertex1 vertex2 element) </help>
++  </parameter>
++  <parameter key ="segmentmarkers" type="double" default="N/A">
++     <section name="mesh" />
++     <help> number associated to each segment </help>
++  </parameter>
++  <parameter key ="vertexconnectivity" type="double" default="N/A">
++     <section name="mesh" />
++     <help> list of vertices connected to vertex_i </help>
++  </parameter>
++  <parameter key ="elementconnectivity" type="double" default="N/A">
++     <section name="mesh" />
++     <help> list of vertices connected to element_i </help>
++  </parameter>
++  <parameter key ="average_vertex_connectivity" type="double" default="25">
++     <section name="mesh" />
++     <help> average number of vertices connected to one vertex </help>
++  </parameter>
++</frame>
++<frame key="3" label="Extracted Model">
++<section name="mesh" />
++  <parameter key ="extractedvertices" type="double" default="N/A">
++     <section name="mesh" />
++     <help> vertices extracted from the model </help>
++  </parameter>
++  <parameter key ="extractedelements" type="double" default="N/A">
++     <section name="mesh" />
++     <help> elements extracted from the model </help>
++  </parameter>
++</frame>
++<frame key="4" label="Projection">
++<section name="mesh" />
++  <parameter key ="lat" type="double" default="N/A">
++     <section name="mesh" />
++     <help> vertices latitude [degrees] </help>
++  </parameter>
++  <parameter key ="long" type="double" default="N/A">
++     <section name="mesh" />
++     <help> verticies longitude [degrees] </help>
++  </parameter>
++  <parameter key ="hemisphere" type="double" default="N/A">
++     <section name="mesh" />
++     <help> Indicate hemisphere 'n' or 's' </help>
++  </parameter></frame>
++
++
++<!-- mask -->
++<parameter key ="groundedice_levelset" type="double" default="NaN">
++     <section name="mask" />
++     <help> is ice grounded ? grounded ice if > 0, grounding line position if = 0, floating ice if &amp;lt; 0 </help>
++</parameter>
++<parameter key ="ice_levelset" type="double" default="NaN">
++     <section name="mask" />
++     <help> presence of ice if > 0, icefront position if = 0, no ice if &amp;lt; 0 </help>
++</parameter>
++
++<!-- geometry -->
++<frame key="1" label="Geometry parameters">
++<section name="geometry" />
++<parameter key ="surface" type="path" optional="false">
++     <section name="geometry" />
++     <help> surface elevation [m] </help>
++</parameter>
++<parameter key ="thickness" type="path" optional="false">
++     <section name="geometry" />
++     <help> ice thickness [m] </help>
++</parameter>
++<parameter key ="bed" type="path" optional="false">
++     <section name="geometry" />
++     <help> bed elevation [m] </help>
++</parameter>
++<parameter key ="bathymetry" type="double" default="N/A">
++     <section name="geometry" />
++     <help> bathymetry elevation [m] </help>
++</parameter>
++<parameter key ="hydrostatic_ratio" type="double" default="N/A">
++     <section name="geometry" />
++     <help> coefficient for ice shelves; thickness correction: hydrostatic_ratio H_obs+ (1-hydrostatic_ratio) H_hydro </help>
++</parameter></frame>
++
++
++<!-- constants -->
++<parameter key ="g" type="double" default="9.81">
++     <section name="constants" />
++     <help> gravitational acceleration [m/s^2] </help>
++</parameter>
++<parameter key ="yts" type="double" default="31536000">
++     <section name="constants" />
++     <help> number of seconds in a year [s/yr] </help>
++</parameter>
++<parameter key ="referencetemperature" type="double" default="223.15">
++     <section name="constants" />
++     <help> reference temperature used in the enthalpy model [K] </help>
++</parameter>
++
++<!-- surfaceforcings(SMB) -->
++<parameter key ="mass_balance" type="double" default="NaN">
++     <section name="surfaceforcings(SMB)" />
++     <help> surface mass balance [m/yr ice eq] </help>
++</parameter>
++
++<!-- basalforcings -->
++<parameter key ="melting_rate" type="double" default="NaN">
++     <section name="basalforcings" />
++     <help> basal melting rate (positive if melting) [m/yr] </help>
++</parameter>
++<parameter key ="melting_rate_correction" type="double" default="NaN">
++     <section name="basalforcings" />
++     <help> additional melting applied to compensate for dh/dt [m/yr] </help>
++</parameter>
++<parameter key ="geothermalflux" type="double" default="NaN">
++     <section name="basalforcings" />
++     <help> geothermal heat flux [W/m^2] </help>
++</parameter>
++
++<!-- materials -->
++<parameter key ="rho_ice" type="double" default="917">
++     <section name="materials" />
++     <help> ice density [kg/m^3] </help>
++</parameter>
++<parameter key ="rho_water" type="double" default="1023">
++     <section name="materials" />
++     <help> ocean water density [kg/m^3] </help>
++</parameter>
++<parameter key ="rho_freshwater" type="double" default="1000">
++     <section name="materials" />
++     <help> fresh water density [kg/m^3] </help>
++</parameter>
++<parameter key ="mu_water" type="double" default="0.001787">
++     <section name="materials" />
++     <help> water viscosity [N s/m^2] </help>
++</parameter>
++<parameter key ="heatcapacity" type="double" default="2093">
++     <section name="materials" />
++     <help> heat capacity [J/kg/K] </help>
++</parameter>
++<parameter key ="latentheat" type="double" default="334000">
++     <section name="materials" />
++     <help> latent heat of fusion [J/kg] </help>
++</parameter>
++<parameter key ="thermalconductivity" type="double" default="2.4">
++     <section name="materials" />
++     <help> ice thermal conductivity [W/m/K] </help>
++</parameter>
++<parameter key ="temperateiceconductivity" type="double" default="0.24">
++     <section name="materials" />
++     <help> temperate ice thermal conductivity [W/m/K] </help>
++</parameter>
++<parameter key ="meltingpoint" type="double" default="273.15">
++     <section name="materials" />
++     <help> melting point of ice at 1atm in K </help>
++</parameter>
++<parameter key ="beta" type="double" default="9.8e-08">
++     <section name="materials" />
++     <help> rate of change of melting point with pressure [K/Pa] </help>
++</parameter>
++<parameter key ="mixed_layer_capacity" type="double" default="3974">
++     <section name="materials" />
++     <help> mixed layer capacity [W/kg/K] </help>
++</parameter>
++<parameter key ="thermal_exchange_velocity" type="double" default="0.0001">
++     <section name="materials" />
++     <help> thermal exchange velocity [m/s] </help>
++</parameter>
++<parameter key ="rheology_B" type="double" default="N/A">
++     <section name="materials" />
++     <help> flow law parameter [Pa/s^(1/n)] </help>
++</parameter>
++<parameter key ="rheology_n" type="double" default="N/A">
++     <section name="materials" />
++     <help> Glens flow law exponent </help>
++</parameter>
++<parameter key ="rheology_law" type="char" default="'Paterson'">
++     <section name="materials" />
++     <help> law for the temperature dependance of the rheology: "None", "Paterson",  "Arrhenius" or "LliboutryDuval" </help>
++</parameter>
++<parameter key ="lithosphere_shear_modulus" type="double" default="67000000000">
++     <section name="materials" />
++     <help> Lithosphere shear modulus [Pa] </help>
++</parameter>
++<parameter key ="lithosphere_density" type="double" default="3.32">
++     <section name="materials" />
++     <help> Lithosphere density [g/cm^-3] </help>
++</parameter>
++<parameter key ="mantle_shear_modulus" type="double" default="145000000000">
++     <section name="materials" />
++     <help> Mantle shear modulus [Pa] </help>
++</parameter>
++<parameter key ="mantle_density" type="double" default="3.34">
++     <section name="materials" />
++     <help> Mantle density [g/cm^-3] </help>
++</parameter>
++
++
++<!-- damage -->
++<!-- Note: this class depends on different input of law -->
++<parameter key ="law" type="alternative" optional="false">
++	<section name="damage" />
++	<option value="undamage" type="string" default="true">
++		<help> law = undamage </help>
++	</option>
++	<option value="pralong" type="string" default="false">
++		<help> law = pralong </help>
++		<parameter key ="stress_threshold" type="double" default="0">
++			<help> damage stress threshold [Pa] </help>
++		</parameter>
++		<parameter key ="c1" type="double" default="0">
++			<help> damage parameter 1 </help>
++		</parameter>
++		<parameter key ="c2" type="double" default="0">
++			<help> damage parameter 2 </help>
++		</parameter>
++		<parameter key ="c3" type="double" default="0">
++			<help> damage parameter 3 [W/m^2] </help>
++		</parameter>
++		<parameter key ="c4" type="double" default="0">
++			<help> damage parameter 4 </help>
++		</parameter>
++		<parameter key ="healing" type="double" default="0">
++			<help> damage healing parameter 1 </help>
++		</parameter>
++		<parameter key ="equiv_stress" type="double" default="0">
++			<help> 0: von Mises </help>
++		</parameter>
++		<parameter key ="requested_outputs" type="cell" default="{'default'}">
++			<help> additional outputs requested </help>
++		</parameter>
++	</option>
++	<help> damage law (string) from {"undamaged","pralong"} </help>
++</parameter>
++<parameter key ="D" type="double" default="0">
++     <section name="damage" />
++     <help> damage tensor (scalar) </help>
++</parameter>
++<parameter key ="law" type="char" default="undamaged">
++     <section name="damage" />
++     <help> damage law (string) from {"undamaged","pralong"} </help>
++</parameter>
++<parameter key ="spcdamage" type="double" default="NaN">
++     <section name="damage" />
++     <help> damage constraints (NaN means no constraint) </help>
++</parameter>
++<parameter key ="max_damage" type="double" default="0.99999">
++     <section name="damage" />
++     <help> maximum possible damage (0&amp;lt;=max_damage&amp;lt;1) </help>
++</parameter>
++<parameter key ="stabilization" type="double" default="2">
++     <section name="damage" />
++     <help> 0: no, 1: artificial_diffusivity, 2: SUPG </help>
++</parameter>
++<parameter key ="maxiter" type="double" default="100">
++     <section name="damage" />
++     <help> maximum number of non linear iterations </help>
++</parameter>
++<parameter key ="penalty_lock" type="double" default="0">
++     <section name="damage" />
++     <help> stabilize unstable damage constraints that keep zigzagging after n iteration (default is 0, no stabilization) </help>
++</parameter>
++<parameter key ="penalty_threshold" type="double" default="0">
++     <section name="damage" />
++     <help> threshold to declare convergence of damage evolution solution (default is 0) </help>
++</parameter>
++<parameter key ="penalty_factor" type="double" default="3">
++     <section name="damage" />
++     <help> scaling exponent (default is 3) </help>
++</parameter>
++
++
++<!-- Friction: Sigma= drag^2 * Neff ^r * u ^s, with Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p -->
++<frame key="1" label="Friction: Sigma= drag^2 * Neff ^r * u ^s, with Neff=rho_ice*g*thickness+rho_water*g*bed, r=q/p and s=1/p">
++<section name="friction" />
++<parameter key ="coefficient" type="double" default="N/A">
++     <section name="friction" />
++     <help> friction coefficient [SI] </help>
++</parameter>
++<parameter key ="p" type="double" default="N/A">
++     <section name="friction" />
++     <help> p exponent </help>
++</parameter>
++<parameter key ="q" type="double" default="N/A">
++     <section name="friction" />
++     <help> q exponent </help>
++</parameter></frame>
++
++
++<!-- flowequation -->
++<frame key="1" label="Flow equation parameters">
++<section name="flowequation" />
++<parameter key ="isSIA" type="double" default="0">
++     <section name="flowequation" />
++     <help> is the Shallow Ice Approximation (SIA) used ? </help>
++</parameter>
++<parameter key ="isSSA" type="double" default="0">
++     <section name="flowequation" />
++     <help> is the Shelfy-Stream Approximation (SSA) used ? </help>
++</parameter>
++<parameter key ="isL1L2" type="double" default="0">
++     <section name="flowequation" />
++     <help> is the L1L2 approximation used ? </help>
++</parameter>
++<parameter key ="isHO" type="double" default="0">
++     <section name="flowequation" />
++     <help> is the Higher-Order (HO) approximation used ? </help>
++</parameter>
++<parameter key ="isFS" type="double" default="0">
++     <section name="flowequation" />
++     <help> are the Full-FS (FS) equations used ? </help>
++</parameter>
++<parameter key ="fe_SSA" type="char" default="'P1'">
++     <section name="flowequation" />
++     <help> Finite Element for SSA  "P1", "P1bubble" "P1bubblecondensed" "P2" </help>
++</parameter>
++<parameter key ="fe_HO" type="char" default="'P1'">
++     <section name="flowequation" />
++     <help> Finite Element for HO   "P1" "P1bubble" "P1bubblecondensed" "P1xP2" "P2xP1" "P2" </help>
++</parameter>
++<parameter key ="fe_FS" type="char" default="'MINIcondensed'">
++     <section name="flowequation" />
++     <help> Finite Element for FS   "P1P1" (debugging only) "P1P1GLS" "MINIcondensed" "MINI" "TaylorHood" </help>
++</parameter>
++<parameter key ="vertex_equation" type="double" default="N/A">
++     <section name="flowequation" />
++     <help> flow equation for each vertex </help>
++</parameter>
++<parameter key ="element_equation" type="double" default="N/A">
++     <section name="flowequation" />
++     <help> flow equation for each element </help>
++</parameter>
++<parameter key ="borderSSA" type="double" default="N/A">
++     <section name="flowequation" />
++     <help> vertices on SSAs border (for tiling) </help>
++</parameter>
++<parameter key ="borderHO" type="double" default="N/A">
++     <section name="flowequation" />
++     <help> vertices on HOs border (for tiling) </help>
++</parameter>
++<parameter key ="borderFS" type="double" default="N/A">
++     <section name="flowequation" />
++     <help> vertices on FS border (for tiling) </help>
++</parameter></frame>
++
++
++<!-- Timestepping -->
++<parameter key ="start_time" type="double" default="0">
++     <section name="timestepping" />
++     <help> simulation starting time [yr] </help>
++</parameter>
++<parameter key ="final_time" type="double" default="5">
++     <section name="timestepping" />
++     <help> final time to stop the simulation [yr] </help>
++</parameter>
++<parameter key ="time_step" type="double" default="0.5">
++     <section name="timestepping" />
++     <help> length of time steps [yr] </help>
++</parameter>
++<parameter key ="time_adapt" type="double" default="0">
++     <section name="timestepping" />
++     <help> use cfl condition to define time step ? (0 or 1)  </help>
++</parameter>
++<parameter key ="cfl_coefficient" type="double" default="0.5">
++     <section name="timestepping" />
++     <help> coefficient applied to cfl condition </help>
++</parameter>
++
++
++<!-- initialization -->
++<frame key="1" label="Initial field values">
++<section name="initialization" />
++<parameter key ="vx" type="double" default="NaN">
++     <section name="initialization" />
++     <help> x component of velocity [m/yr] </help>
++</parameter>
++<parameter key ="vy" type="double" default="NaN">
++     <section name="initialization" />
++     <help> y component of velocity [m/yr] </help>
++</parameter>
++<parameter key ="vz" type="double" default="NaN">
++     <section name="initialization" />
++     <help> z component of velocity [m/yr] </help>
++</parameter>
++<parameter key ="vel" type="double" default="NaN">
++     <section name="initialization" />
++     <help> velocity norm [m/yr] </help>
++</parameter>
++<parameter key ="pressure" type="double" default="NaN">
++     <section name="initialization" />
++     <help> pressure field [Pa] </help>
++</parameter>
++<parameter key ="temperature" type="double" default="NaN">
++     <section name="initialization" />
++     <help> fraction of water in the ice </help>
++</parameter>
++<parameter key ="waterfraction" type="double" default="NaN">
++     <section name="initialization" />
++     <help> ice thickness [m] </help>
++</parameter>
++<parameter key ="sediment_head" type="double" default="NaN">
++     <section name="initialization" />
++     <help> sediment water head of subglacial system [m] </help>
++</parameter>
++<parameter key ="epl_head" type="double" default="NaN">
++     <section name="initialization" />
++     <help> epl water head of subglacial system [m] </help>
++</parameter>
++<parameter key ="watercolumn" type="double" default="NaN">
++     <section name="initialization" />
++     <help> thickness of subglacial water [m] </help>
++</parameter></frame>
++
++
++<!-- rifts -->
++<parameter key ="riftstruct" type="double" default="NaN">
++     <section name="rifts" />
++     <help> structure containing all rift information (vertices coordinates, segments, type of melange, ...) </help>
++</parameter>
++<parameter key ="riftproperties" type="double" default="NaN">
++     <section name="rifts" />
++     <help> N/A </help>
++</parameter>
++
++
++<!-- Debug -->
++<parameter key ="valgrind" type="logical" optional="false">
++     <section name="debug" />
++        <option value="false" type="string" default="true"></option>
++     <help> use Valgrind to debug (0 or 1) </help>
++</parameter>
++<parameter key ="gprof" type="logical" optional="false">
++     <section name="debug" />
++        <option value="false" type="string" default="true"></option>
++     <help> use gnu-profiler to find out where the time is spent </help>
++</parameter>
++<parameter key ="profiling" type="logical" optional="false">
++     <section name="debug" />
++        <option value="false" type="string" default="true"></option>
++     <help> enables profiling (memory, flops, time) </help>
++</parameter>
++
++<!-- verbose -->
++<parameter key ="mprocessor" type="logical" optional="false">
++     <section name="verbose" />
++        <option value="false" type="string" default="true"></option>
++     <help>  </help>
++</parameter>
++<parameter key ="module" type="logical" optional="false">
++     <section name="verbose" />
++        <option value="false" type="string" default="true"></option>
++     <help>  </help>
++</parameter>
++<parameter key ="solution" type="logical" optional="false">
++     <section name="verbose" />
++        <option value="true" type="string" default="true"></option>
++     <help>  </help>
++</parameter>
++<parameter key ="solver" type="logical" optional="false">
++     <section name="verbose" />
++        <option value="false" type="string" default="true"></option>
++     <help>  </help>
++</parameter>
++<parameter key ="convergence" type="logical" optional="false">
++     <section name="verbose" />
++        <option value="false" type="string" default="true"></option>
++     <help>  </help>
++</parameter>
++<parameter key ="control" type="logical" optional="false">
++     <section name="verbose" />
++        <option value="true" type="string" default="true"></option>
++     <help>  </help>
++</parameter>
++<parameter key ="qmu" type="logical" optional="false">
++     <section name="verbose" />
++        <option value="true" type="string" default="true"></option>
++     <help>  </help>
++</parameter>
++<parameter key ="autodiff" type="logical" optional="false">
++     <section name="verbose" />
++        <option value="false" type="string" default="true"></option>
++     <help>  </help>
++</parameter>
++
++<!-- settings -->
++<parameter key ="results_on_nodes" type="double" default="0">
++     <section name="settings" />
++     <help> results are output for all the nodes of each element </help>
++</parameter>
++<parameter key ="io_gather" type="double" default="1">
++     <section name="settings" />
++     <help> I/O gathering strategy for result outputs (default 1) </help>
++</parameter>
++<parameter key ="lowmem" type="double" default="0">
++     <section name="settings" />
++     <help> is the memory limited ? (0 or 1) </help>
++</parameter>
++<parameter key ="output_frequency" type="double" default="1">
++     <section name="settings" />
++     <help> frequency at which results are saved in all solutions with multiple time_steps </help>
++</parameter>
++<parameter key ="waitonlock" type="double" default="Inf">
++     <section name="settings" />
++     <help> maximum number of minutes to wait for batch results (NaN to deactivate) </help>
++</parameter>
++<parameter key ="upload_server" type="char" default="N/A">
++     <section name="settings" />
++     <help> server hostname where model should be uploaded </help>
++</parameter>
++<parameter key ="upload_path" type="char" default="N/A">
++     <section name="settings" />
++     <help> path on server where model should be uploaded </help>
++</parameter>
++<parameter key ="upload_login" type="char" default="N/A">
++     <section name="settings" />
++     <help> server login </help>
++</parameter>
++<parameter key ="upload_port" type="double" default="0">
++     <section name="settings" />
++     <help> port login (default is 0) </help>
++</parameter>
++<parameter key ="upload_filename" type="char" default="N/A">
++     <section name="settings" />
++     <help> unique id generated when uploading the file to server </help>
++</parameter>
++
++<!-- generic -->
++<parameter key ="name" type="char" default="'XPS'">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="login" type="char" default="N/A">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="np" type="double" default="1">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="port" type="double" default="0">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="codepath" type="char" default=":/home/casper/work/issm/trunk:/home/casper/work/issm/trunk/bin">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="executionpath" type="char" default=":/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk/execution">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="etcpath" type="char" default=":/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk/etc">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="valgrind" type="char" default=":/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk/externalpackages/valgrind/install/bin/valgrind">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="valgrindlib" type="char" default=":/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk/externalpackages/valgrind/install/lib/libmpidebug.so">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="valgrindsup" type="char" default=":/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk:/home/casper/work/issm/trunk/externalpackages/valgrind/issm.supp">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++<parameter key ="verbose" type="double" default="1">
++     <section name="cluster" />
++     <help> N/A </help>
++</parameter>
++
++<!-- balancethickness -->
++<parameter key ="spcthickness" type="double" default="N/A">
++     <section name="balancethickness" />
++     <help> thickness constraints (NaN means no constraint) [m] </help>
++</parameter>
++<parameter key ="thickening_rate" type="double" default="N/A">
++     <section name="balancethickness" />
++     <help> ice thickening rate used in the mass conservation (dh/dt) [m/yr] </help>
++</parameter>
++<parameter key ="stabilization" type="double" default="1">
++     <section name="balancethickness" />
++     <help> 0: None, 1: SU, 2: SSAs artificial diffusivity, 3:DG </help>
++</parameter>
++
++<!-- StressBalance solution parameters: -->
++<frame key="1" label="Convergence criteria">
++<section name="stressbalance" />
++<parameter key ="restol" type="double" default="0.0001">
++     <section name="stressbalance" />
++     <help> mechanical equilibrium residual convergence criterion </help>
++</parameter>
++<parameter key ="reltol" type="double" default="0.01">
++     <section name="stressbalance" />
++     <help> velocity relative convergence criterion, NaN: not applied </help>
++</parameter>
++<parameter key ="abstol" type="double" default="10">
++     <section name="stressbalance" />
++     <help> velocity absolute convergence criterion, NaN: not applied </help>
++</parameter>
++<parameter key ="isnewton" type="double" default="0">
++     <section name="stressbalance" />
++     <help> 0: Picards fixed point, 1: Newtons method, 2: hybrid </help>
++</parameter>
++<parameter key ="maxiter" type="double" default="100">
++     <section name="stressbalance" />
++     <help> maximum number of nonlinear iterations </help>
++</parameter>
++<parameter key ="viscosity_overshoot" type="double" default="0">
++     <section name="stressbalance" />
++     <help> over-shooting constant new=new+C*(new-old) </help>
++</parameter>
++</frame>
++<frame key="2" label="Boundary conditions">
++<section name="stressbalance" />
++<parameter key ="spcvx" type="double" default="N/A">
++     <section name="stressbalance" />
++     <help> x-axis velocity constraint (NaN means no constraint) [m/yr] </help>
++</parameter>
++<parameter key ="spcvy" type="double" default="N/A">
++     <section name="stressbalance" />
++     <help> y-axis velocity constraint (NaN means no constraint) [m/yr] </help>
++</parameter>
++<parameter key ="spcvz" type="double" default="N/A">
++     <section name="stressbalance" />
++     <help> z-axis velocity constraint (NaN means no constraint) [m/yr] </help>
++</parameter>
++</frame>
++<frame key="3" label="Rift options">
++<section name="stressbalance" />
++<parameter key ="rift_penalty_threshold" type="double" default="0">
++     <section name="stressbalance" />
++     <help> threshold for instability of mechanical constraints </help>
++</parameter>
++<parameter key ="rift_penalty_lock" type="double" default="10">
++     <section name="stressbalance" />
++     <help> number of iterations before rift penalties are locked </help>
++</parameter>
++</frame>
++<frame key="4" label="Other">
++<section name="stressbalance" />
++<parameter key ="shelf_dampening" type="double" default="0">
++     <section name="stressbalance" />
++     <help> use dampening for floating ice ? Only for FS model </help>
++</parameter>
++<parameter key ="FSreconditioning" type="double" default="10000000000000">
++     <section name="stressbalance" />
++     <help> multiplier for incompressibility equation. Only for FS model </help>
++</parameter>
++<parameter key ="referential" type="double" default="N/A">
++     <section name="stressbalance" />
++     <help> local referential </help>
++</parameter>
++<parameter key ="loadingforce" type="double" default="N/A">
++     <section name="stressbalance" />
++     <help> loading force applied on each point [N/m^3] </help>
++</parameter>
++<parameter key ="requested_outputs" type="cell" default="{'default'}">
++     <section name="stressbalance" />
++     <help> additional outputs requested </help>
++</parameter>
++</frame>
++
++
++<!-- groundingline -->
++<frame key="1" label="Grounding line migration parameters">
++<section name="groundingline" />
++<parameter key ="migration" type="char" default="'None'">
++     <section name="groundingline" />
++     <help> type of grounding line migration: "SoftMigration","AgressiveMigration" or "None" </help>
++</parameter>
++<parameter key ="melting_rate" type="double" default="0">
++     <section name="groundingline" />
++     <help> melting rate applied when previously grounded parts start floating [m/yr] </help>
++</parameter></frame>
++
++
++<!-- Hydrology -->
++<frame key="1" label="Hydrologyshreve solution parameters">
++<section name="hydrologyshreve" />
++<parameter key ="spcwatercolumn" type="double" default="N/A">
++     <section name="hydrologyshreve" />
++     <help> water thickness constraints (NaN means no constraint) [m] </help>
++</parameter>
++<parameter key ="n" type="double" default="0.02">
++     <section name="hydrologyshreve" />
++     <help> Manning roughness coefficient </help>
++</parameter>
++<parameter key ="CR" type="double" default="0.01">
++     <section name="hydrologyshreve" />
++     <help> tortuosity parameter </help>
++</parameter>
++<parameter key ="p" type="double" default="2">
++     <section name="hydrologyshreve" />
++     <help> dimensionless exponent in Manning velocity formula </help>
++</parameter>
++<parameter key ="q" type="double" default="1">
++     <section name="hydrologyshreve" />
++     <help> dimensionless exponent in Manning velocity formula </help>
++</parameter>
++<parameter key ="kn" type="double" default="0">
++     <section name="hydrologyshreve" />
++     <help> parameter in effective pressure formula </help>
++</parameter>
++<parameter key ="stabilization" type="double" default="1">
++     <section name="hydrologyshreve" />
++     <help> artificial diffusivity (default is 1). can be more than 1 to increase diffusivity. </help>
++</parameter>
++</frame>
++<!-- masstransport -->
++<frame key="1" label="Masstransport solution parameters">
++<section name="masstransport" />
++  <parameter key ="spcthickness" type="double" default="N/A">
++     <section name="masstransport" />
++     <help> thickness constraints (NaN means no constraint) [m] </help>
++  </parameter>
++  <parameter key ="calvingrate" type="double" default="N/A">
++     <section name="masstransport" />
++     <help> calving rate at given location [m/a] </help>
++  </parameter>
++  <parameter key ="isfreesurface" type="double" default="0">
++     <section name="masstransport" />
++     <help> do we use free surfaces (FS only) are mass conservation </help>
++  </parameter>
++  <parameter key ="min_thickness" type="double" default="1">
++     <section name="masstransport" />
++     <help> minimum ice thickness allowed [m] </help>
++  </parameter>
++  <parameter key ="hydrostatic_adjustment" type="char" default="'Absolute'">
++     <section name="masstransport" />
++     <help> adjustment of ice shelves surface and bed elevations: 'Incremental' or 'Absolute'  </help>
++  </parameter>
++  <parameter key ="stabilization" type="double" default="1">
++     <section name="masstransport" />
++     <help> 0: no, 1:  artificial_diffusivity, 2: streamline upwinding, 3: discontinuous Galerkin </help>
++  </parameter>
++</frame>
++<frame key="2" label="Penalty options">
++<section name="masstransport" />
++  <parameter key ="vertex_pairing" type="double" default="N/A">
++     <section name="masstransport" />
++     <help> offset used by penalties: penalty = Kmax*10^offset </help>
++  </parameter>
++  <parameter key ="penalty_factor" type="double" default="3">
++     <section name="masstransport" />
++     <help> pairs of vertices that are penalized </help>
++  </parameter>
++  <parameter key ="requested_outputs" type="cell" default="{'default'}">
++     <section name="masstransport" />
++     <help> additional outputs requested </help>
++  </parameter>
++</frame>
++<!-- thermal -->
++<frame key="1" label="Thermal solution parameters">
++<section name="thermal" />
++  <parameter key ="spctemperature" type="double" default="N/A">
++     <section name="thermal" />
++     <help> temperature constraints (NaN means no constraint) [K] </help>
++  </parameter>
++  <parameter key ="penalty_threshold" type="double" default="0">
++     <section name="thermal" />
++     <help> 0: no, 1: artificial_diffusivity, 2: SUPG </help>
++  </parameter>
++  <parameter key ="stabilization" type="double" default="1">
++     <section name="thermal" />
++     <help> maximum number of non linear iterations </help>
++  </parameter>
++  <parameter key ="maxiter" type="double" default="100">
++     <section name="thermal" />
++     <help> stabilize unstable thermal constraints that keep zigzagging after n iteration (default is 0, no stabilization) </help>
++  </parameter>
++  <parameter key ="penalty_lock" type="double" default="0">
++     <section name="thermal" />
++     <help> threshold to declare convergence of thermal solution (default is 0)  </help>
++  </parameter>
++  <parameter key ="penalty_factor" type="double" default="3">
++     <section name="thermal" />
++     <help> scaling exponent (default is 3) </help>
++  </parameter>
++  <parameter key ="isenthalpy" type="double" default="0">
++     <section name="thermal" />
++     <help> use an enthalpy formulation to include temperate ice (default is 0) </help>
++  </parameter>
++  <parameter key ="isdynamicbasalspc" type="double" default="0">
++     <section name="thermal" />
++     <help> enable dynamic setting of basal forcing. required for enthalpy formulation (default is 0)  </help>
++  </parameter>
++  <parameter key ="requested_outputs" type="cell" default="{'default'}">
++     <section name="thermal" />
++     <help> additional outputs requested </help>
++  </parameter>
++</frame>
++<!-- steadystate -->
++<frame key="1" label="steadystate solution parameters">
++<section name="steadystate" />
++  <parameter key ="reltol" type="double" default="0.01">
++     <section name="steadystate" />
++     <help> relative tolerance criterion [K] </help>
++  </parameter>
++  <parameter key ="maxiter" type="double" default="100">
++     <section name="steadystate" />
++     <help> maximum number of iterations </help>
++  </parameter>
++  <parameter key ="requested_outputs" type="cell" default="{'default'}">
++     <section name="steadystate" />
++     <help> additional requested outputs </help>
++  </parameter>
++</frame>
++<!-- transient -->
++<frame key="1" label="transient solution parameters">
++<section name="transient" />
++  <parameter key ="ismasstransport" type="double" default="1">
++     <section name="transient" />
++     <help> indicates whether a masstransport solution is used in the transient </help>
++  </parameter>
++  <parameter key ="isstressbalance" type="double" default="1">
++     <section name="transient" />
++     <help> indicates whether a stressbalance solution is used in the transient </help>
++  </parameter>
++  <parameter key ="isthermal" type="double" default="1">
++     <section name="transient" />
++     <help> indicates whether a thermal solution is used in the transient </help>
++  </parameter>
++  <parameter key ="isgroundingline" type="double" default="0">
++     <section name="transient" />
++     <help> indicates whether a groundingline migration is used in the transient </help>
++  </parameter>
++  <parameter key ="isgia" type="double" default="0">
++     <section name="transient" />
++     <help> indicates whether a postglacial rebound model is used in the transient </help>
++  </parameter>
++  <parameter key ="isdamage" type="double" default="0">
++     <section name="transient" />
++     <help> indicates whether damage evolution is used in the transient </help>
++  </parameter>
++  <parameter key ="islevelset" type="double" default="0">
++     <section name="transient" />
++     <help> LEVEL SET DESCRIPTION...  </help>
++  </parameter>
++  <parameter key ="requested_outputs" type="cell" default="{'default'}">
++     <section name="transient" />
++     <help> list of additional outputs requested </help>
++  </parameter>
++</frame>
++<!-- gia -->
++<frame key="1" label="gia parameters">
++<section name="gia" />
++  <parameter key ="mantle_viscosity" type="double" default="N/A">
++     <section name="gia" />
++     <help> mantle viscosity[Pa s] </help>
++  </parameter>
++  <parameter key ="lithosphere_thickness" type="double" default="N/A">
++     <section name="gia" />
++     <help> lithosphere thickness (km) </help>
++  </parameter>
++  <parameter key ="cross_section_shape" type="double" default="1">
++     <section name="gia" />
++     <help> 1: square-edged (default). 2: elliptical.  See iedge in GiaDeflectionCore </help>
++  </parameter>
++</frame>
++<!-- autodiff -->
++<frame key="1" label="automatic differentiation parameters">
++<section name="autodiff" />
++  <parameter key ="isautodiff" type="logical" optional="false">
++     <section name="autodiff" />
++         <option value="false" type="string" default="true"></option>
++     <help> indicates if the automatic differentiation is activated </help>
++  </parameter>
++  <parameter key ="dependents" type="cell" default="(0x0)">
++     <section name="autodiff" />
++     <help> list of dependent variables </help>
++  </parameter>
++  <parameter key ="independents" type="cell" default="(0x0)">
++     <section name="autodiff" />
++     <help> list of independent variables </help>
++  </parameter>
++  <parameter key ="driver" type="char" default="'fos_forward'">
++     <section name="autodiff" />
++     <help> ADOLC driver ('fos_forward' or 'fov_forward') </help>
++  </parameter>
++  <parameter key ="obufsize" type="double" default="524288">
++     <section name="autodiff" />
++     <help> Number of operations per buffer (==OBUFSIZE in usrparms.h)  </help>
++  </parameter>
++  <parameter key ="lbufsize" type="double" default="524288">
++     <section name="autodiff" />
++     <help> Number of locations per buffer (==LBUFSIZE in usrparms.h) </help>
++  </parameter>
++  <parameter key ="cbufsize" type="double" default="524288">
++     <section name="autodiff" />
++     <help> Number of values per buffer (==CBUFSIZE in usrparms.h) </help>
++  </parameter>
++  <parameter key ="tbufsize" type="double" default="524288">
++     <section name="autodiff" />
++     <help> Number of taylors per buffer (&amp;lt;=TBUFSIZE in usrparms.h) </help>
++  </parameter>
++  <parameter key ="gcTriggerRatio" type="double" default="2">
++     <section name="autodiff" />
++     <help> free location block sorting/consolidation triggered if the ratio between allocated and used locations exceeds gcTriggerRatio </help>
++  </parameter>
++  <parameter key ="gcTriggerRatio" type="double" default="2">
++     <section name="autodiff" />
++     <help> free location block sorting/consolidation triggered if the allocated locations exceed gcTriggerMaxSize </help>
++  </parameter>
++</frame>
++<!-- flaim -->
++<frame key="1" label="Input:">
++<section name="flaim" />
++  <parameter key ="targets" type="char" default="N/A">
++     <section name="flaim" />
++     <help> name of kml output targets file </help>
++  </parameter>
++  <parameter key ="tracks" type="char" default="N/A">
++     <section name="flaim" />
++     <help> name of kml input tracks file </help>
++  </parameter>
++  <parameter key ="flightreqs" type="struct" default="N/A">
++     <section name="flaim" />
++     <help> structure of kml flight requirements (not used yet) </help>
++  </parameter>
++  <parameter key ="criterion" type="double" default="N/A">
++     <section name="flaim" />
++     <help> element or nodal criterion for flight path evaluation (metric) </help>
++  </parameter>
++</frame>
++<frame key="2" label="Arguments:">
++<section name="flaim" />
++  <parameter key ="gridsatequator" type="double" default="200000">
++     <section name="flaim" />
++     <help> number of grids at equator (determines resolution) </help>
++  </parameter>
++  <parameter key ="usevalueordering" type="logical" optional="false">
++     <section name="flaim" />
++         <option value="true" type="string" default="true"></option>
++     <help> flag to consider target values for flight path evaluation </help>
++  </parameter>
++  <parameter key ="split_antimeridian" type="logical" optional="false">
++     <section name="flaim" />
++         <option value="true" type="string" default="true"></option>
++     <help> flag to split polygons on the antimeridian </help>
++  </parameter>
++</frame>
++<frame key="3" label="Optimization:">
++<section name="flaim" />
++  <parameter key ="path_optimize" type="logical" optional="false">
++     <section name="flaim" />
++         <option value="false" type="string" default="true"></option>
++     <help> optimize? (default false) </help>
++  </parameter>
++  <parameter key ="opt_ndir" type="double" default="1">
++     <section name="flaim" />
++     <help> number of directions to test when moving a point.  If this value = 1, a random direction is tested. A value > 1 results in directions equally spaced from [0, 2*PI] being tested. For example, 4 would result in directions [0, PI/2, PI, 3PI/2] </help>
++  </parameter>
++  <parameter key ="opt_dist" type="double" default="25">
++     <section name="flaim" />
++     <help> specifies the distance in km (default 25) to move a randomly selected path point on each iteration </help>
++  </parameter>
++  <parameter key ="opt_niter" type="double" default="30000">
++     <section name="flaim" />
++     <help> number of iterations (default 30,000) to run for flightplan optimization, i.e. the number of times to randomly select a point and move it. </help>
++  </parameter>
++</frame>
++<frame key="4" label="Output:">
++<section name="flaim" />
++  <parameter key ="solution" type="char" default="N/A">
++     <section name="flaim" />
++     <help> name of kml solution file </help>
++  </parameter>
++  <parameter key ="quality" type="double" default="0">
++     <section name="flaim" />
++     <help> quality of kml solution </help>
++  </parameter>
++</frame>
++<!-- inversion -->
++<frame key="1" label="inversion parameters">
++<section name="inversion" />
++  <parameter key ="iscontrol" type="double" default="0">
++     <section name="inversion" />
++     <help> is inversion activated? </help>
++  </parameter>
++  <parameter key ="incomplete_adjoint" type="double" default="1">
++     <section name="inversion" />
++     <help> 1: linear viscosity, 0: non-linear viscosity </help>
++  </parameter>
++  <parameter key ="control_parameters" type="cell" default="{'FrictionCoefficient'}">
++     <section name="inversion" />
++     <help> ex: {'FrictionCoefficient'}, or {'MaterialsRheologyBbar'} </help>
++  </parameter>
++  <parameter key ="nsteps" type="double" default="20">
++     <section name="inversion" />
++     <help> number of optimization searches </help>
++  </parameter>
++  <parameter key ="cost_functions" type="double" default="101">
++     <section name="inversion" />
++     <help> indicate the type of response for each optimization step  </help>
++  </parameter>
++  <parameter key ="cost_functions_coefficients" type="double" default="N/A">
++     <section name="inversion" />
++     <help> cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter </help>
++  </parameter>
++  <parameter key ="cost_function_threshold" type="double" default="N/A">
++     <section name="inversion" />
++     <help> misfit convergence criterion. Default is 1%, NaN if not applied </help>
++  </parameter>
++  <parameter key ="maxiter_per_step" type="double" default="(20x1)">
++     <section name="inversion" />
++     <help> maximum iterations during each optimization step  </help>
++  </parameter>
++  <parameter key ="gradient_scaling" type="double" default="(20x1)">
++     <section name="inversion" />
++     <help> scaling factor on gradient direction during optimization, for each optimization step </help>
++  </parameter>
++  <parameter key ="step_threshold" type="double" default="(20x1)">
++     <section name="inversion" />
++     <help> decrease threshold for misfit, default is 30% </help>
++  </parameter>
++  <parameter key ="min_parameters" type="double" default="N/A">
++     <section name="inversion" />
++     <help> absolute minimum acceptable value of the inversed parameter on each vertex </help>
++  </parameter>
++  <parameter key ="max_parameters" type="double" default="N/A">
++     <section name="inversion" />
++     <help> absolute maximum acceptable value of the inversed parameter on each vertex </help>
++  </parameter>
++  <parameter key ="vx_obs" type="double" default="N/A">
++     <section name="inversion" />
++     <help> observed velocity x component [m/yr] </help>
++  </parameter>
++  <parameter key ="vy_obs" type="double" default="N/A">
++     <section name="inversion" />
++     <help> observed velocity y component [m/yr]  </help>
++  </parameter>
++  <parameter key ="vel_obs" type="double" default="N/A">
++     <section name="inversion" />
++     <help> observed velocity magnitude [m/yr] </help>
++  </parameter>
++  <parameter key ="thickness_obs" type="double" default="N/A">
++     <section name="inversion" />
++     <help> observed thickness [m]) </help>
++  </parameter>
++</frame>
++<frame key="2" label="Available cost functions">
++<section name="inversion" />
++  <parameter key ="SurfaceAbsVelMisfit" type="string" default="101">
++     <section name="inversion" />
++     <help>  </help>
++  </parameter>
++  <parameter key ="SurfaceRelVelMisfit" type="string" default="102">
++     <section name="inversion" />
++     <help>   </help>
++  </parameter>
++  <parameter key ="SurfaceLogVelMisfit" type="string" default="103">
++     <section name="inversion" />
++     <help>  </help>
++  </parameter>
++  <parameter key ="SurfaceLogVxVyMisfit" type="string" default="104">
++     <section name="inversion" />
++     <help>  </help>
++  </parameter>
++  <parameter key ="SurfaceAverageVelMisfit" type="string" default="105">
++     <section name="inversion" />
++     <help>   </help>
++  </parameter>
++  <parameter key ="ThicknessAbsMisfit" type="string" default="106">
++     <section name="inversion" />
++     <help>  </help>
++  </parameter>
++  <parameter key ="DragCoefficientAbsGradient" type="string" default="107">
++     <section name="inversion" />
++     <help>  </help>
++  </parameter>
++  <parameter key ="RheologyBbarAbsGradient" type="string" default="108">
++     <section name="inversion" />
++     <help>  </help>
++  </parameter>
++  <parameter key ="ThicknessAbsGradient" type="string" default="109">
++     <section name="inversion" />
++     <help> </help>
++  </parameter>
++</frame>
++<!-- qmu -->
++<frame key="1" label="qmu parameters">
++<section name="qmu" />
++  <parameter key ="isdakota" type="double" default="0">
++     <section name="qmu" />
++     <help> is qmu analysis activated? </help>
++  </parameter>
++  <parameter key ="variables" type="struct" default="N/A">
++     <section name="qmu" />
++     <help> (arrays of each variable class) </help>
++  </parameter>
++  <parameter key ="responses" type="struct" default="N/A">
++     <section name="qmu" />
++     <help> (arrays of each response class) </help>
++  </parameter>
++  <parameter key ="numberofresponses" type="double" default="0">
++     <section name="qmu" />
++     <help> number of responses </help>
++  </parameter>
++  <parameter key ="params" type="struct" default="N/A">
++     <section name="qmu" />
++     <help> (array of method-independent parameters)  </help>
++  </parameter>
++  <parameter key ="results" type="struct" default="N/A">
++     <section name="qmu" />
++     <help> (information from dakota files) </help>
++  </parameter>
++  <parameter key ="partition" type="double" default="N/A">
++     <section name="qmu" />
++     <help> user provided mesh partitioning, defaults to metis if not specified </help>
++  </parameter>
++  <parameter key ="numberofpartitions" type="double" default="0">
++     <section name="qmu" />
++     <help> number of partitions for semi-discrete qmu  </help>
++  </parameter>
++  <parameter key ="variabledescriptors" type="cell" default="(0x0)">
++     <section name="qmu" />
++     <help>  </help>
++  </parameter>
++  <parameter key ="responsedescriptors" type="cell" default="(0x0)">
++     <section name="qmu" />
++     <help> use an enthalpy formulation to include temperate ice (default is 0) </help>
++  </parameter>
++  <parameter key ="method" type="struct" default="N/A">
++     <section name="qmu" />
++     <help> array of dakota_method class </help>
++  </parameter>
++  <parameter key ="mass_flux_profile_directory" type="double" default="N/A">
++     <section name="qmu" />
++     <help> directory for mass flux profiles </help>
++  </parameter>
++  <parameter key ="mass_flux_profiles" type="double" default="N/A">
++     <section name="qmu" />
++     <help>  </help>
++  </parameter>
++  <parameter key ="mass_flux_segments" type="cell" default="(0x0)">
++     <section name="qmu" />
++     <help>  </help>
++  </parameter>
++  <parameter key ="adjacency" type="double" default="N/A">
++     <section name="qmu" />
++     <help> additional outputs requested </help>
++  </parameter>
++  <parameter key ="vertex_weight" type="double" default="N/A">
++     <section name="qmu" />
++     <help> weight applied to each mesh vertex </help>
++  </parameter>
++</frame>
++<!-- outputdefinition -->
++<frame key="1" label="outputdefinition">
++<section name="outputdefinition" />
++  <parameter key ="definitions" type="cell" default="(0x0)">
++     <section name="outputdefinition" />
++     <help> list of potential outputs that can be requested, but which need additional data to be defined </help>
++  </parameter>
++</frame>
++<!-- miscellaneous -->
++<frame key="1" label="miscellaneous parameters">
++<section name="miscellaneous" />
++  <parameter key ="notes" type="char" default="N/A">
++     <section name="miscellaneous" />
++     <help> notes in a cell of strings </help>
++  </parameter>
++  <parameter key ="name" type="char" default="N/A">
++     <section name="miscellaneous" />
++     <help> model name </help>
++  </parameter>
++  <parameter key ="dummy" type="struct" default="N/A">
++     <section name="miscellaneous" />
++     <help> empty field to store some data </help>
++  </parameter>
++</frame>
++
++
++</inishell_config>
+\ No newline at end of file
+
+Property changes on: ../trunk-jpl/src/java/doc/examples/issm.xml
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/doc/examples/min_example.xml
+===================================================================
+--- ../trunk-jpl/src/java/doc/examples/min_example.xml	(revision 0)
++++ ../trunk-jpl/src/java/doc/examples/min_example.xml	(revision 17993)
+@@ -0,0 +1,40 @@
++<inishell_config>
++	<parameter key="SOME_PARAMETER" type="string">
++		<section name="section1" />
++		<section name="section2" />
++		<help>
++			This is a parameter that asks for a string value and that is present in
++			both the section "section1" and "section2".
++		</help>
++	</parameter>
++	
++	<parameter key="NESTED_PARAMETERS" type="alternative" optional="false">
++		<section name="section1" />
++		<option value="NONE" type="string" />
++		<option value="ONE" type="string">
++			<parameter key="SOME_INTEGER" type="integer" 
++				minimum="-1" maximum="10" default="2">
++				<help>
++					The value for this parameter may be an integer between -1 and 10.
++					The default value is 2.
++					The user may use the + and - buttons to increment/decrement 
++					the number or type the number into the text field.</help>
++				</parameter>
++		</option>
++		<option value="TWO" type="string">
++			<reference name="a_group_that_can_be_referenced" />
++			<help>Here is a reference to two parameters.</help>
++		</option>
++		<help>
++			This parameter belongs to section1. 
++			When the "null" option is selected, the dropdown menu appears
++			red because this parameter is non-optional.
++			When the value "ONE" is selected a nested parameter "SOME_INTEGER" appears. 
++		</help>
++	</parameter>
++	
++	<parametergroup name="a_group_that_can_be_referenced">
++		<parameter key="SOME_FILE" type="file" />
++		<parameter key="A_PATH" type="path" />
++	</parametergroup>
++</inishell_config>
+\ No newline at end of file
+
+Property changes on: ../trunk-jpl/src/java/doc/examples/min_example.xml
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/lib/miglayout-4.0.jar
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/lib/miglayout-4.0.jar
+===================================================================
+--- ../trunk-jpl/src/java/lib/miglayout-4.0.jar	(revision 17992)
++++ ../trunk-jpl/src/java/lib/miglayout-4.0.jar	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/lib/miglayout-4.0.jar
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/MANIFEST.MF
+===================================================================
+--- ../trunk-jpl/src/java/MANIFEST.MF	(revision 0)
++++ ../trunk-jpl/src/java/MANIFEST.MF	(revision 17993)
+@@ -0,0 +1,14 @@
++Manifest-Version: 1.0
++Ant-Version: Apache Ant 1.8.4
++Created-By: 1.6.0_51-b11-457-11M4509 (Apple Inc.)
++Built-By: larour
++Built-On: 2014-04-14
++Built-At: 14:27:23
++Main-Class: main/GUIBuilder
++Specification-Title: INI file generator
++Specification-Version: 1.0.0-20140414
++Specification-Vendor: SLF, www.slf.ch
++Implementation-Title: INIshell ini creator
++Implementation-Version: 1.0.0
++Implementation-Vendor: SLF, www.slf.ch
++
+Index: ../trunk-jpl/src/java/src/gui_elements/CombinedPanel.java
+===================================================================
+--- ../trunk-jpl/src/java/src/gui_elements/CombinedPanel.java	(revision 0)
++++ ../trunk-jpl/src/java/src/gui_elements/CombinedPanel.java	(revision 17993)
+@@ -0,0 +1,267 @@
++/***********************************************************************************/
++/*  Copyright 2012 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
++/***********************************************************************************/
++/*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*
++*/
++
++package gui_elements;
++
++import java.awt.event.ItemEvent;
++import java.text.NumberFormat;
++import java.util.*;
++import java.text.DecimalFormat;
++import java.text.DecimalFormatSymbols;
++
++import javax.swing.JCheckBox;
++import javax.swing.JComponent;
++import javax.swing.JFormattedTextField;
++import javax.swing.JTextField;
++import javax.swing.JLabel;
++import javax.swing.JComboBox;
++
++import main.XMLHelper;
++
++import org.w3c.dom.Element;
++import org.w3c.dom.Node;
++import org.w3c.dom.NodeList;
++import net.miginfocom.swing.MigLayout;
++
++/**
++ * @brief The CombinedPanel may contain other panels, such as check and drop down boxes and text fields
++ *
++ * @author Thomas Egger
++ */
++public class CombinedPanel extends OptionPanel {
++	enum Type { CHOICE, INTEGER, DECIMAL, STRING, DROPDOWN }
++
++	/**
++	 *
++	 */
++	private static final long serialVersionUID = -6751282938445852408L;;
++
++	private final LinkedList<JComponent> valueComponents;
++
++	/**
++	 * Constructor for a panel that can hold text, numbers and check boxes. It
++	 * corresponds to the parameter type "combination" in the configuration file
++	 * and its subcomponents correspond to the option values.
++	 *
++	 * @param element
++	 * @throws GUIBuildException
++	 */
++	public CombinedPanel(Element element, ControlledPanel parent) throws GUIBuildException {
++		super(element, parent, false); //doing layout by itself
++
++		//System.out.println("Hierarchy: Parent: " + parent.getKey() + ": "+ parent.getHierarchy() + "  own: " + getHierarchy());
++
++		int column1 = 200;
++		column1 -= getHierarchy() * 5;
++		this.setLayout(new MigLayout("gapx 6, wrap 8, ins n 5 n n", "["+column1+"!][78!][78!][78!][78!][78!][78!][20!][200:400:400]", ""));
++
++		this.add(jlabel, "gapleft " + getHierarchy() * 5);
++		this.add(help, "cell 8 0, wrap");
++
++		valueComponents = new LinkedList<JComponent>();
++
++		final Element[] optionElements = XMLHelper.getElementArray(element, "option");
++
++		byte lblcounter = 0;
++
++		DecimalFormat format = (DecimalFormat)DecimalFormat.getInstance();
++		DecimalFormatSymbols custom = new DecimalFormatSymbols();
++		custom.setDecimalSeparator('.');
++		format.setDecimalFormatSymbols(custom);
++		format.setGroupingUsed(false);
++
++		DecimalFormat integerFormat = (DecimalFormat)DecimalFormat.getIntegerInstance();
++		integerFormat.setGroupingUsed(false);
++
++		int row = 0;
++		int column = 1;
++		
++		for (int i=0;i<optionElements.length;i++) {
++			final Type optionType = Type.valueOf(optionElements[i].getAttribute("type").toUpperCase());
++			final String initialValue = optionElements[i].getAttribute("value");
++			final String label = optionElements[i].getAttribute("label");
++
++			JComponent component = null;
++			JLabel lblcomponent  = null;
++
++			NodeList nodelist = optionElements[i].getChildNodes();
++
++			switch (optionType) {
++			case INTEGER:
++				component = new JFormattedTextField(integerFormat);
++				((JFormattedTextField)component).setColumns(8);
++				if ((initialValue != null) && (!initialValue.equals("")))
++					((JFormattedTextField)component).setValue(new Integer(initialValue));
++				break;
++			case DECIMAL:
++				component = new JFormattedTextField(format);
++				((JFormattedTextField)component).setColumns(8);
++				if ((initialValue != null) && (!initialValue.equals("")))
++					((JFormattedTextField)component).setValue((new Double(initialValue)));
++				break;
++			case STRING:
++				component = new JTextField(10);
++				((JTextField)component).setText(initialValue);
++				break;
++			case CHOICE:
++				component = new JCheckBox(optionElements[i].getAttribute("value"));
++				((JCheckBox)component).addItemListener(this);
++				break;
++			case DROPDOWN:
++				component = new JComboBox();
++
++				for (int jj = 0; jj < nodelist.getLength(); jj++) {
++					if (nodelist.item(jj).getNodeType() == Node.ELEMENT_NODE) {
++						((JComboBox)component).addItem(((Element)nodelist.item(jj)).getAttribute("value"));
++					}
++				}
++
++				((JComboBox)component).setSelectedItem(optionElements[i].getAttribute("value"));
++				((JComboBox)component).addItemListener(this);
++				break;
++			}
++			
++			int width = 1;
++
++			if ((label != null) && (!label.equals(""))){
++				if (label.length() > 12) width = 2; //for oversize labels
++
++				if (column+width >= 7) { 
++					column = 1; 
++					row++; 
++				}
++				lblcomponent = new JLabel(label);
++				valueComponents.add(lblcomponent);
++				
++				//System.out.println("component: " + component.getClass() + ");
++				//System.out.println("component: " + lblcomponent.getClass() + "  size: " + lblcomponent.getWidth() + "  col: " + column + " row: " + row);
++				this.add(lblcomponent, "cell " + column + " " + row + " " + width + " 1");
++				column += width;
++				width = 1;
++				lblcomponent.setVisible(true);
++			}
++
++			if (column >= 7) { 
++				column = 1; 
++				row++; 
++			}
++			//System.out.println("component: " + component.getClass() + "  size: " + component.getWidth() + "  col: " + column + " row: " + row);
++			this.add(component, "cell " + column + " " + row + " " + width + " 1");
++			column++;
++
++			valueComponents.add(component);
++			component.setVisible(true);
++		}
++		
++		//System.out.println("\t-->Instantiated one Combined Panel with " + optionElements.length + " components");
++	}
++
++	@Override
++	public void close() {
++		// TODO Auto-generated method stub
++
++	}
++
++	@Override
++	public void set(HashMap hm, String inkey, String invalue) {
++		if (!hm.containsKey(hashKey)) return;
++		String val = (String)hm.get(hashKey);
++
++		//System.out.println("\tSetting CombinedPanel: " + hashKey + " = " + val);
++		//System.out.println("\tThis CombinedPanel has the key: " + this.getKey() + "  should be: " + inkey + " val: " + invalue);
++
++		//Now loop through valueComponents and see if the value string can be matched
++		if (val == null) return;
++
++		String[] tokens = val.split("\\s+");
++		int counter = 0;
++
++		//System.out.println("\t\tLooking at VAL param: " + val);
++		for (final JComponent comp : valueComponents) {
++			boolean digested = false;
++			if (tokens.length <= counter) break;
++			//System.out.println("\t\tLooking at USER param: " + tokens[counter]);
++
++			if (comp.getClass() == JCheckBox.class) {
++				String cbString = ((JCheckBox) comp).getText();
++				if (tokens[counter].equals(cbString)) {
++					((JCheckBox) comp).setSelected(true);
++					digested = true;
++				}
++			} else if (comp.getClass() == JComboBox.class) {
++				JComboBox box = (JComboBox) comp;
++
++				for (int ii=0; ii<box.getItemCount(); ii++) {
++					String itemString = (String) box.getItemAt(ii);
++					if (itemString.equals(tokens[counter])) {
++						box.setSelectedIndex(ii);
++						digested = true;
++					}
++				}
++			} else if (comp.getClass() == JTextField.class) {
++				((JTextField) comp).setText(tokens[counter]);
++				digested = true;
++			} else if (comp.getClass() == JFormattedTextField.class) {
++				((JFormattedTextField) comp).setText(tokens[counter]);
++				digested = true;
++			}
++
++			if ((comp.getClass() != JLabel.class) && (digested))
++				counter++;
++		}
++	}
++
++	@Override
++	public String getValue() {
++		String value = "";
++
++		for (final JComponent comp : valueComponents) {
++			if (comp.getClass() == JTextField.class) {
++				value += ((JTextField) comp).getText();
++			} else if (comp.getClass() == JFormattedTextField.class) {
++				value += ((JFormattedTextField) comp).getText();
++			} else if (comp.getClass() == JCheckBox.class) {
++				if (((JCheckBox) comp).isSelected())
++					value += ((JCheckBox) comp).getText();
++			} else if (comp.getClass() == JComboBox.class) {
++				value += ((String)((JComboBox)comp).getSelectedItem());
++			}
++
++			if (value.length() > 0)
++				value += " ";
++		}
++
++		if (value.equals("")) return null;
++		else	return value;
++	}
++
++	@Override
++	public void itemStateChanged(ItemEvent arg0) {
++		String selectedOption = null;
++
++		if (arg0.getItemSelectable().getClass() == JCheckBox.class) {
++			selectedOption = ((JCheckBox) arg0.getItemSelectable()).getText();
++			super.handleItemEvent(arg0, selectedOption);
++		} else if (arg0.getItemSelectable().getClass() == JComboBox.class) {
++			selectedOption = ((String)((JComboBox)arg0.getItemSelectable()).getSelectedItem());
++			//HACK: should call super...
++		}
++	}
++}
+
+Property changes on: ../trunk-jpl/src/java/src/gui_elements/CombinedPanel.java
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/gui_elements/SelectorPanel.java
+===================================================================
+--- ../trunk-jpl/src/java/src/gui_elements/SelectorPanel.java	(revision 0)
++++ ../trunk-jpl/src/java/src/gui_elements/SelectorPanel.java	(revision 17993)
+@@ -0,0 +1,233 @@
++/***********************************************************************************/
++/*  Copyright 2012 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
++/***********************************************************************************/
++/*	This file is part of INIshell.
++ *
++ *   INIshell is free software: you can redistribute it and/or modify
++ *   it under the terms of the GNU General Public License as published by
++ *   the Free Software Foundation, either version 3 of the License, or
++ *   (at your option) any later version.
++ *
++ *   INIshell is distributed in the hope that it will be useful,
++ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ *   GNU General Public License for more details.
++ *
++ *   You should have received a copy of the GNU General Public License
++ *   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++ *
++ */
++
++package gui_elements;
++
++import java.awt.event.ActionEvent;
++import java.awt.event.ActionListener;
++
++import javax.swing.JButton;
++import javax.swing.JOptionPane;
++
++
++import main.GUIBuilder;
++import main.XMLHelper;
++
++import org.w3c.dom.Element;
++import org.w3c.dom.Node;
++import org.w3c.dom.NodeList;
++
++import java.util.List;
++import java.util.ArrayList;
++import java.util.HashMap;
++
++/**
++ * This class introduces more flexibility into the inishell interface:
++ * The SelectorPanel offers the user to add a specific parameter to
++ * the interface.
++ *
++ * @author Thomas Egger
++ */
++public class SelectorPanel extends ControlledPanel implements ActionListener {
++
++	private static final long serialVersionUID = 8610877538909126920L;
++
++	String[] parameters;
++
++	JButton addButton;
++	JButton removeButton;
++	Element template;
++	String  templateKey;
++	HashMap<String, ControlledPanel> mapOfParameters;
++	ControlledPanel cp = null;
++
++	public SelectorPanel(Element element, ControlledPanel parent) {
++		super(element, parent);
++		templateKey = ""; //will store the pattern of the key
++
++		addButton = new JButton("+");
++		this.add(addButton, "cell 1 0, split 2, grow");
++		addButton.addActionListener(this);
++
++		removeButton = new JButton("-");
++		this.add(removeButton, "cell 1 0, grow, wrap");
++		removeButton.addActionListener(this);
++
++		//The following lines try to extract the template key (e.g. %::filters#, %::resample, COPY::%)
++		final NodeList nodelist = element.getChildNodes();
++		for (int ii = 0; ii < nodelist.getLength(); ii++) {
++			if (nodelist.item(ii).getNodeType() == Node.ELEMENT_NODE) {
++				Element currentElement = (Element)nodelist.item(ii);
++				if (currentElement.getAttribute("template").equals("true")){
++					template = (Element)currentElement.cloneNode(true);
++					templateKey = template.getAttribute("key");
++					template.setAttribute("template", "false");
++				}
++			}
++		}
++
++		final Element[] options = XMLHelper.getElementArray(element, "option");
++		parameters = new String[options.length + 1];
++		for (int ii=0; ii < options.length; ii++) {
++			parameters[ii] = options[ii].getAttribute("value");
++		}
++		parameters[options.length] = "Other...";
++
++		key = templateKey; //IMPORTANT: this changes the key only, not the label!
++		hashKey = this.getSection().toUpperCase() + "::" + this.getKey().toUpperCase();
++		mapOfParameters  = new HashMap<String, ControlledPanel>();
++	}
++
++	@Override
++	public void actionPerformed(ActionEvent arg0) {
++		if (arg0.getSource() == addButton) {
++			add();
++		} else if (arg0.getSource() == removeButton) {
++			remove();
++		}
++	}
++
++	@Override
++	public void set(HashMap hm, String key, String value) {
++		//HACK
++		//System.out.println("\tKEY: " + key + "  VAL: " + value);
++
++		String myKey = this.section.toUpperCase() + "::" + templateKey.toUpperCase().replace("%","([a-zA-Z0-9_]+)");
++		myKey = myKey.replace("#","[1-9]+[0-9]*"); //all integer numbers from 1 to infinity
++		//System.out.println("PATTERN: " + myKey);
++		String myKey2 = key.replaceAll(myKey, "$1");
++		String myKey3 = key.replaceAll(myKey, "$0");
++
++		//System.out.println("HUHUI: " + templateKey + " --- " + myKey2 + " -- " + myKey3);
++
++		boolean toAdd = true;
++		if (mapOfParameters.get(myKey2) != null) toAdd = false; //Parameter already exists
++
++		if (toAdd) {
++			ControlledPanel child = add(myKey2, true, hm, key, value);
++			cp = child;
++			if (child != null) child.set(hm, key, value);
++		} else {
++			if (cp != null) cp.set(hm, key, value);
++		}
++	}
++
++	public void add() {
++		String param = "";
++		String choice = "Other...";
++
++		if (parameters.length > 1)
++			choice = (String)JOptionPane.showInputDialog(this, "Add a parameter", "Add", JOptionPane.QUESTION_MESSAGE, null, parameters, null);
++
++		if (choice == null) return;
++
++		if (choice.equals("Other...")) {
++			param = JOptionPane.showInputDialog(this, "Enter the name of a meteo parameter\n(e.g. VW_AVG, P2");
++		} else {
++			param = choice;
++		}
++
++		add(param, false, null, null, null);
++	}
++
++	public ControlledPanel add(String param, boolean doSet, HashMap hm, String key, String value) {
++		//System.out.println("Trying to add SelectorPanel: " + key + " ... " + value);
++
++		if ((param == null) || (param.length() == 0)) return null;
++		param = param.toUpperCase();
++
++		if (mapOfParameters.get(param) != null) return null; //Parameter already exists
++
++		Element child = (Element)template.cloneNode(true);
++		recursiveKeyReplace(child, param);
++		element.appendChild(child);
++
++		ControlledPanel childPanel = null;
++		try {
++			childPanel = ControlledPanel.createSingleParameterPanel(child, this);
++			childPanel.setKey(childPanel.getKey());
++			GUIBuilder.gui.addToTab(childPanel, section, this);
++			childPanel.hold();
++			GUIBuilder.control(childPanel);
++			GUIBuilder.recursiveBuild(child, this, doSet, hm, key, value);
++
++			mapOfParameters.put(param, childPanel);
++		} catch (final GUIBuildException e1) {
++			e1.printStackTrace();
++		}
++
++		this.invalidate();
++
++		return childPanel;
++	}
++
++	@Override
++	public void close() {
++
++	}
++
++	@Override
++	public String getValue() {
++		return null;
++	}
++
++	public void remove() {
++		if (mapOfParameters.size() == 0) return;
++
++		String choice = (String)JOptionPane.showInputDialog(this, "Remove a parameter", "Remove", JOptionPane.QUESTION_MESSAGE, null, mapOfParameters.keySet().toArray(), null);
++
++		if (choice == null) return; //nothing to do
++
++		String childKey = templateKey.replaceAll("%", choice);
++		final Element child = XMLHelper.getCertainChildElement(element, "parameter", "key", childKey);
++
++		if (child == null) return;
++
++		try { //this makes sure that all child nodes are destroyed
++			GUIBuilder.recursiveDestruct(child, this);
++			element.removeChild(child);
++			final ControlledPanel childPanel = GUIBuilder.panelControl.get(section, childKey);
++
++			childPanel.release();
++			childPanel.close();
++
++			if (!childPanel.isNeeded())
++				GUIBuilder.gui.removeFromTab(childPanel, section, this);
++
++			mapOfParameters.remove(choice);
++		} catch (final GUIBuildException e) {
++			e.printStackTrace();
++		}
++
++		this.invalidate();
++	}
++
++	private void recursiveKeyReplace(Element element, String string) {
++		if (element.hasAttribute("key"))
++			element.setAttribute("key", element.getAttribute("key").replaceAll("%", string));
++
++		final NodeList nodelist = element.getChildNodes();
++		for (int i = 0; i < nodelist.getLength(); i++) {
++			if (nodelist.item(i).getNodeType() == Node.ELEMENT_NODE) {
++				recursiveKeyReplace(((Element) nodelist.item(i)), string);
++			}
++		}
++	}
++}
+
+Property changes on: ../trunk-jpl/src/java/src/gui_elements/SelectorPanel.java
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/gui_elements/GUIBuildException.java
+===================================================================
+--- ../trunk-jpl/src/java/src/gui_elements/GUIBuildException.java	(revision 0)
++++ ../trunk-jpl/src/java/src/gui_elements/GUIBuildException.java	(revision 17993)
+@@ -0,0 +1,33 @@
++/***********************************************************************************/
++/*  Copyright 2012 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
++/***********************************************************************************/
++/*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*
++*/
++
++package gui_elements;
++
++public class GUIBuildException extends Exception {
++
++	/**
++	 *
++	 */
++	private static final long serialVersionUID = 1L;
++
++	public GUIBuildException(String message) {
++		super(message);
++	}
++}
+
+Property changes on: ../trunk-jpl/src/java/src/gui_elements/GUIBuildException.java
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/gui_elements/ControlledPanel.java
+===================================================================
+--- ../trunk-jpl/src/java/src/gui_elements/ControlledPanel.java	(revision 0)
++++ ../trunk-jpl/src/java/src/gui_elements/ControlledPanel.java	(revision 17993)
+@@ -0,0 +1,285 @@
++/***********************************************************************************/
++/*  Copyright 2012 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
++/***********************************************************************************/
++/*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*
++*/
++
++package gui_elements;
++
++import java.awt.Color;
++import java.awt.Component;
++import java.awt.Font;
++
++import javax.swing.JEditorPane;
++import javax.swing.JLabel;
++import javax.swing.JPanel;
++import javax.swing.JSeparator;
++import javax.swing.*;
++import java.util.HashMap;
++import javax.swing.border.*;
++
++import main.GUI;
++import main.GUIBuilder;
++import main.XMLHelper;
++import net.miginfocom.swing.MigLayout;
++
++import org.w3c.dom.Element;
++import org.w3c.dom.Node;
++
++/**
++ * Abstract class for JPanels that are maintained with their key and designated
++ * section and can return their current value.
++ */
++public abstract class ControlledPanel extends JPanel {
++
++	private static final long serialVersionUID = 1L;
++
++	private int dependencies;
++
++	protected JLabel jlabel;
++
++	protected String section;
++	protected String key;
++	protected String label;
++	protected String hashKey;
++
++	protected Element element;
++
++	protected boolean optional;
++	protected String replace;
++
++	protected int hierarchy;
++	protected String helptext;
++	protected JEditorPane help;
++
++	/**
++	 * Constructor for a controlled panel.
++	 *
++	 * @param element
++	 */
++	public ControlledPanel(Element element, ControlledPanel parent) {
++		this(element, parent, true);
++	}
++
++	public ControlledPanel(Element element, ControlledPanel parent, boolean doLayout) {
++		super();
++		initialize(element, parent);
++
++		if (doLayout) {
++			int column1 = 200;
++			column1 -= getHierarchy() * 5; //Indentation for the label, 5px per hierarchy level
++
++			setLayout(new MigLayout("gapx 6, wrap 8, top, ins n 5 n n", "["+ column1 + "!][100!][100!][100!][100!][100!][300:400:400]", ""));
++			add(jlabel, "growx, ay top, gaptop 5, gapleft " + getHierarchy() * 5);
++			add(help, "cell 6 0, wrap");
++		}
++	}
++
++	private void initialize(Element element, ControlledPanel parent) {
++		dependencies = 0;
++
++		this.element = element;
++		this.key = element.getAttribute("key");
++		this.label = this.key;
++
++		this.section = element.getAttribute("section");
++		this.hashKey = this.section.toUpperCase() + "::" + this.key.toUpperCase();
++		this.optional = element.getAttribute("optional").equals("true");
++
++		jlabel = new JLabel(this.label + ":      ");
++		jlabel.setForeground(GUI.LABEL_COLOR);
++
++		this.setBackground(Color.white);
++		this.setVisible(true);
++
++		/* Add help to the right side of the panel. */
++		helptext = XMLHelper.getChildElementContent(element, "help");
++		help = ControlledPanel.createHelpPane("<html>"+helptext+"</html>");
++		if (helptext != null) help.setText(helptext);		
++
++		if (parent != null) {
++			setHierarchy(parent.getHierarchy() + 1);
++		} else {
++			setHierarchy(0);
++		}
++	}
++
++	/**
++	 * Creates a ControlledPanel for a parameter that matches its type. (i.e.
++	 * radio buttons for an option parameter, ...
++	 *
++	 * @param element
++	 * @return the Controlled Panel
++	 * @throws GUIBuildException
++	 */
++	public static ControlledPanel createSingleParameterPanel(Element element, ControlledPanel parent) throws GUIBuildException {
++		ControlledPanel panel;
++
++		//System.out.println("IN create: " + XMLHelper.getString((Node)element));
++
++		if (element.hasAttribute("counter")) {
++			panel = new DuplicatorPanel(element, parent);
++		} else if (element.getTagName().equals("frame")) {
++			panel = new FramePanel(element, parent);
++		} else if (element.getAttribute("type").equals("path")	|| element.getAttribute("type").equals("file")) {
++			panel = new PathPanel(element, parent);
++		} else if (element.getAttribute("type").equals("alternative") || element.getAttribute("type").equals("logical")) {
++			panel = new AlternativePanel(element, parent);
++		} else if (element.getAttribute("type").equals("choice")) {
++			panel = new CheckBoxPanel(element, parent);
++		} else if (element.getAttribute("type").equals("integer") || element.getAttribute("type").equals("integer+")){
++			panel = new IntegerPanel(element, parent);
++		} else if (element.getAttribute("type").equals("decimal")) {
++			panel = new DecimalPanel(element, parent);
++		} else if (element.getAttribute("type").equals("double")) {
++			panel = new TextfieldPanel(element, parent);
++		} else if (element.getAttribute("type").equals("string") || element.getAttribute("type").equals("char") || element.getAttribute("type").equals("cell")){
++			panel = new TextfieldPanel(element, parent);
++		} else if (element.getAttribute("type").equals("combination")) {
++			panel = new CombinedPanel(element, parent);
++		} else if (element.getAttribute("type").equals("selector")) {
++			panel = new SelectorPanel(element, parent);
++		} else {
++			throw new GUIBuildException("Cannot create a GUI panel for a parameter of type " + element.getAttribute("type"));
++		}
++
++		return panel;
++	}
++
++	public static JEditorPane createHelpPane(String helptext){
++		JEditorPane help = new JEditorPane();
++		help.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE);
++		help.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 12));
++		help.setEditable(false);
++		help.setContentType("text/html");
++		help.setForeground(Color.GRAY);
++		help.addHyperlinkListener(GUIBuilder.gui);
++
++		if (helptext!=null) {
++			help.setText("<html>"+helptext+"</html>");
++		} else {
++			help.setText("<html></html>");
++		}
++
++		return help;
++	}
++
++	public void setHierarchy(int val) {
++		hierarchy = val;		
++	}
++
++	public int getHierarchy() {
++		return hierarchy;
++	}
++
++	/**
++	 * This method should be called when the panel is removed.
++	 */
++	public abstract void close();
++
++	/**
++	 * @return the GUI component.
++	 */
++	public Component getComponent() {
++		return this;
++	}
++
++	/**
++	 * @return the number of dependencies on the panel.
++	 */
++	public int getDependencies() {
++		return dependencies;
++	}
++
++	/**
++	 * @return the key of the corresponding key / value set
++	 */
++	public String getKey() {
++		return key;
++	}
++
++	/**
++	 * @return the current value of the key / value set null if the key value
++	 *         set should not be printed
++	 */
++	public abstract String getValue();
++
++	/**
++	 * This method should be called when another panel depends needs this panel
++	 * to exist.
++	 */
++	public synchronized void hold() {
++		this.dependencies++;
++	}
++
++	/**
++	 * @return true if dependencies on this panel exist
++	 * @throws GUIBuildException
++	 */
++	public synchronized boolean isNeeded() throws GUIBuildException {
++		if (dependencies == 0) {
++			return false;
++		} else if (dependencies > 0) {
++			return true;
++		} else {
++			throw new GUIBuildException("Inplausible number of dependencies on panel");
++		}
++	}
++
++	/**
++	 * @return true if a value for the underlying parameter is optional
++	 */
++	public boolean isOptional() {
++		return optional;
++	}
++
++	/**
++	 * This method should be called when a panel no longer needs this panel to
++	 * exist. The panel will be removed if no dependency exists.
++	 */
++	public synchronized void release() {
++		this.dependencies--;
++	}
++
++	public void set(HashMap hm, String key, String value) {
++		System.out.println("Set not implemented for ControlledPanel: " + serialVersionUID);
++	}
++
++	public String getHashKey() {
++		return hashKey;
++	}
++
++	/**
++	 * This method sets a new key for a panel and changes its label.
++	 *
++	 * @param key
++	 *            the new key
++	 */
++	public void setKey(String key) {
++		this.key = key;
++		element.setAttribute("key", key);
++		jlabel.setText(this.label + ":      ");
++	}
++
++	/**
++	 * Getter method for the section.
++	 * @return the section
++	 */
++	public String getSection() {
++		return section;
++	}
++}
+
+Property changes on: ../trunk-jpl/src/java/src/gui_elements/ControlledPanel.java
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/gui_elements/CheckBoxPanel.java
+===================================================================
+--- ../trunk-jpl/src/java/src/gui_elements/CheckBoxPanel.java	(revision 0)
++++ ../trunk-jpl/src/java/src/gui_elements/CheckBoxPanel.java	(revision 17993)
+@@ -0,0 +1,139 @@
++/***********************************************************************************/
++/*  Copyright 2012 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
++/***********************************************************************************/
++/*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*
++*/
++
++package gui_elements;
++
++import main.*;
++
++import java.awt.Color;
++import java.awt.event.ItemEvent;
++import java.util.HashMap;
++
++import javax.swing.JCheckBox;
++import javax.swing.JOptionPane;
++import javax.swing.JLabel;
++
++import org.w3c.dom.Element;
++import org.w3c.dom.Node;
++
++public class CheckBoxPanel extends OptionPanel {
++
++	private static final long serialVersionUID = 552186457208697362L;
++	private final JCheckBox[] boxes;
++	String concat;
++	private String setKey = null, setValue = null;
++	private boolean doSet = false;
++	private HashMap setMap;
++
++
++	/**
++	 * Constructor for a panel that can hold a number of checkboxes to compose
++	 * the value for a key/value set.
++	 *
++	 * @param element
++	 * @throws GUIBuildException
++	 */
++	public CheckBoxPanel(Element element, ControlledPanel parent) throws GUIBuildException {
++		super(element, parent);
++
++		concat = "";
++		boxes = new JCheckBox[values.length];
++		for (int i = 0; i < values.length; i++) {
++			boxes[i] = new JCheckBox(values[i]);
++
++			this.add(boxes[i], "cell 1 " + i + ", wrap, ay top");
++
++			String extra = "";
++			if (i > 0)
++				extra = ", gapleft 12";
++
++			this.add(ControlledPanel.createHelpPane(this.helptexts[i]), "cell 6 "+ i +", width 200:400:400, wrap" + extra);
++
++			boxes[i].setBackground(Color.white);
++			boxes[i].setVisible(true);
++			boxes[i].addItemListener(this);
++			if (defaultTrues.contains(values[i])) {
++				boxes[i].setSelected(true);
++				concat += values[i] + " ";
++			}
++		}
++	}
++
++	@Override
++	public void close() {
++		for (final JCheckBox box : boxes)
++			box.setSelected(false);
++	}
++
++	@Override
++	public String getValue() {
++		if (!isOptional() && concat.equals("")) {
++			JOptionPane.showMessageDialog(null, "No option was selected for "
++									+ getKey() + " (section '" + getSection().toUpperCase() + "')"
++									+ ".\nA value is required. Your .ini-file is probably incorrect.",
++									"Problem when building .ini file",
++									JOptionPane.WARNING_MESSAGE);
++		}
++
++		if (concat.equals("")) return null;
++		else	return concat.trim();
++	}
++
++	public synchronized void set(HashMap hm, String key, String value) {
++		String val = ((String)hm.get(hashKey)).toUpperCase();
++		//System.out.println("\tABOUT TO CHANGE CHECKBOXPANEL KEY: " + key + "  VAL: " + val);
++
++		String[] tokens = val.split("\\s+");
++		for (final JCheckBox box : boxes) {
++			box.setSelected(false);
++			
++			for (final String token : tokens) {
++				if (token.equals(box.getText())) {
++					//System.out.println("\t\tSelecting Checkbox: " + token);
++					doSet = true;
++					setKey = key;
++					setValue = value;
++					setMap = hm;
++					box.setSelected(true);
++				}
++			}
++		}
++	}
++
++
++	@Override
++	public synchronized void itemStateChanged(ItemEvent arg0) {
++		final String selectedOption = ((JCheckBox) arg0.getItemSelectable()).getText();
++
++		if (arg0.getStateChange() == ItemEvent.SELECTED) {
++			concat += selectedOption + " ";
++		} else {
++			concat = concat.replaceAll(new String(" " + selectedOption + " "), " ");
++			concat = concat.replaceFirst(new String("^" + selectedOption + " "), ""); //at the beginning of the concat
++		}
++
++		//super.handleItemEvent(arg0, selectedOption);
++		super.handleItemEvent(arg0, selectedOption, doSet, setMap, setKey, setValue);
++		doSet = false;
++		setKey = null;
++		setMap = null;
++		setValue = null;
++	}
++}
+
+Property changes on: ../trunk-jpl/src/java/src/gui_elements/CheckBoxPanel.java
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/gui_elements/DuplicatorPanel.java
+===================================================================
+--- ../trunk-jpl/src/java/src/gui_elements/DuplicatorPanel.java	(revision 0)
++++ ../trunk-jpl/src/java/src/gui_elements/DuplicatorPanel.java	(revision 17993)
+@@ -0,0 +1,175 @@
++/***********************************************************************************/
++/*  Copyright 2012 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
++/***********************************************************************************/
++/*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*
++*/
++
++package gui_elements;
++
++import java.awt.event.ActionEvent;
++import java.awt.event.ActionListener;
++import java.util.*;
++
++import javax.swing.JButton;
++
++import main.GUIBuilder;
++import main.XMLHelper;
++
++import org.w3c.dom.Element;
++import org.w3c.dom.Node;
++import org.w3c.dom.NodeList;
++
++public class DuplicatorPanel extends ControlledPanel implements ActionListener {
++
++	/**
++	 *
++	 */
++	private static final long serialVersionUID = 6801877538909126920L;
++	JButton addButton;
++	Element clone;
++
++	JButton removeButton;
++
++	public DuplicatorPanel(Element element, ControlledPanel parent) {
++		super(element, parent);
++
++		addButton = new JButton("+");
++		this.add(addButton, "cell 1 0, split 2, grow");
++		addButton.addActionListener(this);
++
++		removeButton = new JButton("-");
++		this.add(removeButton, "cell 1 0, grow, wrap");
++		removeButton.addActionListener(this);
++
++		clone = (Element) element.cloneNode(true);
++		clone.removeAttribute("counter");
++		clone.setAttribute("counted", "true");
++	}
++
++	@Override
++	public void actionPerformed(ActionEvent arg0) {
++		if (arg0.getSource() == addButton) {
++			add();
++		} else if (arg0.getSource() == removeButton) {
++			remove();
++		}
++	}
++
++	@Override
++	public void set(HashMap hm, String key, String value) {
++		//System.out.println("Trying to add DUPLICATOR Panel: " + key + " ... " + value + "  HashKey: " + this.getHashKey());
++
++		if (key.indexOf('#') == -1) {
++			ControlledPanel child = add(true, hm, key, value);
++			child.set(hm, key, value);
++		}
++	}
++
++	public ControlledPanel add() {
++		return add(false, null, null, null);
++	}
++
++	public ControlledPanel add(boolean doSet, HashMap hm, String key, String value) {
++
++		final Element child = (Element) this.clone.cloneNode(true);
++		final int counter = Integer.parseInt(element.getAttribute("counter"));
++		element.setAttribute("counter", (counter + 1) + "");
++
++		// child.setAttribute("key",element.getAttribute("key").replaceAll("#",counter+""));
++
++		//System.out.println("\t-->Adding a child panel to DUPLICATOR with key: " + key + "  val: " + value + "  HASH: " + this.getHashKey() + "  hier: " + this.getHierarchy());
++
++		recursiveKeyReplace(child, counter + "");
++		element.appendChild(child);
++
++		ControlledPanel childPanel = null;
++		try {
++			childPanel = ControlledPanel.createSingleParameterPanel(child, this);
++			childPanel.setKey(childPanel.getKey());
++			GUIBuilder.gui.addToTab(childPanel, section, this);
++			childPanel.hold();
++			GUIBuilder.control(childPanel);
++			GUIBuilder.recursiveBuild(child, this, doSet, hm, key, value);
++
++		} catch (final GUIBuildException e1) {
++			// TODO Auto-generated catch block
++			e1.printStackTrace();
++		}
++
++		this.invalidate();
++		
++		return childPanel;
++	}
++
++	@Override
++	public void close() {
++		boolean doRemove = true;
++
++		do {
++			doRemove = remove();
++		} while (doRemove);
++	}
++
++	@Override
++	public String getValue() {
++		return null;
++	}
++
++	public boolean remove() {
++		final int counter = Integer.parseInt(element.getAttribute("counter")) - 1;
++		final String childKey = element.getAttribute("key").replace("#", counter + "");
++		final Element child = XMLHelper.getCertainChildElement(element, "parameter", "key", childKey);
++
++		if (child == null) return false;
++
++		element.removeChild(child);
++		element.setAttribute("counter", (counter) + "");
++
++		final ControlledPanel childPanel = GUIBuilder.panelControl.get(section, childKey);
++
++		if (childPanel != null) {
++			childPanel.release();
++			childPanel.close();
++
++			try {
++				if (!childPanel.isNeeded()) {
++					GUIBuilder.gui.removeFromTab(childPanel, section, this);
++				}
++			} catch (final GUIBuildException e) {
++				// TODO Auto-generated catch block
++				e.printStackTrace();
++			}
++		}
++
++		this.invalidate();
++
++		return true;
++	}
++
++	private void recursiveKeyReplace(Element element, String string) {
++		if (element.hasAttribute("key")) {
++			element.setAttribute("key", element.getAttribute("key").replaceAll("#", string));
++		}
++		final NodeList nodelist = element.getChildNodes();
++		for (int i = 0; i < nodelist.getLength(); i++) {
++			if (nodelist.item(i).getNodeType() == Node.ELEMENT_NODE) {
++				recursiveKeyReplace(((Element) nodelist.item(i)), string);
++			}
++		}
++	}
++
++}
+
+Property changes on: ../trunk-jpl/src/java/src/gui_elements/DuplicatorPanel.java
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/gui_elements/OptionPanel.java
+===================================================================
+--- ../trunk-jpl/src/java/src/gui_elements/OptionPanel.java	(revision 0)
++++ ../trunk-jpl/src/java/src/gui_elements/OptionPanel.java	(revision 17993)
+@@ -0,0 +1,144 @@
++/***********************************************************************************/
++/*  Copyright 2012 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
++/***********************************************************************************/
++/*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*
++*/
++
++package gui_elements;
++
++import java.awt.event.ItemEvent;
++import java.awt.event.ItemListener;
++import java.util.LinkedList;
++import java.util.HashMap;
++import javax.swing.event.EventListenerList;
++
++import main.GUIBuilder;
++import main.XMLHelper;
++
++import org.w3c.dom.Element;
++import org.w3c.dom.Node;
++
++/**
++ * A ControlledPanel that maintains a group of choices and invokes panel
++ * creation according to the current choices.
++ *
++ * @author korhammer et egger
++ *
++ */
++public abstract class OptionPanel extends ControlledPanel implements ItemListener {
++
++	private static final long serialVersionUID = 88L;
++
++	protected LinkedList<String> defaultTrues;
++	protected EventListenerList listenerList;
++
++	protected String[] values;
++	protected String[] labels;
++	protected String[] helptexts;
++
++	/**
++	 * The constructor for an OptionPanel.
++	 *
++	 * @param element
++	 *            : The xml element which the OptionPanel is created for.
++	 * @throws GUIBuildException
++	 */
++	public OptionPanel(Element element, ControlledPanel parent) throws GUIBuildException {
++		this(element, parent, true);
++	}
++
++	public OptionPanel(Element element, ControlledPanel parent, boolean doLayout) throws GUIBuildException {
++		super(element, parent, doLayout);
++		
++		String elementdefault = "";
++
++		if (element.hasAttribute("default"))
++			elementdefault = element.getAttribute("default");
++
++		listenerList = new EventListenerList();
++
++		final Element[] options = XMLHelper.getElementArray(element, "option");
++		defaultTrues = new LinkedList<String>();
++
++		values = new String[options.length];
++		labels = new String[options.length];
++		helptexts = new String[options.length];
++
++		for (int i=0;i<options.length;i++) {
++			values[i] = options[i].getAttribute("value");
++			labels[i] = options[i].getAttribute("label");
++
++			if (labels[i] == "")
++				labels[i] = values[i];
++
++			if (elementdefault.equals(values[i]))
++				defaultTrues.add(values[i]);
++
++			if (options[i].hasAttribute("default") && options[i].getAttribute("default").equals("true"))
++				defaultTrues.add(values[i]);
++
++			helptexts[i] = XMLHelper.getChildElementContent(options[i],"help");
++		}
++	}
++
++	@Override
++	public void set(HashMap hm, String key, String value) {
++		//System.out.println("Trying to change OptionPanel");
++		//ControlledPanel child = add("TA2");
++		//child.set(element);
++	}
++
++
++	/**
++	 * Invokes the appropriate build or destruct methods when changes are made
++	 * to choices.
++	 *
++	 * @param arg0
++	 * @param selectedOption
++	 */
++	public void handleItemEvent(ItemEvent arg0, String selectedOption) {
++		handleItemEvent(arg0, selectedOption, false, null, null, null);
++	}
++
++	public void handleItemEvent(ItemEvent arg0, String selectedOption, boolean doSet, HashMap hm, String setKey, String setValue) {
++		Element optionElement = XMLHelper.getCertainChildElement(this.element, "option", "label", selectedOption);
++
++		if (optionElement == null)
++			optionElement = XMLHelper.getCertainChildElement(this.element, "option", "value", selectedOption);
++
++		//System.out.println("XML of handleItem("+arg0.getItemSelectable().getClass().toString()+"): " + XMLHelper.getString((Node)optionElement));//this.element));
++
++		if (arg0.getStateChange() == ItemEvent.SELECTED) {
++			try {
++				GUIBuilder.recursiveBuild(optionElement, this, doSet, hm, setKey, setValue);
++			} catch (final GUIBuildException e) {
++				// TODO Auto-generated catch block
++				e.printStackTrace();
++			}
++
++		} else {
++			try {
++				GUIBuilder.recursiveDestruct(optionElement, this);
++			} catch (final GUIBuildException e) {
++				// TODO Auto-generated catch block
++				e.printStackTrace();
++			}
++		}
++
++	}
++
++}
+
+Property changes on: ../trunk-jpl/src/java/src/gui_elements/OptionPanel.java
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/gui_elements/TextfieldPanel.java
+===================================================================
+--- ../trunk-jpl/src/java/src/gui_elements/TextfieldPanel.java	(revision 0)
++++ ../trunk-jpl/src/java/src/gui_elements/TextfieldPanel.java	(revision 17993)
+@@ -0,0 +1,129 @@
++/***********************************************************************************/
++/*  Copyright 2012 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
++/***********************************************************************************/
++/*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*
++*/
++
++package gui_elements;
++
++import main.GUI;
++
++import java.awt.*;
++import java.awt.event.*;
++import java.util.HashMap;
++
++import javax.swing.JTextField;
++import javax.swing.JOptionPane;
++
++import org.w3c.dom.Element;
++
++/**
++ * A panel that contains a textfield.
++ *
++ * @author korhammer et egger
++ *
++ */
++public class TextfieldPanel extends ControlledPanel implements KeyListener {
++
++	private static final long serialVersionUID = 1L;
++	private String defaultText;
++
++	protected JTextField textfield;
++
++	/**
++	 * The constructor for a TextfieldPanel.
++	 *
++	 * @param element
++	 */
++	public TextfieldPanel(Element element, ControlledPanel parent) {
++		super(element, parent);
++		textfield = new JTextField(10);
++		textfield.setVisible(true);
++		this.add(textfield, "width 250:100:400, cell 1 0, growx, ay top, gaptop 3");
++		textfield.addKeyListener(this);
++
++		defaultText = "";
++		if (element.hasAttribute("default")) {
++			defaultText = element.getAttribute("default");
++		}
++		textfield.setText(defaultText);
++
++		if (!optional)
++			textfield.setBackground(GUI.WARNING_BACKGROUND_COLOR);
++
++		this.checkBgColor();
++		textfield.invalidate();
++	}
++
++
++
++	@Override
++	public void close() {
++		// TODO Auto-generated method stub
++
++	}
++
++	@Override
++	public void set(HashMap hm, String key, String value) {
++		//System.out.println("\tI'm changing the label of the TextField with key '" + this.getKey() + "'");
++		String val = (String)hm.get(hashKey);
++		if (val != null) textfield.setText(val);
++		this.checkBgColor();
++	}
++
++	@Override
++	public String getValue() {
++		String thetext = textfield.getText();
++
++		if (!isOptional() && thetext.equals("")) {
++			JOptionPane.showMessageDialog(null, "No value was entered for "
++									+ getKey() + " (section '" + getSection().toUpperCase() + "')"
++									+ ".\nA value is required. Your .ini-file is probably incorrect.",
++									"Problem when building .ini file",
++									JOptionPane.WARNING_MESSAGE);
++		}
++
++		if (thetext.equals(""))
++			return null;
++
++		return thetext;
++	}
++
++	/** Handle the key typed event from the text field. */
++	public void keyTyped(KeyEvent e) {}
++
++	/** Handle the key-pressed event from the text field. */
++	public void keyPressed(KeyEvent e) {}
++
++	/** Handle the key-released event from the text field. */
++	public void keyReleased(KeyEvent e) {
++		checkBgColor();
++	}
++
++	public void checkBgColor() {
++		String text = textfield.getText();
++		
++		if (!optional) {
++			if (text.length() > 0) {
++				textfield.setBackground(GUI.NORMAL_BACKGROUND_COLOR);
++			} else {
++				textfield.setBackground(GUI.WARNING_BACKGROUND_COLOR);
++			}
++			textfield.invalidate();
++		}
++	}
++}
+
+Property changes on: ../trunk-jpl/src/java/src/gui_elements/TextfieldPanel.java
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/gui_elements/FramePanel.java
+===================================================================
+--- ../trunk-jpl/src/java/src/gui_elements/FramePanel.java	(revision 0)
++++ ../trunk-jpl/src/java/src/gui_elements/FramePanel.java	(revision 17993)
+@@ -0,0 +1,71 @@
++/***********************************************************************************/
++/*  Copyright 2012 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
++/***********************************************************************************/
++/*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*
++*/
++
++package gui_elements;
++
++import main.GUIBuilder;
++import main.XMLHelper;
++
++import java.util.HashMap;
++import javax.swing.JPanel;
++import javax.swing.border.*;
++import javax.swing.BorderFactory;
++
++import org.w3c.dom.Element;
++import org.w3c.dom.Node;
++import org.w3c.dom.NodeList;
++import net.miginfocom.swing.MigLayout;
++
++public class FramePanel extends ControlledPanel {
++
++	private static final long serialVersionUID = 1987664773406118295L;
++	protected String title = "";
++
++	/**
++	 *
++	 *
++	 * @param element
++	 * @throws GUIBuildException
++	 */
++	public FramePanel(Element element, ControlledPanel parent) throws GUIBuildException {
++		super(element, parent, false);
++		this.setLayout(new MigLayout("wrap 8, top, ins n 5 n n", "[200!][100!][100!][100!][100!][100!][300:400:400]", ""));
++
++		if (parent == null)	hierarchy = 1;
++
++		title = element.getAttribute("label");
++
++		Border mytitledborder = BorderFactory.createTitledBorder(title);
++		//Border loweredetched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
++		this.setBorder(mytitledborder);
++
++		this.invalidate();
++	}
++
++	@Override
++	public String getValue() {
++		return null;
++	}
++	
++	@Override
++	public void close() {
++
++	}
++}
+
+Property changes on: ../trunk-jpl/src/java/src/gui_elements/FramePanel.java
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/gui_elements/PathPanel.java
+===================================================================
+--- ../trunk-jpl/src/java/src/gui_elements/PathPanel.java	(revision 0)
++++ ../trunk-jpl/src/java/src/gui_elements/PathPanel.java	(revision 17993)
+@@ -0,0 +1,118 @@
++/***********************************************************************************/
++/*  Copyright 2012 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
++/***********************************************************************************/
++/*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*
++*/
++
++package gui_elements;
++
++import java.awt.event.ActionEvent;
++import java.awt.event.ActionListener;
++import java.util.HashMap;
++
++import javax.swing.JButton;
++import javax.swing.JFileChooser;
++import javax.swing.JPanel;
++
++import org.w3c.dom.Element;
++
++public class PathPanel extends TextfieldPanel implements ActionListener {
++
++	/**
++	 *
++	 */
++	private static final long serialVersionUID = 1486664773406118295L;
++
++	JButton select_button;
++
++	/**
++	 * Creates a panel with a text field and a file / path chooser button.
++	 *
++	 * @param element
++	 * @throws GUIBuildException
++	 */
++	public PathPanel(Element element, ControlledPanel parent) throws GUIBuildException {
++		super(element, parent);
++
++		if (element.getAttribute("type").equals("path")) {
++			select_button = new JButton("Select Path");
++		} else if (element.getAttribute("type").equals("file")) {
++			select_button = new JButton("Select File");
++		} else {
++			throw new GUIBuildException("PathPanel is not applicable for parameter types other than 'file' and 'path'.");
++		}
++
++		this.remove(textfield);
++		this.add(textfield, "cell 1 0, growx, span2");
++
++		select_button.addActionListener(this);
++		select_button.setActionCommand("open chooser");
++		select_button.setVisible(true);
++		this.add(select_button, "cell 3 0, growx, wrap");
++
++	}
++
++	@Override
++	public void actionPerformed(ActionEvent event) {
++		if (event.getActionCommand().equals("open chooser") && event.getSource() == this.select_button) {
++			try {
++				chooseFile();
++			} catch (final GUIBuildException e) {
++				// TODO Auto-generated catch block
++				e.printStackTrace();
++			}
++		}
++	}
++
++	@Override
++	public void set(HashMap hm, String key, String value) {
++		String val = (String)hm.get(hashKey);
++		if (val != null) textfield.setText(val);
++		this.checkBgColor();
++	}
++
++	/**
++	 * Opens the file chooser dialog and writes the path / filepath into the
++	 * texfield.
++	 *
++	 * @throws GUIBuildException
++	 */
++	public void chooseFile() throws GUIBuildException {
++		final JFileChooser filechooser = new JFileChooser(System.getProperty("user.dir"));
++
++		if (element.getAttribute("type").equals("path")) {
++			filechooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
++		} else if (element.getAttribute("type").equals("file")) {
++			filechooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
++		} else {
++			throw new GUIBuildException("PathPanel is not applicable for parameter types other than 'file' and 'path'.");
++		}
++
++		final int returnVal = filechooser.showOpenDialog(new JPanel());
++
++		if (returnVal == JFileChooser.APPROVE_OPTION) {
++			if (element.getAttribute("type").equals("path")) {
++				textfield.setText(filechooser.getSelectedFile().getAbsolutePath());
++			} else {
++				textfield.setText(filechooser.getSelectedFile().getName());
++			}
++
++			checkBgColor();
++		}
++	}
++
++}
+
+Property changes on: ../trunk-jpl/src/java/src/gui_elements/PathPanel.java
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/gui_elements/IntegerPanel.java
+===================================================================
+--- ../trunk-jpl/src/java/src/gui_elements/IntegerPanel.java	(revision 0)
++++ ../trunk-jpl/src/java/src/gui_elements/IntegerPanel.java	(revision 17993)
+@@ -0,0 +1,246 @@
++/***********************************************************************************/
++/*  Copyright 2012 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
++/***********************************************************************************/
++/*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*
++*/
++
++package gui_elements;
++
++import java.awt.event.*;
++import java.util.HashMap;
++
++import javax.swing.JButton;
++import javax.swing.JOptionPane;
++import javax.swing.SwingConstants;
++
++import org.w3c.dom.Element;
++
++/**
++ * A panel that maintains a number in an editable textfield,
++ * optionally with a maximum and minimum value.
++ * @author korhammer
++ *
++ */
++/**
++ * @author korhammer
++ *
++ */
++public class IntegerPanel extends TextfieldPanel implements ActionListener, FocusListener {
++	/**
++	 *
++	 */
++	private static final long serialVersionUID = -8959578535487185306L;
++
++	private int defaultvalue;
++	private int maximumvalue;
++	private int minimumvalue;
++
++	private boolean printPlus;
++
++	private final JButton down;
++	private final JButton up;
++
++	/**
++	 * Constructor for a NumberPanel.
++	 *
++	 * @param element
++	 * @throws GUIBuildException
++	 */
++	public IntegerPanel(Element element, ControlledPanel parent) throws GUIBuildException {
++		super(element, parent);
++
++		setDefaultvalue(0);
++		minimumvalue = Integer.MIN_VALUE;
++		maximumvalue = Integer.MAX_VALUE;
++		printPlus = false;
++
++		if (element.getAttribute("type").equals("integer+")) {
++			setPrintplus(true);
++		} else {
++			setPrintplus(false);
++		}
++
++		if (element.hasAttribute("default")) {
++			setDefaultvalue(element.getAttribute("default"));
++		}
++		if (element.hasAttribute("maximum")) {
++			setMaximumvalue(element.getAttribute("maximum"));
++		}
++		if (element.hasAttribute("minimum")) {
++			setMinimumvalue(element.getAttribute("minimum"));
++		}
++
++		textfield.setColumns(4);
++		textfield.invalidate();
++		textfield.setHorizontalAlignment(SwingConstants.RIGHT);
++
++		up = new JButton("+");
++		up.addActionListener(this);
++		down = new JButton("-");
++		down.addActionListener(this);
++		this.add(up, "split 2, growx, ay top");
++		this.add(down, "growx, ay top");
++		textfield.addActionListener(this);
++		textfield.addFocusListener(this);
++
++	}
++
++	/**
++	 * Parses a String to an integer. Different from the standard methods as it
++	 * handles the + sign e.g. in time zones.
++	 *
++	 * @param text
++	 * @return the parsed number
++	 * @throws NumberFormatException
++	 */
++	private static int parse(String text) throws NumberFormatException {
++
++		final char first = text.charAt(0);
++
++		if (first == '+')
++			return Integer.parseInt(text.substring(1));
++		if (first == '-')
++			return Integer.parseInt(text);
++		return Integer.parseInt(text);
++	}
++
++	/*
++	 * (non-Javadoc)
++	 *
++	 * @see
++	 * java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
++	 */
++	@Override
++	public void actionPerformed(ActionEvent e) {
++		if (e.getSource() == up) {
++			manipulateNumber(1);
++		} else if (e.getSource() == down) {
++			manipulateNumber(-1);
++		} else if (e.getSource() == textfield) {
++			parseTextfield();
++		}
++	}
++
++	@Override
++	public void set(HashMap hm, String key, String value) {
++		String val = (String)hm.get(hashKey);
++		if (val != null) {
++			try {
++				Integer.parseInt(val);
++				textfield.setText(val);
++			} catch (Exception e) {} //Do nothing if conversion fails
++		}
++	}
++
++	@Override
++	public void focusGained(FocusEvent arg0) {
++
++	}
++
++	@Override
++	public void focusLost(FocusEvent arg0) {
++		parseTextfield();
++	}
++
++	/**
++	 * Manipulates the number in the text field by parsing it, adding the
++	 * increment and writing it back into the textfield.
++	 *
++	 * @param increment
++	 */
++	public void manipulateNumber(int increment) {
++		int number;
++
++		try {
++			number = parseTextfield();
++		} catch (final NumberFormatException nfe) {
++			return;
++		}
++
++		if (number + increment <= maximumvalue
++				&& number + increment >= minimumvalue) {
++			number += increment;
++		} else if (number + increment < minimumvalue) {
++			number = minimumvalue;
++		} else if (number + increment > maximumvalue) {
++			number = maximumvalue;
++		}
++
++		printToTextfield(number);
++	}
++
++	/**
++	 * Calls the parse method on the textfield.
++	 *
++	 * @return
++	 * @throws NumberFormatException
++	 */
++	public int parseTextfield() throws NumberFormatException {
++		try {
++			return parse(textfield.getText());
++		} catch (final NumberFormatException nfe) {
++			JOptionPane.showMessageDialog(null, "The textfield " + getKey()
++					+ " does not contain a number.");
++			throw nfe;
++		}
++	}
++
++	/**
++	 * Prints a number to the text field optionally with a plus sign.
++	 *
++	 * @param number
++	 */
++	public void printToTextfield(int number) {
++		if (this.printPlus && number > 0) {
++			textfield.setText("+" + number);
++		} else {
++			textfield.setText("" + number);
++		}
++		checkBgColor();
++	}
++
++	public void setDefaultvalue(int defaultvalue) {
++		this.defaultvalue = defaultvalue;
++		this.printToTextfield(defaultvalue);
++	}
++
++	public void setDefaultvalue(String defaultvalue) {
++		this.defaultvalue = parse(defaultvalue);
++		this.printToTextfield(this.defaultvalue);
++	}
++
++	public void setMaximumvalue(int maximumvalue) {
++		this.maximumvalue = maximumvalue;
++	}
++
++	public void setMaximumvalue(String maximumvalue) {
++		this.maximumvalue = parse(maximumvalue);
++	}
++
++	public void setMinimumvalue(int minimumvalue) {
++		this.minimumvalue = minimumvalue;
++	}
++
++	public void setMinimumvalue(String minimumvalue) {
++		this.minimumvalue = parse(minimumvalue);
++	}
++
++	public void setPrintplus(boolean printPlus) {
++		this.printPlus = printPlus;
++		printToTextfield(parse(textfield.getText()));
++	}
++}
+
+Property changes on: ../trunk-jpl/src/java/src/gui_elements/IntegerPanel.java
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/gui_elements/AlternativePanel.java
+===================================================================
+--- ../trunk-jpl/src/java/src/gui_elements/AlternativePanel.java	(revision 0)
++++ ../trunk-jpl/src/java/src/gui_elements/AlternativePanel.java	(revision 17993)
+@@ -0,0 +1,177 @@
++/***********************************************************************************/
++/*  Copyright 2012 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
++/***********************************************************************************/
++/*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*
++*/
++
++package gui_elements;
++
++import java.awt.event.ItemEvent;
++
++import javax.swing.JComboBox;
++import javax.swing.JOptionPane;
++import java.util.HashMap;
++import javax.swing.*;
++import java.awt.*;
++
++import main.GUI;
++
++import org.w3c.dom.Element;
++
++/**
++ * The AlternativePanel contains a dropdown list with alternatives to choose from.
++ *
++ * @author Thomas Egger
++ *
++ */
++public class AlternativePanel extends OptionPanel {
++
++	private static final long serialVersionUID = 4468480774697888798L;
++	private final JComboBox box;
++
++	private String setKey = null, setValue = null;
++	private boolean doSet = false;
++	private HashMap setMap;
++
++	/**
++	 * Constructor for the AlternativePanel
++	 *
++	 * @param element the <parameter ...> element for which the panel is created.
++	 * @throws GUIBuildException
++	 */
++	public AlternativePanel(Element element, ControlledPanel parent) throws GUIBuildException {
++		super(element, parent);
++
++		box = new JComboBox(labels);
++		box.insertItemAt("", 0);     //Add an empty label
++		box.setVisible(true);
++		box.setSelectedIndex(0);
++		box.addItemListener(this);
++
++		//Issue 263: On OSX the box.setBackground method does not function without this tweak:
++		if (System.getProperty("os.name").equals("Mac OS X")) 
++		    box.setRenderer(new ColorCellRenderer(box.getPreferredSize().width));
++
++		if (!optional) box.setBackground(GUI.WARNING_BACKGROUND_COLOR);
++
++		if (defaultTrues.size() > 1) {
++			throw new GUIBuildException("Element " + getHashKey() + " has multiple default values");
++		} else if (defaultTrues.size() == 1) {
++			box.setSelectedItem(defaultTrues.getFirst());
++		}
++
++		this.add(box, "cell 1 0, growx, ay top, wrap");
++	}
++
++	@Override
++	public void close() {
++		this.box.setSelectedIndex(0);
++	}
++
++	@Override
++	public String getValue() {
++
++		if (box.getSelectedIndex() != 0) {
++			//String selectedString = (String) box.getSelectedItem();
++			int index = box.getSelectedIndex() - 1;
++			if (index < 0)
++				return "";
++
++			return values[index];
++		}
++
++		if (!isOptional()) {
++			JOptionPane.showMessageDialog(null, "No option was selected for "
++									+ getKey() + " (section '" + getSection().toUpperCase() + "')"
++									+ ".\nA value is required. Your .ini-file is probably incorrect.",
++									"Problem when building .ini file",
++									JOptionPane.WARNING_MESSAGE);
++		}
++
++		return null;
++	}
++
++	@Override
++	public synchronized void set(HashMap hm, String key, String value) {
++		doSet = true;
++		setKey = key;
++		setValue = value;
++		setMap = hm;
++
++		if (!hm.containsKey(hashKey)) return;
++		String val = ((String)hm.get(hashKey)).toUpperCase();
++
++		//System.out.println("\tAP: Setting AlternativePanel: " + hashKey + " = " + val);
++
++		for (int ii=0; ii<values.length; ii++) { //loop through all existant items
++			if (val.equals(values[ii].toUpperCase())) { //compare to val
++				this.box.setSelectedIndex(ii+1);
++				break;
++			}
++		}
++	}
++
++	@Override
++	public synchronized void itemStateChanged(ItemEvent arg0) {
++		//Deal with help text
++		help.setText("");
++
++		if ((box.getSelectedIndex() > 0) && (helptexts[box.getSelectedIndex()-1] != null)) {
++			help.setText("<html>" + helptexts[box.getSelectedIndex()-1] + "</html>");
++		} else {
++			if (helptext != null) 
++				help.setText("<html>" + helptext + "</html>");
++		}
++
++		//handle selected Item
++		final String selectedOption = (String) arg0.getItem();
++		if (selectedOption == "") {
++			if (!optional) {
++				box.setBackground(GUI.WARNING_BACKGROUND_COLOR);
++			}
++		} else {
++			if (!optional) {
++				box.setBackground(GUI.NORMAL_BACKGROUND_COLOR);
++			}
++			//System.out.println("\tDOSET of AlternativePanel: " + doSet);
++			super.handleItemEvent(arg0, selectedOption, doSet, setMap, setKey, setValue);
++			doSet = false;
++			setKey = null;
++			setMap = null;
++			setValue = null;
++		}
++	}
++}
++
++class ColorCellRenderer implements ListCellRenderer {
++	protected DefaultListCellRenderer defaultRenderer = new DefaultListCellRenderer();
++	private Dimension preferredSize = new Dimension(0, 18);
++
++	public ColorCellRenderer(int width) {
++		width -= 50;
++
++		if (width < 100) width = 100; //Default size on OSX
++	
++		preferredSize = new Dimension(width, 18);
++	}
++
++	public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
++		JLabel renderer = (JLabel) defaultRenderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
++		renderer.setPreferredSize(preferredSize);
++		return renderer;
++	}
++}
+
+Property changes on: ../trunk-jpl/src/java/src/gui_elements/AlternativePanel.java
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/gui_elements/DecimalPanel.java
+===================================================================
+--- ../trunk-jpl/src/java/src/gui_elements/DecimalPanel.java	(revision 0)
++++ ../trunk-jpl/src/java/src/gui_elements/DecimalPanel.java	(revision 17993)
+@@ -0,0 +1,133 @@
++/***********************************************************************************/
++/*  Copyright 2012 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
++/***********************************************************************************/
++/*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*
++*/
++
++package gui_elements;
++
++import java.awt.event.ActionEvent;
++import java.awt.event.ActionListener;
++import java.awt.event.FocusEvent;
++import java.awt.event.FocusListener;
++import java.util.HashMap;
++
++import java.text.DecimalFormat;
++import java.text.ParseException;
++import java.text.DecimalFormatSymbols;
++import javax.swing.JFormattedTextField;
++
++import org.w3c.dom.Element;
++
++public class DecimalPanel extends TextfieldPanel implements ActionListener, FocusListener{
++
++	/**
++	 *
++	 */
++	private static final long serialVersionUID = 1555742510677354674L;
++	double defaultvalue;
++	double maximumvalue;
++	double minimumvalue;
++
++	JFormattedTextField textfield;
++
++	public DecimalPanel(Element element, ControlledPanel parent) {
++		super(element, parent);
++		this.remove(super.textfield);
++
++		DecimalFormat format = (DecimalFormat)DecimalFormat.getInstance();
++		DecimalFormatSymbols custom = new DecimalFormatSymbols();
++		custom.setDecimalSeparator('.');
++		format.setDecimalFormatSymbols(custom);
++		format.setGroupingUsed(false);
++
++		textfield = new JFormattedTextField(format);
++		textfield.addActionListener(this);
++		textfield.addFocusListener(this);
++		this.add(textfield,"cell 1 0, growx, ay top, gaptop 3");
++		textfield.setVisible(true);
++		this.invalidate();
++		defaultvalue = 0.0;
++		maximumvalue = Double.MAX_VALUE;
++		minimumvalue = Double.MIN_VALUE;
++
++
++		if(element.hasAttribute("minimum")){
++			minimumvalue = Double.parseDouble(element.getAttribute("minimum"));
++		}
++		if(element.hasAttribute("maximum")){
++			maximumvalue = Double.parseDouble(element.getAttribute("maximum"));
++		}
++		if(element.hasAttribute("default")){
++			defaultvalue = Double.parseDouble(element.getAttribute("default"));
++		}
++		setToDefaultValue();
++	}
++
++	private void setToDefaultValue() {
++		textfield.setValue(new Double(defaultvalue));
++		this.invalidate();
++	}
++
++	private void checkValue(){
++		try {
++			textfield.commitEdit();
++		} catch (ParseException e) {
++			// TODO Auto-generated catch block
++			e.printStackTrace();
++		}
++		double currentvalue = ((Number)textfield.getValue()).doubleValue();
++		if(currentvalue > maximumvalue){
++			textfield.setValue(new Double(maximumvalue));
++		}
++		else if(currentvalue<minimumvalue){
++			textfield.setValue(new Double(minimumvalue));
++		}
++	}
++
++	public String getValue(){
++		return textfield.getValue().toString();
++	}
++
++	@Override
++	public void set(HashMap hm, String key, String value) {
++		String val = (String)hm.get(hashKey);
++		if (val != null) {
++			try {
++				Double.parseDouble(val);
++				textfield.setText(val);
++			} catch (Exception e) {} //Do nothing if conversion fails
++		}
++	}
++
++	@Override
++	public void focusGained(FocusEvent arg0) {
++		checkValue();
++
++	}
++
++	@Override
++	public void focusLost(FocusEvent arg0) {
++		checkValue();
++
++	}
++
++	@Override
++	public void actionPerformed(ActionEvent arg0) {
++		checkValue();
++	}
++}
+
+Property changes on: ../trunk-jpl/src/java/src/gui_elements/DecimalPanel.java
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/main/PanelControl.java
+===================================================================
+--- ../trunk-jpl/src/java/src/main/PanelControl.java	(revision 0)
++++ ../trunk-jpl/src/java/src/main/PanelControl.java	(revision 17993)
+@@ -0,0 +1,248 @@
++/***********************************************************************************/
++/*  Copyright 2012 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
++/***********************************************************************************/
++/*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*
++*/
++
++package main;
++
++import gui_elements.ControlledPanel;
++
++import java.io.File;
++import java.io.FileWriter;
++import java.io.IOException;
++import java.util.HashMap;
++import java.util.LinkedList;
++import java.util.Set;
++import java.util.TreeMap;
++import java.util.Iterator;
++
++/**
++ * Class that maintains all ControlledPanels so that values can be retrieved
++ * from panels, ini-files can be written. And a panel is not multiply created.
++ *
++ * @author korhammer
++ *
++ */
++public class PanelControl {
++
++	LinkedList<String> order;
++	HashMap<String, TreeMap<String, ControlledPanel>> panels;
++	HashMap<String, String> comments = null;
++	HashMap<String, String> added_comments = null;
++	HashMap<String, HashMap<String, String>> unusedKeys = null;
++	PanelNode rootNode = null;
++
++	/**
++	 * Constructor for the panel control.
++	 */
++	public PanelControl() {
++		panels = new HashMap<String, TreeMap<String, ControlledPanel>>();
++		order = new LinkedList<String>();
++
++		unusedKeys = new HashMap<String, HashMap<String, String>>();
++	}
++
++	public PanelControl(PanelControl p) {
++		panels = new HashMap<String, TreeMap<String, ControlledPanel>>(p.panels);
++		order = new LinkedList<String>(p.order);
++		if (added_comments != null)
++			added_comments = new HashMap<String, String>(p.added_comments);
++
++		if (comments != null)
++			comments = new HashMap<String, String>(p.comments);
++	}
++
++	public void setUnusedKeys(String key, String value) {
++		//Parse key
++		int offset = key.indexOf("::");
++		String section = key.substring(0, offset);
++		String sectionkey = key.substring(offset + 2);
++
++		HashMap<String, String> hm = unusedKeys.get(section);
++		if (hm == null) unusedKeys.put(section, new HashMap<String, String>());
++
++		unusedKeys.get(section).put(sectionkey, value);
++	}
++
++	public void setComments(HashMap<String, String> inaddedcomments, HashMap<String, String> incomments) {
++		this.added_comments = new HashMap<String, String>(inaddedcomments);
++		this.comments = new HashMap<String, String>(incomments);
++	}
++
++	/**
++	 * @param section
++	 * @param key
++	 * @return true if a panel with such key is maintained in the specified
++	 *         section
++	 */
++	public boolean contains(String section, String key) {
++		if (!panels.containsKey(section))
++			return false;
++
++		return panels.get(section).containsKey(key);
++	}
++
++	/**
++	 *
++	 * @param section
++	 * @param key
++	 * @return the panel with the specified section / key pair
++	 */
++	public ControlledPanel get(String section, String key) {
++		return panels.get(section).get(key);
++	}
++
++	/**
++	 * Prints the ini-file at the specified path.
++	 *
++	 * @param path
++	 */
++	public void printToFile(String path) {
++		/* create file */
++		final File file = new File(path);
++
++		try {
++			final FileWriter writer = new FileWriter(file);
++
++			writer.write(this.toString());
++			writer.close();
++		} catch (final IOException e) {
++			// TODO Auto-generated catch block
++			e.printStackTrace();
++		}
++	}
++
++	/**
++	 * Adds the panel to the specified section.
++	 *
++	 * @param section
++	 * @param panel
++	 */
++	public void put(String section, ControlledPanel panel) {
++		final String key = panel.getKey();
++		if (!panels.containsKey(section)) {
++			order.add(section);
++			panels.put(section, new TreeMap<String, ControlledPanel>());
++		}
++		panels.get(section).put(key, panel);
++	}
++
++	/**
++	 * Removes the panel with the specified section and key.
++	 *
++	 * @param section
++	 * @param key
++	 * @return the panel
++	 */
++	public ControlledPanel remove(String section, String key) {
++		return panels.get(section).remove(key);
++	}
++
++	/**
++	 * Prints the maintained panels to a string.
++	 *
++	 * @return an ini-file-like structure
++	 */
++	public void setRootNode(PanelNode inrootNode) {
++		rootNode = inrootNode;
++	}
++
++	public String extractKey(String instring) {
++		int offset = instring.indexOf("::");
++		if (offset == -1) return null;
++
++		return instring.substring(offset+2);
++	}
++
++	@Override
++	public String toString() {
++		String out = "";
++
++		for (final String section : order) {
++			/* create section */
++			final String sectionstring = "[" + section.toUpperCase() + "]\n";
++			String keyvaluestring = "";
++
++			/* print section */
++			LinkedList<String> keys = new LinkedList<String>();
++			PanelNode sectionNode = rootNode.get(section.toUpperCase());
++			if (sectionNode != null) sectionNode.getKeyList(keys);
++
++			//final Set<String> keys = panels.get(section).keySet();
++			for (final String hashKey : keys) {
++				String key = extractKey(hashKey);
++				if (key == null) continue;
++
++				final String value = panels.get(section).get(key).getValue();
++				if (value != null) {
++					if ((comments != null) && comments.containsKey(hashKey.toUpperCase())) {
++						String precomments =  comments.get(hashKey.toUpperCase());
++						if (!precomments.equals(""))
++						 	keyvaluestring += precomments;						
++					}
++
++					keyvaluestring += key + "\t=\t" + value;					
++
++					if ((added_comments != null) && added_comments.containsKey(hashKey.toUpperCase()))
++						keyvaluestring += "\t" + added_comments.get(hashKey.toUpperCase());
++
++					keyvaluestring += "\n";
++				}
++			}
++
++			//Add unused keys
++			HashMap<String, String> extra = unusedKeys.get(section.toUpperCase());
++			if (extra != null) {
++				if (!keyvaluestring.equals("")) keyvaluestring += "\n";
++
++				for (String extrakey : extra.keySet()) {
++					String hashKey = section.toUpperCase() + "::" + extrakey.toUpperCase();
++					if ((comments != null) && comments.containsKey(hashKey)) {
++						String precomments =  comments.get(hashKey);
++						if (!precomments.equals(""))
++						 	keyvaluestring += precomments;						
++					}
++				
++					keyvaluestring += extrakey + "\t=\t" + extra.get(extrakey);
++
++					if ((added_comments != null) && added_comments.containsKey(hashKey))
++					    keyvaluestring += "\t" + added_comments.get(hashKey);
++
++					keyvaluestring += "\n";
++				}
++			}
++			
++			//check if there aren't any comments in that section
++			String hashKey = section.toUpperCase() + "::";
++			if ((comments != null) && comments.containsKey(hashKey)) {
++				String precomments =  comments.get(hashKey);
++				if (!precomments.equals("")) {
++					if (precomments.indexOf("\n") == -1) precomments += "\n";
++					keyvaluestring = precomments + keyvaluestring + "\n";
++				}
++			}
++			
++			/* add section only if keys / values are printed */
++			if (!keyvaluestring.equals("")) {
++				out += sectionstring + keyvaluestring + "\n";
++			}
++		}
++
++		return out;
++	}
++}
+
+Property changes on: ../trunk-jpl/src/java/src/main/PanelControl.java
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/main/XMLHelper.java
+===================================================================
+--- ../trunk-jpl/src/java/src/main/XMLHelper.java	(revision 0)
++++ ../trunk-jpl/src/java/src/main/XMLHelper.java	(revision 17993)
+@@ -0,0 +1,525 @@
++/***********************************************************************************/
++/*  Copyright 2012 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
++/***********************************************************************************/
++/*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*
++*/
++
++package main;
++
++import gui_elements.GUIBuildException;
++
++import java.io.IOException;
++import java.util.LinkedList;
++
++import javax.xml.parsers.DocumentBuilder;
++import javax.xml.parsers.DocumentBuilderFactory;
++import javax.xml.parsers.ParserConfigurationException;
++import javax.xml.transform.TransformerConfigurationException;
++import javax.xml.transform.TransformerException;
++import javax.xml.transform.TransformerFactory;
++
++import org.w3c.dom.Document;
++import org.w3c.dom.Element;
++import org.w3c.dom.Node;
++import org.w3c.dom.NodeList;
++import org.xml.sax.SAXException;
++
++//for the XML printing
++import javax.xml.transform.stream.StreamResult;
++import javax.xml.transform.*;
++import javax.xml.transform.dom.*;
++import java.io.StringWriter;
++
++public class XMLHelper {
++
++	/**
++	 * Find the parameter values for which the element should be cloned
++	 * e.g. for section tags.
++	 *
++	 * @param element
++	 * @param tagName
++	 * @param attributeName
++	 * @param parentArgument
++	 * @return the
++	 */
++	public static String[] findApplicableValues(Element element,
++			String tagName, String attributeName, String parentArgument) {
++
++		final String[] argumentsFromElement = getAttributesFromChildren(
++				element, tagName, attributeName);
++
++		/*
++		 * If no such arguments are specified for the current element but there
++		 * are for the parent element, take that of the parent.
++		 */
++		if (argumentsFromElement.length == 0 && parentArgument != null)
++			return new String[] { parentArgument };
++		else if ((argumentsFromElement.length > 0 && parentArgument != null)) {
++			if (getCertainChildElement(element, tagName, attributeName,
++					parentArgument) != null)
++				return new String[] { parentArgument };
++			else
++				/*
++				 * The empty intersection is an empty array so that his case can
++				 * be handled differently from the null case below.
++				 */
++				return new String[0];
++		}
++
++		/*
++		 * If no arguments are specified for the parent use all element
++		 * arguments.
++		 */
++		else if (argumentsFromElement.length > 0 && parentArgument == null)
++			return argumentsFromElement;
++		else if (argumentsFromElement.length == 0 && parentArgument == null)
++			return null;
++		return null;
++	}
++
++	/**
++	 * Get all children of an element that have a certain element tag and
++	 * extract the values for a certain attribute.
++	 *
++	 * @param parent
++	 *            the parent element
++	 * @param tag
++	 *            the element tag
++	 * @param attribute
++	 *            the attribute name
++	 *
++	 * @return a String array with the attribute values
++	 */
++	public static String[] getAttributesFromChildren(Element parent, String tag, String attribute) {
++		final Element[] elements = getElementArray(parent, tag);
++
++		final String[] attributes = new String[elements.length];
++		for (int i = 0; i < elements.length; i++) {
++			attributes[i] = elements[i].getAttribute(attribute);
++		}
++		return attributes;
++	}
++
++	/**
++	 * Returns the first child element that has the specified element tag and
++	 * the value for the specified attribute.
++	 *
++	 * @param parent
++	 * @param tag
++	 * @param attribute
++	 * @param value
++	 * @return the first child element that meets the criteria
++	 */
++	public static Element getCertainChildElement(Element parent, String tag,
++			String attribute, String value) {
++		final Element[] allElements = getElementArray(parent, tag);
++		for (final Element element : allElements) {
++			if (element.hasAttribute(attribute)) {
++				if (element.getAttribute(attribute).equals(value))
++					return element;
++			}
++		}
++		return null;
++	}
++
++	/**
++	 * For the specified element gets the text that is contained in the first
++	 * child that has a certain element name.
++	 *
++	 *
++	 * @param parent
++	 *            the parent element
++	 * @param tag
++	 *            the element tag for the child
++	 * @return the text content
++	 */
++	public static String getChildElementContent(Element parent, String tag) {
++		final Element[] elements = getElementArray(parent, tag);
++		if (elements.length == 0)
++			return null;
++
++		return elements[0].getTextContent();
++	}
++
++
++
++	/**
++	 * @param parent
++	 * @param tag
++	 * @return all child elements of the parent with the specified tag
++	 */
++	public static Element[] getElementArray(Element parent, String tag) {
++		if (!parent.hasChildNodes())
++			return new Element[0];
++
++		final NodeList nodeList = parent.getChildNodes();
++		final LinkedList<Element> elementlist = new LinkedList<Element>();
++		for (int i = 0; i < nodeList.getLength(); i++) {
++
++			final Node element = nodeList.item(i);
++			if (element.getNodeType() == Node.ELEMENT_NODE && ((Element) element).getTagName().equals(tag)) {
++				elementlist.add((Element) element);
++			}
++		}
++		final Element[] elements = new Element[elementlist.size()];
++
++		return elementlist.toArray(elements);
++	}
++
++	public static Element[] getElementArray(Element parent, String[] tags) {
++		if (!parent.hasChildNodes())
++			return new Element[0];
++
++		final NodeList nodeList = parent.getChildNodes();
++		final LinkedList<Element> elementlist = new LinkedList<Element>();
++		for (int ii = 0; ii < nodeList.getLength(); ii++) {
++
++			final Node element = nodeList.item(ii);
++			if (element.getNodeType() == Node.ELEMENT_NODE) {
++				//Loop through all possible tags
++				for (int jj=0; jj<tags.length; jj++) {
++					if (((Element) element).getTagName().equals(tags[jj])) {
++						elementlist.add((Element) element);
++						break;
++					}
++				}
++			}
++		}
++
++		final Element[] elements = new Element[elementlist.size()];
++		return elementlist.toArray(elements);
++	}
++
++	/**
++	 * Prints the Document object to the console. as XML.
++	 *
++	 * @param doc
++	 */
++	public static String printToScreen(Document doc) {
++
++		final javax.xml.transform.TransformerFactory tfactory = TransformerFactory
++				.newInstance();
++
++		javax.xml.transform.Transformer xform;
++		try {
++			xform = tfactory.newTransformer();
++
++			final javax.xml.transform.Source src = new javax.xml.transform.dom.DOMSource(
++					doc);
++
++			final java.io.StringWriter writer = new java.io.StringWriter();
++			final javax.xml.transform.Result result = new javax.xml.transform.stream.StreamResult(
++					writer);
++
++			xform.transform(src, result);
++
++			return writer.toString();
++
++		} catch (final TransformerConfigurationException e) {
++			// TODO Auto-generated catch block
++			e.printStackTrace();
++		} catch (final TransformerException e) {
++			// TODO Auto-generated catch block
++			e.printStackTrace();
++		}
++		return null;
++	}
++
++
++
++	/**
++	 * Reads an XML file and writes it into a Document structure.
++	 *
++	 * @param filepath
++	 * @param xsdpath
++	 *            the path of the W3 XML schema that the file is based on.
++	 * @throws GUIBuildException
++	 */
++	public static Document readXML(String filepath, String xsdpath)
++			throws GUIBuildException {
++
++		/* read XML file and write it into Document structure */
++
++		final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
++		dbf.setIgnoringComments(true);
++		dbf.setValidating(true);
++		dbf.setIgnoringElementContentWhitespace(true);
++
++		dbf.setAttribute(
++				"http://java.sun.com/xml/jaxp/properties/schemaLanguage",
++				"http://www.w3.org/2001/XMLSchema");
++		dbf.setAttribute(
++				"http://java.sun.com/xml/jaxp/properties/schemaSource", xsdpath);
++
++
++		DocumentBuilder db;
++		Document doc;
++
++		try {
++
++			db = dbf.newDocumentBuilder();
++			doc = db.parse(filepath);
++		} catch (final ParserConfigurationException e) {
++			throw new GUIBuildException(e.getMessage());
++		} catch (final SAXException e) {
++			throw new GUIBuildException(e.getMessage());
++		} catch (final IOException e) {
++			throw new GUIBuildException(e.getMessage());
++		}
++
++		doc.normalize();
++		doc.normalizeDocument();
++
++		resolveIncludes(doc, xsdpath);
++		resolveReferences(doc);
++		recursivelyResolveSections(doc.getDocumentElement(), null);
++		recursivelyResolveReplaces(doc.getDocumentElement(), null);
++
++		return doc;
++	}
++
++	/**
++	 * This method recursively traverses the document tree and replaces all
++	 * parameters that contain replace elements with the corresponding number of
++	 * cloned elements.
++	 *
++	 * @param current
++	 *            the current element
++	 * @param parentReplace
++	 *
++	 */
++	public static void recursivelyResolveReplaces(Element current,
++			String parentReplace) {
++
++		final String[] replacements = XMLHelper.findApplicableValues(
++				current, "replace", "name", parentReplace);
++
++		/* delete replace children */
++		final Element[] replaceChildren = XMLHelper.getElementArray(current,
++				"replace");
++		for (final Element replace : replaceChildren) {
++			current.removeChild(replace);
++		}
++
++		if (replacements == null) {
++			final NodeList childNodes = current.getChildNodes();
++			final Node[] nodes = new Node[childNodes.getLength()];
++			for (int i = 0; i < childNodes.getLength(); i++) {
++				nodes[i] = childNodes.item(i);
++			}
++
++			for (final Node node : nodes) {
++				if (node.getNodeType() == Node.ELEMENT_NODE) {
++					XMLHelper.recursivelyResolveReplaces((Element) node,
++							parentReplace);
++				}
++			}
++		} else if (replacements.length == 0) {
++			current.getParentNode().removeChild(current);
++		} else if (replacements != null) {
++			/* clone element */
++			for (final String replace : replacements) {
++				final Element clone = (Element) current.cloneNode(true);
++				clone.setAttribute("key",
++						clone.getAttribute("key").replaceAll("%", replace));
++				clone.setAttribute("replaced", replace);
++				current.getParentNode().appendChild(clone);
++
++				/* Recursion: Do not do recursion on NodeList as it is updated */
++				final NodeList childNodes = clone.getChildNodes();
++				final Node[] nodes = new Node[childNodes.getLength()];
++				for (int i = 0; i < childNodes.getLength(); i++) {
++					nodes[i] = childNodes.item(i);
++				}
++
++				for (final Node node : nodes) {
++					if (node.getNodeType() == Node.ELEMENT_NODE) {
++						XMLHelper.recursivelyResolveReplaces((Element) node,
++								replace);
++					}
++				}
++
++			}
++			current.getParentNode().removeChild(current);
++		}
++	}
++
++	/**
++	 * This method recursively traverses the document tree and replaces all
++	 * parameters that contain section elements with the corresponding number of
++	 * cloned elements.
++	 *
++	 * @param current
++	 */
++	public static void recursivelyResolveSections(Element current,
++			String parentSection) {
++
++		final String[] sections = XMLHelper.findApplicableValues(current,
++				"section", "name", parentSection);
++
++
++		final Element[] sectionChildren = XMLHelper.getElementArray(current,
++				"section");
++		for (final Element section : sectionChildren) {
++			current.removeChild(section);
++		}
++
++		if (sections == null) {
++			final NodeList childNodes = current.getChildNodes();
++			final Node[] nodes = new Node[childNodes.getLength()];
++			for (int i = 0; i < childNodes.getLength(); i++) {
++				nodes[i] = childNodes.item(i);
++			}
++
++			for (final Node node : nodes) {
++				if (node.getNodeType() == Node.ELEMENT_NODE) {
++					XMLHelper.recursivelyResolveSections((Element) node,
++							parentSection);
++				}
++			}
++		} else if (sections != null) {
++			/* clone element */
++			for (final String section : sections) {
++				final Element clone = (Element) current.cloneNode(true);
++				clone.setAttribute("section", section);
++
++				current.getParentNode().appendChild(clone);
++
++				/* Recursion: Do not do recursion on NodeList as it is updated */
++				final NodeList childNodes = clone.getChildNodes();
++				final Node[] nodes = new Node[childNodes.getLength()];
++				for (int i = 0; i < childNodes.getLength(); i++) {
++					nodes[i] = childNodes.item(i);
++				}
++
++				for (final Node node : nodes) {
++					if (node.getNodeType() == Node.ELEMENT_NODE) {
++						XMLHelper.recursivelyResolveSections((Element) node,
++								section);
++					}
++				}
++
++			}
++			current.getParentNode().removeChild(current);
++		}
++	}
++
++	/**
++	 * Parses an XML file as specified in the path of an "include" element and
++	 * replaces the include element with the content of the XML file.
++	 *
++	 * @param doc
++	 */
++	public static Document resolveIncludes(Document doc, String xsdpath) {
++		final NodeList include = doc.getElementsByTagName("include");
++
++		for (int i = 0; i < include.getLength(); i++) {
++
++			final String includePath = ((Element) include.item(i))
++					.getAttribute("path");
++
++			try {
++				final Document partialDocument = readXML(includePath, xsdpath);
++
++				final NodeList children = partialDocument.getChildNodes()
++						.item(0).getChildNodes();
++				final Node parent = include.item(i).getParentNode();
++
++				for (int j = 0; j < children.getLength(); j++) {
++					final Node imported = doc
++							.importNode(children.item(j), true);
++					parent.appendChild(imported);
++				}
++
++				// parent.replaceChild(fragment, include.item(i));
++			} catch (final GUIBuildException e) {
++				// TODO Auto-generated catch block
++				e.printStackTrace();
++			}
++
++		}
++
++		return doc;
++	}
++
++	/**
++	 * Manipulates the document structure, so that "reference" elements are
++	 * replaced by the corresponding "parametergroup".
++	 *
++	 * @param doc
++	 * @return
++	 */
++	public static Document resolveReferences(Document doc) {
++
++		final NodeList references = doc.getElementsByTagName("reference");
++		final NodeList parametergroups = doc.getElementsByTagName("parametergroup");
++
++		while (references.getLength() != 0) {
++
++			final Element referenceElement = (Element) references.item(0);
++
++			final Element parent = (Element) referenceElement.getParentNode();
++
++			parent.removeChild(referenceElement);
++
++			for (int i = 0; i < parametergroups.getLength(); i++) {
++
++				final Node parametergroupElement = parametergroups.item(i);
++
++				if (((Element) parametergroupElement).getAttribute("name")
++						.equals(referenceElement.getAttribute("name"))) {
++					final NodeList children = parametergroupElement
++							.getChildNodes();
++
++					for (int j = 0; j < children.getLength(); j++) {
++						final Node clone = children.item(j).cloneNode(true);
++						parent.appendChild(clone);
++					}
++				}
++			}
++		}
++
++		while (parametergroups.getLength() != 0) {
++			parametergroups.item(0).getParentNode()
++					.removeChild(parametergroups.item(0));
++		}
++
++		return doc;
++	}
++
++
++	/**
++	 * @brief  The funciton expects a Node element as argument and transform the XML
++	 *         (sub)tree starting with the given Node into a string
++	 * @return A string representing the (sub)tree starting with node
++	 * @author Thomas Egger
++	 */
++	public static String getString(Node node){
++		String str = "";
++
++		try {
++			Transformer transformer = TransformerFactory.newInstance().newTransformer();
++			StringWriter buffer = new StringWriter();
++			transformer.transform(new DOMSource(node), new StreamResult(buffer));
++			str = buffer.toString();
++		} catch (Exception ex) {
++			throw new RuntimeException("Error converting to String", ex);
++		}
++
++		return str;
++	}
++}
+
+Property changes on: ../trunk-jpl/src/java/src/main/XMLHelper.java
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/main/GUI.java
+===================================================================
+--- ../trunk-jpl/src/java/src/main/GUI.java	(revision 0)
++++ ../trunk-jpl/src/java/src/main/GUI.java	(revision 17993)
+@@ -0,0 +1,548 @@
++/***********************************************************************************/
++/*  Copyright 2012 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
++/***********************************************************************************/
++/*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*
++*/
++
++package main;
++
++import gui_elements.ControlledPanel;
++import gui_elements.GUIBuildException;
++
++import java.awt.BorderLayout;
++import java.awt.Color;
++import java.awt.Component;
++import java.awt.Container;
++import java.awt.Desktop;
++import java.awt.*;
++import java.awt.event.ActionEvent;
++import java.awt.event.ActionListener;
++import java.awt.event.WindowEvent;
++import java.awt.event.WindowListener;
++import java.io.IOException;
++import java.net.URISyntaxException;
++import java.util.HashMap;
++import java.util.LinkedList;
++
++import javax.swing.BoxLayout;
++import javax.swing.ImageIcon;
++import javax.swing.JButton;
++import javax.swing.JEditorPane;
++import javax.swing.JFileChooser;
++import javax.swing.JFrame;
++import javax.swing.JOptionPane;
++import javax.swing.JPanel;
++import javax.swing.JScrollPane;
++import javax.swing.JTabbedPane;
++import javax.swing.JToolBar;
++import javax.swing.event.HyperlinkEvent;
++import javax.swing.event.HyperlinkListener;
++import javax.swing.filechooser.FileNameExtensionFilter;
++import java.io.*;
++import javax.swing.*;
++import java.awt.*;
++import java.awt.event.*;
++
++import net.miginfocom.swing.MigLayout;
++
++/**
++ * The GUI created by the author.
++ *
++ * @author korhammer et egger
++ *
++ */
++public class GUI extends JFrame implements WindowListener, ActionListener, HyperlinkListener {
++
++	/**
++	 *
++	 */
++	private static final long serialVersionUID = -2428732881181670225L;
++	public static PanelNode rootNode = null;
++
++	private static String title = GUI.class.getPackage().getImplementationTitle() + " " + GUI.class.getPackage().getImplementationVersion();
++
++	public static final Color LABEL_COLOR = Color.decode("#000080");
++	public static Color NORMAL_BACKGROUND_COLOR = Color.decode("#EEEEEE");
++	public static Color WARNING_BACKGROUND_COLOR = Color.decode("#FF0011");
++
++	public static ImageIcon openicon = new ImageIcon(GUI.class.getClassLoader().getResource("resources/icons/xml_open.png"));
++	public static ImageIcon openiniicon = new ImageIcon(GUI.class.getClassLoader().getResource("resources/icons/fileopen.png"));
++	public static ImageIcon exporticon = new ImageIcon(GUI.class.getClassLoader().getResource("resources/icons/filesave.png"));
++	public static ImageIcon previewicon = new ImageIcon(GUI.class.getClassLoader().getResource("resources/icons/kghostview.png"));
++	public static ImageIcon reseticon = new ImageIcon(GUI.class.getClassLoader().getResource("resources/icons/reset.png"));
++
++	private final JButton createbutton;
++	private final JButton previewButton;
++	private final JButton openbutton;
++	private final JButton openinibutton;
++	private final JButton resetbutton;
++
++	private final JTabbedPane tabpane;
++	private final JToolBar toolbar;
++	private HashMap<String,JPanel> tabpanels;
++
++	private String configFilePath, iniFilePath;
++
++	/*
++	 * Creates a window with the static components of the GUI, i.e. components
++	 * that do not depend on the configuration file.
++	 */
++	public GUI() throws GUIBuildException {
++		super(title);
++
++		configFilePath = System.getProperty("user.dir");
++		iniFilePath = System.getProperty("user.dir");
++
++		tabpanels = new HashMap<String,JPanel>();
++
++		Dimension screenDim = new Dimension(1280, 800);
++		Dimension maxDim = null;
++
++		if (this.getMaximizedBounds() == null) {
++			Toolkit tk = Toolkit.getDefaultToolkit();
++			maxDim = tk.getScreenSize();
++			this.setMaximizedBounds(new Rectangle(0, 0, (int)maxDim.getWidth(), (int)maxDim.getHeight()));
++		} else {
++			maxDim = this.getMaximizedBounds().getSize();
++		}
++
++		if (maxDim.height < screenDim.height) {
++			screenDim.height = maxDim.height;
++			if (screenDim.height > 100)
++				screenDim.height -= 25;
++		}
++
++		if (maxDim.width < screenDim.width) {
++			screenDim.width = maxDim.width;
++			if (screenDim.width > 100)
++				screenDim.width -= 25;
++		}
++
++		this.setSize(screenDim);
++		//this.setExtendedState(MAXIMIZED_BOTH);
++		this.setVisible(true);
++		this.setLayout(new BorderLayout());
++
++		this.toolbar = new JToolBar();
++		toolbar.setLayout(new BoxLayout(toolbar, 1));
++		toolbar.setFloatable(false);
++		this.setVisible(true);
++		this.add(toolbar, BorderLayout.WEST);
++
++		this.tabpane = new JTabbedPane();
++		this.add(tabpane);
++		tabpane.setVisible(true);
++
++		this.openbutton = new JButton(openicon);
++		this.openbutton.setActionCommand("open config");
++		this.openbutton.setToolTipText("Open XML-configuration");
++		openbutton.addActionListener(this);
++		toolbar.add(this.openbutton);
++
++		this.openinibutton = new JButton(openiniicon);
++		this.openinibutton.setActionCommand("open ini");
++		this.openinibutton.setToolTipText("Open existing INI file");
++		openinibutton.addActionListener(this);
++		toolbar.add(this.openinibutton);
++
++		this.resetbutton = new JButton(reseticon);
++		this.resetbutton.setActionCommand("reset");
++		this.resetbutton.setToolTipText("Reset Interface");
++		resetbutton.addActionListener(this);
++		toolbar.add(this.resetbutton);
++
++		this.createbutton = new JButton(exporticon);
++		this.createbutton.setActionCommand("write config");
++		this.createbutton.setToolTipText("Write to INI-file");
++		createbutton.addActionListener(this);
++		toolbar.add(this.createbutton);
++
++		this.previewButton = new JButton(previewicon);
++		this.previewButton.setActionCommand("preview");
++		this.previewButton.setToolTipText("Preview INI-file");
++		previewButton.addActionListener(this);
++		toolbar.add(previewButton);
++
++		this.addWindowListener(this);
++
++		rootNode = new PanelNode("");
++	}
++
++	/**
++	 * Writes the application name into the GUI window title bar.
++	 *
++	 * @param application
++	 */
++	public void setApplicationForTitle(String application){
++		if(application.equals("")){
++			this.setTitle(title);
++		}
++		else{
++			this.setTitle(title + " for "+application);
++		}
++	}
++
++	public void hideOpenButton(){
++		openbutton.setVisible(false);
++	}
++
++	/**
++	 * Closes all tabs.
++	 */
++	public void closeAllTabs(){
++		tabpane.removeAll();
++	}
++
++	/**
++	 * Adds a component to the tab specified and creates the tab if it does not
++	 * already exist.
++	 *
++	 * @param comp
++	 * @param tabName
++	 * @throws GUIBuildException
++	 */
++	public void addToTab(ControlledPanel comp, String tabName, ControlledPanel parentPanel) throws GUIBuildException {
++		tabName = Character.toUpperCase(tabName.charAt(0)) + tabName.substring(1).toLowerCase();
++
++		String section = ((ControlledPanel)comp).getSection().toUpperCase();
++		String key = section + "::" + ((ControlledPanel)comp).getKey();//((ControlledPanel)comp).getHashKey();
++		//System.out.println("\tPanel: " + ((ControlledPanel)comp).getHashKey() + "   Section: " + ((ControlledPanel)comp).getSection());
++
++		PanelNode sectionNode = rootNode.getChild(section);
++		if (sectionNode == null) {
++			PanelNode tmp = new PanelNode(section);
++			//System.out.println("\t--Adding section '" + section + "' to tree");
++			sectionNode = rootNode.add(tmp);
++		}
++
++		if (parentPanel != null) {
++			//System.out.println("\tLooking for node: " + parentPanel.getHashKey());
++			sectionNode = sectionNode.get(parentPanel.getSection().toUpperCase() + "::" + parentPanel.getKey());
++		}
++
++		if (sectionNode != null) {
++			PanelNode keyNode = sectionNode.get(key);
++			if (keyNode == null) {
++				PanelNode tmp = new PanelNode(key);
++				keyNode = sectionNode.add(tmp);
++				//System.out.println("\t--Adding key '" + key + "' to tree as leaf to " + sectionNode.getData());
++			}
++		}
++
++		JPanel tab;
++		if (tabpane.indexOfTab(tabName) == -1) {
++
++			tab = new JPanel();
++			tab.setBackground(Color.white);
++			tab.setVisible(true);
++			tab.setLayout(new MigLayout("wrap 1"));
++
++			JScrollPane scrollpane = new JScrollPane(tab);
++			tabpane.add(tabName, scrollpane);
++			tabpanels.put(tabName, tab);
++
++		} else {
++			tab = tabpanels.get(tabName);
++		}
++
++		if (parentPanel != null && containsPanel(tab, parentPanel)) {
++			parentPanel.add(comp, "span");
++		} else {
++			tab.add(comp);
++		}
++
++		//JViewport jv = ((JScrollPane)tabpane.getComponentAt(tabpane.indexOfTab(tabName))).getViewport();
++		//jv.setViewPosition(new Point(0,0));
++
++		this.validate();
++	}
++
++	public void removeFromTab(ControlledPanel parameterPanel, String section, ControlledPanel parentPanel) {
++		final String tabTitle = section.substring(0, 1).toUpperCase() + section.substring(1).toLowerCase();
++		final int index = tabpane.indexOfTab(tabTitle);
++
++		final Container container = (Container) tabpane.getComponentAt(index);
++
++		//System.out.println("Removing Panel: " + parameterPanel.getHashKey());
++		PanelNode tmp = rootNode.get(parameterPanel.getSection().toUpperCase() + "::" + parameterPanel.getKey());
++		tmp.getParent().remove(tmp);
++
++		if (parentPanel != null && containsPanel(container, parentPanel)) {
++			parentPanel.remove(parameterPanel);
++		} else {
++			container.remove(parameterPanel);
++		}
++
++		GUIBuilder.panelControl.remove(section, parameterPanel.getKey());
++
++		container.repaint();
++		this.validate();
++	}
++
++	public boolean containsPanel(Container container, JPanel panel) {
++
++		for (final Component component : container.getComponents()) {
++			if (component == panel)
++				return true;
++			if (containsPanel((Container) component, panel))
++				return true;
++		}
++		return false;
++	}
++
++	@Override
++	public void actionPerformed(ActionEvent e) {
++		if (e.getActionCommand().equals("write config") && GUIBuilder.application!=null ) {
++			GUIBuilder.panelControl.setRootNode(rootNode);
++
++			try {
++				GUIBuilder.printIOFile();
++			} catch (final IOException e1) {
++				// TODO Auto-generated catch block
++				e1.printStackTrace();
++			} catch (final GUIBuildException e2) {
++				// TODO Auto-generated catch block
++				e2.printStackTrace();
++			}
++		} else if (e.getActionCommand().equals("preview") && GUIBuilder.application!=null) {
++			GUIBuilder.panelControl.setRootNode(rootNode);
++			previewINIFile();
++		} else if (e.getActionCommand().equals("reset") && GUIBuilder.application!=null) {
++			resetGUI();
++		} else if( (e.getActionCommand().equals("open config"))) {
++			openFile();
++		} else if( (e.getActionCommand().equals("open ini"))) {
++			openINIFile();
++		}
++	}
++
++	public void resetGUI() {
++		try {
++			int returnval = GUIBuilder.closeFile();
++			if (returnval == JOptionPane.CANCEL_OPTION) return;
++			GUIBuilder.buildGUI(GUIBuilder.currentConfigFile);
++		} catch (GUIBuildException e) {
++			e.printStackTrace();
++		}
++	}
++
++	public void previewINIFile(){
++		JFrame frame = new JFrame();
++		frame.setSize(600,800);
++		frame.setVisible(true);
++		//frame.setLayout(new BorderLayout());
++
++		JEditorPane pane = new JEditorPane();
++
++		pane.setText(GUIBuilder.panelControl.toString());
++		pane.setVisible(true);
++		pane.setEditable(false);
++
++		JScrollPane scrollPane = new JScrollPane(pane);
++		scrollPane.setVisible(true);
++		frame.add(scrollPane);
++
++		frame.validate();
++		frame.repaint();
++	}
++
++	public void openINIFile(){
++		final FileNameExtensionFilter inifilter = new FileNameExtensionFilter(".ini files", "ini");
++		final JFileChooser filechooser = new JFileChooser(iniFilePath);
++		filechooser.setFileFilter(inifilter);
++		final int returnval = filechooser.showOpenDialog(new JPanel());
++
++		HashMap<String, String> hm = new HashMap<String, String>();
++		HashMap<String, String> comments = new HashMap<String, String>();
++		HashMap<String, String> added_comments = new HashMap<String, String>();
++
++		if (returnval == JFileChooser.APPROVE_OPTION) {
++			final String path = filechooser.getSelectedFile().toString();
++			if (filechooser.getSelectedFile().isDirectory()) return;
++
++			iniFilePath = filechooser.getSelectedFile().getParent();
++
++			System.out.println("Opening INI file: " + path);
++
++			try {
++				BufferedReader br = new BufferedReader(new FileReader(path));
++				String line;
++
++				String section = "GENERAL::";
++				String clines = "";
++
++				while((line = br.readLine()) != null) {
++					int offset = line.indexOf(";");
++					int offset2 = line.indexOf("#");
++
++					if ((offset2 != -1) && (offset != -1)) {
++						if (offset2 < offset) offset = offset2;
++					} else if ((offset2 != -1) && (offset == -1)) {
++						offset = offset2;
++					}
++
++					String comment = null;
++				     //System.out.println("CLINES" + clines);
++					if (offset != -1) {
++						//System.out.println("COMMENT: " + line.substring(offset));
++						comment = line.substring(offset);
++					} else {
++						//System.out.println("COMMENTLESS");
++					}
++
++					if (-1 != offset) line = line.substring(0, offset);
++
++					offset = line.indexOf("#");
++					if (-1 != offset) line = line.substring(0, offset);
++
++					line = line.trim(); //take away ws
++
++					if (line.length()>1) {
++
++						if (line.charAt(0) == '[') {
++							offset = line.indexOf("]");
++							if ((offset == -1) || (offset <= 1)) continue;
++
++							if (!clines.equals("")) {
++								int lbr = clines.indexOf("\n");
++								clines = clines.substring(0, lbr);
++								//System.out.println("Adding the precomment: " + clines);
++								comments.put(section, clines);
++								clines = "";
++							}
++
++							section = line.substring(1, offset).toUpperCase() + "::";
++							//System.out.println("New Section: " + section);
++
++						} else {
++							String[] tokens = line.split("=");
++							if (tokens.length == 2) {
++								String key = tokens[0].trim();
++								String value = tokens[1].trim();
++								if (key.length() > 0) {
++									hm.put(section + key.toUpperCase(), value);
++									if (comment != null) added_comments.put(section + key.toUpperCase(), comment);
++									if (!clines.equals("")) {
++										//System.out.println("Adding the precomment: " + clines);
++										comments.put(section + key.toUpperCase(), clines);
++										clines = "";
++									}
++								}
++							}
++						}
++
++						//System.out.println(line);
++					} else {
++						//it was a comment line only, associate it with the next key
++						if (comment != null) clines += comment;
++						clines += "\n";
++					}
++				}
++				br.close();
++
++				GUIBuilder.setValues(hm, added_comments, comments);
++			} catch (Exception e) {
++					// TODO Auto-generated catch block
++					e.printStackTrace();
++			}
++		}
++	}
++
++	public void openFile(){
++		/* If a configuration is already open, ask for close. */
++		final FileNameExtensionFilter xmlfilter = new FileNameExtensionFilter(".xml files", "xml");
++		final JFileChooser filechooser = new JFileChooser(configFilePath);
++		filechooser.setFileFilter(xmlfilter);
++		final int returnval = filechooser.showOpenDialog(new JPanel());
++		if (returnval == JFileChooser.APPROVE_OPTION) {
++			if(GUIBuilder.application != null){
++				final int returnval2 = GUIBuilder.closeFile();
++				if (returnval2 == JOptionPane.CANCEL_OPTION) return;
++			}
++
++			final String path = filechooser.getSelectedFile().toString();
++			if (filechooser.getSelectedFile().isDirectory()) return;
++
++			configFilePath = filechooser.getSelectedFile().getParent();
++
++			try {
++				GUIBuilder.buildGUI(path);
++			} catch (GUIBuildException e) {
++				// TODO Auto-generated catch block
++				e.printStackTrace();
++			}
++		}
++	}
++
++	@Override
++	public void windowActivated(WindowEvent e) {
++		// TODO Auto-generated method stub
++
++	}
++
++	@Override
++	public void windowClosed(WindowEvent e) {
++		// TODO Auto-generated method stub
++
++	}
++
++	@Override
++	public void windowClosing(WindowEvent e) {
++		System.exit(NORMAL);
++
++	}
++
++	@Override
++	public void windowDeactivated(WindowEvent e) {
++		// TODO Auto-generated method stub
++
++	}
++
++	@Override
++	public void windowDeiconified(WindowEvent e) {
++		// TODO Auto-generated method stub
++
++	}
++
++	@Override
++	public void windowIconified(WindowEvent e) {
++		// TODO Auto-generated method stub
++
++	}
++
++	@Override
++	public void windowOpened(WindowEvent e) {
++		// TODO Auto-generated method stub
++
++	}
++
++	@Override
++	public void hyperlinkUpdate(HyperlinkEvent e) {
++
++		if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
++		      try {
++				Desktop.getDesktop().browse(e.getURL().toURI());
++			} catch (IOException e1) {
++				// TODO Auto-generated catch block
++				e1.printStackTrace();
++			} catch (URISyntaxException e1) {
++				// TODO Auto-generated catch block
++				e1.printStackTrace();
++			}
++		}
++	}
++}
+
+Property changes on: ../trunk-jpl/src/java/src/main/GUI.java
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/main/PanelNode.java
+===================================================================
+--- ../trunk-jpl/src/java/src/main/PanelNode.java	(revision 0)
++++ ../trunk-jpl/src/java/src/main/PanelNode.java	(revision 17993)
+@@ -0,0 +1,69 @@
++package main;
++
++import java.util.List;
++import java.util.LinkedList;
++
++public class PanelNode {
++	private String data;
++	private PanelNode parent;
++	private LinkedList<PanelNode> children = new LinkedList<PanelNode>();
++
++	public PanelNode(String indata) {
++		data = indata;
++		parent = null;
++	}
++
++	public PanelNode(PanelNode p) {
++		data = p.data;
++		parent = p.parent;
++		children = new LinkedList<PanelNode>(p.children);
++	}
++
++	public String getData() {
++		return data;
++	}
++
++	public PanelNode getChild(String data) {
++		for (PanelNode child : children) {
++			if (child.data.equals(data))
++				return child;
++		}
++
++		return null;
++	}
++
++	public PanelNode add(PanelNode c) {
++		c.parent = this;
++		children.add(c);
++
++		return children.getLast();
++	}
++
++	public PanelNode get(String searchstring) {
++		if (data.equals(searchstring)) return this;
++
++		for (PanelNode child : children) {
++			PanelNode tmp = child.get(searchstring);
++			if (tmp != null) return tmp;
++		}
++
++		return null; //Nothing found in subtree
++	}
++
++	public boolean remove(PanelNode tmp) {
++		return children.remove(tmp);
++	}
++
++	public PanelNode getParent() {
++		return parent;
++	}
++
++	public void getKeyList(LinkedList<String> keyList) {
++		if ((data.indexOf('#') == -1) && (data.indexOf('%') == -1))
++			keyList.add(data);
++
++		for (PanelNode child : children) {
++			child.getKeyList(keyList);
++		}
++	}
++}
+
+Property changes on: ../trunk-jpl/src/java/src/main/PanelNode.java
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/main/GUIBuilder.java
+===================================================================
+--- ../trunk-jpl/src/java/src/main/GUIBuilder.java	(revision 0)
++++ ../trunk-jpl/src/java/src/main/GUIBuilder.java	(revision 17993)
+@@ -0,0 +1,391 @@
++/***********************************************************************************/
++/*  Copyright 2012 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
++/***********************************************************************************/
++/*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*
++*/
++
++package main;
++
++import gui_elements.ControlledPanel;
++import gui_elements.GUIBuildException;
++
++import java.io.IOException;
++
++import javax.swing.ProgressMonitor;
++import javax.swing.JFileChooser;
++import javax.swing.JOptionPane;
++import javax.swing.JPanel;
++import javax.swing.filechooser.FileNameExtensionFilter;
++
++import java.util.*;
++
++import org.w3c.dom.Document;
++import org.w3c.dom.Element;
++
++/**
++ * The main class to build the .ini file creator. Upon construction it reads an
++ * XML file and creates the corresponding GUI. Maintains an ElementControl
++ * object.
++ *
++ * @author korhammer et egger
++ *
++ */
++public class GUIBuilder {
++	public static ProgressMonitor monitor;
++
++	public static final String xsd = GUIBuilder.class.getClassLoader().getResource("resources/config_schema-0.1.1.xsd").toString();
++	public static String res_filepath = GUIBuilder.class.getClassLoader().getResource("resources/default_config.xml").toString(); //the default config to start with
++	public static Document doc;
++
++	public static GUI gui;
++	public static PanelControl panelControl;
++
++	public static String application;
++	public static String currentConfigFile;
++
++	public static String saveFilePath = System.getProperty("user.dir");
++
++
++	private static String getFileExtension(final String file_and_path) {
++		final String file_sep = System.getProperty("file.separator");
++
++		// get filename without path
++		final int fileSepIndex = file_and_path.lastIndexOf(file_sep);
++		if (fileSepIndex == -1) {
++			return "";
++		}
++		final String filename = file_and_path.substring(fileSepIndex+1); //remove path
++
++		// get the extension from the filename
++		final int extIndex = filename.lastIndexOf(".");
++		if (extIndex == -1)
++			return "";
++
++		return filename.substring(extIndex+1);
++	}
++
++	/**
++	 * The main method. Opens the GUI Builder with a menu bar on the side.
++	 * If an XML filepath is handed over as an argument,
++	 * the XML file is opened.
++	 *
++	 * @param args
++	 * @throws GUIBuildException
++	 */
++	public static void main(String args[]) throws GUIBuildException {
++
++		new GUIBuilder();
++
++		if ((args.length != 0) && (args[0].length() > 0))
++			res_filepath = args[0]; //User may provice xml file as first argument
++
++		buildGUI(res_filepath);
++		//gui.hideOpenButton();
++	}
++
++	/**
++	 * Builds a GUI from the XML-file specified with validation through
++	 * the specified schema.
++	 *
++	 * @param filepath
++	 * @param schemapath
++	 * @throws GUIBuildException
++	 */
++	public GUIBuilder()	throws GUIBuildException {
++		if (System.getProperty("mrj.version") != null) {  //detect if running on mac
++			System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Inishell");
++			System.setProperty("apple.awt.brushMetalLook", "true");
++		}
++		gui = new GUI();
++	}
++
++	public static void setComments(HashMap<String, String> added_comments, HashMap<String, String> comments) {
++		panelControl.setComments(added_comments, comments);
++	}
++
++	/**
++	 * Builds the gui for a filepath that can either be handed over as an argument
++	 * on application start or chosen by using the open button.
++	 *
++	 * @param filepath
++	 * @throws GUIBuildException
++	 */
++	public static void buildGUI(String filepath) throws GUIBuildException{
++		currentConfigFile = filepath;
++
++		doc = XMLHelper.readXML(filepath, xsd);
++		doc = XMLHelper.resolveReferences(doc);
++
++		application = doc.getDocumentElement().getAttribute("application");
++
++		gui.setApplicationForTitle(application);
++
++		panelControl = new PanelControl();
++
++		final Element root = doc.getDocumentElement();
++		recursiveBuild(root, null, false);
++	}
++
++
++	public static void setValues(final HashMap<String, String> hm, final HashMap<String, String> added_comments, final HashMap<String, String> comments) {
++		if (hm == null) return;
++
++		monitor = new ProgressMonitor(gui, "Loading INI file", "0 out of " + panelControl.order.size() + " sections loaded", 0, panelControl.order.size());
++		monitor.setMillisToPopup(0);
++
++		Thread myrunner = new Thread() {
++				public void run() {
++					int progress_counter = 0; //Effectively counts the sections already parsed into the GUI
++					try {
++						final int returnval = GUIBuilder.closeFile();
++						if (returnval == JOptionPane.CANCEL_OPTION) return;
++						monitor.setProgress(progress_counter);
++
++						GUIBuilder.buildGUI(currentConfigFile);
++					} catch (GUIBuildException e) {
++						e.printStackTrace();
++					}
++
++					gui.setEnabled(false); //Disable user interaction while the ProgressMonitor is on
++
++					HashSet<String> usedKeys = new HashSet<String>(); //save all keys that were used from the HashMap
++					HashSet<String> unusedKeys = new HashSet<String>(); //save all keys that were used from the HashMap
++
++					Iterator<Map.Entry<String, TreeMap<String, ControlledPanel>>> sectionIterator = panelControl.panels.entrySet().iterator();
++					while (sectionIterator.hasNext()) {
++						progress_counter++;
++						monitor.setProgress(progress_counter);
++						monitor.setNote(progress_counter + " out of " + panelControl.order.size() + " sections loaded");
++
++						if (monitor.isCanceled()) { //user cancelled loading
++							monitor.close();
++							gui.setEnabled(true);
++							break; //HACK, should reset the whole environment before breaking
++						}
++
++						Map.Entry<String, TreeMap<String, ControlledPanel>> entry = sectionIterator.next();
++						TreeMap<String, ControlledPanel> value = entry.getValue();
++
++						List<String> sectionKeys = new ArrayList<String>(hm.keySet()); //all keys as defined in the existing ini
++						String sectionKey = entry.getKey().toUpperCase() + "::"; //The section string
++						filterList(sectionKey, sectionKeys); //filter keys for current section only (optimization)
++
++						LinkedList<ControlledPanel> todos = new LinkedList<ControlledPanel>();
++						LinkedList<String> keys = new LinkedList<String>();
++						LinkedList<String> values = new LinkedList<String>();
++
++						do {
++							todos.clear();
++							keys.clear();
++							values.clear();
++
++							Iterator<Map.Entry<String, ControlledPanel>> keyIterator = value.entrySet().iterator();
++							while(keyIterator.hasNext()) { //go through all keys of current section
++								final ControlledPanel mypanel = keyIterator.next().getValue();
++								//System.out.println("\t" + mypanel.getKey());
++
++								String pattern = mypanel.getHashKey();
++								pattern = pattern.replace("%","[a-zA-Z0-9_]+");
++								pattern = pattern.replace("#","[1-9]+[0-9]*"); //all integer numbers from 1 to infinity
++								//System.out.println("Current pattern: " + pattern);
++
++								//Loop through all defined keys of this section and compare them with pattern
++								Iterator<String> keyit = sectionKeys.iterator();
++								while (keyit.hasNext()) {
++									final String currkey = keyit.next();
++									//System.out.println("sectionKeys contains: " + currkey);
++
++									if ((!usedKeys.contains(currkey)) && currkey.matches(pattern)) {
++										//Add mypanel to list of todos
++										//System.out.println("Adding panel for " + currkey);
++										todos.add(mypanel);
++										keys.add(currkey);
++										values.add(hm.get(currkey));
++
++										usedKeys.add(currkey);
++									}
++								}
++							}
++
++							for (int jj = 0; jj < todos.size(); jj++) {
++								//System.out.println("--> SETTING " + keys.get(jj) + "  = " +values.get(jj));
++								todos.get(jj).set(hm, keys.get(jj), values.get(jj));
++							}
++						} while (todos.size() != 0);
++
++						if (progress_counter == panelControl.order.size()) gui.setEnabled(true);
++					}
++
++					//Now find out all keys that were not used in the hashmap
++					for (String key : hm.keySet()) {
++						if (!usedKeys.contains(key)) {
++							//System.out.println("Unknown key = " + key);
++							unusedKeys.add(key);
++							panelControl.setUnusedKeys(key, hm.get(key));
++						}
++					}
++
++					setComments(added_comments, comments);
++				}
++			};//thread
++		myrunner.start();
++	}
++
++	private static void filterList(String filter, List<String> list) {
++		for (Iterator<String> it=list.iterator(); it.hasNext();) {
++			final String next = it.next();
++			if (!next.startsWith(filter)) {
++				it.remove();
++			}
++		}
++	}
++
++	public static int closeFile(){
++		final int returnval = JOptionPane.showConfirmDialog(new JPanel(),
++				"You will lose all changes made to the current ini-file. " +
++				"Do you want this?", "Inishell is already open for " + application, JOptionPane.OK_CANCEL_OPTION);
++
++
++
++		if (returnval == JOptionPane.OK_OPTION) {
++			gui.closeAllTabs();
++			gui.rootNode = new PanelNode("");
++			application = null;
++			doc = null;
++			panelControl = null;
++		}
++
++		return returnval;
++	}
++
++
++	/**
++	 * Puts the specified panel into the panel control.
++	 * @param panel
++	 */
++	public static void control(ControlledPanel panel) {
++		final String section = panel.getSection();
++		panelControl.put(section, panel);
++	}
++
++
++	/**
++	 * Recursively traverses all children of the specified element
++	 * and builds the corresponding panels.
++	 *
++	 * @param parentElement
++	 * @param parentPanel
++	 * @throws GUIBuildException
++	 */
++	public static void recursiveBuild(Element parentElement, ControlledPanel parentPanel, boolean doSet) throws GUIBuildException {
++		recursiveBuild(parentElement, parentPanel, doSet, null, null, null);
++	}
++
++
++	public static void recursiveBuild(Element parentElement, ControlledPanel parentPanel, boolean doSet, HashMap hm, String key, String value) throws GUIBuildException {
++
++		/* get all child elements for the root */
++		final String[] tags = {"parameter", "frame"};
++		final Element[] parameterElements = XMLHelper.getElementArray(parentElement, tags);
++
++		for (final Element element : parameterElements) {
++			final String section = element.getAttribute("section");
++			ControlledPanel parameterPanel;
++
++			if (!panelControl.contains(section, element.getAttribute("key"))) {
++				//System.out.println("Adding through recursiveBuild: " + element.getAttribute("key"));
++				parameterPanel = ControlledPanel.createSingleParameterPanel(element, parentPanel);
++				parameterPanel.setKey(parameterPanel.getKey());
++
++				if (!element.getAttribute("template").equals("true")) {
++					//if (doSet) System.out.println("\tSETTING component key: " + key + "  value: " + value);
++					if (doSet) parameterPanel.set(hm, parameterPanel.getKey(), value);
++
++					gui.addToTab(parameterPanel, section, parentPanel);
++					control(parameterPanel);
++				}
++			} else {
++				parameterPanel = panelControl.get(section, element.getAttribute("key"));
++			}
++
++			parameterPanel.hold();
++			recursiveBuild(element, parameterPanel, doSet);
++		}
++
++		gui.validate();
++	}
++
++	/**
++	 * Recursively destructs child elements of the specified root.
++	 *
++	 * @param rootElement
++	 * @param rootPanel
++	 * @throws GUIBuildException
++	 */
++	public static void recursiveDestruct(Element rootElement, ControlledPanel rootPanel)
++		throws GUIBuildException {
++
++		/* get all child elements for the root */
++		final Element[] parameterElements = XMLHelper.getElementArray(rootElement, "parameter");
++
++		for (final Element element : parameterElements) {
++			final String section = element.getAttribute("section");
++			final ControlledPanel parameterPanel = panelControl.get(section, element.getAttribute("key"));
++			recursiveDestruct(element, parameterPanel);
++
++			parameterPanel.release();
++			parameterPanel.close();
++
++			if (!parameterPanel.isNeeded()) {
++				gui.removeFromTab(parameterPanel, section, rootPanel);
++			}
++
++		}
++
++		gui.validate();
++	}
++
++
++	/**
++	 * Opens a prompt for the path to save the ini file to. Then prints the ini
++	 * to the path specified.
++	 *
++	 * @throws IOException
++	 * @throws GUIBuildException
++	 */
++	public static void printIOFile() throws IOException, GUIBuildException {
++		final FileNameExtensionFilter inifilter = new FileNameExtensionFilter(".ini files", "ini");
++
++		final JFileChooser filechooser = new JFileChooser(saveFilePath);
++		filechooser.setFileFilter(inifilter);
++
++		final int returnval = filechooser.showSaveDialog(new JPanel());
++
++		if (returnval == JFileChooser.APPROVE_OPTION) {
++			String path = filechooser.getSelectedFile().getAbsolutePath();
++			final String ext = getFileExtension(path).toLowerCase();
++			if(!ext.equals("ini")) {
++				path += ".ini";
++			}
++
++			if (filechooser.getSelectedFile().isDirectory()) return;
++			saveFilePath = filechooser.getSelectedFile().getParent();
++
++			panelControl.printToFile(path);
++		}
++	}
++}
+
+Property changes on: ../trunk-jpl/src/java/src/main/GUIBuilder.java
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/document-open-2.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/src/resources/document-open-2.png
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/document-open-2.png	(revision 17992)
++++ ../trunk-jpl/src/java/src/resources/document-open-2.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/src/resources/document-open-2.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/document-preview.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/src/resources/document-preview.png
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/document-preview.png	(revision 17992)
++++ ../trunk-jpl/src/java/src/resources/document-preview.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/src/resources/document-preview.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/document-export-4.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/src/resources/document-export-4.png
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/document-export-4.png	(revision 17992)
++++ ../trunk-jpl/src/java/src/resources/document-export-4.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/src/resources/document-export-4.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/config_schema.xsd
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/config_schema.xsd	(revision 0)
++++ ../trunk-jpl/src/java/src/resources/config_schema.xsd	(revision 17993)
+@@ -0,0 +1,141 @@
++<?xml version="1.0"?>
++<!-- 
++*   
++*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*    	
++* -->
++
++<xsd:schema version="1.0"
++xmlns:xsd="http://www.w3.org/2001/XMLSchema">
++
++  <xsd:element name="inishell_config" type="general" />
++  
++	<xsd:complexType name="general">
++      <xsd:choice maxOccurs="unbounded">
++			<xsd:element name="parameter" type="parametertype" />
++			<xsd:element name="parametergroup" type="pargroup" />
++			<xsd:element name="include" type="pathonly" /> 
++      </xsd:choice>
++	  <xsd:attribute name="application" />
++    </xsd:complexType>
++	
++	<xsd:complexType name="parametertype">
++		<xsd:complexContent>
++			<xsd:extension base="parbasetype">
++				<xsd:attribute name="key" type="xsd:string" use="required"/> 
++				<xsd:attribute name="default" type="xsd:string" />
++				<xsd:attribute name="counter" type="xsd:integer" />
++			</xsd:extension>
++		</xsd:complexContent>		
++	</xsd:complexType>
++   
++   <xsd:complexType name="nameonly">
++		<xsd:attribute name="name" />   
++   </xsd:complexType>
++   
++   <xsd:complexType name="pathonly">
++		<xsd:attribute name="path" />   
++   </xsd:complexType>
++   
++	<xsd:complexType name="pargroup">
++		<xsd:choice minOccurs="1" maxOccurs="unbounded">
++			<xsd:element name="parameter" type="parametertype" />
++			<xsd:element name="reference" type="nameonly" />
++		</xsd:choice>
++		<xsd:attribute name="name" />
++	</xsd:complexType>
++  
++	
++	<xsd:complexType name="parbasetype">
++		<xsd:sequence>
++			<xsd:sequence minOccurs="0" maxOccurs="unbounded">
++				<xsd:element name="section" type="nameonly"/>
++			</xsd:sequence>
++			<xsd:sequence minOccurs="0" maxOccurs="unbounded">
++				<xsd:element name="replace" type="nameonly"/>
++			</xsd:sequence>
++			<xsd:sequence minOccurs="0" maxOccurs="unbounded">
++				<xsd:element name="parameter" type="parametertype" />
++			</xsd:sequence>
++			<xsd:choice minOccurs="0" maxOccurs="unbounded">				
++				<xsd:element name="option" minOccurs="0">
++					<xsd:complexType>
++						<xsd:complexContent>
++							<xsd:extension base="parbasetype">
++								<xsd:attribute name="value" type="xsd:string" use="required" />
++								<xsd:attribute name="label" type="xsd:string" use="optional" />
++								<xsd:attribute name="default" type="xsd:boolean"/>
++							</xsd:extension>
++						</xsd:complexContent>
++					</xsd:complexType>
++				</xsd:element>
++			</xsd:choice>
++			<xsd:sequence minOccurs="0" maxOccurs="unbounded">
++				<xsd:element name="reference" type="nameonly" />
++			</xsd:sequence>
++			<xsd:sequence minOccurs="0" maxOccurs="unbounded">
++				<xsd:element name="help" type="helptype"/>	
++			</xsd:sequence>
++		</xsd:sequence>
++		
++		<xsd:attribute name="type" use="required">
++		     <xsd:simpleType>
++				<xsd:restriction base="xsd:string">
++					<xsd:enumeration value="integer" />
++					<xsd:enumeration value="integer+" />
++					<xsd:enumeration value="decimal" />
++					<xsd:enumeration value="path" />
++					<xsd:enumeration value="file" />
++					<xsd:enumeration value="choice" />
++					<xsd:enumeration value="alternative" />
++					<xsd:enumeration value="string" />
++					<xsd:enumeration value="combination" />
++					<xsd:enumeration value="selector" />
++				</xsd:restriction>
++			</xsd:simpleType>
++		</xsd:attribute>
++		
++		<xsd:attribute name="maximum" type="xsd:integer"/>
++		<xsd:attribute name="minimum" type="xsd:integer"/>
++		<xsd:attribute name="template" type="xsd:boolean" default="false" use="optional" />
++		<xsd:attribute name="optional" type="xsd:boolean" default="true" />
++	</xsd:complexType>
++	
++	<xsd:complexType name="needstype">
++		<xsd:attribute name="type" type="xsd:string" use="required" />
++		<xsd:attribute name="name" type="xsd:string" use="required" />
++	
++		<xsd:attribute name="value" />
++		<xsd:attribute name="optional" type="xsd:boolean" />
++		<xsd:attribute name="minoccur" type="xsd:integer" />
++		<xsd:attribute name="maxoccur" type="xsd:string" />
++	</xsd:complexType>
++	
++	<xsd:complexType name="baseType">
++		<xsd:sequence minOccurs="0" maxOccurs="1">
++			<xsd:element name="help" type="helptype" />		
++		</xsd:sequence>
++		<xsd:attribute name="key" type="xsd:string" use="required" />
++	</xsd:complexType>
++	
++	<xsd:complexType name="helptype" mixed="true">
++		<xsd:choice minOccurs="0" maxOccurs="unbounded">
++			<xsd:element name="section" type="nameonly" />
++			<xsd:element name="replace" type="nameonly" />
++		</xsd:choice>
++	</xsd:complexType>
++	
++</xsd:schema>
+
+Property changes on: ../trunk-jpl/src/java/src/resources/config_schema.xsd
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/default_config.xml
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/default_config.xml	(revision 0)
++++ ../trunk-jpl/src/java/src/resources/default_config.xml	(revision 17993)
+@@ -0,0 +1,919 @@
++<inishell_config application="Meteo IO">
++
++	<!-- General Parameters -->
++	<parameter key="BUFF_CHUNK_SIZE" type="integer" default="30">
++		<section name="general" />
++		<help>Size in days of a chunk of data to read at once.</help>
++	</parameter>
++
++	<parameter key="BUFF_BEFORE" type="decimal" default="1.5">
++		<section name="general" />
++		<help>Alternate way of buffer centering: When rebuffering, the new date will be located BUFF_BEFORE days from the
++		beginning of the buffer (therefore, it takes a value in days).</help>
++	</parameter>
++
++	<!-- Coordinate systems, time zones -->
++	<parameter key="COORDSYS" type="alternative" optional="false">
++		<section name="input" />
++		<section name="output" />
++		<option value="CH1903" type="string" default="true">
++			<help>coordinates in the Swiss Grid &lt;a href="http://geomatics.ladetto.ch/ch1903_wgs84_de.pdf"&gt;http://geomatics.ladetto.ch/ch1903_wgs84_de.pdf&lt;/a&gt;</help>
++		</option>
++		<option value="UTM" type="string">
++			<parameter key="COORDPARAM" type="string">
++				<help>specify the zone with the zone letter (for example, 32T)</help>
++			</parameter>
++			<help>UTM coordinates, see &lt;a href="http://www.oc.nps.edu/oc2902w/maps/utmups.pdf"&gt;http://www.oc.nps.edu/oc2902w/maps/utmups.pdf&lt;/a&gt;</help>
++		</option>
++		<option value="UPS" type="string">
++			<parameter key="COORDPARAM" type="string">
++				<help>specify the hemisphere (either N or S)</help>
++			</parameter>
++			<help>Universal Polar Stereographic coordinates, see &lt;a href="https://en.wikipedia.org/wiki/Universal_Polar_Stereographic_coordinate_system"&gt;https://en.wikipedia.org/wiki/Universal_Polar_Stereographic_coordinate_system&lt;/a&gt;</help>
++		</option>
++		<option value="PROJ4" type="string">
++			<parameter key="COORDPARAM" type="string" optional="false" />
++			<help>external library: see &lt;a href="http://trac.osgeo.org/proj/"&gt;http://trac.osgeo.org/proj/&lt;/a&gt;</help>
++		</option>
++		<option value="LOCAL"  type="string">
++			<help>uses the horizontal and vertical distance from a reference point</help>
++		</option>
++		<help>coordinate system</help>
++	</parameter>
++
++	<parameter key="TIME_ZONE" type="integer+" default="+1" maximum="14" minimum="-12" optional="false">
++		<section name="input" />
++		<section name="output" />
++	</parameter>
++
++	<!-- Datatypes: special pts -->
++	<parameter key="SPECIALPTS" type="alternative">
++		<section name="input" />
++		<option value="A3D" type="string">
++			<parameter key="SPECIALPTSFILE" type="file" optional="false">
++				<help>a path+file name to the a file containing grid coordinates of special points of interest (for special outputs)</help>
++			</parameter>
++		</option>
++		<option value="SMET" type="string">
++			<parameter key="SPECIALPTSFILE" type="file" optional="false">
++				<help>a path+file name to the a file containing grid coordinates of special points of interest (for special outputs)</help>
++			</parameter>
++		</option>
++	</parameter>
++
++	<!-- Datatypes: Meteo Data -->
++	<parameter key="METEO" type="alternative">
++		<section name="input" />
++		<section name="output" />
++
++		<option value="A3D" type="string">
++			<parameter key="METEOPATH" type="path" optional="false">
++				<help>string containing the path to the meteorological files</help>
++			</parameter>
++		</option>
++		<option value="BORMA" type="string">
++			<section name="input" />
++			<reference name="BORMA" />
++		</option>
++		<option value="COSMO" type="string">
++			<parameter key="METEOPATH" type="path" optional="false">
++				<help>string containing the path to the meteorological files</help>
++			</parameter>
++		</option>
++		<option value="GEOTOP" type="string">
++			<section name="input" />
++			<reference name="GEOTOP_IN" />
++		</option>
++		<option value="GEOTOP" type="string">
++			<section name="output" />
++			<reference name="GEOTOP_OUT" />
++		</option>
++		<option value="GRIB" type="string">
++			<section name="input" />
++			<reference name="GRIB_METEO" />
++		</option>
++		<option value="GSN" type="string">
++			<section name="input" />
++			<reference name="GSN" />
++		</option>
++		<option value="IMIS" type="string">
++			<section name="input" />
++			<reference name="IMIS" />
++		</option>
++		<option value="SMET" type="string">
++			<section name="input" />
++			<reference name="SMET_IN" />
++		</option>
++		<option value="SMET" type="string">
++			<section name="output" />
++			<reference name="SMET_OUT" />
++		</option>
++		<option value="SNOWPACK" type="string">
++			<section name="input" />
++			<reference name="SNIO_IN" />
++		</option>
++		<option value="SNOWPACK" type="string">
++			<section name="output" />
++			<parameter key="METEOPATH" type="path" optional="false">
++				<help>string representing path where SNOWPACK files should be saved</help>
++			</parameter>
++		</option>
++
++		<help>plugin for METEO data </help>
++	</parameter>
++
++	<parameter key="Add Meteo parameter copy" type="selector">
++		<section name="input"/>
++		<parameter key="COPY::%" type="string" optional="false" template="true">
++		  <help>The name of the parameter to copy (e.g. TA, RH, VW, ISWR, etc)</help>
++		</parameter>
++	</parameter>
++
++	<!-- Datatypes: DEM -->
++	<frame key="dem_frame" label="Digital Elevation Model">
++	<section name="input"/>
++		<parameter key="DEM" type="alternative">
++			<section name="input" />
++			<option value="ARC" type="string">
++				<parameter key="DEMFILE" type="file" optional="false">
++					<help>For reading the data as a DEMObject</help>
++				</parameter>
++			</option>
++			<option value="ARPS" type="string">
++				<parameter key="DEMFILE" type="file" optional="false">
++					<help>For reading the data as a DEMObject</help>
++				</parameter>
++				<parameter key="ARPS_XCOORD" type="decimal" optional="false">
++					<help>x coordinate of the lower left corner of the grids</help>
++				</parameter>
++				<parameter key="ARPS_YCOORD" type="decimal" optional="false">
++					<help>y coordinate of the lower left corner of the grids</help>
++				</parameter>
++			</option>
++			<option value="GRASS" type="string">
++				<parameter key="DEMFILE" type="file" optional="false">
++					<help>For reading the data as a DEMObject</help>
++				</parameter>
++			</option>
++			<option value="GRIB" type="string">
++				<parameter key="DEMFILE" type="file" optional="false">
++					<help>For reading the data as a DEMObject</help>
++				</parameter>
++				<parameter key="GRIB_DEM_UPDATE" type="alternative" optional="true">
++					<option value="TRUE" type="string" />
++					<option value="FALSE" type="string" />
++					<help>recompute slope/azimuth from the elevations when reading a DEM (default=false, that is we use the slope and azimuth included in the GRIB file)</help>
++				</parameter>
++			</option>
++			<option value="PGM" type="string">
++				<parameter key="DEMFILE" type="file" optional="false">
++					<help>For reading the data as a DEMObject</help>
++				</parameter>
++				<reference name="PGM_IN" />
++			</option>
++
++			<help>plugin for Digital Elevation Model data </help>
++		</parameter>
++	</frame>
++
++	<!-- Datatypes: Landuse -->
++	<parameter key="LANDUSE" type="alternative">
++		<section name="input" />
++		<option value="ARC" type="string">
++			<parameter key="LANDUSEFILE" type="file" optional="false">
++				<help>File containing a grid of landuse codes</help>
++			</parameter>
++		</option>
++
++		<help>plugin for land cover data </help>
++	</parameter>
++
++	<!-- Datatypes: Grids -->
++	<parameter key="GRID2D" type="alternative">
++		<section name="input" />
++		<section name="output" />
++		<option value="ARC" type="string">
++			<parameter key="GRID2DPATH" type="path" optional="false">
++				<help>string representing path where grid files should be read from</help>
++			</parameter>
++			<reference name="ARC" />
++		</option>
++		<option value="ARPS" type="string">
++			<section name="input" />
++			<parameter key="GRID2DPATH" type="path" optional="false">
++				<help>string representing path where grid files should be read from</help>
++			</parameter>
++			<reference name="ARPS" />
++		</option>
++		<option value="GRASS" type="string">
++			<section name="input" />
++			<parameter key="GRID2DPATH" type="path" optional="false">
++				<help>string representing path where grid files should be read from</help>
++			</parameter>
++		</option>
++		<option value="GRIB" type="string">
++			<section name="input" />
++			<parameter key="GRID2DPATH" type="path" optional="false">
++				<help>string representing path where grid files should be read from</help>
++			</parameter>
++			<reference name="GRIB_GRIDS" />
++		</option>
++		<option value="PGM" type="string">
++			<section name="input" />
++			<parameter key="GRID2DPATH" type="path" optional="false">
++				<help>string representing path where grid files should be read from</help>
++			</parameter>
++			<reference name="PGM_IN" />
++		</option>
++		<option value="PGM" type="string">
++			<section name="output" />
++			<parameter key="GRID2DPATH" type="path" optional="false">
++				<help>string representing path where grid files should be read from</help>
++			</parameter>
++		</option>
++		<option value="PNG" type="string">
++			<section name="output" />
++			<parameter key="GRID2DPATH" type="path" optional="false">
++				<help>string representing path where grid files should be read from</help>
++			</parameter>
++			<reference name="PNG" />
++		</option>
++		<help>plugin for 2D gridded data </help>
++	</parameter>
++
++	<!--Parameter group for list of stations -->
++	<parametergroup name="stationgroup_files">
++		<parameter key="STATION#" type="file" counter="1" optional="false">
++			<help>filename for station number # </help>
++		</parameter>
++	</parametergroup>
++	<parametergroup name="stationgroup_names">
++		<parameter key="STATION#" type="string" counter="1" optional="false">
++			<help>station id for the given station number # </help>
++		</parameter>
++	</parametergroup>
++	<parametergroup name="stationgroup_pos">
++		<parameter key="STATION#" type="string" counter="1">
++			<help>Coordinates are given as "lat lon" or "xcoord ycoord epsg_code"</help>
++		</parameter>
++	</parametergroup>
++
++	<!-- Plugins for Meteo Data-->
++	<parametergroup name="BORMA">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string containing the path to the xml files</help>
++		</parameter>
++		<reference name="stationgroup_names" />
++	</parametergroup>
++
++	<parametergroup name="IMIS">
++		<parameter key="DBNAME" type="string" optional="false">
++			<help>database name, as provided by your database administrator</help>
++		</parameter>
++		<parameter key="DBUSER" type="string" optional="false">
++			<help>database user name</help>
++		</parameter>
++		<parameter key="DBPASS" type="string" optional="false">
++			<help>database password associated with the user name</help>
++		</parameter>
++		<parameter key="USEANETZ" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		  <help>OPTIONAL: use ANETZ stations to provide precipitations for normal IMIS stations.
++		  Each IMIS station is associated with one or two ANETZ stations and does a weighted
++		  average to get what should be its local precipitations</help>
++		</parameter>
++		<parameter key="USE_IMIS_HNW" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		  <help>OPTIONAL: if set to false (default), all IMIS precipitation will be deleted (since IMIS stations don't have heated rain gauges, their precipitation measurements are not good in winter conditions). If set to true, it is strongly advised to use a FilterHNWMelt filter to detect snow melting in the rain gauge and perform winter conditions detection in the application.</help>
++		</parameter>
++		<parameter key="USE_SNOWPACK_HNW" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		  <help>if set to true, the SNOWPACK simulated Snow Water Equivalent from the database will be used to compute HNW. Data gaps greater than 3 hours on SWE will lead to unchanged hnw while all data that can properly be computed will overwrite hnw. (default=false)</help>
++		</parameter>
++
++		<reference name="stationgroup_names" />
++	</parametergroup>
++
++	<parametergroup name="GRIB_METEO">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string containing the path to the grib files</help>
++		</parameter>
++		<parameter key="METEOEXT" type="string" optional="true">
++			<help>grib file extension, or none for no file extension (default: .grb)</help>
++		</parameter>
++
++		<reference name="stationgroup_pos" />
++	</parametergroup>
++
++	<parametergroup name="GEOTOP_IN">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string containing the path to the data files</help>
++		</parameter>
++		<parameter key="METAFILE" type="file" optional="false">
++			<help>absolute filename of the geotop.inpts file</help>
++		</parameter>
++		<parameter key="METEOPREFIX" type="string" optional="true">
++			<help>prefix to append when generating a file name for reading</help>
++		</parameter>
++	</parametergroup>
++
++	<parametergroup name="GEOTOP_OUT">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string containing the path to the data files</help>
++		</parameter>
++		<parameter key="METEOSEQ" type="string" optional="false">
++			<help>specifiy in which order the columns should be printed out</help>
++		</parameter>
++	</parametergroup>
++
++	<parametergroup name="GSN">
++		<parameter key="ENDPOINT" type="string" optional="false">
++			<help>webserver running GSN with its port number and full path. For example:
++			http://montblanc.slf.ch:22001/services/A3DWebService</help>
++		</parameter>
++		<parameter key="PROXY" type="string" optional="true">
++			<help>Should the connection go through a proxy? This is useful for servers
++			filtering on domains but usually not necessary.</help>
++		</parameter>
++		<parameter key="PROXYPORT" type="string" optional="true" />
++		<parameter key="PROXYUSER" type="string" optional="true" />
++		<parameter key="PROXYPASS" type="string" optional="true" />
++
++		<reference name="stationgroup_names" />
++	</parametergroup>
++
++	<parametergroup name="SMET_IN">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string containing the path to the smet files</help>
++		</parameter>
++		<reference name="stationgroup_files" />
++	</parametergroup>
++
++	<parametergroup name="SMET_OUT">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string representing path where SMET files should be saved</help>
++		</parameter>
++		<parameter key="METEOPARAM" type="alternative">
++		  <option value="ASCII" type="string" default="true">
++		    <help>Write ASCII SMET files</help>
++		  </option>
++		  <option value="BINARY" type="string">
++		    <help>Write BINARY SMET files</help>
++		  </option>
++		</parameter>
++	</parametergroup>
++
++	<parametergroup name="SNIO_IN">
++		<parameter key="METEOPATH" type="path" optional="false">
++			<help>string containing the path to the SNOWPACK files</help>
++		</parameter>
++		<parameter key="METAFILE" type="file" optional="true">
++			<help>filename of the meta data file (in METEOPATH)</help>
++		</parameter>
++
++		<parameter key="NUMBER_MEAS_TEMPERATURES" type="integer+" minimum="0" default="0">
++		  <help>the number of measured snow temperatures provided</help>
++		</parameter>
++
++		<parameter key="NUMBER_OF_SOLUTES" type="integer+" minimum="0" default="0">
++		  <help>the number of solutes for which input data are provided</help>
++		</parameter>
++
++		<parameter key="RSWR_INP" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		</parameter>
++		<parameter key="ISWR_INP" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		</parameter>
++		<parameter key="VW_DRIFT" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		  <help>OPTIONAL: wind velocity to use for blowing and drifting snow is provided</help>
++		</parameter>
++		<parameter key="RHO_HN" type="alternative" optional="true">
++		  <option value="TRUE" type="string" />
++		  <option value="FALSE" type="string" />
++		  <help>OPTIONAL: measured new snow density is provided</help>
++		</parameter>
++
++		<reference name="stationgroup_files" />
++	</parametergroup>
++
++	<!-- Plugins for Gridded Data-->
++	<parametergroup name="ARC">
++		<parameter key="A3D_VIEW" type="alternative" optional="true">
++			<option value="TRUE" type="string" />
++			<option value="FALSE" type="string" />
++			<help>generate names compatible with Alpine3D's grid viewer?</help>
++		</parameter>
++		<parameter key="GRID2DEXT" type="string" optional="true">
++			<help>grid file extension, or none for no file extension (default: .asc)</help>
++		</parameter>
++	</parametergroup>
++
++	<parametergroup name="ARPS">
++		<parameter key="ARPS_XCOORD" type="decimal" optional="false">
++			<help>x coordinate of the lower left corner of the grids</help>
++		</parameter>
++		<parameter key="ARPS_YCOORD" type="decimal" optional="false">
++			<help>y coordinate of the lower left corner of the grids</help>
++		</parameter>
++		<parameter key="GRID2DEXT" type="string" optional="true">
++			<help>grid file extension, or none for no file extension (default: .asc)</help>
++		</parameter>
++	</parametergroup>
++
++	<parametergroup name="GRIB_GRIDS">
++		<parameter key="GRID2DPREFIX" type="string" optional="true">
++			<help>prefix to append when generating a file name for reading (ie: something like "laf" for Cosmo-Analysis-full domain)</help>
++		</parameter>
++		<parameter key="GRID2DEXT" type="string" optional="true">
++			<help>grib file extension, or none for no file extension (default: .grb)</help>
++		</parameter>
++	</parametergroup>
++
++	<parametergroup name="PNG">
++		<parameter key="PNG_WORLD_FILE" type="alternative" optional="true">
++			<option value="TRUE" type="string" />
++			<option value="FALSE" type="string" />
++			<help>generate a world file for each output file? This file contains the geolocalization information</help>
++		</parameter>
++		<parameter key="PNG_LEGEND" type="alternative" optional="true">
++			<option value="TRUE" type="string" />
++			<option value="FALSE" type="string" />
++			<help>generate a legend?</help>
++		</parameter>
++		<parameter key="PNG_AUTOSCALE" type="alternative" optional="true">
++			<option value="TRUE" type="string" />
++			<option value="FALSE" type="string" />
++			<help>autoscale color scale?</help>
++		</parameter>
++		<parameter key="PNG_SCALING" type="alternative" optional="true">
++			<option value="nearest" type="string" />
++			<option value="bilinear" type="string" />
++			<help>scaling algorithm (default=bilinear)</help>
++		</parameter>
++		<parameter key="PNG_MIN_SIZE" type="string" optional="false">
++			<help>minimum dimensions of the PNG, like 640x480</help>
++		</parameter>
++		<parameter key="PNG_MAX_SIZE" type="string" optional="false">
++			<help>maximum dimensions of the PNG, like 1024x768</help>
++		</parameter>
++		<parameter key="PNG_INDEXED" type="alternative" optional="true">
++			<option value="TRUE" type="string" />
++			<option value="FALSE" type="string" />
++			<help>generate a color indexed file (default=true)</help>
++		</parameter>
++		<parameter key="PNG_SPEED_OPTIMIZE" type="alternative" optional="true">
++			<option value="TRUE" type="string" />
++			<option value="FALSE" type="string" />
++			<help>optimize for speed (default=false)</help>
++		</parameter>
++		<parameter key="PNG_NR_LEVELS" type="integer+" default="+30" maximum="255" minimum="6" optional="true">
++			<help>number of colors in the palette (default=30)</help>
++		</parameter>
++	</parametergroup>
++
++	<parametergroup name="PGM_IN">
++		<parameter key="PGM_XCOORD" type="decimal" optional="false">
++			<help>lower left x coordinate</help>
++		</parameter>
++		<parameter key="PGM_YCOORD" type="decimal" optional="false">
++			<help>lower left y coordinate</help>
++		</parameter>
++		<parameter key="PGM_CELLSIZE" type="decimal" optional="false">
++			<help>cellsize in meters</help>
++		</parameter>
++		<parameter key="PGM_MIN" type="decimal" optional="false">
++			<help>minimum value in real world coordinates to match with the minimum value read out of the PGM file (such minimum being greater than 0 because 0 is NODATA)</help>
++		</parameter>
++		<parameter key="PGM_MAX" type="decimal" optional="false">
++			<help>maximum value in real world coordinates to match with the maximum value read out of the PGM file</help>
++		</parameter>
++	</parametergroup>
++
++	<!-- Meteo Parameters for Filters, resampling, spatial interpolations-->
++	<parametergroup name="METEOIOPARAMETERS">
++		<option value="TA"/>
++		<option value="RH"/>
++		<option value="VW"/>
++		<option value="DW"/>
++		<option value="VW_MAX"/>
++		<option value="ISWR"/>
++		<option value="RSWR"/>
++		<option value="ILWR"/>
++		<option value="HS"/>
++		<option value="HNW"/>
++		<option value="TSG"/>
++		<option value="TSS"/>
++		<option value="P"/>
++	</parametergroup>
++
++	<!-- Filters -->
++	<parameter key="Add/Remove Filter" type="selector">
++		<section name="filters" />
++
++		<parameter key="%::filter#" type="alternative" counter="1" template="true">
++			<section name="filters" />
++
++			<option label="MeanAvg" value="mean_avg" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			    </help>
++			  </parameter>
++			  <help>Mean average processing. The mean average filter returns the mean value of all values within a user given time window.</help>
++			</option>
++
++			<option label="MedianAvg" value="median_avg" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="decimal" minimum="0" />
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			    </help>
++			  </parameter>
++			  <help>Median average processing. The median average filter returns the median value of all values within a user given time window.</help>
++			</option>
++
++			<option label="Std Deviation Filter" value="std_dev" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			    </help>
++			  </parameter>
++			  <help>Standard deviation filter. Values outside of mean ± 2 std_dev are rejected.</help>
++			</option>
++
++			<option label="MAD" value="mad" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			    </help>
++			  </parameter>
++			  <help>Median Absolute Deviation. Values outside of median ± 3 σ_MAD are rejected. &lt;br&gt;
++			  See http://en.wikipedia.org/wiki/Median_absolute_deviation for more information.</help>
++			</option>
++
++			<option label="Tukey 53H Filter" value="Tukey" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <help>
++			      The keyword "soft" maybe added, if the window position is allowed to be adjusted to the data present.
++			      The two arguments may be preceded by the keywords "left", "center" or "right", indicating the window position.
++			    </help>
++			  </parameter>
++			  <help>Tukey 53H method A smooth time sequence is generated from the median, substracted from the original signal and
++			  compared with the standard deviation. see "Despiking Acoustic Doppler Velocimeter Data", Derek G. Goring and Vladimir
++			  L. Nikora, Journal of Hydraulic Engineering, 128, 1, 2002 The deviation factor coeffecient is currently hard-coded as k=1.5. </help>
++			</option>
++
++			<option label="Wind Averaging Filter" value="wind_avg" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			    </help>
++			  </parameter>
++			  <help>Wind vector averaging. This calculates the vector average over a user given time period. Each wind vector
++			  within this period is added and the final sum is normalized by the number of vectors that have been added. </help>
++			</option>
++
++			<option label="Exponential Smoothing" value="exp_smoothing" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <option label="alpha:" value="0.8" type="decimal" minimum="0" maximum="1"/>
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			      Alpha needs to be provided as last argument. Please note that the standard filter works with a left window!
++			    </help>
++			  </parameter>
++			  <help>Exponential smooting processing, exponential moving average s_0 = x_0 s_n = alpha*x_(t-1) + (1-alpha)*s_t-1</help>
++			</option>
++
++			<option label="Weighted Moving Average Smoothing" value="wma_smoothing" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option value="center" type="dropdown">
++			      <option value="left" type="string" />
++			      <option value="center" type="string" />
++			      <option value="right" type="string" />
++			    </option>
++			    <option label="# of points:" value="1" type="integer" minimum="1" />
++			    <option label="Duration:" value="0" type="integer" minimum="0" />
++			    <help>
++			      Activate "soft" if the window position is allowed to be adjusted, window position maybe left, center or right.
++			      Minimal number of points in window and minimal time interval spanning the window (seconds) are required.
++			      Please note that the standard filter works with a left window!
++			    </help>
++			  </parameter>
++			  <help>Weighted moving average smoothing such as: WMA = (1*X1 + 2*X2 + ... + n*Xn) / sum_of_weights</help>
++			</option>
++
++			<option label="Min Range Filter" value="min" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option label="Min:" value="" type="decimal" />
++			    <option label="Adjust to:" value="" type="decimal" />
++			    <help>The keyword "soft" maybe added, in such a case all data smaller than the min would be
++			    assigned the minimum permissible value or another value given as an extra argument</help>
++			  </parameter>
++			  <help>Min range filter. Reject all values smaller than the min.</help>
++			</option>
++
++			<option label="Max Range Filter" value="max" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option label="Max:" value="" type="decimal" />
++			    <option label="Adjust to:" value="" type="decimal" />
++			    <help>The keyword "soft" maybe added, in such a case all data greater than the max would be
++			    assigned the maximum permissible value or another value given as an extra argument</help>
++			  </parameter>
++			  <help>Max range filter. Reject all values greater than the max.</help>
++			</option>
++
++			<option label="MinMax (2 or 4 arguments)" value="min_max" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option label="Min:" value="" type="decimal" />
++			    <option label="Max:" value="" type="decimal" />
++			    <option label="Min adjust to:" value="" type="decimal" />
++			    <option label="Max adjust to:" value="" type="decimal" />
++			    <help>The keyword "soft" maybe added, in such a case all data greater than the max would be assigned
++			    the maximum permissible value and all data smaller than the min would be assigned the minimum
++			    permissible value or an optional extra set of two user provided values</help>
++			  </parameter>
++			  <help>Reject all values greater than the max or smaller than the min. &lt;br&gt;</help>
++			</option>
++
++			<option label="Rate Filter (1 argument)" value="rate" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option label="Max:" value="1.0" type="decimal" minimum="0" maximum="1" />
++			    <help>the absolute value of the maximum permissible rate of change (per seconds)</help>
++			  </parameter>
++			  <help>Rate of change filter. Calculate the change rate (ie: slope) between two points, if it is above a user given value, reject the point.</help>
++			</option>
++
++			<option label="Rate Filter (2 arguments)" value="rate" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option label="Min:" value="0.0" type="decimal" minimum="0" maximum="1" />
++			    <option label="Max:" value="1.0" type="decimal" minimum="0" maximum="1" />
++			    <help>the minimum and maximum permissible rate of change (per second)</help>
++			  </parameter>
++			  <help>Rate of change filter. Calculate the change rate (ie: slope) between two points, if it is above a user given value, reject the point.</help>
++			</option>
++
++			<option label="Unheated Rain Gauge Filter" value="Unheated_RainGauge" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option value="soft" type="choice" />
++			    <option label="RH threshold:" value="0.5" type="decimal" minimum="0" maximum="1" />
++			    <option label="Delta_T threshold:" value="3.0" type="decimal" minimum="0" maximum="20" />
++			  </parameter>
++			  <help>Filters out snow melting in an unheated rain gauge. This filter can ONLY be applied to precipitation. Non-zero measurements are accepted only if they take place when the relative humidity is greater than RH_threshold and (TA-TSS) smaller than Delta_T_threshold, otherwise they get reset to 0. If none of these conditions could be tested (for lack of data), then the precipitation is reset to nodata (or left unchanged if "soft" has been selected).</help>
++			</option>
++
++			<option label="WMO Undercatch Filter" value="undercatch_wmo" type="string">
++			  <parameter key="%::arg#" type="combination">
++				<option value="Gage type" type="dropdown">
++					<option value="Nipher" type="string" />
++					<option value="Tretyakov" type="string" />
++					<option value="US8sh" type="string" />
++					<option value="US8unsh" type="string" />
++					<option value="Hellmann" type="string" />
++					<option value="Hellmannsh" type="string" />
++				</option>
++			  </parameter>
++			  <help>This implements the standard methods for precipitation correction as described in "WMO Solid Precipitation Measurement Intercomparison", B. Goodison, P. Louie and D. Yang, 872, 1998 as well as the overview given by "Literature Study on the Correction of Precipitation Measurements", Annette Wagner, 2009. The correction parameters for the shielded Hellmann gauge (German version) are from "Wind-induced Precipitation Undercatch of the Hellmann Gauges", Daqing Yang et al, Nordic Hydrology, 30, 1999, pp 57-80.</help>
++			</option>
++
++			<option label="WMO Undercatch Filter - simplified" value="undercatch_wmo" type="string">
++			  <parameter key="%::arg#" type="combination">
++				<option value="Kind" type="dropdown">
++					<option value="Cst" type="string" />
++				</option>
++				<option label="Snow factor:" value="1.3" type="decimal" minimum="0" maximum="5" />
++				<option label="Mixed prec factor:" value="1.1" type="decimal" minimum="0" maximum="5" />
++			  </parameter>
++			  <help>This applies a constant correction factor to the precipitation, one for pure snow and one for mixed precipitation. The following thresholds are used: pure snow below -2 C; mixed precipitation between -2 and +2 C; pure rain above 2 C. These threshold can be changed (see online documentation).</help>
++			</option>
++
++			<option label="Unventillated temperature sensor" value="Unventilated_T" type="string">
++			  <parameter key="%::arg#" type="combination">
++			    <option label="albedo:" value="0.23" type="decimal" />
++			    <option value="soft" type="choice" />
++			    <help>If the "soft" option is given, the albedo has a value different according to snow (or no snow) on the ground</help>
++			  </parameter>
++			  <help>This implements the correction described in (Reina Nakamura, 2005) with an albedo dependency as introduced in (Huwald, 2009)</help>
++			</option>
++
++			<option label="Add an offset" value="add" type="string">
++			  <parameter key="%::arg#" type="combination">
++				<option label="offset:" value="0." type="decimal" />
++			  </parameter>
++			  <help>This adds a given offset to the data.</help>
++			</option>
++
++			<option label="Multiply by a factor" value="mult" type="string">
++			  <parameter key="%::arg#" type="combination">
++				<option label="factor:" value="1." type="decimal" />
++			  </parameter>
++			  <help>This multiplies the data by a given factor.</help>
++			</option>
++
++		</parameter>
++
++		<reference name="METEOIOPARAMETERS" />
++	</parameter>
++
++	<!-- 1D Interpolation -->
++	<parameter key="WINDOW_SIZE" type="integer+" minimum="1" default="43200">
++		<section name="Interpolations1D" />
++		<help>Affects resampling: expresses (in seconds) how far a valid point can be
++		searched for when re-interpolating a missing value</help>
++	</parameter>
++
++	<parameter key="Add/Remove 1D Interpolation" type="selector">
++		<section name="Interpolations1D" />
++
++		<parameter key="%::resample" type="alternative" template="true">
++			<section name="Interpolations1D" />
++			<option label="No Interpolation" value="none" type="string" />
++			<option label="Nearest Neighbour" value="nearest_neighbour" type="string" />
++			<option label="Linear" value="linear" type="string">
++			  <parameter key="%::args" type="combination">
++			    <option value="extrapolate" type="choice" />
++			    <help>
++			      If "extrapolate" is added, then data *outside* of the original date range can be interpolated.
++			      Otherwise, a data point will only be calculated between the original date range.
++			    </help>
++			  </parameter>
++			  <help>Mean average processing. The mean average filter returns the mean value of all values within a user given time window.</help>
++			</option>
++			<option label="Accumulate" value="accumulate" type="string">
++			  <parameter key="%::args" type="combination">
++			    <option value="strict" type="choice" />
++			    <option label="Seconds:" value="900" type="integer" minimum="1" />
++			    <help>Accumulation period (in seconds). This must usually match the model time step. if enabling "strict", nodatas will propagate (ie. a single nodata in the input will force the re-accumulated value to be nodata). Otherwise, all valid values are aggregated and only pure nodata intervals produce a nodata in the output.</help>
++			  </parameter>
++			  <help>Accumulation over a user given period (filter argument, in seconds -
++			  should coincide with your calculation step!).</help>
++			</option>
++		</parameter>
++
++		<reference name="METEOIOPARAMETERS" />
++	</parameter>
++
++	<!-- 2D Interpolation -->
++	<parameter key="Add/Remove 2D Interpolation" type="selector">
++		<section name="Interpolations2D" />
++
++		<parameter key="%::algorithms" type="choice" template="true">
++			<section name="Interpolations2D" />
++			<option value="STD_PRESS" type="choice">
++				<help>Generate a standard atmosphere pressure as a function of the cell's elevation</help>
++			</option>
++			<option value="CST" type="choice">
++				<help>Fill the grid with the average over all the stations</help>
++			</option>
++			<option value="CST_LAPSE" type="choice">
++			  <parameter key="%::cst_lapse" type="combination">
++			    <option label="Lapse Rate:" value="0.008" type="decimal" optional="false" />
++			    <option value="" type="dropdown">
++			      <option value="" type="string" />
++			      <option value="soft" type="string" />
++			      <option value="frac" type="string" />
++			    </option>
++			  </parameter>
++			  <help>Detrend the measured data, fill the grid with the average over all the stations, reapply the elevation trend</help>
++			</option>
++			<option value="IDW" type="choice">
++				<help>Inverse Distance Weighted average</help>
++			</option>
++			<option value="IDW_LAPSE" type="choice">
++			  <parameter key="%::idw_lapse" type="combination">
++			    <option label="Lapse Rate:" value="0.008" type="decimal" optional="false" />
++			    <option value="" type="dropdown">
++			      <option value="" type="string" />
++			      <option value="soft" type="string" />
++			      <option value="frac" type="string" />
++			    </option>
++			  </parameter>
++			  <help>Detrend the measured data, apply Inverse Distance Weighted average, reapply elevation trend</help>
++			</option>
++			<option value="LIDW_LAPSE" type="choice">
++			  <parameter key="%::lidw_lapse" type="combination">
++			    <option label="Lapse Rate:" value="0.008" type="decimal" optional="false" />
++			    <option value="" type="dropdown">
++			      <option value="" type="string" />
++			      <option value="soft" type="string" />
++			      <option value="frac" type="string" />
++			    </option>
++			  </parameter>
++			  <help>Same as IDW_LAPSE, but only considering a given number of neighboring stations</help>
++			</option>
++			<option value="RH" type="choice">
++				<help>Computes the dew point temperature, distribute it with IDW_LAPSE, recompute RH at each pixel</help>
++			</option>
++			<option value="ILWR" type="choice">
++				<help>Compute emissivity, distribute it with IDW_LAPSE, recompute ILWR at each pixel</help>
++			</option>
++			<option value="WIND_CURV" type="choice">
++				<help>Distribute wind velocity with IDW_LAPSE, then apply correction factors as a function of local slope and curvature</help>
++			</option>
++			<option value="HNW_SNOW" type="choice">
++				<parameter key="%::hnw_snow" type="combination">
++				<option value="IDW_LAPSE" type="dropdown">
++					<option value="CST" type="string" />
++					<option value="CST_LAPSE" type="string" />
++					<option value="IDW" type="string" />
++					<option value="IDW_LAPSE" type="string" />
++					<option value="ODKRIG" type="string" />
++				</option>
++				<help>Base algorithm (do not forget to add the options for the base algorithm)</help>
++				</parameter>
++				<help>Distribute precipitation with a base algorithm (IDW_LAPSE by default), then reduce/remove precipitation on
++				steep slopes and correct with the local curvature. This is to simulate snow redistribution processes.</help>
++			</option>
++			<option value="USER" type="choice">
++			  <parameter key="%::user" type="path" optional="false"/>
++			  <help>User provided grids, named as {numeric date}_{capitalized meteo parameter}.asc</help>
++			</option>
++			<option value="ODKRIG" type="choice">
++			  <parameter key="%::odkrig" type="combination">
++			  	<option value="" type="dropdown">
++					<option value="LINVARIO" type="string" />
++					<option value="EXPVARIO" type="string" />
++					<option value="SPHERICVARIO" type="string" />
++					<option value="RATQUADVARIO" type="string" />
++				</option>
++				<help>Variogram model</help>
++			  </parameter>
++			  <help>Ordinary kriging (EXPERIMENTAL)</help>
++			</option>
++		</parameter>
++
++		<reference name="METEOIOPARAMETERS" />
++	</parameter>
++</inishell_config>
+\ No newline at end of file
+
+Property changes on: ../trunk-jpl/src/java/src/resources/default_config.xml
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/icons/file_ops.xcf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/src/resources/icons/file_ops.xcf
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/icons/file_ops.xcf	(revision 17992)
++++ ../trunk-jpl/src/java/src/resources/icons/file_ops.xcf	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/src/resources/icons/file_ops.xcf
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/icons/filesave.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/src/resources/icons/filesave.png
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/icons/filesave.png	(revision 17992)
++++ ../trunk-jpl/src/java/src/resources/icons/filesave.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/src/resources/icons/filesave.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/icons/viewmag.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/src/resources/icons/viewmag.png
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/icons/viewmag.png	(revision 17992)
++++ ../trunk-jpl/src/java/src/resources/icons/viewmag.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/src/resources/icons/viewmag.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/icons/ini_open.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/src/resources/icons/ini_open.png
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/icons/ini_open.png	(revision 17992)
++++ ../trunk-jpl/src/java/src/resources/icons/ini_open.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/src/resources/icons/ini_open.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/icons/fileopen.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/src/resources/icons/fileopen.png
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/icons/fileopen.png	(revision 17992)
++++ ../trunk-jpl/src/java/src/resources/icons/fileopen.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/src/resources/icons/fileopen.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/icons/xml_open.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/src/resources/icons/xml_open.png
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/icons/xml_open.png	(revision 17992)
++++ ../trunk-jpl/src/java/src/resources/icons/xml_open.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/src/resources/icons/xml_open.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/icons/filesaveas.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/src/resources/icons/filesaveas.png
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/icons/filesaveas.png	(revision 17992)
++++ ../trunk-jpl/src/java/src/resources/icons/filesaveas.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/src/resources/icons/filesaveas.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/icons/opensettings.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/src/resources/icons/opensettings.png
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/icons/opensettings.png	(revision 17992)
++++ ../trunk-jpl/src/java/src/resources/icons/opensettings.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/src/resources/icons/opensettings.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/icons/reset.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/src/resources/icons/reset.png
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/icons/reset.png	(revision 17992)
++++ ../trunk-jpl/src/java/src/resources/icons/reset.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/src/resources/icons/reset.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/icons/advancedsettings.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/src/resources/icons/advancedsettings.png
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/icons/advancedsettings.png	(revision 17992)
++++ ../trunk-jpl/src/java/src/resources/icons/advancedsettings.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/src/resources/icons/advancedsettings.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/icons/mydocuments.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/src/resources/icons/mydocuments.png
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/icons/mydocuments.png	(revision 17992)
++++ ../trunk-jpl/src/java/src/resources/icons/mydocuments.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/src/resources/icons/mydocuments.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/icons/readme.txt
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/icons/readme.txt	(revision 0)
++++ ../trunk-jpl/src/java/src/resources/icons/readme.txt	(revision 17993)
+@@ -0,0 +1,10 @@
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++This copyright and license notice covers the images in this directory.
++************************************************************************
++
++TITLE:	Crystal Project Icons
++AUTHOR:	Everaldo Coelho
++SITE:	http://www.everaldo.com
++CONTACT: everaldo@everaldo.com
++
++Copyright (c)  2006-2007  Everaldo Coelho.
+
+Property changes on: ../trunk-jpl/src/java/src/resources/icons/readme.txt
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/icons/kghostview.png
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/java/src/resources/icons/kghostview.png
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/icons/kghostview.png	(revision 17992)
++++ ../trunk-jpl/src/java/src/resources/icons/kghostview.png	(revision 17993)
+
+Property changes on: ../trunk-jpl/src/java/src/resources/icons/kghostview.png
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/src/resources/config_schema-0.1.1.xsd
+===================================================================
+--- ../trunk-jpl/src/java/src/resources/config_schema-0.1.1.xsd	(revision 0)
++++ ../trunk-jpl/src/java/src/resources/config_schema-0.1.1.xsd	(revision 17993)
+@@ -0,0 +1,154 @@
++<?xml version="1.0"?>
++<!-- 
++*   
++*	This file is part of INIshell.
++*
++*   INIshell is free software: you can redistribute it and/or modify
++*   it under the terms of the GNU General Public License as published by
++*   the Free Software Foundation, either version 3 of the License, or
++*   (at your option) any later version.
++*
++*   INIshell is distributed in the hope that it will be useful,
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++*   GNU General Public License for more details.
++*
++*   You should have received a copy of the GNU General Public License
++*   along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
++*    	
++* -->
++<xsd:schema version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
++  <xsd:element name="inishell_config" type="general" />
++  
++  <xsd:complexType name="general">
++    <xsd:choice maxOccurs="unbounded">
++      <xsd:element name="parameter" type="parametertype" />
++      <xsd:element name="parametergroup" type="pargroup" />
++      <xsd:element name="include" type="pathonly" /> 
++      <xsd:element name="frame" type="framegroup" /> 
++    </xsd:choice>
++    <xsd:attribute name="application" />
++  </xsd:complexType>
++
++  <xsd:complexType name="framegroup">
++    <xsd:choice minOccurs="1" maxOccurs="unbounded">
++      <xsd:element name="parameter" type="parametertype" />
++      <xsd:element name="reference" type="nameonly" />
++      <xsd:element name="section" type="nameonly"/>
++    </xsd:choice>
++    <xsd:attribute name="key" />
++    <xsd:attribute name="label" />
++  </xsd:complexType>
++  
++  <xsd:complexType name="parametertype">
++    <xsd:complexContent>
++      <xsd:extension base="parbasetype">
++		<xsd:attribute name="key" type="xsd:string" use="required"/> 
++		<xsd:attribute name="default" type="xsd:string" />
++		<xsd:attribute name="counter" type="xsd:integer" />
++      </xsd:extension>
++    </xsd:complexContent>		
++  </xsd:complexType>
++  
++  <xsd:complexType name="nameonly">
++	<xsd:attribute name="name" />   
++  </xsd:complexType>
++
++  <xsd:complexType name="optionvalue">
++	<xsd:attribute name="value" />   
++  </xsd:complexType>
++
++  <xsd:complexType name="pathonly">
++	<xsd:attribute name="path" />   
++  </xsd:complexType>
++  
++  <xsd:complexType name="pargroup">
++	<xsd:choice minOccurs="1" maxOccurs="unbounded">
++	  <xsd:element name="parameter" type="parametertype" />
++	  <xsd:element name="reference" type="nameonly" />
++	  <xsd:element name="option" type="optionvalue" />
++	  <xsd:element name="frame" type="framegroup" /> 
++	</xsd:choice>
++	<xsd:attribute name="name" />
++  </xsd:complexType>
++
++  <xsd:complexType name="parbasetype">
++	<xsd:sequence>
++	  <xsd:sequence minOccurs="0" maxOccurs="unbounded">
++		<xsd:element name="section" type="nameonly"/>
++	  </xsd:sequence>
++	  <xsd:sequence minOccurs="0" maxOccurs="unbounded">
++		<xsd:element name="replace" type="nameonly"/>
++	  </xsd:sequence>
++	  <xsd:sequence minOccurs="0" maxOccurs="unbounded">
++		<xsd:element name="parameter" type="parametertype" />
++	  </xsd:sequence>
++	  <xsd:choice minOccurs="0" maxOccurs="unbounded">				
++		<xsd:element name="option" minOccurs="0">
++		  <xsd:complexType>
++			<xsd:complexContent>
++			  <xsd:extension base="parbasetype">
++				<xsd:attribute name="value" type="xsd:string" use="required" />
++				<xsd:attribute name="label" type="xsd:string" use="optional" />
++				<xsd:attribute name="default" type="xsd:boolean" use="optional"/>
++			  </xsd:extension>
++			</xsd:complexContent>
++		  </xsd:complexType>
++		</xsd:element>
++	  </xsd:choice>
++	  <xsd:sequence minOccurs="0" maxOccurs="unbounded">
++		<xsd:element name="reference" type="nameonly" />
++	  </xsd:sequence>
++	  <xsd:sequence minOccurs="0" maxOccurs="unbounded">
++		<xsd:element name="help" type="helptype"/>	
++	  </xsd:sequence>
++	</xsd:sequence>
++	
++	<xsd:attribute name="type" use="required">
++	  <xsd:simpleType>
++		<xsd:restriction base="xsd:string">
++		  <xsd:enumeration value="integer" />
++		  <xsd:enumeration value="integer+" />
++		  <xsd:enumeration value="decimal" />
++		  <xsd:enumeration value="path" />
++		  <xsd:enumeration value="file" />
++		  <xsd:enumeration value="choice" />
++		  <xsd:enumeration value="alternative" />
++		  <xsd:enumeration value="dropdown" />
++		  <xsd:enumeration value="string" />
++		  <xsd:enumeration value="combination" />
++		  <xsd:enumeration value="selector" />
++		</xsd:restriction>
++	  </xsd:simpleType>
++	</xsd:attribute>
++	
++	<xsd:attribute name="maximum" type="xsd:integer"/>
++	<xsd:attribute name="minimum" type="xsd:integer"/>
++	<xsd:attribute name="template" type="xsd:boolean" default="false" use="optional" />
++	<xsd:attribute name="optional" type="xsd:boolean" default="true" />
++  </xsd:complexType>
++  
++  <xsd:complexType name="needstype">
++	<xsd:attribute name="type" type="xsd:string" use="required" />
++	<xsd:attribute name="name" type="xsd:string" use="required" />
++	
++	<xsd:attribute name="value" />
++	<xsd:attribute name="optional" type="xsd:boolean" />
++	<xsd:attribute name="minoccur" type="xsd:integer" />
++	<xsd:attribute name="maxoccur" type="xsd:string" />
++  </xsd:complexType>
++  
++  <xsd:complexType name="baseType">
++	<xsd:sequence minOccurs="0" maxOccurs="1">
++	  <xsd:element name="help" type="helptype" />		
++	</xsd:sequence>
++	<xsd:attribute name="key" type="xsd:string" use="required" />
++  </xsd:complexType>
++  
++  <xsd:complexType name="helptype" mixed="true">
++	<xsd:choice minOccurs="0" maxOccurs="unbounded">
++	  <xsd:element name="section" type="nameonly" />
++	  <xsd:element name="replace" type="nameonly" />
++	</xsd:choice>
++  </xsd:complexType> 
++</xsd:schema>
+
+Property changes on: ../trunk-jpl/src/java/src/resources/config_schema-0.1.1.xsd
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/COPYING
+===================================================================
+--- ../trunk-jpl/src/java/COPYING	(revision 0)
++++ ../trunk-jpl/src/java/COPYING	(revision 17993)
+@@ -0,0 +1,674 @@
++                    GNU GENERAL PUBLIC LICENSE
++                       Version 3, 29 June 2007
++
++ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
++ Everyone is permitted to copy and distribute verbatim copies
++ of this license document, but changing it is not allowed.
++
++                            Preamble
++
++  The GNU General Public License is a free, copyleft license for
++software and other kinds of works.
++
++  The licenses for most software and other practical works are designed
++to take away your freedom to share and change the works.  By contrast,
++the GNU General Public License is intended to guarantee your freedom to
++share and change all versions of a program--to make sure it remains free
++software for all its users.  We, the Free Software Foundation, use the
++GNU General Public License for most of our software; it applies also to
++any other work released this way by its authors.  You can apply it to
++your programs, too.
++
++  When we speak of free software, we are referring to freedom, not
++price.  Our General Public Licenses are designed to make sure that you
++have the freedom to distribute copies of free software (and charge for
++them if you wish), that you receive source code or can get it if you
++want it, that you can change the software or use pieces of it in new
++free programs, and that you know you can do these things.
++
++  To protect your rights, we need to prevent others from denying you
++these rights or asking you to surrender the rights.  Therefore, you have
++certain responsibilities if you distribute copies of the software, or if
++you modify it: responsibilities to respect the freedom of others.
++
++  For example, if you distribute copies of such a program, whether
++gratis or for a fee, you must pass on to the recipients the same
++freedoms that you received.  You must make sure that they, too, receive
++or can get the source code.  And you must show them these terms so they
++know their rights.
++
++  Developers that use the GNU GPL protect your rights with two steps:
++(1) assert copyright on the software, and (2) offer you this License
++giving you legal permission to copy, distribute and/or modify it.
++
++  For the developers' and authors' protection, the GPL clearly explains
++that there is no warranty for this free software.  For both users' and
++authors' sake, the GPL requires that modified versions be marked as
++changed, so that their problems will not be attributed erroneously to
++authors of previous versions.
++
++  Some devices are designed to deny users access to install or run
++modified versions of the software inside them, although the manufacturer
++can do so.  This is fundamentally incompatible with the aim of
++protecting users' freedom to change the software.  The systematic
++pattern of such abuse occurs in the area of products for individuals to
++use, which is precisely where it is most unacceptable.  Therefore, we
++have designed this version of the GPL to prohibit the practice for those
++products.  If such problems arise substantially in other domains, we
++stand ready to extend this provision to those domains in future versions
++of the GPL, as needed to protect the freedom of users.
++
++  Finally, every program is threatened constantly by software patents.
++States should not allow patents to restrict development and use of
++software on general-purpose computers, but in those that do, we wish to
++avoid the special danger that patents applied to a free program could
++make it effectively proprietary.  To prevent this, the GPL assures that
++patents cannot be used to render the program non-free.
++
++  The precise terms and conditions for copying, distribution and
++modification follow.
++
++                       TERMS AND CONDITIONS
++
++  0. Definitions.
++
++  "This License" refers to version 3 of the GNU General Public License.
++
++  "Copyright" also means copyright-like laws that apply to other kinds of
++works, such as semiconductor masks.
++
++  "The Program" refers to any copyrightable work licensed under this
++License.  Each licensee is addressed as "you".  "Licensees" and
++"recipients" may be individuals or organizations.
++
++  To "modify" a work means to copy from or adapt all or part of the work
++in a fashion requiring copyright permission, other than the making of an
++exact copy.  The resulting work is called a "modified version" of the
++earlier work or a work "based on" the earlier work.
++
++  A "covered work" means either the unmodified Program or a work based
++on the Program.
++
++  To "propagate" a work means to do anything with it that, without
++permission, would make you directly or secondarily liable for
++infringement under applicable copyright law, except executing it on a
++computer or modifying a private copy.  Propagation includes copying,
++distribution (with or without modification), making available to the
++public, and in some countries other activities as well.
++
++  To "convey" a work means any kind of propagation that enables other
++parties to make or receive copies.  Mere interaction with a user through
++a computer network, with no transfer of a copy, is not conveying.
++
++  An interactive user interface displays "Appropriate Legal Notices"
++to the extent that it includes a convenient and prominently visible
++feature that (1) displays an appropriate copyright notice, and (2)
++tells the user that there is no warranty for the work (except to the
++extent that warranties are provided), that licensees may convey the
++work under this License, and how to view a copy of this License.  If
++the interface presents a list of user commands or options, such as a
++menu, a prominent item in the list meets this criterion.
++
++  1. Source Code.
++
++  The "source code" for a work means the preferred form of the work
++for making modifications to it.  "Object code" means any non-source
++form of a work.
++
++  A "Standard Interface" means an interface that either is an official
++standard defined by a recognized standards body, or, in the case of
++interfaces specified for a particular programming language, one that
++is widely used among developers working in that language.
++
++  The "System Libraries" of an executable work include anything, other
++than the work as a whole, that (a) is included in the normal form of
++packaging a Major Component, but which is not part of that Major
++Component, and (b) serves only to enable use of the work with that
++Major Component, or to implement a Standard Interface for which an
++implementation is available to the public in source code form.  A
++"Major Component", in this context, means a major essential component
++(kernel, window system, and so on) of the specific operating system
++(if any) on which the executable work runs, or a compiler used to
++produce the work, or an object code interpreter used to run it.
++
++  The "Corresponding Source" for a work in object code form means all
++the source code needed to generate, install, and (for an executable
++work) run the object code and to modify the work, including scripts to
++control those activities.  However, it does not include the work's
++System Libraries, or general-purpose tools or generally available free
++programs which are used unmodified in performing those activities but
++which are not part of the work.  For example, Corresponding Source
++includes interface definition files associated with source files for
++the work, and the source code for shared libraries and dynamically
++linked subprograms that the work is specifically designed to require,
++such as by intimate data communication or control flow between those
++subprograms and other parts of the work.
++
++  The Corresponding Source need not include anything that users
++can regenerate automatically from other parts of the Corresponding
++Source.
++
++  The Corresponding Source for a work in source code form is that
++same work.
++
++  2. Basic Permissions.
++
++  All rights granted under this License are granted for the term of
++copyright on the Program, and are irrevocable provided the stated
++conditions are met.  This License explicitly affirms your unlimited
++permission to run the unmodified Program.  The output from running a
++covered work is covered by this License only if the output, given its
++content, constitutes a covered work.  This License acknowledges your
++rights of fair use or other equivalent, as provided by copyright law.
++
++  You may make, run and propagate covered works that you do not
++convey, without conditions so long as your license otherwise remains
++in force.  You may convey covered works to others for the sole purpose
++of having them make modifications exclusively for you, or provide you
++with facilities for running those works, provided that you comply with
++the terms of this License in conveying all material for which you do
++not control copyright.  Those thus making or running the covered works
++for you must do so exclusively on your behalf, under your direction
++and control, on terms that prohibit them from making any copies of
++your copyrighted material outside their relationship with you.
++
++  Conveying under any other circumstances is permitted solely under
++the conditions stated below.  Sublicensing is not allowed; section 10
++makes it unnecessary.
++
++  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
++
++  No covered work shall be deemed part of an effective technological
++measure under any applicable law fulfilling obligations under article
++11 of the WIPO copyright treaty adopted on 20 December 1996, or
++similar laws prohibiting or restricting circumvention of such
++measures.
++
++  When you convey a covered work, you waive any legal power to forbid
++circumvention of technological measures to the extent such circumvention
++is effected by exercising rights under this License with respect to
++the covered work, and you disclaim any intention to limit operation or
++modification of the work as a means of enforcing, against the work's
++users, your or third parties' legal rights to forbid circumvention of
++technological measures.
++
++  4. Conveying Verbatim Copies.
++
++  You may convey verbatim copies of the Program's source code as you
++receive it, in any medium, provided that you conspicuously and
++appropriately publish on each copy an appropriate copyright notice;
++keep intact all notices stating that this License and any
++non-permissive terms added in accord with section 7 apply to the code;
++keep intact all notices of the absence of any warranty; and give all
++recipients a copy of this License along with the Program.
++
++  You may charge any price or no price for each copy that you convey,
++and you may offer support or warranty protection for a fee.
++
++  5. Conveying Modified Source Versions.
++
++  You may convey a work based on the Program, or the modifications to
++produce it from the Program, in the form of source code under the
++terms of section 4, provided that you also meet all of these conditions:
++
++    a) The work must carry prominent notices stating that you modified
++    it, and giving a relevant date.
++
++    b) The work must carry prominent notices stating that it is
++    released under this License and any conditions added under section
++    7.  This requirement modifies the requirement in section 4 to
++    "keep intact all notices".
++
++    c) You must license the entire work, as a whole, under this
++    License to anyone who comes into possession of a copy.  This
++    License will therefore apply, along with any applicable section 7
++    additional terms, to the whole of the work, and all its parts,
++    regardless of how they are packaged.  This License gives no
++    permission to license the work in any other way, but it does not
++    invalidate such permission if you have separately received it.
++
++    d) If the work has interactive user interfaces, each must display
++    Appropriate Legal Notices; however, if the Program has interactive
++    interfaces that do not display Appropriate Legal Notices, your
++    work need not make them do so.
++
++  A compilation of a covered work with other separate and independent
++works, which are not by their nature extensions of the covered work,
++and which are not combined with it such as to form a larger program,
++in or on a volume of a storage or distribution medium, is called an
++"aggregate" if the compilation and its resulting copyright are not
++used to limit the access or legal rights of the compilation's users
++beyond what the individual works permit.  Inclusion of a covered work
++in an aggregate does not cause this License to apply to the other
++parts of the aggregate.
++
++  6. Conveying Non-Source Forms.
++
++  You may convey a covered work in object code form under the terms
++of sections 4 and 5, provided that you also convey the
++machine-readable Corresponding Source under the terms of this License,
++in one of these ways:
++
++    a) Convey the object code in, or embodied in, a physical product
++    (including a physical distribution medium), accompanied by the
++    Corresponding Source fixed on a durable physical medium
++    customarily used for software interchange.
++
++    b) Convey the object code in, or embodied in, a physical product
++    (including a physical distribution medium), accompanied by a
++    written offer, valid for at least three years and valid for as
++    long as you offer spare parts or customer support for that product
++    model, to give anyone who possesses the object code either (1) a
++    copy of the Corresponding Source for all the software in the
++    product that is covered by this License, on a durable physical
++    medium customarily used for software interchange, for a price no
++    more than your reasonable cost of physically performing this
++    conveying of source, or (2) access to copy the
++    Corresponding Source from a network server at no charge.
++
++    c) Convey individual copies of the object code with a copy of the
++    written offer to provide the Corresponding Source.  This
++    alternative is allowed only occasionally and noncommercially, and
++    only if you received the object code with such an offer, in accord
++    with subsection 6b.
++
++    d) Convey the object code by offering access from a designated
++    place (gratis or for a charge), and offer equivalent access to the
++    Corresponding Source in the same way through the same place at no
++    further charge.  You need not require recipients to copy the
++    Corresponding Source along with the object code.  If the place to
++    copy the object code is a network server, the Corresponding Source
++    may be on a different server (operated by you or a third party)
++    that supports equivalent copying facilities, provided you maintain
++    clear directions next to the object code saying where to find the
++    Corresponding Source.  Regardless of what server hosts the
++    Corresponding Source, you remain obligated to ensure that it is
++    available for as long as needed to satisfy these requirements.
++
++    e) Convey the object code using peer-to-peer transmission, provided
++    you inform other peers where the object code and Corresponding
++    Source of the work are being offered to the general public at no
++    charge under subsection 6d.
++
++  A separable portion of the object code, whose source code is excluded
++from the Corresponding Source as a System Library, need not be
++included in conveying the object code work.
++
++  A "User Product" is either (1) a "consumer product", which means any
++tangible personal property which is normally used for personal, family,
++or household purposes, or (2) anything designed or sold for incorporation
++into a dwelling.  In determining whether a product is a consumer product,
++doubtful cases shall be resolved in favor of coverage.  For a particular
++product received by a particular user, "normally used" refers to a
++typical or common use of that class of product, regardless of the status
++of the particular user or of the way in which the particular user
++actually uses, or expects or is expected to use, the product.  A product
++is a consumer product regardless of whether the product has substantial
++commercial, industrial or non-consumer uses, unless such uses represent
++the only significant mode of use of the product.
++
++  "Installation Information" for a User Product means any methods,
++procedures, authorization keys, or other information required to install
++and execute modified versions of a covered work in that User Product from
++a modified version of its Corresponding Source.  The information must
++suffice to ensure that the continued functioning of the modified object
++code is in no case prevented or interfered with solely because
++modification has been made.
++
++  If you convey an object code work under this section in, or with, or
++specifically for use in, a User Product, and the conveying occurs as
++part of a transaction in which the right of possession and use of the
++User Product is transferred to the recipient in perpetuity or for a
++fixed term (regardless of how the transaction is characterized), the
++Corresponding Source conveyed under this section must be accompanied
++by the Installation Information.  But this requirement does not apply
++if neither you nor any third party retains the ability to install
++modified object code on the User Product (for example, the work has
++been installed in ROM).
++
++  The requirement to provide Installation Information does not include a
++requirement to continue to provide support service, warranty, or updates
++for a work that has been modified or installed by the recipient, or for
++the User Product in which it has been modified or installed.  Access to a
++network may be denied when the modification itself materially and
++adversely affects the operation of the network or violates the rules and
++protocols for communication across the network.
++
++  Corresponding Source conveyed, and Installation Information provided,
++in accord with this section must be in a format that is publicly
++documented (and with an implementation available to the public in
++source code form), and must require no special password or key for
++unpacking, reading or copying.
++
++  7. Additional Terms.
++
++  "Additional permissions" are terms that supplement the terms of this
++License by making exceptions from one or more of its conditions.
++Additional permissions that are applicable to the entire Program shall
++be treated as though they were included in this License, to the extent
++that they are valid under applicable law.  If additional permissions
++apply only to part of the Program, that part may be used separately
++under those permissions, but the entire Program remains governed by
++this License without regard to the additional permissions.
++
++  When you convey a copy of a covered work, you may at your option
++remove any additional permissions from that copy, or from any part of
++it.  (Additional permissions may be written to require their own
++removal in certain cases when you modify the work.)  You may place
++additional permissions on material, added by you to a covered work,
++for which you have or can give appropriate copyright permission.
++
++  Notwithstanding any other provision of this License, for material you
++add to a covered work, you may (if authorized by the copyright holders of
++that material) supplement the terms of this License with terms:
++
++    a) Disclaiming warranty or limiting liability differently from the
++    terms of sections 15 and 16 of this License; or
++
++    b) Requiring preservation of specified reasonable legal notices or
++    author attributions in that material or in the Appropriate Legal
++    Notices displayed by works containing it; or
++
++    c) Prohibiting misrepresentation of the origin of that material, or
++    requiring that modified versions of such material be marked in
++    reasonable ways as different from the original version; or
++
++    d) Limiting the use for publicity purposes of names of licensors or
++    authors of the material; or
++
++    e) Declining to grant rights under trademark law for use of some
++    trade names, trademarks, or service marks; or
++
++    f) Requiring indemnification of licensors and authors of that
++    material by anyone who conveys the material (or modified versions of
++    it) with contractual assumptions of liability to the recipient, for
++    any liability that these contractual assumptions directly impose on
++    those licensors and authors.
++
++  All other non-permissive additional terms are considered "further
++restrictions" within the meaning of section 10.  If the Program as you
++received it, or any part of it, contains a notice stating that it is
++governed by this License along with a term that is a further
++restriction, you may remove that term.  If a license document contains
++a further restriction but permits relicensing or conveying under this
++License, you may add to a covered work material governed by the terms
++of that license document, provided that the further restriction does
++not survive such relicensing or conveying.
++
++  If you add terms to a covered work in accord with this section, you
++must place, in the relevant source files, a statement of the
++additional terms that apply to those files, or a notice indicating
++where to find the applicable terms.
++
++  Additional terms, permissive or non-permissive, may be stated in the
++form of a separately written license, or stated as exceptions;
++the above requirements apply either way.
++
++  8. Termination.
++
++  You may not propagate or modify a covered work except as expressly
++provided under this License.  Any attempt otherwise to propagate or
++modify it is void, and will automatically terminate your rights under
++this License (including any patent licenses granted under the third
++paragraph of section 11).
++
++  However, if you cease all violation of this License, then your
++license from a particular copyright holder is reinstated (a)
++provisionally, unless and until the copyright holder explicitly and
++finally terminates your license, and (b) permanently, if the copyright
++holder fails to notify you of the violation by some reasonable means
++prior to 60 days after the cessation.
++
++  Moreover, your license from a particular copyright holder is
++reinstated permanently if the copyright holder notifies you of the
++violation by some reasonable means, this is the first time you have
++received notice of violation of this License (for any work) from that
++copyright holder, and you cure the violation prior to 30 days after
++your receipt of the notice.
++
++  Termination of your rights under this section does not terminate the
++licenses of parties who have received copies or rights from you under
++this License.  If your rights have been terminated and not permanently
++reinstated, you do not qualify to receive new licenses for the same
++material under section 10.
++
++  9. Acceptance Not Required for Having Copies.
++
++  You are not required to accept this License in order to receive or
++run a copy of the Program.  Ancillary propagation of a covered work
++occurring solely as a consequence of using peer-to-peer transmission
++to receive a copy likewise does not require acceptance.  However,
++nothing other than this License grants you permission to propagate or
++modify any covered work.  These actions infringe copyright if you do
++not accept this License.  Therefore, by modifying or propagating a
++covered work, you indicate your acceptance of this License to do so.
++
++  10. Automatic Licensing of Downstream Recipients.
++
++  Each time you convey a covered work, the recipient automatically
++receives a license from the original licensors, to run, modify and
++propagate that work, subject to this License.  You are not responsible
++for enforcing compliance by third parties with this License.
++
++  An "entity transaction" is a transaction transferring control of an
++organization, or substantially all assets of one, or subdividing an
++organization, or merging organizations.  If propagation of a covered
++work results from an entity transaction, each party to that
++transaction who receives a copy of the work also receives whatever
++licenses to the work the party's predecessor in interest had or could
++give under the previous paragraph, plus a right to possession of the
++Corresponding Source of the work from the predecessor in interest, if
++the predecessor has it or can get it with reasonable efforts.
++
++  You may not impose any further restrictions on the exercise of the
++rights granted or affirmed under this License.  For example, you may
++not impose a license fee, royalty, or other charge for exercise of
++rights granted under this License, and you may not initiate litigation
++(including a cross-claim or counterclaim in a lawsuit) alleging that
++any patent claim is infringed by making, using, selling, offering for
++sale, or importing the Program or any portion of it.
++
++  11. Patents.
++
++  A "contributor" is a copyright holder who authorizes use under this
++License of the Program or a work on which the Program is based.  The
++work thus licensed is called the contributor's "contributor version".
++
++  A contributor's "essential patent claims" are all patent claims
++owned or controlled by the contributor, whether already acquired or
++hereafter acquired, that would be infringed by some manner, permitted
++by this License, of making, using, or selling its contributor version,
++but do not include claims that would be infringed only as a
++consequence of further modification of the contributor version.  For
++purposes of this definition, "control" includes the right to grant
++patent sublicenses in a manner consistent with the requirements of
++this License.
++
++  Each contributor grants you a non-exclusive, worldwide, royalty-free
++patent license under the contributor's essential patent claims, to
++make, use, sell, offer for sale, import and otherwise run, modify and
++propagate the contents of its contributor version.
++
++  In the following three paragraphs, a "patent license" is any express
++agreement or commitment, however denominated, not to enforce a patent
++(such as an express permission to practice a patent or covenant not to
++sue for patent infringement).  To "grant" such a patent license to a
++party means to make such an agreement or commitment not to enforce a
++patent against the party.
++
++  If you convey a covered work, knowingly relying on a patent license,
++and the Corresponding Source of the work is not available for anyone
++to copy, free of charge and under the terms of this License, through a
++publicly available network server or other readily accessible means,
++then you must either (1) cause the Corresponding Source to be so
++available, or (2) arrange to deprive yourself of the benefit of the
++patent license for this particular work, or (3) arrange, in a manner
++consistent with the requirements of this License, to extend the patent
++license to downstream recipients.  "Knowingly relying" means you have
++actual knowledge that, but for the patent license, your conveying the
++covered work in a country, or your recipient's use of the covered work
++in a country, would infringe one or more identifiable patents in that
++country that you have reason to believe are valid.
++
++  If, pursuant to or in connection with a single transaction or
++arrangement, you convey, or propagate by procuring conveyance of, a
++covered work, and grant a patent license to some of the parties
++receiving the covered work authorizing them to use, propagate, modify
++or convey a specific copy of the covered work, then the patent license
++you grant is automatically extended to all recipients of the covered
++work and works based on it.
++
++  A patent license is "discriminatory" if it does not include within
++the scope of its coverage, prohibits the exercise of, or is
++conditioned on the non-exercise of one or more of the rights that are
++specifically granted under this License.  You may not convey a covered
++work if you are a party to an arrangement with a third party that is
++in the business of distributing software, under which you make payment
++to the third party based on the extent of your activity of conveying
++the work, and under which the third party grants, to any of the
++parties who would receive the covered work from you, a discriminatory
++patent license (a) in connection with copies of the covered work
++conveyed by you (or copies made from those copies), or (b) primarily
++for and in connection with specific products or compilations that
++contain the covered work, unless you entered into that arrangement,
++or that patent license was granted, prior to 28 March 2007.
++
++  Nothing in this License shall be construed as excluding or limiting
++any implied license or other defenses to infringement that may
++otherwise be available to you under applicable patent law.
++
++  12. No Surrender of Others' Freedom.
++
++  If conditions are imposed on you (whether by court order, agreement or
++otherwise) that contradict the conditions of this License, they do not
++excuse you from the conditions of this License.  If you cannot convey a
++covered work so as to satisfy simultaneously your obligations under this
++License and any other pertinent obligations, then as a consequence you may
++not convey it at all.  For example, if you agree to terms that obligate you
++to collect a royalty for further conveying from those to whom you convey
++the Program, the only way you could satisfy both those terms and this
++License would be to refrain entirely from conveying the Program.
++
++  13. Use with the GNU Affero General Public License.
++
++  Notwithstanding any other provision of this License, you have
++permission to link or combine any covered work with a work licensed
++under version 3 of the GNU Affero General Public License into a single
++combined work, and to convey the resulting work.  The terms of this
++License will continue to apply to the part which is the covered work,
++but the special requirements of the GNU Affero General Public License,
++section 13, concerning interaction through a network will apply to the
++combination as such.
++
++  14. Revised Versions of this License.
++
++  The Free Software Foundation may publish revised and/or new versions of
++the GNU General Public License from time to time.  Such new versions will
++be similar in spirit to the present version, but may differ in detail to
++address new problems or concerns.
++
++  Each version is given a distinguishing version number.  If the
++Program specifies that a certain numbered version of the GNU General
++Public License "or any later version" applies to it, you have the
++option of following the terms and conditions either of that numbered
++version or of any later version published by the Free Software
++Foundation.  If the Program does not specify a version number of the
++GNU General Public License, you may choose any version ever published
++by the Free Software Foundation.
++
++  If the Program specifies that a proxy can decide which future
++versions of the GNU General Public License can be used, that proxy's
++public statement of acceptance of a version permanently authorizes you
++to choose that version for the Program.
++
++  Later license versions may give you additional or different
++permissions.  However, no additional obligations are imposed on any
++author or copyright holder as a result of your choosing to follow a
++later version.
++
++  15. Disclaimer of Warranty.
++
++  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
++APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
++HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
++OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
++THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
++IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
++ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
++
++  16. Limitation of Liability.
++
++  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
++THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
++GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
++USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
++DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
++PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
++EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
++SUCH DAMAGES.
++
++  17. Interpretation of Sections 15 and 16.
++
++  If the disclaimer of warranty and limitation of liability provided
++above cannot be given local legal effect according to their terms,
++reviewing courts shall apply local law that most closely approximates
++an absolute waiver of all civil liability in connection with the
++Program, unless a warranty or assumption of liability accompanies a
++copy of the Program in return for a fee.
++
++                     END OF TERMS AND CONDITIONS
++
++            How to Apply These Terms to Your New Programs
++
++  If you develop a new program, and you want it to be of the greatest
++possible use to the public, the best way to achieve this is to make it
++free software which everyone can redistribute and change under these terms.
++
++  To do so, attach the following notices to the program.  It is safest
++to attach them to the start of each source file to most effectively
++state the exclusion of warranty; and each file should have at least
++the "copyright" line and a pointer to where the full notice is found.
++
++    <one line to give the program's name and a brief idea of what it does.>
++    Copyright (C) <year>  <name of author>
++
++    This program is free software: you can redistribute it and/or modify
++    it under the terms of the GNU General Public License as published by
++    the Free Software Foundation, either version 3 of the License, or
++    (at your option) any later version.
++
++    This program is distributed in the hope that it will be useful,
++    but WITHOUT ANY WARRANTY; without even the implied warranty of
++    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++    GNU General Public License for more details.
++
++    You should have received a copy of the GNU General Public License
++    along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++Also add information on how to contact you by electronic and paper mail.
++
++  If the program does terminal interaction, make it output a short
++notice like this when it starts in an interactive mode:
++
++    <program>  Copyright (C) <year>  <name of author>
++    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
++    This is free software, and you are welcome to redistribute it
++    under certain conditions; type `show c' for details.
++
++The hypothetical commands `show w' and `show c' should show the appropriate
++parts of the General Public License.  Of course, your program's commands
++might be different; for a GUI interface, you would use an "about box".
++
++  You should also get your employer (if you work as a programmer) or school,
++if any, to sign a "copyright disclaimer" for the program, if necessary.
++For more information on this, and how to apply and follow the GNU GPL, see
++<http://www.gnu.org/licenses/>.
++
++  The GNU General Public License does not permit incorporating your program
++into proprietary programs.  If your program is a subroutine library, you
++may consider it more useful to permit linking proprietary applications with
++the library.  If this is what you want to do, use the GNU Lesser General
++Public License instead of this License.  But first, please read
++<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+
+Property changes on: ../trunk-jpl/src/java/COPYING
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/java/build.xml
+===================================================================
+--- ../trunk-jpl/src/java/build.xml	(revision 0)
++++ ../trunk-jpl/src/java/build.xml	(revision 17993)
+@@ -0,0 +1,126 @@
++<project name="inishell" default="help" basedir=".">
++	<description>
++	Build and run the inishell Application from the command line.
++	</description>
++
++
++	<!-- set global properties for the build -->
++	<property name="src" location="src"/>
++	<property name="examples" location="doc/examples"/>
++	<property name="build" location="build"/>
++	<property name="dist"  location="dist"/>
++	<property name="lib.dir" location="lib"/>
++	<tstamp prefix="build-info">
++		<format property="date" pattern="yyyy-MM-dd" locale="en" />
++		<format property="time" pattern="HH:mm:ss" locale="en" />
++		<format property="num-date" pattern="yyyyMMdd" locale="en" />
++	</tstamp>
++	<property name="version.num" value="1.0.0" />
++	<!--<buildnumber file="dist/build.num"/>-->
++	<!--<property name="version-number" value="${version.num}-${build.number}" />-->
++	<property name="version-number" value="${version.num}" />
++	<property name="version-full" value="${version.num}-${build-info.num-date}" />
++
++	<path id="classpath">
++		<fileset dir="${lib.dir}" includes="**/*.jar"/>
++	</path>
++
++
++	<!-- targets -->
++	<target name="help">
++		<echo>You can use the following targets:</echo>
++		<echo> </echo>
++		<echo>  help     : (default) Prints this message </echo>
++		<echo>  init     : create necessary directories</echo>
++		<echo>  clean    : Deletes work directories</echo>
++		<echo>  compile  : Compiles into class files</echo>
++		<echo>  dist     : pack all necessary files into a JAR file</echo>
++		<echo>  issm 	 : create inishell GUI using issm.xml</echo>
++		<echo>  snowpack : dist tailored for snowpack</echo>
++		<echo>  meteoio  : dist tailored for meteoio</echo>
++		<echo>  run      : run the previously compiled version</echo>
++		<echo>  pack     : pack all in a zip file for a release</echo>
++		<echo></echo>
++	</target>
++
++	<target name="init">
++		<mkdir dir="${build}"/>
++		<mkdir dir="${dist}"/>
++	</target>
++
++	<target name="snowpack" depends="init" description="Make doc/examples/snowpack_config.xml the default XML config">
++		<copy file="${examples}/snowpack_config.xml" tofile="${build}/resources/default_config.xml" overwrite="true"/>
++		<antcall target="dist"/>
++	</target>
++
++	<target name="meteoio" depends="init" description="Make doc/examples/meteoio_config.xml the default XML config">
++		<copy file="${examples}/meteoio_config.xml" tofile="${build}/resources/default_config.xml" overwrite="true"/>
++		<antcall target="dist"/>
++	</target>
++	
++	<target name="issm" depends="init" description="Make doc/examples/issm.xml the default XML config">
++		<copy file="./doc/examples/issm.xml" tofile="${build}/resources/default_config.xml" overwrite="true"/>
++		<antcall target="dist"/>
++	</target>
++
++	<target name="compile" depends="init" description="Compile from ${src} to ${build}">
++		<javac srcdir="${src}" destdir="${build}" includeantruntime="false">
++			<classpath>
++				<fileset dir="lib">
++				<include name="**/*.jar"/>
++				</fileset>
++			</classpath>
++		</javac>
++		<copy todir="${build}/resources">
++		<fileset dir="${src}/resources" includes="**"/>
++	</copy>
++	</target>
++
++	<target name="dist" depends="compile" description="generate the distribution" >
++		<!-- Create the distribution directory -->
++		<delete file="MANIFEST.MF"/>
++		<manifest file="MANIFEST.MF">
++			<attribute name="Built-By" value="${user.name}"/>
++			<attribute name="Built-On" value="${build-info.date}" />
++			<attribute name="Built-At" value="${build-info.time}" />
++			<attribute name="Main-Class" value="main/GUIBuilder"/>
++			<attribute name="Specification-Title" value="INI file generator"/>
++			<attribute name="Specification-Version" value="${version-full}"/>
++			<attribute name="Specification-Vendor" value="SLF, www.slf.ch"/>
++			<attribute name="Implementation-Title" value="INIshell ini creator"/>
++			<attribute name="Implementation-Version" value="${version-number}"/>
++			<attribute name="Implementation-Vendor" value="SLF, www.slf.ch"/>
++		</manifest>
++
++		<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
++		<jar jarfile="${dist}/inishell.jar" basedir="${build}" manifest="MANIFEST.MF" index="true" >
++			<zipfileset src="${lib.dir}/miglayout-4.0.jar" includes="**/*.class"/>
++		</jar>
++	</target>
++
++	<target name="run" depends="dist">
++		<java fork="true" classname="main/GUIBuilder">
++			<classpath>
++				<path refid="classpath"/>
++				<path location="${dist}/inishell.jar"/>
++			</classpath>
++		</java>
++	</target>
++
++	<target name="clean" description="clean up" >
++		<!-- Delete the ${build} and ${dist} directory trees -->
++		<delete file="MANIFEST.MF"/>
++		<delete dir="${build}"/>
++		<delete dir="${dist}"/>
++	</target>
++
++	<target name="pack" depends="dist" description="pack for distribution">
++		<zip destfile="inishell-${version.num}.zip">
++			<zipfileset dir="doc/examples" prefix="inishell-${version.num}/doc/examples"/>
++			<zipfileset dir="dist" prefix="inishell-${version.num}/bin"/>
++			<zipfileset dir="." includes="inishell.sh" prefix="inishell-${version.num}/bin"/>
++			<zipfileset dir="." includes="Changelog_${version.num}.txt" prefix="inishell-${version.num}/doc"/>
++		</zip>
++	</target>
++
++</project>
+
+Property changes on: ../trunk-jpl/src/java/build.xml
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 17992)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 17993)
+@@ -88,10 +88,221 @@
+ }/*}}}*/
+ ElementMatrix* LevelsetAnalysis::CreateKMatrix(Element* element){/*{{{*/
+ 
+-	_error_("not implemented yet");
++	if(!element->IsOnBase()) return NULL;
++	Element* basalelement = element->SpawnBasalElement();
++
++	/*Intermediaries */
++	int  dim, domaintype;
++	int i, row, col;
++	IssmDouble kappa;
++	IssmDouble Jdet, dt, D_scalar;
++	IssmDouble h,hx,hy,hz;
++	IssmDouble vel, calvingrate;
++	IssmDouble norm_dlsf;
++	IssmDouble* xyz_list = NULL;
++
++	/*Get problem dimension*/
++	basalelement->FindParam(&domaintype,DomainTypeEnum);
++	switch(domaintype){
++		case Domain2DverticalEnum:   dim = 1; break;
++		case Domain2DhorizontalEnum: dim = 2; break;
++		case Domain3DEnum:           dim = 2; break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
++
++	/*Fetch number of nodes and dof for this finite element*/
++	int numnodes    = basalelement->GetNumberOfNodes();
++
++	/*Initialize Element vector and other vectors*/
++	ElementMatrix* Ke       = basalelement->NewElementMatrix();
++	IssmDouble*    basis    = xNew<IssmDouble>(numnodes);
++	IssmDouble*    B        = xNew<IssmDouble>(dim*numnodes);
++	IssmDouble*    Bprime   = xNew<IssmDouble>(dim*numnodes);
++	IssmDouble*    D        = xNew<IssmDouble>(dim*dim);
++	IssmDouble*    v        = xNew<IssmDouble>(dim);
++	IssmDouble*    w        = xNew<IssmDouble>(dim);
++	IssmDouble*    c        = xNew<IssmDouble>(dim);
++	IssmDouble*    dlsf     = xNew<IssmDouble>(dim);
++
++	/*Retrieve all inputs and parameters*/
++	basalelement->GetVerticesCoordinates(&xyz_list);
++	basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
++	Input* vx_input=NULL;
++	Input* vy_input=NULL;
++	if(domaintype==Domain2DhorizontalEnum){
++		vx_input=basalelement->GetInput(VxEnum); _assert_(vx_input);
++		vy_input=basalelement->GetInput(VyEnum); _assert_(vy_input);
++	}
++	else{
++		if(dim==1){
++			vx_input=basalelement->GetInput(VxEnum); _assert_(vx_input);
++		}
++		if(dim==2){
++			vx_input=basalelement->GetInput(VxAverageEnum); _assert_(vx_input);
++			vy_input=basalelement->GetInput(VyAverageEnum); _assert_(vy_input);
++		}
++	}
++
++	Input* lsf_slopex_input  = basalelement->GetInput(LevelsetfunctionSlopeXEnum); _assert_(lsf_slopex_input);
++	Input* lsf_slopey_input  = basalelement->GetInput(LevelsetfunctionSlopeYEnum); _assert_(lsf_slopey_input);
++	Input* calvingrate_input  = basalelement->GetInput(MasstransportCalvingrateEnum);     _assert_(calvingrate_input);
++	
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=basalelement->NewGauss(2);
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++		gauss->GaussPoint(ig);
++
++		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		D_scalar=gauss->weight*Jdet;
++
++		/* Transient */
++		if(dt!=0.){
++			basalelement->NodalFunctions(basis,gauss);
++			TripleMultiply(basis,numnodes,1,0,
++						&D_scalar,1,1,0,
++						basis,1,numnodes,0,
++						&Ke->values[0],1);
++			D_scalar*=dt;
++		}
++
++		/* Advection */
++		GetB(B,basalelement,xyz_list,gauss); 
++		GetBprime(Bprime,basalelement,xyz_list,gauss); 
++		vx_input->GetInputValue(&v[0],gauss); // in 3D case, add mesh velocity 
++		vy_input->GetInputValue(&v[1],gauss); 
++		lsf_slopex_input->GetInputValue(&dlsf[0],gauss);
++		lsf_slopey_input->GetInputValue(&dlsf[1],gauss);
++		calvingrate_input->GetInputValue(&calvingrate,gauss);
++
++		norm_dlsf=0.;
++		for(i=0;i<dim;i++) norm_dlsf+=pow(dlsf[i],2);
++		norm_dlsf=sqrt(norm_dlsf);
++
++		if(norm_dlsf>1.e-10)
++			for(i=0;i<dim;i++) c[i]=calvingrate*dlsf[i]/norm_dlsf;
++		else
++			for(i=0;i<dim;i++) c[i]=0.;
++		
++		for(i=0;i<dim;i++) w[i]=v[i]-c[i];
++
++		for(row=0;row<dim;row++)
++			for(col=0;col<dim;col++)
++				if(row==col)
++					D[row*dim+col]=D_scalar*w[row];
++				else
++				   D[row*dim+col]=0.;
++
++		TripleMultiply(B,dim,numnodes,1,
++					D,dim,dim,0,
++					Bprime,dim,numnodes,0,
++					&Ke->values[0],1);
++
++		/* Stabilization */
++		int stabilization=2;
++		vel=0.;
++		for(i=0;i<dim;i++) vel+=v[i]*v[i];
++		vel=sqrt(vel)+1.e-14;
++		switch(stabilization){
++			case 0:
++				// no stabilization, do nothing
++				break;
++			case 1:
++				/* Artificial Diffusion */
++				basalelement->ElementSizes(&hx,&hy,&hz);
++				h=sqrt( pow(hx*v[0]/vel,2) + pow(hy*v[1]/vel,2) ); 
++				kappa=h*vel/2.;
++				for(row=0;row<dim;row++)
++					for(col=0;col<dim;col++)
++					if(row==col)
++						D[row*dim+col]=D_scalar*kappa;
++					else
++						D[row*dim+col]=0.;
++
++				TripleMultiply(Bprime,dim,numnodes,1,
++							D,dim,dim,0,
++							Bprime,dim,numnodes,0,
++							&Ke->values[0],1);
++				break;	
++			case 2:
++				/* Streamline Upwinding */
++				basalelement->ElementSizes(&hx,&hy,&hz);
++				h=sqrt( pow(hx*v[0]/vel,2) + pow(hy*v[1]/vel,2) );
++				for(row=0;row<dim;row++) 
++					for(col=0;col<dim;col++) 
++						D[row*dim+col] = D_scalar*h/(2.*vel)*v[row]*v[col];
++
++				TripleMultiply(Bprime,dim,numnodes,1,
++							D,dim,dim,0,
++							Bprime,dim,numnodes,0,
++							&Ke->values[0],1);
++				break;
++			default:
++				_error_("unknown type of stabilization in LevelsetAnalysis.cpp");
++		}
++	}
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(basis);
++	xDelete<IssmDouble>(B);
++	xDelete<IssmDouble>(D);
++	xDelete<IssmDouble>(Bprime);
++	xDelete<IssmDouble>(v);
++	xDelete<IssmDouble>(w);
++	xDelete<IssmDouble>(c);
++	xDelete<IssmDouble>(dlsf);
++	delete gauss;
++	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++	return Ke;
+ }/*}}}*/
+ ElementVector* LevelsetAnalysis::CreatePVector(Element* element){/*{{{*/
+-	_error_("not implemented yet");
++	
++	if(!element->IsOnBase()) return NULL;
++	Element* basalelement = element->SpawnBasalElement();
++
++	/*Intermediaries */
++	int i, ig, domaintype;
++	IssmDouble  Jdet,dt;
++	IssmDouble  lsf;
++	IssmDouble* xyz_list = NULL;
++	
++	/*Fetch number of nodes and dof for this finite element*/
++	int numnodes = basalelement->GetNumberOfNodes();
++
++	/*Initialize Element vector*/
++	ElementVector* pe = basalelement->NewElementVector();
++	basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
++	
++	if(dt!=0.){
++		/*Initialize basis vector*/
++		IssmDouble*    basis = xNew<IssmDouble>(numnodes);
++
++		/*Retrieve all inputs and parameters*/
++		basalelement->GetVerticesCoordinates(&xyz_list);
++		Input* levelset_input     = basalelement->GetInput(MaskIceLevelsetEnum);                    _assert_(levelset_input);
++
++		/* Start  looping on the number of gaussian points: */
++		Gauss* gauss=basalelement->NewGauss(2);
++		for(ig=gauss->begin();ig<gauss->end();ig++){
++			gauss->GaussPoint(ig);
++
++			basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
++			basalelement->NodalFunctions(basis,gauss);
++
++			/* old function value */
++			levelset_input->GetInputValue(&lsf,gauss);
++			for(i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*lsf*basis[i];
++		}
++
++		/*Clean up and return*/
++		xDelete<IssmDouble>(xyz_list);
++		xDelete<IssmDouble>(basis);
++		basalelement->FindParam(&domaintype,DomainTypeEnum);
++		if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++		delete gauss;
++	}
++
++	return pe;
+ }/*}}}*/
+ void LevelsetAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	_error_("not implemented yet");
Index: /issm/oecreview/Archive/17984-18295/ISSM-17993-17994.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-17993-17994.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-17993-17994.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/model.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.py	(revision 17993)
++++ ../trunk-jpl/src/m/classes/model.py	(revision 17994)
+@@ -656,7 +656,7 @@
+ 		#connectivity
+ 		md.mesh.elementconnectivity=numpy.tile(md.mesh.elementconnectivity,(numlayers-1,1))
+ 		md.mesh.elementconnectivity[numpy.nonzero(md.mesh.elementconnectivity==0)]=-sys.maxint-1
+-		if not numpy.isnan(md.mesh.lementconnectivity).all():
++		if not numpy.isnan(md.mesh.elementconnectivity).all():
+ 			for i in xrange(1,numlayers-1):
+ 				md.mesh.elementconnectivity[i*md.mesh.numberofelements2d:(i+1)*md.mesh.numberofelements2d,:] \
+ 						=md.mesh.elementconnectivity[i*md.mesh.numberofelements2d:(i+1)*md.mesh.numberofelements2d,:]+md.mesh.numberofelements2d
Index: /issm/oecreview/Archive/17984-18295/ISSM-17994-17995.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-17994-17995.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-17994-17995.diff	(revision 18296)
@@ -0,0 +1,1110 @@
+Index: ../trunk-jpl/src/c/modules/EdgeDetectionx/EdgeDetectionx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/EdgeDetectionx/EdgeDetectionx.h	(revision 17994)
++++ ../trunk-jpl/src/c/modules/EdgeDetectionx/EdgeDetectionx.h	(revision 17995)
+@@ -1,14 +0,0 @@
+-/*!\file:  EdgeDetectionx.h
+- * \brief header file for EdgeDetectionx module
+- */ 
+-
+-#ifndef _EDGEDETECTIONX_H_
+-#define _EDGEDETECTIONX_H_
+-
+-#include <string.h>
+-#include "../../classes/classes.h"
+-
+-/* local prototypes: */
+-void EdgeDetectionx(Contours* contours, bool* image, int M, int N);
+-
+-#endif  /* _EDGEDETECTIONX_H */
+Index: ../trunk-jpl/src/c/modules/EdgeDetectionx/EdgeDetectionx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/EdgeDetectionx/EdgeDetectionx.cpp	(revision 17994)
++++ ../trunk-jpl/src/c/modules/EdgeDetectionx/EdgeDetectionx.cpp	(revision 17995)
+@@ -1,35 +0,0 @@
+-/*!\file EdgeDetectionx
+- * \brief: x code for EdgeDetection module
+- */
+-
+-/*Header files: {{{*/
+-#include "./EdgeDetectionx.h"
+-#include "../../shared/shared.h"
+-#include "../../toolkits/toolkits.h"
+-/*}}}*/
+-
+-void EdgeDetectionx(Contours* contours, bool* image, int M, int N){
+-
+-	/*intermediary: */
+-	int i;
+-
+-	_assert_(contours);
+-
+-	/*output: */
+-	Contour<IssmPDouble>* contour=NULL;
+-	IssmPDouble* x=NULL;
+-	IssmPDouble* y=NULL;
+-
+-	/*Create bogus contour: */
+-	x=xNewZeroInit<IssmPDouble>(10);
+-	y=xNewZeroInit<IssmPDouble>(10);
+-	for(i=0;i<10;i++){
+-		x[i]=(IssmPDouble)i;
+-		y[i]=(IssmPDouble)i;
+-	}
+-	contour= new Contour<IssmPDouble>(1,10,x,y,true);
+-
+-	/*Add contour to our dataset of contours: */
+-	contours->AddObject(contour);
+-
+-}
+Index: ../trunk-jpl/src/c/modules/AverageFilterx/AverageFilterx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/AverageFilterx/AverageFilterx.cpp	(revision 17994)
++++ ../trunk-jpl/src/c/modules/AverageFilterx/AverageFilterx.cpp	(revision 17995)
+@@ -1,43 +0,0 @@
+-/*!\file:  AverageFilterx.cpp
+- * \brief  plug missing values of a double* array, using interpolation techniques. This 
+- * is an adaptation of Dr. Crippen's routine (Jet Propulsion Lab, see AverageFilterCrippen.c
+- * for more details.
+- */ 
+-
+-#include <stdio.h>
+-#include <time.h>
+-#include "./AverageFilterx.h"
+-#include "../../shared/shared.h"
+-
+-int AverageFilterx(double** pimageout,double* image, int lines,int samps,int smooth){
+-
+-	double      temp;
+-	int         numvalues;
+-	long			i, j;
+-	int         pix1, pix2;
+-
+-	/*output: */
+-	double* imageout=NULL;
+-
+-	imageout=xNew<double>(samps*lines);
+-
+-  	for ( i = 0; i < lines; i++ ){
+-  		for ( j = 0; j < samps; j++ ){
+-			temp=0;
+-			numvalues=0;
+-			for ( pix1 = -smooth; pix1 < smooth+1; pix1++ ){
+-				for ( pix2 = -smooth; pix2 < smooth+1; pix2++ ){
+-					if( i+pix1 < 0 || i+pix1 > lines-1 || j+pix2 < 0 || j+pix2 > samps-1) continue;
+-					numvalues=numvalues+1;
+-					temp=temp+*(image+samps*(i+pix1)+j+pix2);
+-				}
+-			}
+-			*(imageout+samps*(i)+j)=temp/numvalues;
+-		}
+-	}
+-
+-	/*Assign output pointers: */
+-	*pimageout=imageout;
+-
+-	return 1;
+-}
+Index: ../trunk-jpl/src/c/modules/AverageFilterx/AverageFilterx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/AverageFilterx/AverageFilterx.h	(revision 17994)
++++ ../trunk-jpl/src/c/modules/AverageFilterx/AverageFilterx.h	(revision 17995)
+@@ -1,14 +0,0 @@
+-/*
+-	AverageFilterx.h
+-*/
+-
+-#ifndef AVERAGEFILTERX_H
+-#define AVERAGEFILTERX_H
+-
+-//#define _DEBUG_
+-//#define _DEBUG2_
+-
+-/* local prototypes: */
+-int AverageFilterx(double** pimageout,double* imagein, int lines,int samp,int smooth);
+-
+-#endif /* AVERAGEFILTERX_H */
+Index: ../trunk-jpl/src/c/modules/HoleFillerx/HoleFillerx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/HoleFillerx/HoleFillerx.h	(revision 17994)
++++ ../trunk-jpl/src/c/modules/HoleFillerx/HoleFillerx.h	(revision 17995)
+@@ -1,14 +0,0 @@
+-/*
+-	HoleFillerx.h
+-*/
+-
+-#ifndef HOLEFILLERX_H
+-#define HOLEFILLERX_H
+-
+-//#define _DEBUG_
+-//#define _DEBUG2_
+-
+-/* local prototypes: */
+-int HoleFillerx(double** pimageout,double* imagein, int lines,int samp,int smooth);
+-
+-#endif /* HOLEFILLERX_H */
+Index: ../trunk-jpl/src/c/modules/HoleFillerx/HoleFillerx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/HoleFillerx/HoleFillerx.cpp	(revision 17994)
++++ ../trunk-jpl/src/c/modules/HoleFillerx/HoleFillerx.cpp	(revision 17995)
+@@ -1,347 +0,0 @@
+-/*!\file:  HoleFillerx.cpp
+- * \brief  plug missing values of a double* array, using interpolation techniques. This 
+- * is an adaptation of Dr. Crippen's routine (Jet Propulsion Lab)
+- */ 
+-
+-#include <stdio.h>
+-#include <time.h>
+-#include "./HoleFillerx.h"
+-#include "../../shared/shared.h"
+-
+-int HoleFillerx(double** pimageout,double* image, int lines,int samps,int smooth){
+-
+-	long			infinit;
+-	double          temp;
+-	long			i, j, k, l, ii, jj;
+-	long			iii, jjj;
+-	long			test;
+-	float			nsteps, ssteps, wsteps, esteps;
+-	float			nwsteps, nesteps, swsteps, sesteps;
+-	float			north, south, east, west;
+-	float			nw, sw, ne, se, elev, range;
+-	float			nnesteps, enesteps, esesteps, ssesteps;
+-	float			sswsteps, wswsteps, wnwsteps, nnwsteps;
+-	float			nne, ene, ese, sse;
+-	float			ssw, wsw, wnw, nnw;	
+-	float			sum;
+-
+-	time_t			t1, t2;
+-
+-	/*output: */
+-	double*         imageout=NULL;
+-
+-	double*         image2=NULL;
+-	double*         image3=NULL;
+-	double*         image4=NULL;
+-
+-	 /*^^^^^^^^^^^^^  Remove pixels close to the holes ^^^^^^^^^^^^^*/
+-	image2 = xNew<double>(lines*samps);
+-	memcpy(image2,image,lines*samps*sizeof(double));
+-
+-  	for ( i = 0; i < lines; i++ ){
+-  		for ( j = 0; j < samps; j++ ){
+- 			if ( *(image+i*samps+j) == 0 ){ 
+-  				if ( (j > 3) && (j < samps-4) && (i > 3) && (i < lines-4)){
+-					for ( k = 0; k < 4; k++ ){
+-						for ( l = 0; l < 4; l++ ){
+-							*(image2+samps*(i+k)+j+l)=0;
+-							*(image2+samps*(i-k)+j+l)=0;
+-							*(image2+samps*(i+k)+j-l)=0;
+-							*(image2+samps*(i-k)+j-l)=0;
+-
+-						}
+-					}
+-				}
+-			}
+-		}
+-	}
+-
+-	image3 = xNew<double>(lines*samps);
+-	memcpy(image3,image2,lines*samps*sizeof(double));
+-
+-	#ifdef _DEBUG2_
+-		counter=0;
+-		for ( i = 0; i < lines; i++ ) {
+-			for ( j = 0; j < samps; j++ ){
+-				if ( *(image2+i*samps+j) != 0 ) { 
+-					counter++;
+-				}
+-			}
+-		}
+-		_printf_( ""  << "\n");
+-		_printf_("Number of zeroes remaining: " << lines*samps-counter);
+-		fflush( stdout );
+-	#endif
+-
+-	goto afterfirst2;
+-
+-	again2:	
+-
+-	#ifdef _DEBUG2_
+-		counter=0;
+-		for ( i = 0; i < lines; i++ ) {
+-			for ( j = 0; j < samps; j++ ){
+-				if ( *(image2+i*samps+j) != 0 ) { 
+-					counter++;
+-				}
+-			}
+-		}
+-		//        n u m b e r   o f   z e r o e s   r e m a i n i n g :   1 2 3 4 5 6 7 8 9 10        
+-		_printf_( "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b" );
+-		_printf_("Number of zeroes remaining: " << lines*samps-counter);
+-		fflush( stdout );
+-	#endif
+-
+-	afterfirst2:
+-
+-/***************** FIRST RUN *********************/
+-/*
+-fprintf ( stdout, "First  Application:  " ); time(&t2); _printf_( ctime(&t2) );
+-*/
+-	for ( i = 0; i < lines; i++ ){
+-		for ( j = 0; j < samps; j++ ){
+-			if ( *(image2+i*samps+j) != 0 ){ 
+-				*(image3+samps*i+j) = *(image2+i*samps+j); 
+-				continue; 
+-			} 
+-
+-	/* Count All Neighbors Test */
+-			test = 0;		
+-			for ( ii = i-1; ii < i+2; ii++ ){
+-				for ( jj = j-1; jj < j+2; jj++ ){
+-					if (( ii < 0 ) || ( ii >= lines )) continue;
+-					if (( jj < 0 ) || ( jj >= samps )) continue;
+-					if ( *(image2+ii*samps+jj) != 0 ) test += 1;			
+-				}
+-			}
+-			if ( test < 3 ){ 
+-				*(image3+samps*i+j) = 0; 
+-				continue; 
+-			} 
+-
+-			/* For void edge pixels: */			
+-
+-			nsteps = 0.0; ssteps = 0.0; esteps = 0.0; wsteps = 0.0;
+-			nwsteps = 0.0; nesteps = 0.0; swsteps = 0.0; sesteps = 0.0;
+-			north = 0.0; south = 0.0; east = 0.0; west = 0.0;
+-			nw = 0.0; ne = 0.0; sw = 0.0; se = 0.0;
+-
+-			nnesteps = 0.0; enesteps = 0.0; esesteps = 0.0; ssesteps = 0.0;
+-			sswsteps = 0.0; wswsteps = 0.0; wnwsteps = 0.0; nnwsteps = 0.0;
+-			nne = 0.0; ene = 0.0; ese = 0.0; sse = 0.0;
+-			ssw = 0.0; wsw = 0.0; wnw = 0.0; nnw = 0.0;
+-
+-/** NSEW **/
+-			for ( ii = i - 1; ii >= 0; ii-- ){   /* North */
+-				if ( ii <= 0 ) { north = 0; nsteps = 0; break;}
+-				if ( *(image2+ii*samps+j) != 0 ){ north = *(image2+ii*samps+j); nsteps = i - ii; break;}
+-			}
+-
+-			for ( ii = i + 1; ii < lines; ii++ ){ /* South */ 
+-				if ( ii >= lines-1 ){ south = 0; ssteps = 0; break;}
+-				if ( *(image2+ii*samps+j) != 0 ){ south = *(image2+ii*samps+j); ssteps = ii - i; break;}
+-			}
+-
+-			for ( jj = j - 1; jj >= 0; jj-- ){   /* West */
+-				if ( jj <= 0 ) { west = 0; wsteps = 0; break;}
+-				if ( *(image2+i*samps+jj) != 0 ){ west = *(image2+i*samps+jj); wsteps = j - jj; break;}
+-			}
+-
+-			for ( jj = j + 1; jj < samps; jj++ ){ /* East */
+-				if ( jj >= samps-1 ){ east = 0; esteps = 0; break;}
+-				if ( *(image2+i*samps+jj) != 0 ){ east = *(image2+i*samps+jj); esteps = jj - j; break;}
+-			}
+-
+-/** Diagonals  **/						
+-			/* Southeast */
+-			for ( k = 1; k < infinit; k++ ){
+-				ii = i + k; jj = j + k;
+-				if (( ii == lines ) || ( jj == samps )){ se = 0; sesteps = 0; break;}
+-				if ( *(image2+ii*samps+jj) != 0 ){ se = *(image2+ii*samps+jj); sesteps = 1.4142 * k; break;}
+-			}
+-
+-			/* Northeast */
+-			for ( k = 1; k < infinit; k++ ){
+-				ii = i - k; jj = j + k;
+-				if (( ii == -1 ) || ( jj == samps )){ ne = 0; nesteps = 0; break;}
+-				if ( *(image2+ii*samps+jj) != 0 ){ ne = *(image2+ii*samps+jj); nesteps = 1.4142 * k; break;}
+-			}
+-
+-			/* Northwest */
+-			for ( k = 1; k < infinit; k++ ){
+-				ii = i - k; jj = j - k;
+-				if (( ii == -1 ) || ( jj == -1 )){ nw = 0; nwsteps = 0; break;}
+-				if ( *(image2+ii*samps+jj) != 0 ){ nw = *(image2+ii*samps+jj); nwsteps = 1.4142 * k; break;}
+-			}
+-
+-			/* Southwest */
+-			for ( k = 1; k < infinit; k++ ){
+-				ii = i + k; jj = j - k;
+-				if (( ii == lines ) || ( jj == -1 )){ sw = 0; swsteps = 0; break;}
+-				if ( *(image2+ii*samps+jj) != 0 ){ sw = *(image2+ii*samps+jj); swsteps = 1.4142 * k; break;}
+-			}
+-
+-/** Other 8 **/
+-			/* NNE */
+-			for ( k = 1; k < infinit; k++ ){
+-				ii = i - (k*2); jj = j + k;
+-				if (( ii <= -1 ) || ( jj >= samps )){ nne = 0; nnesteps = 0; break;}
+-				if ( *(image2+ii*samps+jj) != 0 ){ nne = *(image2+ii*samps+jj); nnesteps = 2.2361 * k; break;}
+-			}
+-
+-			/* ENE */
+-			for ( k = 1; k < infinit; k++ ){
+-				ii = i - k; jj = j + (k*2);
+-				if (( ii <= -1 ) || ( jj >= samps )){ ene = 0; enesteps = 0; break;}
+-				if ( *(image2+ii*samps+jj) != 0 ){ ene = *(image2+ii*samps+jj); enesteps = 2.2361 * k; break;}
+-			}
+-
+-			/* ESE */
+-			for ( k = 1; k < infinit; k++ ){
+-				ii = i + k; jj = j + (k*2);
+-				if (( ii >= lines ) || ( jj >= samps )){ ese = 0; esesteps = 0; break;}
+-				if ( *(image2+ii*samps+jj) != 0 ){ ese = *(image2+ii*samps+jj); esesteps = 2.2361 * k; break;}
+-			}
+-
+-			/* SSE */
+-			for ( k = 1; k < infinit; k++ ){
+-				ii = i + (k*2); jj = j + k;
+-				if (( ii >= lines ) || ( jj >= samps )){ sse = 0; ssesteps = 0; break;}
+-				if ( *(image2+ii*samps+jj) != 0 ){ sse = *(image2+ii*samps+jj); ssesteps = 2.2361 * k; break;}
+-			}
+-
+-			/* SSW */
+-			for ( k = 1; k < infinit; k++ ){
+-				ii = i + (k*2); jj = j - k;
+-				if (( ii >= lines ) || ( jj <= -1 )){ ssw = 0; sswsteps = 0; break;}
+-				if ( *(image2+ii*samps+jj) != 0 ){ ssw = *(image2+ii*samps+jj); sswsteps = 2.2361 * k; break;}
+-			}
+-
+-			/* WSW */
+-			for ( k = 1; k < infinit; k++ ){
+-				ii = i + k; jj = j - (k*2);
+-				if (( ii >= lines ) || ( jj <= -1 )){ wsw = 0; wswsteps = 0; break;}
+-				if ( *(image2+ii*samps+jj) != 0 ){ wsw = *(image2+ii*samps+jj); wswsteps = 2.2361 * k; break;}
+-			}
+-
+-			/* WNW */
+-			for ( k = 1; k < infinit; k++ ){
+-				ii = i - k; jj = j - (k*2);
+-				if (( ii <= -1 ) || ( jj <= -1 )){ wnw = 0; wnwsteps = 0; break;}
+-				if ( *(image2+ii*samps+jj) != 0 ){ wnw = *(image2+ii*samps+jj); wnwsteps = 2.2361 * k; break;}
+-			}
+-
+-			/* NNW */
+-			for ( k = 1; k < infinit; k++ ){
+-				ii = i - (k*2); jj = j - k;
+-				if (( ii <= -1 ) || ( jj <= -1 )){ nnw = 0; nnwsteps = 0; break;}
+-				if ( *(image2+ii*samps+jj) != 0 ){ nnw = *(image2+ii*samps+jj); nnwsteps = 2.2361 * k; break;}
+-			}
+-
+-			elev = 0; range = 0;
+-/*NSEW*/			
+-			if ( nsteps > 0.5 ){ elev += north /  nsteps; range +=  1.00 /  nsteps;}
+-			if ( ssteps > 0.5 ){ elev += south /  ssteps; range +=  1.00 /  ssteps;}
+-			if ( esteps > 0.5 ){ elev +=  east /  esteps; range +=  1.00 /  esteps;}
+-			if ( wsteps > 0.5 ){ elev +=  west /  wsteps; range +=  1.00 /  wsteps;}
+-/*Diag*/
+-			if ( nwsteps > 0.5 ){ elev +=    nw / nwsteps; range +=  1.00 / nwsteps;}
+-			if ( nesteps > 0.5 ){ elev +=    ne / nesteps; range +=  1.00 / nesteps;}
+-			if ( swsteps > 0.5 ){ elev +=    sw / swsteps; range +=  1.00 / swsteps;}
+-			if ( sesteps > 0.5 ){ elev +=    se / sesteps; range +=  1.00 / sesteps;}
+-
+-/*Other 8*/
+-			if ( nnesteps > 0.5 ){ elev += nne / nnesteps; range +=  1.00 / nnesteps;}
+-			if ( enesteps > 0.5 ){ elev += ene / enesteps; range +=  1.00 / enesteps;}
+-			if ( esesteps > 0.5 ){ elev += ese / esesteps; range +=  1.00 / esesteps;}
+-			if ( ssesteps > 0.5 ){ elev += sse / ssesteps; range +=  1.00 / ssesteps;}
+-			if ( sswsteps > 0.5 ){ elev += ssw / sswsteps; range +=  1.00 / sswsteps;}
+-			if ( wswsteps > 0.5 ){ elev += wsw / wswsteps; range +=  1.00 / wswsteps;}
+-			if ( wnwsteps > 0.5 ){ elev += wnw / wnwsteps; range +=  1.00 / wnwsteps;}
+-			if ( nnwsteps > 0.5 ){ elev += nnw / nnwsteps; range +=  1.00 / nnwsteps;}
+-
+-			//temp = ( elev / range ) + 0.5 ;
+-			temp = ( elev / range );
+-			//+ 0.5 ;
+-			//if ( temp > 10000 ) temp = 10000;
+-			//if ( temp <     0 ) temp =     0;
+-
+-			#ifdef _DEBUG2_
+-				//_printf_(temp << " " << elev << " " << range << " \n");
+-			#endif
+-
+-			*(image3+samps*i+j) = temp ;			
+-		}
+-	}
+-
+-	for ( i = 0; i < lines; i++ ){
+-		for ( j = 0; j < samps; j++ ){
+-			*(image2+samps*i+j)= *(image3+samps*i+j);
+-		}
+-	}
+-
+-	for ( i = 0; i < lines; i++ ){
+-		for ( j = 0; j < samps; j++ ){
+-			if ( *(image2+samps*i+j) == 0 ) goto again2;
+-		}
+-	}
+-
+-	if ( smooth == 0 ) goto there2;		
+-
+-/************************ SMOOTH THE RESULT ***********************/		
+-
+-	image4 = xNew<double>(lines*samps);
+-	memcpy(image4,image3,lines*samps*sizeof(double));
+-
+-	for ( i = 0; i < lines; i++ ) {
+-		for ( j = 0; j < samps; j++ ) {
+-			if ( *(image4+i*samps+j) != 0 ) { *(image3+i*samps+j) = *(image2+i*samps+j) ; continue; }
+-
+-			for ( k = 1; k < infinit; k++ ) { /* Find the smallest box size with data */ 
+-				for ( ii = i-k; ii <= i+k; ii++ ){
+-					if ( ii <      0 ) continue;
+-					if ( ii >= lines ) break;
+-					for ( jj = j-k; jj <= j+k; jj++ ) {
+-						if ( jj <      0 ) continue;
+-						if ( jj >= samps ) continue;
+-						if ( *(image4+ii*samps+jj) != 0 ) goto k_nowset;
+-					}
+-				}
+-			}
+-
+-			k_nowset:
+-			k = k / 4; if ( k < 1 ) k = 1; /* Errrrr.  Make it fourth size */
+-			sum = 0;
+-			for ( ii = i-k; ii <= i+k; ii++ ) {
+-				if ( ii <      0 ) iii = -1 - ii; else iii = ii;
+-				if ( ii >= lines ) iii = lines - (ii - lines + 1);
+-				for ( jj = j-k; jj <= j+k; jj++ ) {
+-					if ( jj <      0 ) jjj = -1 - jj; else jjj = jj;
+-					if ( jj >= samps ) jjj = samps - (jj - samps + 1);
+-					sum += *(image2+samps*iii+jjj) ;
+-				}
+-			}
+-			k = (k*2)+1;
+-			*(image3+samps*i+j) = ( sum / k / k ) ;//+ 0.5;
+-		}
+-
+-	}
+-
+-there2:		
+-
+-	/*Allocate output image: */
+-	imageout=xNew<double>(samps*lines);
+-	memcpy(imageout,image3,lines*samps*sizeof(double));
+-
+-	time(&t2);	
+-
+-	#ifdef _DEBUG2_
+-		_printf_( "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b" );
+-		_printf_("Number of zeroes remaining:          0\n\n");
+-		printf ( "\n");
+-	#endif
+-
+-	/*Assign output pointers: */
+-	*pimageout=imageout;
+-	return 1;
+-}
+Index: ../trunk-jpl/src/c/modules/modules.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/modules.h	(revision 17994)
++++ ../trunk-jpl/src/c/modules/modules.h	(revision 17995)
+@@ -7,7 +7,6 @@
+ 
+ /*Modules: */
+ #include "./AllocateSystemMatricesx/AllocateSystemMatricesx.h"
+-#include "./AverageFilterx/AverageFilterx.h"
+ #include "./AverageOntoPartitionx/AverageOntoPartitionx.h"
+ #include "./Bamgx/Bamgx.h"
+ #include "./BamgConvertMeshx/BamgConvertMeshx.h"
+@@ -23,7 +22,6 @@
+ #include "./CreateJacobianMatrixx/CreateJacobianMatrixx.h"
+ #include "./DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h"
+ #include "./ElementConnectivityx/ElementConnectivityx.h"
+-#include "./EdgeDetectionx/EdgeDetectionx.h"
+ #include "./GetSolutionFromInputsx/GetSolutionFromInputsx.h"
+ #include "./GetVectorFromInputsx/GetVectorFromInputsx.h"
+ #include "./GetVectorFromControlInputsx/GetVectorFromControlInputsx.h"
+@@ -32,7 +30,6 @@
+ #include "./SetActiveNodesLSMx/SetActiveNodesLSMx.h"
+ #include "./Gradjx/Gradjx.h"
+ #include "./GroundinglineMigrationx/GroundinglineMigrationx.h"
+-#include "./HoleFillerx/HoleFillerx.h"
+ #include "./InputControlUpdatex/InputControlUpdatex.h"
+ #include "./InputDepthAverageAtBasex/InputDepthAverageAtBasex.h"
+ #include "./InputDuplicatex/InputDuplicatex.h"
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 17994)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 17995)
+@@ -825,12 +825,6 @@
+ 			./modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h\
+ 			./modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp\
+ 			./modules/InterpFromMeshToGridx/InterpFromMeshToGridx.h\
+-			./modules/HoleFillerx/HoleFillerx.cpp\
+-			./modules/HoleFillerx/HoleFillerx.h\
+-			./modules/EdgeDetectionx/EdgeDetectionx.cpp\
+-			./modules/EdgeDetectionx/EdgeDetectionx.h\
+-			./modules/AverageFilterx/AverageFilterx.cpp\
+-			./modules/AverageFilterx/AverageFilterx.h\
+ 			./modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp\
+ 			./modules/MeshProfileIntersectionx/MeshProfileIntersectionx.h\
+ 			./modules/ContourToMeshx/ContourToMeshx.cpp\
+Index: ../trunk-jpl/src/wrappers/HoleFiller/HoleFiller.cpp
+===================================================================
+--- ../trunk-jpl/src/wrappers/HoleFiller/HoleFiller.cpp	(revision 17994)
++++ ../trunk-jpl/src/wrappers/HoleFiller/HoleFiller.cpp	(revision 17995)
+@@ -1,64 +0,0 @@
+-/*!\file:  HoleFiller.cpp
+- * \brief fill holes in matlab velocity array
+-	this matlab module is an adaptation of a routine written by Robber 
+-	Crippen.  The original routine was designed for the SRTM mission at JPL, 
+-	and can be found in the current directory, under the name 
+-	HoleFillerCrippen.  It fills void holes in an image, using an interpolation 
+-	algorithm, and optionnally a smoothing algorithm. 
+-	This matlab module extends the Crippen routine to be used in Matlab, 
+-	using double arrays found in the workspace, and loaded directly into memory.
+-*/
+-
+-#include "./HoleFiller.h"
+-
+-void HoleFillerUsage(void){/*{{{*/
+-	_printf_("   HoleFiller usage:\n");
+-	_printf_("   [image_out]=HoleFiller(image_in,smooth);\n");
+-	_printf_("   where:\n");
+-	_printf_("      image_in in double format\n");
+-	_printf_("      smooth: 1 to smooth with a box filer, 0 to leave data raw\n");
+-	_printf_("      image_out in double format\n");
+-	_printf_("\n");
+-}/*}}}*/
+-WRAPPER(HoleFiller){
+-
+-	/* required input: */
+-	double* imagein=NULL;
+-	int     imagein_rows,imagein_cols;
+-	int     smooth_flag;
+-	int     smooth;
+-
+-	/* output: */
+-	double* imageout=NULL;
+-	int     imageout_rows,imageout_cols;
+-
+-	/*Boot module: */
+-	MODULEBOOT();
+-
+-	/*checks on arguments on the matlab side: */
+-	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&HoleFillerUsage);
+-
+-	/*Fetch data: */
+-	FetchData(&imagein,&imagein_rows,&imagein_cols,IMAGEIN);
+-	FetchData(&smooth_flag,SMOOTH);
+-
+-	/*Get smooth flag setup: */
+-	if (smooth_flag==0)
+-		smooth=1;
+-	else
+-		smooth=0;
+-
+-	/*Run core hole filler routine: */
+-	HoleFillerx( &imageout,imagein,imagein_rows,imagein_cols,smooth);
+-
+-	/* output: */
+-	WriteData(IMAGEOUT,imageout,imagein_rows,imagein_cols);
+-
+-	/*Clean up*/
+-	xDelete<double>(imagein);
+-	xDelete<double>(imageout);
+-	xDelete<double>(imagein);
+-
+-	/*end module: */
+-	MODULEEND();
+-}
+Index: ../trunk-jpl/src/wrappers/HoleFiller/HoleFiller.h
+===================================================================
+--- ../trunk-jpl/src/wrappers/HoleFiller/HoleFiller.h	(revision 17994)
++++ ../trunk-jpl/src/wrappers/HoleFiller/HoleFiller.h	(revision 17995)
+@@ -1,49 +0,0 @@
+-/*
+-	HoleFiller.h
+-*/
+-
+-#ifndef _HOLEFILLER_H
+-#define _HOLEFILLER_H
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-/*For python modules: needs to come before header files inclusion*/
+-#ifdef _HAVE_PYTHON_
+-#define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+-#endif
+-
+-#include "../bindings.h"
+-#include "../../c/main/globals.h"
+-#include "../../c/modules/modules.h"
+-#include "../../c/shared/shared.h"
+-
+-#undef __FUNCT__ 
+-#define __FUNCT__  "HoleFiller"
+-
+-#ifdef _HAVE_MATLAB_MODULES_
+-/* serial input macros: */
+-#define IMAGEIN prhs[0]
+-#define SMOOTH  prhs[1]
+-/* serial output macros: */
+-#define IMAGEOUT (mxArray**)&plhs[0]
+-#endif
+-
+-#ifdef _HAVE_PYTHON_MODULES_
+-/* serial input macros: */
+-#define IMAGEIN PyTuple_GetItem(args,0)
+-#define SMOOTH  PyTuple_GetItem(args,1)
+-/* serial output macros: */
+-#define IMAGEOUT output,0
+-#endif
+-
+-/* serial arg counts: */
+-#undef NLHS
+-#define NLHS  1
+-#undef NRHS
+-#define NRHS  2
+-
+-#endif  /* _HOLEFILLER_H */
+Index: ../trunk-jpl/src/wrappers/EdgeDetection/EdgeDetection.cpp
+===================================================================
+--- ../trunk-jpl/src/wrappers/EdgeDetection/EdgeDetection.cpp	(revision 17994)
++++ ../trunk-jpl/src/wrappers/EdgeDetection/EdgeDetection.cpp	(revision 17995)
+@@ -1,53 +0,0 @@
+-/*!\file EdgeDetection.c
+- * \brief: edge detection for a boolean image
+-*/
+-
+-#include "./EdgeDetection.h"
+-
+-void EdgeDetectionUsage(void){/*{{{*/
+-	_printf0_("EDGEDETECTION usage- detect edges of a boolean image\n");
+-	_printf0_("\n");
+-	_printf0_("   Usage:\n");
+-	_printf0_("      contours=EdgeDetection(image);\n");
+-	_printf0_("\n");
+-	_printf0_("      image: boolean matrix\n");
+-	_printf0_("\n");
+-	_printf0_("   Example:\n");
+-	_printf0_("      load('velocities.mat');\n");
+-	_printf0_("      md.inversion.vx_obs=EdgeDetection(x_n,y_m,vx,md.mesh.x,md.mesh.y,0);\n");
+-	_printf0_("\n");
+-}/*}}}*/
+-WRAPPER(EdgeDetection){
+-
+-	/*input: */
+-	bool *image = NULL;
+-	int   M,N;
+-
+-	/* output: */
+-	Contours* contours=NULL;
+-
+-	/*Boot module: */
+-	MODULEBOOT();
+-
+-	/*checks on arguments: */
+-	CHECKARGUMENTS(NLHS,NRHS,&EdgeDetectionUsage);
+-
+-	/*Input datasets: */
+-	FetchData(&image,&M,&N,IMAGE);
+-
+-	/*Initialize output: */
+-	contours=new Contours();
+-
+-	/* Run core computations: */
+-	EdgeDetectionx(contours,image,M,N);
+-
+-	/*Write data: */
+-	WriteData(CONTOURS,contours);
+-
+-	/*Clean up*/
+-	xDelete<bool>(image);
+-	delete contours;
+-
+-	/*end module: */
+-	MODULEEND();
+-}
+Index: ../trunk-jpl/src/wrappers/EdgeDetection/EdgeDetection.h
+===================================================================
+--- ../trunk-jpl/src/wrappers/EdgeDetection/EdgeDetection.h	(revision 17994)
++++ ../trunk-jpl/src/wrappers/EdgeDetection/EdgeDetection.h	(revision 17995)
+@@ -1,51 +0,0 @@
+-/*!\file EdgeDetection.h
+- * \brief: prototype for EdgeDetection module 
+- */
+-
+-#ifndef _EDGEDETECTION_H_
+-#define _EDGEDETECTION_H_
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-/*For python modules: needs to come before header files inclusion*/
+-#ifdef _HAVE_PYTHON_
+-#define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+-#endif
+-
+-/*Header files: */
+-#include "../bindings.h"
+-#include "../../c/main/globals.h"
+-#include "../../c/toolkits/toolkits.h"
+-#include "../../c/modules/modules.h"
+-#include "../../c/shared/shared.h"
+-#include "../../c/shared/io/io.h"
+-#include "../../c/shared/Enum/Enum.h"
+-
+-#undef __FUNCT__ 
+-#define __FUNCT__  "EdgeDetection"
+-
+-#ifdef _HAVE_MATLAB_MODULES_
+-/* serial input macros: */
+-#define IMAGE       prhs[0]
+-/* serial output macros: */
+-#define CONTOURS (mxArray**)&plhs[0]
+-#endif
+-
+-#ifdef _HAVE_PYTHON_MODULES_
+-/* serial input macros: */
+-#define IMAGE       PyTuple_GetItem(args,0)
+-/* serial output macros: */
+-#define CONTOURS output,0
+-#endif
+-
+-/* serial arg counts: */
+-#undef NLHS
+-#define NLHS  1
+-#undef NRHS
+-#define NRHS  1
+-
+-#endif  /* _EDGEDETECTION_H_ */
+Index: ../trunk-jpl/src/wrappers/AverageFilter/AverageFilter.cpp
+===================================================================
+--- ../trunk-jpl/src/wrappers/AverageFilter/AverageFilter.cpp	(revision 17994)
++++ ../trunk-jpl/src/wrappers/AverageFilter/AverageFilter.cpp	(revision 17995)
+@@ -1,58 +0,0 @@
+-/*!\file:  AverageFilter.cpp
+- * \brief fill holes in matlab velocity array
+-	this matlab module is an adaptation of a routine written by Robber 
+-	Crippen.  The original routine was designed for the SRTM mission at JPL, 
+-	and can be found in the current directory, under the name 
+-	AverageFilterCrippen.  It fills void holes in an image, using an interpolation 
+-	algorithm, and optionnally a smoothing algorithm. 
+-	This matlab module extends the Crippen routine to be used in Matlab, 
+-	using double arrays found in the workspace, and loaded directly into memory.
+-*/
+-
+-#include "./AverageFilter.h"
+-
+-void AverageFilterUsage(void){/*{{{*/
+-	_printf_("   AverageFilter usage:\n");
+-	_printf_("   [image_out]=AverageFilter(image_in,pixels)\n");
+-	_printf_("   where:\n");
+-	_printf_("      image_in in double format\n");
+-	_printf_("      pixels: characteristic size of smoothing\n");
+-	_printf_("      image_out in double format\n");
+-	_printf_("\n");
+-}/*}}}*/
+-WRAPPER(AverageFilter){
+-
+-	int i,j;
+-
+-	/* required input: */
+-	double* imagein=NULL;
+-	int     imagein_rows,imagein_cols;
+-	int     smooth;
+-
+-	/* output: */
+-	double* imageout=NULL;
+-	int     imageout_rows,imageout_cols;
+-
+-	/*Boot module: */
+-	MODULEBOOT();
+-
+-	/*checks on arguments on the matlab side: */
+-	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&AverageFilterUsage);
+-
+-	/*Fetch data: */
+-	FetchData(&imagein,&imagein_rows,&imagein_cols,IMAGEIN);
+-	FetchData(&smooth,SMOOTH);
+-
+-	/*Run core hole filler routine: */
+-	AverageFilterx( &imageout,imagein,imagein_rows,imagein_cols,smooth);
+-
+-	/* output: */
+-	WriteData(IMAGEOUT,imageout,imagein_rows,imagein_cols);
+-
+-	/*free ressources: */
+-	xDelete<double>(imagein);
+-	xDelete<double>(imageout);
+-
+-	/*end module: */
+-	MODULEEND();
+-}
+Index: ../trunk-jpl/src/wrappers/AverageFilter/AverageFilter.h
+===================================================================
+--- ../trunk-jpl/src/wrappers/AverageFilter/AverageFilter.h	(revision 17994)
++++ ../trunk-jpl/src/wrappers/AverageFilter/AverageFilter.h	(revision 17995)
+@@ -1,49 +0,0 @@
+-/*
+-	AverageFilter.h
+-*/
+-
+-#ifndef _AVERAGEFILTER_H
+-#define _AVERAGEFILTER_H
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-/*For python modules: needs to come before header files inclusion*/
+-#ifdef _HAVE_PYTHON_
+-#define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+-#endif
+-
+-#include "../bindings.h"
+-#include "../../c/main/globals.h"
+-#include "../../c/modules/modules.h"
+-#include "../../c/shared/shared.h"
+-
+-#undef __FUNCT__ 
+-#define __FUNCT__  "AverageFilter"
+-
+-#ifdef _HAVE_MATLAB_MODULES_
+-/* serial input macros: */
+-#define IMAGEIN prhs[0]
+-#define SMOOTH  prhs[1]
+-/* serial output macros: */
+-#define IMAGEOUT (mxArray**)&plhs[0]
+-#endif
+-
+-#ifdef _HAVE_PYTHON_MODULES_
+-/* serial input macros: */
+-#define IMAGEIN PyTuple_GetItem(args,0)
+-#define SMOOTH  PyTuple_GetItem(args,1)
+-/* serial output macros: */
+-#define IMAGEOUT output,0
+-#endif
+-
+-/* serial arg counts: */
+-#undef NLHS
+-#define NLHS  1
+-#undef NRHS
+-#define NRHS  2
+-
+-#endif  /* _AVERAGEFILTER_H */
+Index: ../trunk-jpl/src/wrappers/InternalFront/InternalFront.cpp
+===================================================================
+--- ../trunk-jpl/src/wrappers/InternalFront/InternalFront.cpp	(revision 17994)
++++ ../trunk-jpl/src/wrappers/InternalFront/InternalFront.cpp	(revision 17995)
+@@ -1,92 +0,0 @@
+-/*\file InternalFront.c
+- *\brief: build pressureload
+- */
+-
+-#include "./InternalFront.h"
+-
+-void InternalFrontUsage(void) {/*{{{*/
+-	_printf0_("\n");
+-	_printf0_("   usage: icefront = " << __FUNCT__ << "(md);\n");
+-	_printf0_("\n");
+-}/*}}}*/
+-WRAPPER(InternalFront){
+-
+-	bool*   elementonwater=NULL;
+-	int*    elements=NULL;
+-	int*    elementconnectivity=NULL;
+-	int*    front=NULL;
+-	double* front2=NULL;
+-	bool    found;
+-	int     numberofelements,numberofsegments;
+-	int     i,j,ii,jj,id;
+-	int     dummy;
+-
+-	/*Boot module: */
+-	MODULEBOOT();
+-
+-	/*checks on arguments: */
+-	CHECKARGUMENTS(NLHS,NRHS,&InternalFrontUsage);
+-
+-	/*Fetch inputs: */
+-	FetchData(&elements,&numberofelements,&dummy,ELEMENTS);
+-	FetchData(&elementonwater,&dummy,&dummy,ELEMENTONWATER);
+-	FetchData(&elementconnectivity,&dummy,&dummy,ELEMENTCONNECTIVITY);
+-
+-	/*Allocate and initialize all variables*/
+-	numberofsegments=0;
+-	front=xNew<int>(3*numberofelements*4);
+-
+-	/*Loop over all elements on water*/
+-	for(i=0;i<numberofelements;i++){
+-
+-		/*Skip if on water*/
+-		if(!elementonwater[i]) continue;
+-
+-		/*Loop over all three adjacent elements*/
+-		for(j=0;j<3;j++){
+-
+-			/*Skip if adjacent element does not exist or is on water*/
+-			id=elementconnectivity[i*3+j];
+-			if(id==0) continue;
+-			if(elementonwater[id-1]) continue;
+-
+-			/*We have an ice front to add here, let's go!*/
+-			for(ii=0;ii<3;ii++){
+-
+-				found=false;
+-				for(jj=0;jj<3;jj++){
+-					if(elements[(id-1)*3+ii]==elements[i*3+jj]){
+-						found=true;
+-						break;
+-					}
+-				}
+-
+-				/*OK, we just found the node of id, which is not in i. We have the segment*/
+-				if(!found){
+-					front[numberofsegments*4+0]=elements[(id-1)*3+(ii+1)%3];
+-					front[numberofsegments*4+1]=elements[(id-1)*3+(ii+2)%3];
+-					front[numberofsegments*4+2]=id;
+-					front[numberofsegments*4+3]=IceEnum;
+-					numberofsegments+=1;
+-					break;
+-				}
+-			}
+-
+-			/*In debugging mode, check that the segment has been found*/
+-			_assert_(!found);
+-		}
+-	}
+-
+-	/*Now that we know how many segments there is we can allocate the final matrix*/
+-	if(numberofsegments){
+-		front2=xNew<double>(4*numberofsegments);
+-		for(i=0;i<4*numberofsegments;i++) front2[i]=(double)front[i];
+-	}
+-	xDelete<int>(front);
+-
+-	/*write output datasets: */
+-	WriteData(FRONT,front2,numberofsegments,4);
+-
+-	/*end module: */
+-	MODULEEND();
+-}
+Index: ../trunk-jpl/src/wrappers/InternalFront/InternalFront.h
+===================================================================
+--- ../trunk-jpl/src/wrappers/InternalFront/InternalFront.h	(revision 17994)
++++ ../trunk-jpl/src/wrappers/InternalFront/InternalFront.h	(revision 17995)
+@@ -1,51 +0,0 @@
+-/*
+-	InternalFront.h
+-*/
+-
+-#ifndef _INTERNALFRONT_H
+-#define _INTERNALFRONT_H
+-
+-#ifdef HAVE_CONFIG_H
+-	#include <config.h>
+-#else
+-	#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-/*For python modules: needs to come before header files inclusion*/
+-#ifdef _HAVE_PYTHON_
+-#define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
+-#endif
+-
+-#include "../bindings.h"
+-#include "../../c/main/globals.h"
+-#include "../../c/shared/shared.h"
+-#include "../../c/shared/io/io.h"
+-
+-#undef __FUNCT__ 
+-#define __FUNCT__  "InternalFront"
+-
+-#ifdef _HAVE_MATLAB_MODULES_
+-/* serial input macros: */
+-#define ELEMENTS prhs[0]
+-#define ELEMENTONWATER prhs[1]
+-#define ELEMENTCONNECTIVITY prhs[2]
+-/* serial output macros: */
+-#define FRONT (mxArray**)&plhs[0]
+-#endif
+-
+-#ifdef _HAVE_PYTHON_MODULES_
+-/* serial input macros: */
+-#define ELEMENTS PyTuple_GetItem(args,0)
+-#define ELEMENTONWATER PyTuple_GetItem(args,1)
+-#define ELEMENTCONNECTIVITY PyTuple_GetItem(args,2)
+-/* serial output macros: */
+-#define FRONT output,0]
+-#endif
+-
+-/* serial arg counts: */
+-#undef NLHS
+-#define NLHS  1
+-#undef NRHS
+-#define NRHS  3
+-
+-#endif
+Index: ../trunk-jpl/src/wrappers/matlab/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 17994)
++++ ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 17995)
+@@ -46,18 +46,14 @@
+ #}}}
+ #Wrappers {{{
+ if WRAPPERS
+-lib_LTLIBRARIES +=  AverageFilter.la\
+-						 BamgMesher.la\
++lib_LTLIBRARIES += BamgMesher.la\
+ 						 BamgConvertMesh.la\
+ 						 BamgTriangulate.la\
+ 						 ContourToMesh.la\
+ 						 ContourToNodes.la\
+-						 EdgeDetection.la\
+ 						 ElementConnectivity.la\
+ 						 EnumToString.la\
+ 						 ExpSimplify.la\
+-						 HoleFiller.la\
+-						 InternalFront.la\
+ 						 InterpFromGridToMesh.la\
+ 						 InterpFromMeshToMesh2d.la\
+ 						 InterpFromMeshToMesh3d.la\
+@@ -132,10 +128,6 @@
+ libISSMApi_la_LIBADD = $(MPILIB) $(PETSCLIB) $(GSLLIB) $(MATHLIB) $(MEXLIB)
+ libISSMApi_la_LDFLAGS = -module -export-dynamic
+ 
+-AverageFilter_la_SOURCES = ../AverageFilter/AverageFilter.cpp\
+-									../AverageFilter/AverageFilter.h
+-AverageFilter_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(GSLLIB)
+-
+ BamgMesher_la_SOURCES = ../BamgMesher/BamgMesher.cpp\
+ 								../BamgMesher/BamgMesher.h
+ BamgMesher_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(GSLLIB)
+@@ -172,14 +164,6 @@
+ 								  ../StringToEnum/StringToEnum.h
+ StringToEnum_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(GSLLIB)
+ 
+-HoleFiller_la_SOURCES = ../HoleFiller/HoleFiller.cpp\
+-								../HoleFiller/HoleFiller.h
+-HoleFiller_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB)  $(GSLLIB)
+-
+-InternalFront_la_SOURCES = ../InternalFront/InternalFront.cpp\
+-									../InternalFront/InternalFront.h
+-InternalFront_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(GSLLIB)
+-
+ InterpFromGridToMesh_la_SOURCES = ../InterpFromGridToMesh/InterpFromGridToMesh.cpp\
+ 											 ../InterpFromGridToMesh/InterpFromGridToMesh.h
+ InterpFromGridToMesh_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(MULTITHREADINGLIB) $(GSLLIB)
+@@ -224,10 +208,6 @@
+ 						 ../Ll2xy/Ll2xy.h
+ Ll2xy_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(GSLLIB)
+ 
+-EdgeDetection_la_SOURCES = ../EdgeDetection/EdgeDetection.cpp\
+-							../EdgeDetection/EdgeDetection.h
+-EdgeDetection_la_LIBADD= ${deps} $(MPILIB) $(PETSCLIB) $(GSLLIB)
+-
+ ExpSimplify_la_SOURCES = ../ExpSimplify/ExpSimplify.cpp\
+ 							../ExpSimplify/ExpSimplify.h
+ ExpSimplify_la_LIBADD = ${deps} $(MPILIB) $(PETSCLIB) $(GSLLIB)
Index: /issm/oecreview/Archive/17984-18295/ISSM-17999-18000.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-17999-18000.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-17999-18000.diff	(revision 18296)
@@ -0,0 +1,587 @@
+Index: ../trunk-jpl/src/m/classes/SMBcomponents.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBcomponents.py	(revision 0)
++++ ../trunk-jpl/src/m/classes/SMBcomponents.py	(revision 18000)
+@@ -0,0 +1,80 @@
++from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from project3d import *
++from WriteData import *
++
++class SMBcomponents(object):
++	"""
++	SMBcomponents Class definition
++
++	   Usage:
++	      SMBcomponents=SMBcomponents();
++	"""
++
++	def __init__(self): # {{{
++		self.accumulation = float('NaN')
++		self.runoff = float('NaN')
++		self.evaporation = float('NaN')
++		#}}}
++	def __repr__(self): # {{{
++		string="   surface forcings parameters (SMB=accumulation-runoff-evaporation) :"
++		string="%s\n%s"%(string,fielddisplay(self,'accumulation','accumulated snow [m/yr ice eq]'))
++		string="%s\n%s"%(string,fielddisplay(self,'runoff','amount of ice melt lost from the ice column [m/yr ice eq]'))
++		string="%s\n%s"%(string,fielddisplay(self,'evaporation','mount of ice lost to evaporative processes [m/yr ice eq]'))
++		return string
++		#}}}
++	def extrude(self,md): # {{{
++
++		self.mass_balance=project3d(md,'vector',self.accumulation,'type','node');
++		self.mass_balance=project3d(md,'vector',self.runoff,'type','node');
++		self.mass_balance=project3d(md,'vector',self.evaporation,'type','node');
++		return self
++	#}}}
++	def initialize(self,md): # {{{
++
++		if numpy.all(numpy.isnan(self.accumulation)):
++			self.accumulation=numpy.zeros((md.mesh.numberofvertices,1))
++			print "      no SMB.accumulation specified: values set as zero"
++
++		if numpy.all(numpy.isnan(self.runoff)):
++			self.runoff=numpy.zeros((md.mesh.numberofvertices,1))
++			print "      no SMB.runoff specified: values set as zero"
++
++		if numpy.all(numpy.isnan(self.evaporation)):
++			self.evaporation=numpy.zeros((md.mesh.numberofvertices,1))
++			print "      no SMB.evaporation specified: values set as zero"
++
++		return self
++	#}}}
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		if MasstransportAnalysisEnum() in analyses:
++			md = checkfield(md,'fieldname','surfaceforcings.accumulation','forcing',1,'NaN',1)
++
++		if BalancethicknessAnalysisEnum() in analyses:
++			md = checkfield(md,'fieldname','surfaceforcings.accumulation','size',[md.mesh.numberofvertices],'NaN',1)
++
++		if MasstransportAnalysisEnum() in analyses:
++			md = checkfield(md,'fieldname','surfaceforcings.runoff','forcing',1,'NaN',1)
++
++		if BalancethicknessAnalysisEnum() in analyses:
++			md = checkfield(md,'fieldname','surfaceforcings.runoff','size',[md.mesh.numberofvertices],'NaN',1)
++
++		if MasstransportAnalysisEnum() in analyses:
++			md = checkfield(md,'fieldname','surfaceforcings.evaporation','forcing',1,'NaN',1)
++
++		if BalancethicknessAnalysisEnum() in analyses:
++			md = checkfield(md,'fieldname','surfaceforcings.evaporation','size',[md.mesh.numberofvertices],'NaN',1)
++
++		return md
++	# }}}
++	def marshall(self,md,fid):    # {{{
++
++		yts=365.0*24.0*3600.0
++
++		WriteData(fid,'enum',SurfaceforcingsEnum(),'data',SMBEnum(),'format','Integer');
++		WriteData(fid,'object',self,'class','surfaceforcings','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
++		WriteData(fid,'object',self,'class','surfaceforcings','fieldname','runoff','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
++		WriteData(fid,'object',self,'class','surfaceforcings','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
++	# }}}
+Index: ../trunk-jpl/src/m/classes/timestepping.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/timestepping.py	(revision 17999)
++++ ../trunk-jpl/src/m/classes/timestepping.py	(revision 18000)
+@@ -17,6 +17,7 @@
+ 		self.time_step       = 0.
+ 		self.time_adapt      = 0
+ 		self.cfl_coefficient = 0.
++		self.interp_forcings = 1
+ 		
+ 		#set defaults
+ 		self.setdefaultparameters()
+@@ -29,6 +30,7 @@
+ 		string="%s\n%s"%(string,fielddisplay(self,"time_step","length of time steps [yr]"))
+ 		string="%s\n%s"%(string,fielddisplay(self,"time_adapt","use cfl condition to define time step ? (0 or 1) "))
+ 		string="%s\n%s"%(string,fielddisplay(self,"cfl_coefficient","coefficient applied to cfl condition"))
++		string="%s\n%s"%(string,fielddisplay(self,"interp_forcings","interpolate in time between requested forcing values ? (0 or 1)"))
+ 		return string
+ 		#}}}
+ 	def setdefaultparameters(self): # {{{
+@@ -42,6 +44,9 @@
+ 		#time adaptation? 
+ 		self.time_adapt=0
+ 		self.cfl_coefficient=0.5
++		
++		#should we interpolate forcings between timesteps?
++		self.interp_forcings=1
+ 
+ 		return self
+ 	#}}}
+@@ -54,6 +59,7 @@
+ 		md = checkfield(md,'fieldname','timestepping.cfl_coefficient','numel',[1],'>',0,'<=',1)
+ 		if self.final_time-self.start_time<0:
+ 			md.checkmessage("timestepping.final_time should be larger than timestepping.start_time")
++		md = checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0,1])
+ 
+ 		return md
+ 	# }}}
+@@ -66,4 +72,5 @@
+ 		WriteData(fid,'object',self,'fieldname','time_step','format','Double','scale',yts)
+ 		WriteData(fid,'object',self,'fieldname','time_adapt','format','Boolean')
+ 		WriteData(fid,'object',self,'fieldname','cfl_coefficient','format','Double')
++		WriteData(fid,'object',self,'fieldname','interp_forcings','format','Boolean')
+ 	# }}}
+Index: ../trunk-jpl/src/m/classes/SMBmeltcomponents.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBmeltcomponents.py	(revision 0)
++++ ../trunk-jpl/src/m/classes/SMBmeltcomponents.py	(revision 18000)
+@@ -0,0 +1,93 @@
++from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import *
++from project3d import *
++from WriteData import *
++
++class SMBmeltcomponents(object):
++	"""
++	SMBmeltcomponents Class definition
++
++	   Usage:
++	      SMBmeltcomponents=SMBmeltcomponents();
++	"""
++
++	def __init__(self): # {{{
++		self.accumulation = float('NaN')
++		self.runoff = float('NaN')
++		self.evaporation = float('NaN')
++		#}}}
++	def __repr__(self): # {{{
++		string="   surface forcings parameters with melt (SMB=accumulation-evaporation-melt+refreeze) :"
++		string="%s\n%s"%(string,fielddisplay(self,'accumulation','accumulated snow [m/yr ice eq]'))
++		string="%s\n%s"%(string,fielddisplay(self,'evaporation','mount of ice lost to evaporative processes [m/yr ice eq]'))
++		string="%s\n%s"%(string,fielddisplay(self,'melt','amount of ice melt in the ice column [m/yr ice eq]'))
++		string="%s\n%s"%(string,fielddisplay(self,'refreeze','amount of ice melt refrozen in the ice column [m/yr ice eq]'))
++		return string
++		#}}}
++	def extrude(self,md): # {{{
++
++		self.mass_balance=project3d(md,'vector',self.accumulation,'type','node');
++		self.mass_balance=project3d(md,'vector',self.evaporation,'type','node');
++		self.mass_balance=project3d(md,'vector',self.melt,'type','node');
++		self.mass_balance=project3d(md,'vector',self.refreeze,'type','node');
++		return self
++	#}}}
++	def initialize(self,md): # {{{
++
++		if numpy.all(numpy.isnan(self.accumulation)):
++			self.accumulation=numpy.zeros((md.mesh.numberofvertices,1))
++			print "      no SMB.accumulation specified: values set as zero"
++
++		if numpy.all(numpy.isnan(self.evaporation)):
++			self.evaporation=numpy.zeros((md.mesh.numberofvertices,1))
++			print "      no SMB.evaporation specified: values set as zero"
++
++		if numpy.all(numpy.isnan(self.melt)):
++			self.melt=numpy.zeros((md.mesh.numberofvertices,1))
++			print "      no SMB.melt specified: values set as zero"
++
++		if numpy.all(numpy.isnan(self.refreeze)):
++			self.refreeze=numpy.zeros((md.mesh.numberofvertices,1))
++			print "      no SMB.refreeze specified: values set as zero"
++
++		return self
++	#}}}
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		if MasstransportAnalysisEnum() in analyses:
++			md = checkfield(md,'fieldname','surfaceforcings.accumulation','forcing',1,'NaN',1)
++
++		if BalancethicknessAnalysisEnum() in analyses:
++			md = checkfield(md,'fieldname','surfaceforcings.accumulation','size',[md.mesh.numberofvertices],'NaN',1)
++
++		if MasstransportAnalysisEnum() in analyses:
++			md = checkfield(md,'fieldname','surfaceforcings.melt','forcing',1,'NaN',1)
++
++		if BalancethicknessAnalysisEnum() in analyses:
++			md = checkfield(md,'fieldname','surfaceforcings.melt','size',[md.mesh.numberofvertices],'NaN',1)
++
++		if MasstransportAnalysisEnum() in analyses:
++			md = checkfield(md,'fieldname','surfaceforcings.refreeze','forcing',1,'NaN',1)
++
++		if BalancethicknessAnalysisEnum() in analyses:
++			md = checkfield(md,'fieldname','surfaceforcings.refreeze','size',[md.mesh.numberofvertices],'NaN',1)
++
++		if MasstransportAnalysisEnum() in analyses:
++			md = checkfield(md,'fieldname','surfaceforcings.evaporation','forcing',1,'NaN',1)
++
++		if BalancethicknessAnalysisEnum() in analyses:
++			md = checkfield(md,'fieldname','surfaceforcings.evaporation','size',[md.mesh.numberofvertices],'NaN',1)
++
++		return md
++	# }}}
++	def marshall(self,md,fid):    # {{{
++
++		yts=365.0*24.0*3600.0
++
++		WriteData(fid,'enum',SurfaceforcingsEnum(),'data',SMBEnum(),'format','Integer');
++		WriteData(fid,'object',self,'class','surfaceforcings','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
++		WriteData(fid,'object',self,'class','surfaceforcings','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
++		WriteData(fid,'object',self,'class','surfaceforcings','fieldname','melt','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
++		WriteData(fid,'object',self,'class','surfaceforcings','fieldname','refreeze','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
++	# }}}
+Index: ../trunk-jpl/src/m/classes/SMBmeltcomponents.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBmeltcomponents.m	(revision 0)
++++ ../trunk-jpl/src/m/classes/SMBmeltcomponents.m	(revision 18000)
+@@ -0,0 +1,94 @@
++%SMBmeltcomponents Class definition
++%
++%   Usage:
++%      SMBmeltcomponents=SMBmeltcomponents();
++
++classdef SMBmeltcomponents
++	properties (SetAccess=public) 
++		accumulation = NaN;
++		evaporation = NaN;
++		melt = NaN;
++		refreeze = NaN;
++	end
++	methods
++		function obj = SMBmeltcomponents(varargin) % {{{
++			switch nargin
++				case 0
++				otherwise
++					error('constructor not supported');
++			end
++		end % }}}
++		function self = extrude(self,md) % {{{
++
++			self.accumulation=project3d(md,'vector',self.accumulation,'type','node');
++			self.evaporation=project3d(md,'vector',self.evaporation,'type','node');
++			self.melt=project3d(md,'vector',self.melt,'type','node');
++			self.refreeze=project3d(md,'vector',self.refreeze,'type','node');
++
++		end % }}}
++		function self = initialize(self,md) % {{{
++
++			if isnan(self.accumulation)
++				self.accumulation=zeros(md.mesh.numberofvertices,1);
++				disp('      no surfaceforcings.accumulation specified: values set as zero');
++			end
++			if isnan(self.evaporation)
++				self.evaporation=zeros(md.mesh.numberofvertices,1);
++				disp('      no surfaceforcings.evaporation specified: values set as zero');
++			end
++			if isnan(self.refreeze)
++				self.refreeze=zeros(md.mesh.numberofvertices,1);
++				disp('      no surfaceforcings.refreeze specified: values set as zero');
++			end
++			if isnan(self.melt)
++				self.melt=zeros(md.mesh.numberofvertices,1);
++				disp('      no surfaceforcings.melt specified: values set as zero');
++			end
++
++		end % }}}
++		function md = checkconsistency(obj,md,solution,analyses) % {{{
++
++			if ismember(MasstransportAnalysisEnum(),analyses),
++				md = checkfield(md,'fieldname','surfaceforcings.accumulation','forcing',1,'NaN',1);
++			end
++			if ismember(BalancethicknessAnalysisEnum(),analyses),
++				md = checkfield(md,'fieldname','surfaceforcings.accumulation','size',[md.mesh.numberofvertices 1],'NaN',1);
++			end
++			if ismember(MasstransportAnalysisEnum(),analyses),
++				md = checkfield(md,'fieldname','surfaceforcings.evaporation','forcing',1,'NaN',1);
++			end
++			if ismember(BalancethicknessAnalysisEnum(),analyses),
++				md = checkfield(md,'fieldname','surfaceforcings.evaporation','size',[md.mesh.numberofvertices 1],'NaN',1);
++			end
++			if ismember(MasstransportAnalysisEnum(),analyses),
++				md = checkfield(md,'fieldname','surfaceforcings.refreeze','forcing',1,'NaN',1);
++			end
++			if ismember(BalancethicknessAnalysisEnum(),analyses),
++				md = checkfield(md,'fieldname','surfaceforcings.refreeze','size',[md.mesh.numberofvertices 1],'NaN',1);
++			end
++			if ismember(MasstransportAnalysisEnum(),analyses),
++				md = checkfield(md,'fieldname','surfaceforcings.melt','forcing',1,'NaN',1);
++			end
++			if ismember(BalancethicknessAnalysisEnum(),analyses),
++				md = checkfield(md,'fieldname','surfaceforcings.melt','size',[md.mesh.numberofvertices 1],'NaN',1);
++			end
++		end % }}}
++		function disp(obj) % {{{
++			disp(sprintf('   surface forcings parameters with melt (SMB=accumulation-evaporation-melt+refreeze) :'));
++			fielddisplay(obj,'accumulation','accumulated snow [m/yr ice eq]');
++			fielddisplay(obj,'evaporation','amount of ice lost to evaporative processes [m/yr ice eq]');
++			fielddisplay(obj,'melt','amount of ice melt in ice column [m/yr ice eq]');
++			fielddisplay(obj,'refreeze','amount of ice melt refrozen in ice column [m/yr ice eq]');
++		end % }}}
++		function marshall(obj,md,fid) % {{{
++
++			yts=365.0*24.0*3600.0;
++
++			WriteData(fid,'enum',SurfaceforcingsEnum(),'data',SMBmeltcomponentsEnum(),'format','Integer');
++			WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1);
++			WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1);
++			WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','melt','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1);
++			WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','refreeze','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1);
++		end % }}}
++	end
++end
+Index: ../trunk-jpl/src/m/classes/timestepping.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/timestepping.m	(revision 17999)
++++ ../trunk-jpl/src/m/classes/timestepping.m	(revision 18000)
+@@ -10,6 +10,7 @@
+ 		time_step       = 0.;
+ 		time_adapt      = 0;
+ 		cfl_coefficient = 0.;
++		interp_forcings = 1;
+ 	end
+ 	methods
+        function createxml(obj,fid) % {{{
+@@ -45,6 +46,9 @@
+ 			%time adaptation? 
+ 			obj.time_adapt=0;
+ 			obj.cfl_coefficient=0.5;
++
++			%should we interpolate forcings between timesteps?
++			obj.interp_forcings=1;
+ 		end % }}}
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
+@@ -53,6 +57,7 @@
+ 			md = checkfield(md,'fieldname','timestepping.time_step','numel',[1],'>=',0,'NaN',1);
+ 			md = checkfield(md,'fieldname','timestepping.time_adapt','numel',[1],'values',[0 1]);
+ 			md = checkfield(md,'fieldname','timestepping.cfl_coefficient','numel',[1],'>',0,'<=',1);
++			md = checkfield(md,'fieldname','timestepping.interp_forcings','numel',[1],'values',[0 1]);
+ 			if obj.final_time-obj.start_time<0,
+ 				md = checkmessage(md,'timestepping.final_time should be larger than timestepping.start_time');
+ 			end 
+@@ -65,6 +70,7 @@
+ 			fielddisplay(obj,'time_step','length of time steps [yr]');
+ 			fielddisplay(obj,'time_adapt','use cfl condition to define time step ? (0 or 1) ');
+ 			fielddisplay(obj,'cfl_coefficient','coefficient applied to cfl condition');
++			fielddisplay(obj,'interp_forcings','interpolate in time between requested forcing values ? (0 or 1)');
+ 
+ 		end % }}}
+ 		function marshall(obj,md,fid) % {{{
+@@ -76,6 +82,7 @@
+ 			WriteData(fid,'object',obj,'fieldname','time_step','format','Double','scale',yts);
+ 			WriteData(fid,'object',obj,'fieldname','time_adapt','format','Boolean');
+ 			WriteData(fid,'object',obj,'fieldname','cfl_coefficient','format','Double');
++			WriteData(fid,'object',obj,'fieldname','interp_forcings','format','Boolean');
+ 		end % }}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/SMBcomponents.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBcomponents.m	(revision 0)
++++ ../trunk-jpl/src/m/classes/SMBcomponents.m	(revision 18000)
+@@ -0,0 +1,80 @@
++%SMBcomponents Class definition
++%
++%   Usage:
++%      SMBcomponents=SMBcomponents();
++
++classdef SMBcomponents
++	properties (SetAccess=public) 
++		accumulation = NaN;
++		runoff = NaN;
++		evaporation = NaN;
++	end
++	methods
++		function obj = SMBcomponents(varargin) % {{{
++			switch nargin
++				case 0
++				otherwise
++					error('constructor not supported');
++			end
++		end % }}}
++		function self = extrude(self,md) % {{{
++
++			self.accumulation=project3d(md,'vector',self.accumulation,'type','node');
++			self.runoff=project3d(md,'vector',self.runoff,'type','node');
++			self.evaporation=project3d(md,'vector',self.evaporation,'type','node');
++
++		end % }}}
++		function self = initialize(self,md) % {{{
++
++			if isnan(self.accumulation)
++				self.accumulation=zeros(md.mesh.numberofvertices,1);
++				disp('      no surfaceforcings.accumulation specified: values set as zero');
++			end
++			if isnan(self.evaporation)
++				self.evaporation=zeros(md.mesh.numberofvertices,1);
++				disp('      no surfaceforcings.evaporation specified: values set as zero');
++			end
++			if isnan(self.runoff)
++				self.runoff=zeros(md.mesh.numberofvertices,1);
++				disp('      no surfaceforcings.runoff specified: values set as zero');
++			end
++
++		end % }}}
++		function md = checkconsistency(obj,md,solution,analyses) % {{{
++
++			if ismember(MasstransportAnalysisEnum(),analyses),
++				md = checkfield(md,'fieldname','surfaceforcings.accumulation','forcing',1,'NaN',1);
++			end
++			if ismember(BalancethicknessAnalysisEnum(),analyses),
++				md = checkfield(md,'fieldname','surfaceforcings.accumulation','size',[md.mesh.numberofvertices 1],'NaN',1);
++			end
++			if ismember(MasstransportAnalysisEnum(),analyses),
++				md = checkfield(md,'fieldname','surfaceforcings.runoff','forcing',1,'NaN',1);
++			end
++			if ismember(BalancethicknessAnalysisEnum(),analyses),
++				md = checkfield(md,'fieldname','surfaceforcings.runoff','size',[md.mesh.numberofvertices 1],'NaN',1);
++			end
++			if ismember(MasstransportAnalysisEnum(),analyses),
++				md = checkfield(md,'fieldname','surfaceforcings.evaporation','forcing',1,'NaN',1);
++			end
++			if ismember(BalancethicknessAnalysisEnum(),analyses),
++				md = checkfield(md,'fieldname','surfaceforcings.evaporation','size',[md.mesh.numberofvertices 1],'NaN',1);
++			end
++		end % }}}
++		function disp(obj) % {{{
++			disp(sprintf('   surface forcings parameters (SMB=accumulation-runoff-evaporation) :'));
++			fielddisplay(obj,'accumulation','accumulated snow [m/yr ice eq]');
++			fielddisplay(obj,'runoff','amount of ice melt lost from the ice column [m/yr ice eq]');
++			fielddisplay(obj,'evaporation','amount of ice lost to evaporative processes [m/yr ice eq]');
++		end % }}}
++		function marshall(obj,md,fid) % {{{
++
++			yts=365.0*24.0*3600.0;
++
++			WriteData(fid,'enum',SurfaceforcingsEnum(),'data',SMBcomponentsEnum(),'format','Integer');
++			WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1);
++			WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','runoff','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1);
++			WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1);
++		end % }}}
++	end
++end
+Index: ../trunk-jpl/src/m/enum/SurfaceforcingsEvaporationEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/SurfaceforcingsEvaporationEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/SurfaceforcingsEvaporationEnum.m	(revision 18000)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsEvaporationEnum()
++%SURFACEFORCINGSEVAPORATIONENUM - Enum of SurfaceforcingsEvaporation
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsEvaporationEnum()
++
++macro=StringToEnum('SurfaceforcingsEvaporation');
+Index: ../trunk-jpl/src/m/enum/SurfaceforcingsMeltEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/SurfaceforcingsMeltEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/SurfaceforcingsMeltEnum.m	(revision 18000)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsMeltEnum()
++%SURFACEFORCINGSMELTENUM - Enum of SurfaceforcingsMelt
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsMeltEnum()
++
++macro=StringToEnum('SurfaceforcingsMelt');
+Index: ../trunk-jpl/src/m/enum/SurfaceforcingsRunoffEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/SurfaceforcingsRunoffEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/SurfaceforcingsRunoffEnum.m	(revision 18000)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsRunoffEnum()
++%SURFACEFORCINGSRUNOFFENUM - Enum of SurfaceforcingsRunoff
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsRunoffEnum()
++
++macro=StringToEnum('SurfaceforcingsRunoff');
+Index: ../trunk-jpl/src/m/enum/SMBmeltcomponentsEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/SMBmeltcomponentsEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/SMBmeltcomponentsEnum.m	(revision 18000)
+@@ -0,0 +1,11 @@
++function macro=SMBmeltcomponentsEnum()
++%SMBMELTCOMPONENTSENUM - Enum of SMBmeltcomponents
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=SMBmeltcomponentsEnum()
++
++macro=StringToEnum('SMBmeltcomponents');
+Index: ../trunk-jpl/src/m/enum/SurfaceforcingsAccumulationEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/SurfaceforcingsAccumulationEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/SurfaceforcingsAccumulationEnum.m	(revision 18000)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsAccumulationEnum()
++%SURFACEFORCINGSACCUMULATIONENUM - Enum of SurfaceforcingsAccumulation
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsAccumulationEnum()
++
++macro=StringToEnum('SurfaceforcingsAccumulation');
+Index: ../trunk-jpl/src/m/enum/SMBcomponentsEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/SMBcomponentsEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/SMBcomponentsEnum.m	(revision 18000)
+@@ -0,0 +1,11 @@
++function macro=SMBcomponentsEnum()
++%SMBCOMPONENTSENUM - Enum of SMBcomponents
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=SMBcomponentsEnum()
++
++macro=StringToEnum('SMBcomponents');
+Index: ../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- ../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 17999)
++++ ../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 18000)
+@@ -321,6 +321,13 @@
+ def SurfaceforcingsBPosEnum(): return StringToEnum("SurfaceforcingsBPos")[0]
+ def SurfaceforcingsBNegEnum(): return StringToEnum("SurfaceforcingsBNeg")[0]
+ def SMBhenningEnum(): return StringToEnum("SMBhenning")[0]
++def SMBcomponentsEnum(): return StringToEnum("SMBcomponents")[0]
++def SurfaceforcingsAccumulationEnum(): return StringToEnum("SurfaceforcingsAccumulation")[0]
++def SurfaceforcingsEvaporationEnum(): return StringToEnum("SurfaceforcingsEvaporation")[0]
++def SurfaceforcingsRunoffEnum(): return StringToEnum("SurfaceforcingsRunoff")[0]
++def SMBmeltcomponentsEnum(): return StringToEnum("SMBmeltcomponents")[0]
++def SurfaceforcingsMeltEnum(): return StringToEnum("SurfaceforcingsMelt")[0]
++def SurfaceforcingsRefreezeEnum(): return StringToEnum("SurfaceforcingsRefreeze")[0]
+ def SurfaceforcingsIspddEnum(): return StringToEnum("SurfaceforcingsIspdd")[0]
+ def SurfaceforcingsIssmbgradientsEnum(): return StringToEnum("SurfaceforcingsIssmbgradients")[0]
+ def SolutionTypeEnum(): return StringToEnum("SolutionType")[0]
+Index: ../trunk-jpl/src/m/enum/SurfaceforcingsRefreezeEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/SurfaceforcingsRefreezeEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/SurfaceforcingsRefreezeEnum.m	(revision 18000)
+@@ -0,0 +1,11 @@
++function macro=SurfaceforcingsRefreezeEnum()
++%SURFACEFORCINGSREFREEZEENUM - Enum of SurfaceforcingsRefreeze
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=SurfaceforcingsRefreezeEnum()
++
++macro=StringToEnum('SurfaceforcingsRefreeze');
Index: /issm/oecreview/Archive/17984-18295/ISSM-18000-18001.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18000-18001.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18000-18001.diff	(revision 18296)
@@ -0,0 +1,569 @@
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 18000)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 18001)
+@@ -115,6 +115,17 @@
+ 		case SMBhenningEnum:
+ 			iomodel->FetchDataToInput(elements,SurfaceforcingsSmbrefEnum,0.);
+ 			break;
++		case SMBcomponentsEnum:
++			iomodel->FetchDataToInput(elements,SurfaceforcingsAccumulationEnum,0.);
++			iomodel->FetchDataToInput(elements,SurfaceforcingsEvaporationEnum,0.);
++			iomodel->FetchDataToInput(elements,SurfaceforcingsRunoffEnum,0.);
++			break;
++		case SMBmeltcomponentsEnum:
++			iomodel->FetchDataToInput(elements,SurfaceforcingsAccumulationEnum,0.);
++			iomodel->FetchDataToInput(elements,SurfaceforcingsEvaporationEnum,0.);
++			iomodel->FetchDataToInput(elements,SurfaceforcingsMeltEnum,0.);
++			iomodel->FetchDataToInput(elements,SurfaceforcingsRefreezeEnum,0.);
++			break;
+ 		default:
+ 			_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
+ 	}
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18000)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18001)
+@@ -323,6 +323,13 @@
+ 	SurfaceforcingsBPosEnum,
+ 	SurfaceforcingsBNegEnum,
+ 	SMBhenningEnum,
++	SMBcomponentsEnum,
++	SurfaceforcingsAccumulationEnum,
++	SurfaceforcingsEvaporationEnum,
++	SurfaceforcingsRunoffEnum,
++	SMBmeltcomponentsEnum,
++	SurfaceforcingsMeltEnum,
++	SurfaceforcingsRefreezeEnum,
+ 	/*TO BE REMOVED*/
+ 	SurfaceforcingsIspddEnum,
+ 	SurfaceforcingsIssmbgradientsEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18000)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18001)
+@@ -329,6 +329,13 @@
+ 		case SurfaceforcingsBPosEnum : return "SurfaceforcingsBPos";
+ 		case SurfaceforcingsBNegEnum : return "SurfaceforcingsBNeg";
+ 		case SMBhenningEnum : return "SMBhenning";
++		case SMBcomponentsEnum : return "SMBcomponents";
++		case SurfaceforcingsAccumulationEnum : return "SurfaceforcingsAccumulation";
++		case SurfaceforcingsEvaporationEnum : return "SurfaceforcingsEvaporation";
++		case SurfaceforcingsRunoffEnum : return "SurfaceforcingsRunoff";
++		case SMBmeltcomponentsEnum : return "SMBmeltcomponents";
++		case SurfaceforcingsMeltEnum : return "SurfaceforcingsMelt";
++		case SurfaceforcingsRefreezeEnum : return "SurfaceforcingsRefreeze";
+ 		case SurfaceforcingsIspddEnum : return "SurfaceforcingsIspdd";
+ 		case SurfaceforcingsIssmbgradientsEnum : return "SurfaceforcingsIssmbgradients";
+ 		case SolutionTypeEnum : return "SolutionType";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18000)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18001)
+@@ -335,6 +335,13 @@
+ 	      else if (strcmp(name,"SurfaceforcingsBPos")==0) return SurfaceforcingsBPosEnum;
+ 	      else if (strcmp(name,"SurfaceforcingsBNeg")==0) return SurfaceforcingsBNegEnum;
+ 	      else if (strcmp(name,"SMBhenning")==0) return SMBhenningEnum;
++	      else if (strcmp(name,"SMBcomponents")==0) return SMBcomponentsEnum;
++	      else if (strcmp(name,"SurfaceforcingsAccumulation")==0) return SurfaceforcingsAccumulationEnum;
++	      else if (strcmp(name,"SurfaceforcingsEvaporation")==0) return SurfaceforcingsEvaporationEnum;
++	      else if (strcmp(name,"SurfaceforcingsRunoff")==0) return SurfaceforcingsRunoffEnum;
++	      else if (strcmp(name,"SMBmeltcomponents")==0) return SMBmeltcomponentsEnum;
++	      else if (strcmp(name,"SurfaceforcingsMelt")==0) return SurfaceforcingsMeltEnum;
++	      else if (strcmp(name,"SurfaceforcingsRefreeze")==0) return SurfaceforcingsRefreezeEnum;
+ 	      else if (strcmp(name,"SurfaceforcingsIspdd")==0) return SurfaceforcingsIspddEnum;
+ 	      else if (strcmp(name,"SurfaceforcingsIssmbgradients")==0) return SurfaceforcingsIssmbgradientsEnum;
+ 	      else if (strcmp(name,"SolutionType")==0) return SolutionTypeEnum;
+@@ -375,17 +382,17 @@
+ 	      else if (strcmp(name,"FreeSurfaceBaseAnalysis")==0) return FreeSurfaceBaseAnalysisEnum;
+ 	      else if (strcmp(name,"FreeSurfaceTopAnalysis")==0) return FreeSurfaceTopAnalysisEnum;
+ 	      else if (strcmp(name,"SurfaceNormalVelocity")==0) return SurfaceNormalVelocityEnum;
+-	      else if (strcmp(name,"ExtrudeFromBaseAnalysis")==0) return ExtrudeFromBaseAnalysisEnum;
++         else stage=4;
++   }
++   if(stage==4){
++	      if (strcmp(name,"ExtrudeFromBaseAnalysis")==0) return ExtrudeFromBaseAnalysisEnum;
+ 	      else if (strcmp(name,"ExtrudeFromTopAnalysis")==0) return ExtrudeFromTopAnalysisEnum;
+ 	      else if (strcmp(name,"DepthAverageAnalysis")==0) return DepthAverageAnalysisEnum;
+ 	      else if (strcmp(name,"SteadystateSolution")==0) return SteadystateSolutionEnum;
+ 	      else if (strcmp(name,"SurfaceSlopeSolution")==0) return SurfaceSlopeSolutionEnum;
+ 	      else if (strcmp(name,"SmoothedSurfaceSlopeXAnalysis")==0) return SmoothedSurfaceSlopeXAnalysisEnum;
+ 	      else if (strcmp(name,"SmoothedSurfaceSlopeYAnalysis")==0) return SmoothedSurfaceSlopeYAnalysisEnum;
+-         else stage=4;
+-   }
+-   if(stage==4){
+-	      if (strcmp(name,"ThermalAnalysis")==0) return ThermalAnalysisEnum;
++	      else if (strcmp(name,"ThermalAnalysis")==0) return ThermalAnalysisEnum;
+ 	      else if (strcmp(name,"ThermalSolution")==0) return ThermalSolutionEnum;
+ 	      else if (strcmp(name,"TransientSolution")==0) return TransientSolutionEnum;
+ 	      else if (strcmp(name,"GiaSolution")==0) return GiaSolutionEnum;
+@@ -498,17 +505,17 @@
+ 	      else if (strcmp(name,"Misfit")==0) return MisfitEnum;
+ 	      else if (strcmp(name,"Pressure")==0) return PressureEnum;
+ 	      else if (strcmp(name,"PressurePicard")==0) return PressurePicardEnum;
+-	      else if (strcmp(name,"QmuPressure")==0) return QmuPressureEnum;
++         else stage=5;
++   }
++   if(stage==5){
++	      if (strcmp(name,"QmuPressure")==0) return QmuPressureEnum;
+ 	      else if (strcmp(name,"QmuVx")==0) return QmuVxEnum;
+ 	      else if (strcmp(name,"QmuVy")==0) return QmuVyEnum;
+ 	      else if (strcmp(name,"QmuVz")==0) return QmuVzEnum;
+ 	      else if (strcmp(name,"QmuThickness")==0) return QmuThicknessEnum;
+ 	      else if (strcmp(name,"QmuBase")==0) return QmuBaseEnum;
+ 	      else if (strcmp(name,"QmuSurface")==0) return QmuSurfaceEnum;
+-         else stage=5;
+-   }
+-   if(stage==5){
+-	      if (strcmp(name,"QmuMelting")==0) return QmuMeltingEnum;
++	      else if (strcmp(name,"QmuMelting")==0) return QmuMeltingEnum;
+ 	      else if (strcmp(name,"QmuVxMesh")==0) return QmuVxMeshEnum;
+ 	      else if (strcmp(name,"QmuVyMesh")==0) return QmuVyMeshEnum;
+ 	      else if (strcmp(name,"QmuVzMesh")==0) return QmuVzMeshEnum;
+@@ -621,17 +628,17 @@
+ 	      else if (strcmp(name,"MisfitObservation")==0) return MisfitObservationEnum;
+ 	      else if (strcmp(name,"MisfitObservationEnum")==0) return MisfitObservationEnumEnum;
+ 	      else if (strcmp(name,"MisfitTimeinterpolation")==0) return MisfitTimeinterpolationEnum;
+-	      else if (strcmp(name,"MisfitWeights")==0) return MisfitWeightsEnum;
++         else stage=6;
++   }
++   if(stage==6){
++	      if (strcmp(name,"MisfitWeights")==0) return MisfitWeightsEnum;
+ 	      else if (strcmp(name,"MisfitWeightsEnum")==0) return MisfitWeightsEnumEnum;
+ 	      else if (strcmp(name,"SurfaceObservation")==0) return SurfaceObservationEnum;
+ 	      else if (strcmp(name,"WeightsSurfaceObservation")==0) return WeightsSurfaceObservationEnum;
+ 	      else if (strcmp(name,"MinVel")==0) return MinVelEnum;
+ 	      else if (strcmp(name,"MaxVel")==0) return MaxVelEnum;
+ 	      else if (strcmp(name,"MinVx")==0) return MinVxEnum;
+-         else stage=6;
+-   }
+-   if(stage==6){
+-	      if (strcmp(name,"MaxVx")==0) return MaxVxEnum;
++	      else if (strcmp(name,"MaxVx")==0) return MaxVxEnum;
+ 	      else if (strcmp(name,"MaxAbsVx")==0) return MaxAbsVxEnum;
+ 	      else if (strcmp(name,"MinVy")==0) return MinVyEnum;
+ 	      else if (strcmp(name,"MaxVy")==0) return MaxVyEnum;
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 18000)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 18001)
+@@ -52,6 +52,7 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject(TimesteppingTimeAdaptEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(TimesteppingTimeStepEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(TimesteppingCflCoefficientEnum));
++	parameters->AddObject(iomodel->CopyConstantObject(TimesteppingInterpForcingsEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(SettingsLowmemEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(DebugProfilingEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(MeshAverageVertexConnectivityEnum));
+@@ -122,6 +123,12 @@
+ 		case SMBhenningEnum:
+ 			/*Nothing to add to parameters*/
+ 			break;
++		case SMBcomponentsEnum:
++			/*Nothing to add to parameters*/
++			break;
++		case SMBmeltcomponentsEnum:
++			/*Nothing to add to parameters*/
++			break;
+ 		default:
+ 			_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
+ 	}
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 18000)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h	(revision 18001)
+@@ -13,5 +13,7 @@
+ void Delta18oParameterizationx(FemModel* femmodel);
+ void PositiveDegreeDayx(FemModel* femmodel);
+ void SmbHenningx(FemModel* femmodel);
++void SmbComponentsx(FemModel* femmodel);
++void SmbMeltComponentsx(FemModel* femmodel);
+ 
+ #endif  /* _SurfaceMassBalancex_H*/
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 18000)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 18001)
+@@ -37,6 +37,14 @@
+ 			if(VerboseSolution())_printf_("  call smb Henning module\n");
+ 			SmbHenningx(femmodel);
+ 			break;
++		case SMBcomponentsEnum:
++			if(VerboseSolution())_printf_("  call smb Components module\n");
++			SmbComponentsx(femmodel);
++			break;
++		case SMBmeltcomponentsEnum:
++			if(VerboseSolution())_printf_("  call smb Melt Components module\n");
++			SmbMeltComponentsx(femmodel);
++			break;
+ 		default:
+ 			_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
+ 	}
+@@ -49,10 +57,58 @@
+ 	//    INPUT parameters: ni: working size of arrays
+ 	//    INPUT: surface elevation (m): hd(NA)
+ 	//    OUTPUT: mass-balance (m/yr ice): agd(NA)
++	int v;
++	IssmDouble rho_water;                   // density of fresh water
++	IssmDouble rho_ice;                     // density of ice
+ 
++	/*Loop over all the elements of this partition*/
+ 	for(int i=0;i<femmodel->elements->Size();i++){
+ 		Element* element=dynamic_cast<Element*>(femmodel->elements->GetObjectByOffset(i));
+-		element->SmbGradients();
++
++		/*Allocate all arrays*/
++		int         numvertices = element->GetNumberOfVertices();
++		IssmDouble* Href        = xNew<IssmDouble>(numvertices); // reference elevation from which deviations are used to calculate the SMB adjustment
++		IssmDouble* Smbref      = xNew<IssmDouble>(numvertices); // reference SMB to which deviations are added
++		IssmDouble* b_pos       = xNew<IssmDouble>(numvertices); // Hs-SMB relation parameter
++		IssmDouble* b_neg       = xNew<IssmDouble>(numvertices); // Hs-SMB relation paremeter
++		IssmDouble* h           = xNew<IssmDouble>(numvertices); // ice thickness (m)
++		IssmDouble* s           = xNew<IssmDouble>(numvertices); // surface elevation (m)
++		IssmDouble* smb         = xNew<IssmDouble>(numvertices);
++
++		/*Recover SmbGradients*/
++		element->GetInputListOnVertices(Href,SurfaceforcingsHrefEnum);
++		element->GetInputListOnVertices(Smbref,SurfaceforcingsSmbrefEnum);
++		element->GetInputListOnVertices(b_pos,SurfaceforcingsBPosEnum);
++		element->GetInputListOnVertices(b_neg,SurfaceforcingsBNegEnum);
++
++		/*Recover surface elevatio at vertices: */
++		element->GetInputListOnVertices(h,ThicknessEnum);
++		element->GetInputListOnVertices(s,SurfaceEnum);
++
++		/*Get material parameters :*/
++		rho_ice=element->matpar->GetRhoIce();
++		rho_water=element->matpar->GetRhoFreshwater();
++
++		// loop over all vertices
++		for(v=0;v<numvertices;v++){
++			if(Smbref[v]>0){
++				smb[v]=Smbref[v]+b_pos[v]*(s[v]-Href[v]);
++			}
++			else{
++				smb[v]=Smbref[v]+b_neg[v]*(s[v]-Href[v]);
++			}
++			smb[v]=smb[v]/rho_ice;      // SMB in m/y ice
++		}  //end of the loop over the vertices
++
++		/*Add input to element and Free memory*/
++		element->AddInput(SurfaceforcingsMassBalanceEnum,smb,P1Enum);
++		xDelete<IssmDouble>(Href);
++		xDelete<IssmDouble>(Smbref);
++		xDelete<IssmDouble>(b_pos);
++		xDelete<IssmDouble>(b_neg);
++		xDelete<IssmDouble>(h);
++		xDelete<IssmDouble>(s);
++		xDelete<IssmDouble>(smb);
+ 	}
+ 
+ }/*}}}*/
+@@ -226,3 +282,87 @@
+ 	}
+ 
+ }/*}}}*/
++void SmbComponentsx(FemModel* femmodel){/*{{{*/
++
++	// void SmbComponentsx(acc,evap,runoff,ni){
++	//    INPUT parameters: ni: working size of arrays
++	//    INPUT: surface accumulation (m/yr water equivalent): acc
++	//    surface evaporation (m/yr water equivalent): evap
++	//    surface runoff (m/yr water equivalent): runoff
++	//    OUTPUT: mass-balance (m/yr ice): agd(NA)
++	int v;
++
++	/*Loop over all the elements of this partition*/
++	for(int i=0;i<femmodel->elements->Size();i++){
++		Element* element=dynamic_cast<Element*>(femmodel->elements->GetObjectByOffset(i));
++
++		/*Allocate all arrays*/
++		int         numvertices = element->GetNumberOfVertices();
++		IssmDouble* acc         = xNew<IssmDouble>(numvertices); 
++		IssmDouble* evap        = xNew<IssmDouble>(numvertices);
++		IssmDouble* runoff      = xNew<IssmDouble>(numvertices); 
++		IssmDouble* smb         = xNew<IssmDouble>(numvertices);
++
++		/*Recover Smb Components*/
++		element->GetInputListOnVertices(acc,SurfaceforcingsAccumulationEnum);
++		element->GetInputListOnVertices(evap,SurfaceforcingsEvaporationEnum);
++		element->GetInputListOnVertices(runoff,SurfaceforcingsRunoffEnum);
++
++		// loop over all vertices
++		for(v=0;v<numvertices;v++){
++			smb[v]=acc[v]-evap[v]-runoff[v];
++		}  //end of the loop over the vertices
++
++		/*Add input to element and Free memory*/
++		element->AddInput(SurfaceforcingsMassBalanceEnum,smb,P1Enum);
++		xDelete<IssmDouble>(acc);
++		xDelete<IssmDouble>(evap);
++		xDelete<IssmDouble>(runoff);
++		xDelete<IssmDouble>(smb);
++	}
++
++}/*}}}*/
++void SmbMeltComponentsx(FemModel* femmodel){/*{{{*/
++
++	// void SmbMeltComponentsx(acc,evap,melt,refreeze,ni){
++	//    INPUT parameters: ni: working size of arrays
++	//    INPUT: surface accumulation (m/yr water equivalent): acc
++	//    surface evaporation (m/yr water equivalent): evap
++	//    surface melt (m/yr water equivalent): melt
++	//    refreeze of surface melt (m/yr water equivalent): refreeze
++	//    OUTPUT: mass-balance (m/yr ice): agd(NA)
++	int v;
++
++	/*Loop over all the elements of this partition*/
++	for(int i=0;i<femmodel->elements->Size();i++){
++		Element* element=dynamic_cast<Element*>(femmodel->elements->GetObjectByOffset(i));
++
++		/*Allocate all arrays*/
++		int         numvertices = element->GetNumberOfVertices();
++		IssmDouble* acc         = xNew<IssmDouble>(numvertices);
++		IssmDouble* evap        = xNew<IssmDouble>(numvertices); 
++		IssmDouble* melt        = xNew<IssmDouble>(numvertices);
++		IssmDouble* refreeze    = xNew<IssmDouble>(numvertices);
++		IssmDouble* smb         = xNew<IssmDouble>(numvertices);
++
++		/*Recover Smb Components*/
++		element->GetInputListOnVertices(acc,SurfaceforcingsAccumulationEnum);
++		element->GetInputListOnVertices(evap,SurfaceforcingsEvaporationEnum);
++		element->GetInputListOnVertices(melt,SurfaceforcingsMeltEnum);
++		element->GetInputListOnVertices(refreeze,SurfaceforcingsRefreezeEnum);
++
++		// loop over all vertices
++		for(v=0;v<numvertices;v++){
++			smb[v]=acc[v]-evap[v]-melt[v]+refreeze[v];
++		}  //end of the loop over the vertices
++
++		/*Add input to element and Free memory*/
++		element->AddInput(SurfaceforcingsMassBalanceEnum,smb,P1Enum);
++		xDelete<IssmDouble>(acc);
++		xDelete<IssmDouble>(evap);
++		xDelete<IssmDouble>(melt);
++		xDelete<IssmDouble>(refreeze);
++		xDelete<IssmDouble>(smb);
++	}
++
++}/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Materials/Matpar.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matpar.cpp	(revision 18000)
++++ ../trunk-jpl/src/c/classes/Materials/Matpar.cpp	(revision 18001)
+@@ -55,6 +55,12 @@
+ 		case SMBhenningEnum:
+ 			/*Nothing to add*/
+ 			break;
++		case SMBcomponentsEnum:
++			/*Nothing to add*/
++			break;
++		case SMBmeltcomponentsEnum:
++			/*Nothing to add*/
++			break;
+ 		default:
+ 			_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
+ 	}
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18000)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18001)
+@@ -227,7 +227,6 @@
+ 		virtual IssmDouble TimeAdapt()=0;
+ 		virtual void   PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm)=0;
+ 		virtual void   Delta18oParameterization(void)=0;
+-		virtual void   SmbGradients(void)=0;
+ 	   virtual Element*   SpawnBasalElement(void)=0;
+ 		virtual Element*   SpawnTopElement(void)=0;
+ 		virtual void   ReduceMatrices(ElementMatrix* Ke,ElementVector* pe)=0;
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18000)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18001)
+@@ -1718,51 +1718,6 @@
+ 	_error_("not implemented yet");
+ }
+ /*}}}*/
+-void       Tria::SmbGradients(void){/*{{{*/
+-
+-	int i;
+-
+-	// input
+-   IssmDouble h[NUMVERTICES];					// ice thickness (m)		
+-	IssmDouble s[NUMVERTICES];					// surface elevation (m)
+-	IssmDouble b_pos[NUMVERTICES];				// Hs-SMB relation parameter
+-	IssmDouble b_neg[NUMVERTICES];				// Hs-SMB relation paremeter
+-	IssmDouble Href[NUMVERTICES];					// reference elevation from which deviations are used to calculate the SMB adjustment
+-	IssmDouble Smbref[NUMVERTICES];				// reference SMB to which deviations are added
+-   IssmDouble rho_water;                   // density of fresh water
+-	IssmDouble rho_ice;                     // density of ice
+-
+-	// output
+-	IssmDouble smb[NUMVERTICES];					// surface mass balance (m/yr ice)
+-
+-	/*Recover SmbGradients*/
+-	GetInputListOnVertices(&Href[0],SurfaceforcingsHrefEnum);
+-	GetInputListOnVertices(&Smbref[0],SurfaceforcingsSmbrefEnum);
+-	GetInputListOnVertices(&b_pos[0],SurfaceforcingsBPosEnum);
+-	GetInputListOnVertices(&b_neg[0],SurfaceforcingsBNegEnum);
+-
+-   /*Recover surface elevatio at vertices: */
+-	GetInputListOnVertices(&h[0],ThicknessEnum);
+-	GetInputListOnVertices(&s[0],SurfaceEnum);
+-
+-   /*Get material parameters :*/
+-   rho_ice=matpar->GetRhoIce();
+-   rho_water=matpar->GetRhoFreshwater();
+-
+-   // loop over all vertices
+-   for(i=0;i<NUMVERTICES;i++){
+-     if(Smbref[i]>0){
+-		  smb[i]=Smbref[i]+b_pos[i]*(s[i]-Href[i]);
+-	  }
+-	  else{
+-		  smb[i]=Smbref[i]+b_neg[i]*(s[i]-Href[i]);
+-	  }
+-	  smb[i]=smb[i]/rho_ice;      // SMB in m/y ice		
+-		}  //end of the loop over the vertices
+-	  /*Update inputs*/
+-	  this->inputs->AddInput(new TriaInput(SurfaceforcingsMassBalanceEnum,&smb[0],P1Enum));
+-}
+-/*}}}*/
+ Seg*       Tria::SpawnSeg(int index1,int index2){/*{{{*/
+ 
+ 	int analysis_counter;
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18000)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18001)
+@@ -92,7 +92,6 @@
+ 		void        PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm);
+ 		void        ReduceMatrices(ElementMatrix* Ke,ElementVector* pe);
+ 		void        ResetFSBasalBoundaryCondition(void);
+-		void	      SmbGradients();
+ 	   Element*    SpawnBasalElement(void);
+ 		Element*    SpawnTopElement(void);
+ 		int         VelocityInterpolation();
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18000)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18001)
+@@ -2002,51 +2002,6 @@
+ 	return tria;
+ }
+ /*}}}*/
+-void       Penta::SmbGradients(void){/*{{{*/
+-
+-	int i;
+-
+-	// input
+-   IssmDouble h[NUMVERTICES];					// ice thickness (m)		
+-	IssmDouble s[NUMVERTICES];					// surface elevation (m)
+-	IssmDouble b_pos[NUMVERTICES];				// Hs-SMB relation parameter
+-	IssmDouble b_neg[NUMVERTICES];				// Hs-SMB relation paremeter
+-	IssmDouble Href[NUMVERTICES];					// reference elevation from which deviations are used to calculate the SMB adjustment
+-	IssmDouble Smbref[NUMVERTICES];				// reference SMB to which deviations are added
+-   IssmDouble rho_water;                   // density of fresh water
+-	IssmDouble rho_ice;                     // density of ice
+-
+-	// output
+-	IssmDouble smb[NUMVERTICES];					// surface mass balance (m/yr ice)
+-
+-	/*Recover SmbGradients*/
+-	GetInputListOnVertices(&Href[0],SurfaceforcingsHrefEnum);
+-	GetInputListOnVertices(&Smbref[0],SurfaceforcingsSmbrefEnum);
+-	GetInputListOnVertices(&b_pos[0],SurfaceforcingsBPosEnum);
+-	GetInputListOnVertices(&b_neg[0],SurfaceforcingsBNegEnum);
+-
+-   /*Recover surface elevatio at vertices: */
+-	GetInputListOnVertices(&h[0],ThicknessEnum);
+-	GetInputListOnVertices(&s[0],SurfaceEnum);
+-
+-   /*Get material parameters :*/
+-   rho_ice=matpar->GetRhoIce();
+-   rho_water=matpar->GetRhoFreshwater();
+-
+-   // loop over all vertices
+- for(i=0;i<NUMVERTICES;i++){
+-     if(Smbref[i]>0){
+-		  smb[i]=Smbref[i]+b_pos[i]*(s[i]-Href[i]);
+-	  }
+-	  else{
+-		  smb[i]=Smbref[i]+b_neg[i]*(s[i]-Href[i]);
+-	  }
+-	  smb[i]=smb[i]/rho_ice;      // SMB in m/y ice		
+-	}  //end of the loop over the vertices
+-	  /*Update inputs*/
+-	  this->inputs->AddInput(new PentaInput(SurfaceforcingsMassBalanceEnum,&smb[0],P1Enum));
+-}
+-/*}}}*/
+ IssmDouble Penta::SurfaceArea(void){/*{{{*/
+ 
+ 	int    approximation;
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 18000)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 18001)
+@@ -94,7 +94,6 @@
+ 		void   PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm);
+ 		void   ReduceMatrices(ElementMatrix* Ke,ElementVector* pe);
+ 		void   ResetFSBasalBoundaryCondition(void);
+-		void   SmbGradients();
+ 		void   SetTemporaryElementType(int element_type_in);
+ 	   Element* SpawnBasalElement(void);
+ 		Element* SpawnTopElement(void);
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 18000)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 18001)
+@@ -135,7 +135,6 @@
+ 		void        ResetFSBasalBoundaryCondition(void){_error_("not implemented yet");};
+ 		void        ReduceMatrices(ElementMatrix* Ke,ElementVector* pe){_error_("not implemented yet");};
+ 		void        SetTemporaryElementType(int element_type_in){_error_("not implemented yet");};
+-		void	      SmbGradients(){_error_("not implemented yet");};
+ 		IssmDouble  SurfaceArea(void){_error_("not implemented yet");};
+ 		void        Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type,int finitelement){_error_("not implemented yet");};
+ 		IssmDouble  TimeAdapt(){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 18000)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 18001)
+@@ -139,7 +139,6 @@
+ 		void        ResetFSBasalBoundaryCondition(void);
+ 		void        ReduceMatrices(ElementMatrix* Ke,ElementVector* pe);
+ 		void        SetTemporaryElementType(int element_type_in){_error_("not implemented yet");};
+-		void	      SmbGradients(){_error_("not implemented yet");};
+ 		IssmDouble  SurfaceArea(void){_error_("not implemented yet");};
+ 		void        Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type,int finitelement);
+ 		IssmDouble  TimeAdapt(){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 18000)
++++ ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 18001)
+@@ -519,7 +519,11 @@
+ 	IssmDouble alpha1,alpha2;
+ 	int        found;
+ 	int        offset;
++	bool       interp;
+ 
++	/*First, recover interp bool: */
++	this->parameters->FindParam(&interp,TimesteppingInterpForcingsEnum);
++
+ 	Input *input  = NULL;
+ 	Input *input1 = NULL;
+ 	Input *input2 = NULL;
+@@ -534,12 +538,12 @@
+ 		_assert_(intime<this->timesteps[0]);
+ 		input=(Input*)((Input*)this->inputs->GetObjectByOffset(0))->copy();
+ 	}
+-	else if(offset==(this->numtimesteps-1)){
++	else if(offset==(this->numtimesteps-1) || !interp){
+ 		/*get values for the last time: */
+ 		_assert_(intime>=this->timesteps[offset]);
+ 		input=(Input*)((Input*)this->inputs->GetObjectByOffset(offset))->copy();
+ 	}
+-	else{
++	else {
+ 		/*get values between two times [offset:offset+1[, Interpolate linearly*/
+ 		_assert_(intime>=this->timesteps[offset] && intime<this->timesteps[offset+1]);
+ 		deltat=this->timesteps[offset+1]-this->timesteps[offset];
Index: /issm/oecreview/Archive/17984-18295/ISSM-18001-18002.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18001-18002.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18001-18002.diff	(revision 18296)
@@ -0,0 +1,936 @@
+Index: ../trunk-jpl/test/NightlyRun/test337.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test337.py	(revision 0)
++++ ../trunk-jpl/test/NightlyRun/test337.py	(revision 18002)
+@@ -0,0 +1,76 @@
++import numpy
++from model import *
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from EnumDefinitions import *
++from solve import *
++from MatlabFuncs import *
++
++md=triangle(model(),'../Exp/Square.exp',150000.)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelf.py')
++md.extrude(3,1.)
++md=setflowequation(md,'HO','all')
++md.cluster=generic('name',oshostname(),'np',3)
++
++md.timestepping.time_step=1.
++md.settings.output_frequency=1
++md.timestepping.final_time=4.
++
++#Set up transient
++smb=numpy.ones((md.mesh.numberofvertices,1))*3.6
++smb=numpy.hstack((smb,smb*-1.))
++
++md.surfaceforcings=SMBcomponents();
++md.surfaceforcings.accumulation=numpy.vstack((smb*2, [1.5,3.]));
++md.surfaceforcings.runoff=numpy.vstack((smb/2, [1.5,3.]));
++md.surfaceforcings.evaporation=numpy.vstack((smb/2, [1.5,3.]));
++md.transient.isthermal=False
++
++md=solve(md,TransientSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SurfaceforcingsMassBalance1', \
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SurfaceforcingsMassBalance2', \
++	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SurfaceforcingsMassBalance3', \
++	'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SurfaceforcingsMassBalance4']
++field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
++field_values=[\
++	md.results.TransientSolution[0].Vx,\
++	md.results.TransientSolution[0].Vy,\
++	md.results.TransientSolution[0].Vel,\
++	md.results.TransientSolution[0].Pressure,\
++	md.results.TransientSolution[0].Base,\
++	md.results.TransientSolution[0].Surface,\
++	md.results.TransientSolution[0].Thickness,\
++	md.results.TransientSolution[0].SurfaceforcingsMassBalance,\
++	md.results.TransientSolution[1].Vx,\
++	md.results.TransientSolution[1].Vy,\
++	md.results.TransientSolution[1].Vel,\
++	md.results.TransientSolution[1].Pressure,\
++	md.results.TransientSolution[1].Base,\
++	md.results.TransientSolution[1].Surface,\
++	md.results.TransientSolution[1].Thickness,\
++	md.results.TransientSolution[1].SurfaceforcingsMassBalance,\
++	md.results.TransientSolution[2].Vx,\
++	md.results.TransientSolution[2].Vy,\
++	md.results.TransientSolution[2].Vel,\
++	md.results.TransientSolution[2].Pressure,\
++	md.results.TransientSolution[2].Base,\
++	md.results.TransientSolution[2].Surface,\
++	md.results.TransientSolution[2].Thickness,\
++	md.results.TransientSolution[2].SurfaceforcingsMassBalance,\
++	md.results.TransientSolution[3].Vx,\
++	md.results.TransientSolution[3].Vy,\
++	md.results.TransientSolution[3].Vel,\
++	md.results.TransientSolution[3].Pressure,\
++	md.results.TransientSolution[3].Base,\
++	md.results.TransientSolution[3].Surface,\
++	md.results.TransientSolution[3].Thickness,\
++	md.results.TransientSolution[3].SurfaceforcingsMassBalance,\
++	]
+Index: ../trunk-jpl/test/NightlyRun/test239.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test239.py	(revision 0)
++++ ../trunk-jpl/test/NightlyRun/test239.py	(revision 18002)
+@@ -0,0 +1,78 @@
++import numpy
++from model import *
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from EnumDefinitions import *
++from solve import *
++from MatlabFuncs import *
++
++md=triangle(model(),'../Exp/Square.exp',350000.)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelf.py')
++md.extrude(3,1.)
++md=setflowequation(md,'HO','all')
++md.cluster=generic('name',oshostname(),'np',3)
++
++md.timestepping.time_step=1.
++md.settings.output_frequency=1
++md.timestepping.final_time=4.
++md.timestepping.interp_forcings=False
++
++#Set up transient
++smb=numpy.ones((md.mesh.numberofvertices,1))*3.6
++smb=numpy.hstack((smb,smb*-1.))
++
++md.surfaceforcings.mass_balance=numpy.vstack((smb,[1.5,3.]))
++md.transient.isthermal=False
++
++md=solve(md,TransientSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SurfaceforcingsMassBalance1', \
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SurfaceforcingsMassBalance2', \
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SurfaceforcingsMassBalance3', \
++	'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SurfaceforcingsMassbalance4']
++field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
++	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
++	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
++	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
++field_values=[\
++	md.results.TransientSolution[0].Vx,\
++	md.results.TransientSolution[0].Vy,\
++	md.results.TransientSolution[0].Vz,\
++	md.results.TransientSolution[0].Vel,\
++	md.results.TransientSolution[0].Pressure,\
++	md.results.TransientSolution[0].Base,\
++	md.results.TransientSolution[0].Surface,\
++	md.results.TransientSolution[0].Thickness,\
++	md.results.TransientSolution[0].SurfaceforcingsMassBalance,\
++	md.results.TransientSolution[1].Vx,\
++	md.results.TransientSolution[1].Vy,\
++	md.results.TransientSolution[1].Vz,\
++	md.results.TransientSolution[1].Vel,\
++	md.results.TransientSolution[1].Pressure,\
++	md.results.TransientSolution[1].Base,\
++	md.results.TransientSolution[1].Surface,\
++	md.results.TransientSolution[1].Thickness,\
++	md.results.TransientSolution[1].SurfaceforcingsMassBalance,\
++	md.results.TransientSolution[2].Vx,\
++	md.results.TransientSolution[2].Vy,\
++	md.results.TransientSolution[2].Vz,\
++	md.results.TransientSolution[2].Vel,\
++	md.results.TransientSolution[2].Pressure,\
++	md.results.TransientSolution[2].Base,\
++	md.results.TransientSolution[2].Surface,\
++	md.results.TransientSolution[2].Thickness,\
++	md.results.TransientSolution[2].SurfaceforcingsMassBalance,\
++	md.results.TransientSolution[3].Vx,\
++	md.results.TransientSolution[3].Vy,\
++	md.results.TransientSolution[3].Vz,\
++	md.results.TransientSolution[3].Vel,\
++	md.results.TransientSolution[3].Pressure,\
++	md.results.TransientSolution[3].Base,\
++	md.results.TransientSolution[3].Surface,\
++	md.results.TransientSolution[3].Thickness,\
++	md.results.TransientSolution[3].SurfaceforcingsMassBalance,\
++	]
+Index: ../trunk-jpl/test/NightlyRun/test337.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test337.m	(revision 0)
++++ ../trunk-jpl/test/NightlyRun/test337.m	(revision 18002)
+@@ -0,0 +1,66 @@
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=extrude(md,3,1.);
++md=setflowequation(md,'HO','all');
++md.cluster=generic('name',oshostname(),'np',3);
++
++md.timestepping.time_step=1.;
++md.settings.output_frequency=1;
++md.timestepping.final_time=4.;
++
++%Set up transient
++smb=ones(md.mesh.numberofvertices,1)*3.6;
++smb=[ smb smb*-1. ];
++
++md.surfaceforcings=SMBcomponents();
++md.surfaceforcings.accumulation=[smb*2; [1.5 3.]];
++md.surfaceforcings.runoff=[smb/2; [1.5 3.]];
++md.surfaceforcings.evaporation=[smb/2; [1.5 3.]];
++md.transient.isthermal=0;
++
++md=solve(md,TransientSolutionEnum());
++
++%Fields and tolerances to track changes
++field_names={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SurfaceforcingsMassBalance1', ...
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SurfaceforcingsMassBalance2', ...
++	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SurfaceforcingsMassBalance3', ...
++	'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SurfaceforcingsMassBalance4'};
++field_tolerances={1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(4).Vx),...
++	(md.results.TransientSolution(4).Vy),...
++	(md.results.TransientSolution(4).Vel),...
++	(md.results.TransientSolution(4).Pressure),...
++	(md.results.TransientSolution(4).Base),...
++	(md.results.TransientSolution(4).Surface),...
++	(md.results.TransientSolution(4).Thickness),...
++	(md.results.TransientSolution(4).SurfaceforcingsMassBalance),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test239.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test239.m	(revision 0)
++++ ../trunk-jpl/test/NightlyRun/test239.m	(revision 18002)
+@@ -0,0 +1,69 @@
++md=triangle(model(),'../Exp/Square.exp',350000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=extrude(md,3,1.);
++md=setflowequation(md,'HO','all');
++md.cluster=generic('name',oshostname(),'np',3);
++
++md.timestepping.time_step=1;
++md.settings.output_frequency=1;
++md.timestepping.final_time=4;
++md.timestepping.interp_forcings=0;
++
++%Set up transient
++smb=ones(md.mesh.numberofvertices,1)*3.6;
++smb=[ smb smb*-1. ];
++
++md.surfaceforcings.mass_balance=smb;
++md.surfaceforcings.mass_balance(end+1,:)=[1.5 3.];
++md.transient.isthermal=0;
++
++md=solve(md,TransientSolutionEnum());
++
++%Fields and tolerances to track changes
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SurfaceforcingsMassBalance1', ...
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SurfaceforcingsMassBalance2', ...
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SurfaceforcingsMassBalance3', ...
++	'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SurfaceforcingsMassbalance4'};
++field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-13,...
++	1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-13,...
++	1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-13,...
++	1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-13};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vz),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vz),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vz),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(4).Vx),...
++	(md.results.TransientSolution(4).Vy),...
++	(md.results.TransientSolution(4).Vz),...
++	(md.results.TransientSolution(4).Vel),...
++	(md.results.TransientSolution(4).Pressure),...
++	(md.results.TransientSolution(4).Base),...
++	(md.results.TransientSolution(4).Surface),...
++	(md.results.TransientSolution(4).Thickness),...
++	(md.results.TransientSolution(4).SurfaceforcingsMassBalance),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test338.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test338.py	(revision 0)
++++ ../trunk-jpl/test/NightlyRun/test338.py	(revision 18002)
+@@ -0,0 +1,76 @@
++import numpy
++from model import *
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from EnumDefinitions import *
++from solve import *
++from MatlabFuncs import *
++
++md=triangle(model(),'../Exp/Square.exp',150000.)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelf.py')
++md=setflowequation(md,'SSA','all')
++md.cluster=generic('name',oshostname(),'np',3)
++
++md.timestepping.time_step=1.
++md.settings.output_frequency=1
++md.timestepping.final_time=4.
++
++#Set up transient
++smb=numpy.ones((md.mesh.numberofvertices,1))*3.6
++smb=numpy.hstack((smb,smb*-1.))
++
++md.surfaceforcings=SMBmeltcomponents();
++md.surfaceforcings.accumulation=numpy.vstack((smb, [1.5,3.]));
++md.surfaceforcings.evaporation=numpy.vstack((smb/2, [1.5,3.]));
++md.surfaceforcings.melt=numpy.vstack((smb/2, [1.5,3.]));
++md.surfaceforcings.refreeze=numpy.vstack((smb, [1.5,3.]));
++md.transient.isthermal=False
++
++md=solve(md,TransientSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SurfaceforcingsMassBalance1', \
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SurfaceforcingsMassBalance2', \
++	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SurfaceforcingsMassBalance3', \
++	'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SurfaceforcingsMassBalance4']
++field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
++field_values=[\
++	md.results.TransientSolution[0].Vx,\
++	md.results.TransientSolution[0].Vy,\
++	md.results.TransientSolution[0].Vel,\
++	md.results.TransientSolution[0].Pressure,\
++	md.results.TransientSolution[0].Base,\
++	md.results.TransientSolution[0].Surface,\
++	md.results.TransientSolution[0].Thickness,\
++	md.results.TransientSolution[0].SurfaceforcingsMassBalance,\
++	md.results.TransientSolution[1].Vx,\
++	md.results.TransientSolution[1].Vy,\
++	md.results.TransientSolution[1].Vel,\
++	md.results.TransientSolution[1].Pressure,\
++	md.results.TransientSolution[1].Base,\
++	md.results.TransientSolution[1].Surface,\
++	md.results.TransientSolution[1].Thickness,\
++	md.results.TransientSolution[1].SurfaceforcingsMassBalance,\
++	md.results.TransientSolution[2].Vx,\
++	md.results.TransientSolution[2].Vy,\
++	md.results.TransientSolution[2].Vel,\
++	md.results.TransientSolution[2].Pressure,\
++	md.results.TransientSolution[2].Base,\
++	md.results.TransientSolution[2].Surface,\
++	md.results.TransientSolution[2].Thickness,\
++	md.results.TransientSolution[2].SurfaceforcingsMassBalance,\
++	md.results.TransientSolution[3].Vx,\
++	md.results.TransientSolution[3].Vy,\
++	md.results.TransientSolution[3].Vel,\
++	md.results.TransientSolution[3].Pressure,\
++	md.results.TransientSolution[3].Base,\
++	md.results.TransientSolution[3].Surface,\
++	md.results.TransientSolution[3].Thickness,\
++	md.results.TransientSolution[3].SurfaceforcingsMassBalance,\
++	]
+Index: ../trunk-jpl/test/NightlyRun/test338.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test338.m	(revision 0)
++++ ../trunk-jpl/test/NightlyRun/test338.m	(revision 18002)
+@@ -0,0 +1,66 @@
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=setflowequation(md,'SSA','all');
++md.cluster=generic('name',oshostname(),'np',3);
++
++md.timestepping.time_step=1.;
++md.settings.output_frequency=1;
++md.timestepping.final_time=4.;
++
++%Set up transient
++smb=ones(md.mesh.numberofvertices,1)*3.6;
++smb=[ smb smb*-1. ];
++
++md.surfaceforcings=SMBmeltcomponents();
++md.surfaceforcings.accumulation=[smb; [1.5 3.]];
++md.surfaceforcings.melt=[smb/2; [1.5 3.]];
++md.surfaceforcings.refreeze=[smb; [1.5 3.]];
++md.surfaceforcings.evaporation=[smb/2; [1.5 3.]];
++md.transient.isthermal=0;
++
++md=solve(md,TransientSolutionEnum());
++
++%Fields and tolerances to track changes
++field_names={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SurfaceforcingsMassBalance1', ...
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SurfaceforcingsMassBalance2', ...
++	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SurfaceforcingsMassBalance3', ...
++	'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SurfaceforcingsMassBalance4'};
++field_tolerances={1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(4).Vx),...
++	(md.results.TransientSolution(4).Vy),...
++	(md.results.TransientSolution(4).Vel),...
++	(md.results.TransientSolution(4).Pressure),...
++	(md.results.TransientSolution(4).Base),...
++	(md.results.TransientSolution(4).Surface),...
++	(md.results.TransientSolution(4).Thickness),...
++	(md.results.TransientSolution(4).SurfaceforcingsMassBalance),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test339.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test339.m	(revision 0)
++++ ../trunk-jpl/test/NightlyRun/test339.m	(revision 18002)
+@@ -0,0 +1,67 @@
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=extrude(md,3,1.);
++md=setflowequation(md,'HO','all');
++md.cluster=generic('name',oshostname(),'np',3);
++
++md.timestepping.time_step=1.;
++md.settings.output_frequency=1;
++md.timestepping.final_time=4.;
++
++%Set up transient
++smb=ones(md.mesh.numberofvertices,1)*3.6;
++smb=[ smb smb*-1. ];
++
++md.surfaceforcings=SMBmeltcomponents();
++md.surfaceforcings.accumulation=[smb; [1.5 3.]];
++md.surfaceforcings.melt=[smb/2; [1.5 3.]];
++md.surfaceforcings.refreeze=[smb; [1.5 3.]];
++md.surfaceforcings.evaporation=[smb/2; [1.5 3.]];
++md.transient.isthermal=0;
++
++md=solve(md,TransientSolutionEnum());
++
++%Fields and tolerances to track changes
++field_names={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SurfaceforcingsMassBalance1', ...
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SurfaceforcingsMassBalance2', ...
++	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SurfaceforcingsMassBalance3', ...
++	'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SurfaceforcingsMassBalance4'};
++field_tolerances={1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(4).Vx),...
++	(md.results.TransientSolution(4).Vy),...
++	(md.results.TransientSolution(4).Vel),...
++	(md.results.TransientSolution(4).Pressure),...
++	(md.results.TransientSolution(4).Base),...
++	(md.results.TransientSolution(4).Surface),...
++	(md.results.TransientSolution(4).Thickness),...
++	(md.results.TransientSolution(4).SurfaceforcingsMassBalance),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test339.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test339.py	(revision 0)
++++ ../trunk-jpl/test/NightlyRun/test339.py	(revision 18002)
+@@ -0,0 +1,77 @@
++import numpy
++from model import *
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from EnumDefinitions import *
++from solve import *
++from MatlabFuncs import *
++
++md=triangle(model(),'../Exp/Square.exp',150000.)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelf.py')
++md.extrude(3,1.)
++md=setflowequation(md,'HO','all')
++md.cluster=generic('name',oshostname(),'np',3)
++
++md.timestepping.time_step=1.
++md.settings.output_frequency=1
++md.timestepping.final_time=4.
++
++#Set up transient
++smb=numpy.ones((md.mesh.numberofvertices,1))*3.6
++smb=numpy.hstack((smb,smb*-1.))
++
++md.surfaceforcings=SMBmeltcomponents();
++md.surfaceforcings.accumulation=numpy.vstack((smb, [1.5,3.]));
++md.surfaceforcings.evaporation=numpy.vstack((smb/2, [1.5,3.]));
++md.surfaceforcings.melt=numpy.vstack((smb/2, [1.5,3.]));
++md.surfaceforcings.refreeze=numpy.vstack((smb, [1.5,3.]));
++md.transient.isthermal=False
++
++md=solve(md,TransientSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SurfaceforcingsMassBalance1', \
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SurfaceforcingsMassBalance2', \
++	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SurfaceforcingsMassBalance3', \
++	'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SurfaceforcingsMassBalance4']
++field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
++field_values=[\
++	md.results.TransientSolution[0].Vx,\
++	md.results.TransientSolution[0].Vy,\
++	md.results.TransientSolution[0].Vel,\
++	md.results.TransientSolution[0].Pressure,\
++	md.results.TransientSolution[0].Base,\
++	md.results.TransientSolution[0].Surface,\
++	md.results.TransientSolution[0].Thickness,\
++	md.results.TransientSolution[0].SurfaceforcingsMassBalance,\
++	md.results.TransientSolution[1].Vx,\
++	md.results.TransientSolution[1].Vy,\
++	md.results.TransientSolution[1].Vel,\
++	md.results.TransientSolution[1].Pressure,\
++	md.results.TransientSolution[1].Base,\
++	md.results.TransientSolution[1].Surface,\
++	md.results.TransientSolution[1].Thickness,\
++	md.results.TransientSolution[1].SurfaceforcingsMassBalance,\
++	md.results.TransientSolution[2].Vx,\
++	md.results.TransientSolution[2].Vy,\
++	md.results.TransientSolution[2].Vel,\
++	md.results.TransientSolution[2].Pressure,\
++	md.results.TransientSolution[2].Base,\
++	md.results.TransientSolution[2].Surface,\
++	md.results.TransientSolution[2].Thickness,\
++	md.results.TransientSolution[2].SurfaceforcingsMassBalance,\
++	md.results.TransientSolution[3].Vx,\
++	md.results.TransientSolution[3].Vy,\
++	md.results.TransientSolution[3].Vel,\
++	md.results.TransientSolution[3].Pressure,\
++	md.results.TransientSolution[3].Base,\
++	md.results.TransientSolution[3].Surface,\
++	md.results.TransientSolution[3].Thickness,\
++	md.results.TransientSolution[3].SurfaceforcingsMassBalance,\
++	]
+Index: ../trunk-jpl/test/NightlyRun/IdToName.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/IdToName.m	(revision 18001)
++++ ../trunk-jpl/test/NightlyRun/IdToName.m	(revision 18002)
+@@ -66,6 +66,8 @@
+ 	case 235, name='SquareShelfTranForceNeg2dDakotaLocal';
+ 	case 236, name='SquareShelfTranIspddIsdeltaSSA2d';
+ 	case 237, name='SquareShelfTranIspddIsdeltaSSA3d';
++	case 238, name='SquareShelfTranForceNoInterp2d';
++	case 239, name='SquareShelfTranForceNoInterp3d';
+ 	case 270, name='SquareShelfStressSSA2dDamage';
+ 	case 271, name='SquareShelfStressSSA2dDamageTran';
+ 	case 272, name='SquareShelfCMZSSA2dDamage';
+@@ -108,6 +110,10 @@
+ 	case 333, name='SquareSheetHydrologyDCTwoLayers';
+ 	case 334, name='SquareSheetConstrainedExtrudedHydrologyDC';
+ 	case 335, name='SquareSheetExtrudedHydrologyDCTwoLayers';
++	case 336, name='SquareSheetConstrainedSmbComponents2d';
++	case 337, name='SquareSheetConstrainedSmbComponents3d';
++	case 338, name='SquareSheetConstrainedSmbMeltComponents2d';
++	case 339, name='SquareSheetConstrainedSmbMeltComponents3d';
+ 	case 401, name='SquareSheetShelfStressSSA2d';
+ 	case 402, name='SquareSheetShelfStressSSA3d';
+ 	case 403, name='SquareSheetShelfStressHO';
+Index: ../trunk-jpl/test/NightlyRun/test336.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test336.py	(revision 0)
++++ ../trunk-jpl/test/NightlyRun/test336.py	(revision 18002)
+@@ -0,0 +1,75 @@
++import numpy
++from model import *
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from EnumDefinitions import *
++from solve import *
++from MatlabFuncs import *
++
++md=triangle(model(),'../Exp/Square.exp',150000.)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelf.py')
++md=setflowequation(md,'SSA','all')
++md.cluster=generic('name',oshostname(),'np',3)
++
++md.timestepping.time_step=1.
++md.settings.output_frequency=1
++md.timestepping.final_time=4.
++
++#Set up transient
++smb=numpy.ones((md.mesh.numberofvertices,1))*3.6
++smb=numpy.hstack((smb,smb*-1.))
++
++md.surfaceforcings=SMBcomponents();
++md.surfaceforcings.accumulation=numpy.vstack((smb*2, [1.5,3.]));
++md.surfaceforcings.runoff=numpy.vstack((smb/2, [1.5,3.]));
++md.surfaceforcings.evaporation=numpy.vstack((smb/2, [1.5,3.]));
++md.transient.isthermal=False
++
++md=solve(md,TransientSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SurfaceforcingsMassBalance1', \
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SurfaceforcingsMassBalance2', \
++	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SurfaceforcingsMassBalance3', \
++	'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SurfaceforcingsMassBalance4']
++field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
++field_values=[\
++	md.results.TransientSolution[0].Vx,\
++	md.results.TransientSolution[0].Vy,\
++	md.results.TransientSolution[0].Vel,\
++	md.results.TransientSolution[0].Pressure,\
++	md.results.TransientSolution[0].Base,\
++	md.results.TransientSolution[0].Surface,\
++	md.results.TransientSolution[0].Thickness,\
++	md.results.TransientSolution[0].SurfaceforcingsMassBalance,\
++	md.results.TransientSolution[1].Vx,\
++	md.results.TransientSolution[1].Vy,\
++	md.results.TransientSolution[1].Vel,\
++	md.results.TransientSolution[1].Pressure,\
++	md.results.TransientSolution[1].Base,\
++	md.results.TransientSolution[1].Surface,\
++	md.results.TransientSolution[1].Thickness,\
++	md.results.TransientSolution[1].SurfaceforcingsMassBalance,\
++	md.results.TransientSolution[2].Vx,\
++	md.results.TransientSolution[2].Vy,\
++	md.results.TransientSolution[2].Vel,\
++	md.results.TransientSolution[2].Pressure,\
++	md.results.TransientSolution[2].Base,\
++	md.results.TransientSolution[2].Surface,\
++	md.results.TransientSolution[2].Thickness,\
++	md.results.TransientSolution[2].SurfaceforcingsMassBalance,\
++	md.results.TransientSolution[3].Vx,\
++	md.results.TransientSolution[3].Vy,\
++	md.results.TransientSolution[3].Vel,\
++	md.results.TransientSolution[3].Pressure,\
++	md.results.TransientSolution[3].Base,\
++	md.results.TransientSolution[3].Surface,\
++	md.results.TransientSolution[3].Thickness,\
++	md.results.TransientSolution[3].SurfaceforcingsMassBalance,\
++	]
+Index: ../trunk-jpl/test/NightlyRun/test238.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test238.py	(revision 0)
++++ ../trunk-jpl/test/NightlyRun/test238.py	(revision 18002)
+@@ -0,0 +1,73 @@
++import numpy
++from model import *
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from EnumDefinitions import *
++from solve import *
++from MatlabFuncs import *
++
++md=triangle(model(),'../Exp/Square.exp',150000.)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelf.py')
++md=setflowequation(md,'SSA','all')
++md.cluster=generic('name',oshostname(),'np',3)
++
++md.timestepping.time_step=1.
++md.settings.output_frequency=1
++md.timestepping.final_time=4.
++md.timestepping.interp_forcings=False
++
++#Set up transient
++smb=numpy.ones((md.mesh.numberofvertices,1))*3.6
++smb=numpy.hstack((smb,smb*-1.))
++
++md.surfaceforcings.mass_balance=numpy.vstack((smb,[1.5,3.]))
++md.transient.isthermal=False
++
++md=solve(md,TransientSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names=['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SurfaceforcingsMassBalance1', \
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SurfaceforcingsMassBalance2', \
++	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SurfaceforcingsMassBalance3', \
++	'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SurfaceforcingsMassBalance4']
++field_tolerances=[1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
++field_values=[\
++	md.results.TransientSolution[0].Vx,\
++	md.results.TransientSolution[0].Vy,\
++	md.results.TransientSolution[0].Vel,\
++	md.results.TransientSolution[0].Pressure,\
++	md.results.TransientSolution[0].Base,\
++	md.results.TransientSolution[0].Surface,\
++	md.results.TransientSolution[0].Thickness,\
++	md.results.TransientSolution[0].SurfaceforcingsMassBalance,\
++	md.results.TransientSolution[1].Vx,\
++	md.results.TransientSolution[1].Vy,\
++	md.results.TransientSolution[1].Vel,\
++	md.results.TransientSolution[1].Pressure,\
++	md.results.TransientSolution[1].Base,\
++	md.results.TransientSolution[1].Surface,\
++	md.results.TransientSolution[1].Thickness,\
++	md.results.TransientSolution[1].SurfaceforcingsMassBalance,\
++	md.results.TransientSolution[2].Vx,\
++	md.results.TransientSolution[2].Vy,\
++	md.results.TransientSolution[2].Vel,\
++	md.results.TransientSolution[2].Pressure,\
++	md.results.TransientSolution[2].Base,\
++	md.results.TransientSolution[2].Surface,\
++	md.results.TransientSolution[2].Thickness,\
++	md.results.TransientSolution[2].SurfaceforcingsMassBalance,\
++	md.results.TransientSolution[3].Vx,\
++	md.results.TransientSolution[3].Vy,\
++	md.results.TransientSolution[3].Vel,\
++	md.results.TransientSolution[3].Pressure,\
++	md.results.TransientSolution[3].Base,\
++	md.results.TransientSolution[3].Surface,\
++	md.results.TransientSolution[3].Thickness,\
++	md.results.TransientSolution[3].SurfaceforcingsMassBalance,\
++	]
+Index: ../trunk-jpl/test/NightlyRun/test336.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test336.m	(revision 0)
++++ ../trunk-jpl/test/NightlyRun/test336.m	(revision 18002)
+@@ -0,0 +1,65 @@
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=setflowequation(md,'SSA','all');
++md.cluster=generic('name',oshostname(),'np',3);
++
++md.timestepping.time_step=1.;
++md.settings.output_frequency=1;
++md.timestepping.final_time=4.;
++
++%Set up transient
++smb=ones(md.mesh.numberofvertices,1)*3.6;
++smb=[ smb smb*-1. ];
++
++md.surfaceforcings=SMBcomponents();
++md.surfaceforcings.accumulation=[smb*2; [1.5 3.]];
++md.surfaceforcings.runoff=[smb/2; [1.5 3.]];
++md.surfaceforcings.evaporation=[smb/2; [1.5 3.]];
++md.transient.isthermal=0;
++
++md=solve(md,TransientSolutionEnum());
++
++%Fields and tolerances to track changes
++field_names={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SurfaceforcingsMassBalance1', ...
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SurfaceforcingsMassBalance2', ...
++	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SurfaceforcingsMassBalance3', ...
++	'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SurfaceforcingsMassBalance4'};
++field_tolerances={1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(4).Vx),...
++	(md.results.TransientSolution(4).Vy),...
++	(md.results.TransientSolution(4).Vel),...
++	(md.results.TransientSolution(4).Pressure),...
++	(md.results.TransientSolution(4).Base),...
++	(md.results.TransientSolution(4).Surface),...
++	(md.results.TransientSolution(4).Thickness),...
++	(md.results.TransientSolution(4).SurfaceforcingsMassBalance),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/test238.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test238.m	(revision 0)
++++ ../trunk-jpl/test/NightlyRun/test238.m	(revision 18002)
+@@ -0,0 +1,64 @@
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=setflowequation(md,'SSA','all');
++md.cluster=generic('name',oshostname(),'np',3);
++
++md.timestepping.time_step=1.;
++md.settings.output_frequency=1;
++md.timestepping.final_time=4.;
++md.timestepping.interp_forcings=0;
++
++%Set up transient
++smb=ones(md.mesh.numberofvertices,1)*3.6;
++smb=[ smb smb*-1. ];
++
++md.surfaceforcings.mass_balance=smb;
++md.surfaceforcings.mass_balance(end+1,:)=[1.5 3.];
++md.transient.isthermal=0;
++
++md=solve(md,TransientSolutionEnum());
++
++%Fields and tolerances to track changes
++field_names={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SurfaceforcingsMassBalance1', ...
++	'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SurfaceforcingsMassBalance2', ...
++	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SurfaceforcingsMassBalance3', ...
++	'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SurfaceforcingsMassBalance4'};
++field_tolerances={1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(1).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(2).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
++	(md.results.TransientSolution(4).Vx),...
++	(md.results.TransientSolution(4).Vy),...
++	(md.results.TransientSolution(4).Vel),...
++	(md.results.TransientSolution(4).Pressure),...
++	(md.results.TransientSolution(4).Base),...
++	(md.results.TransientSolution(4).Surface),...
++	(md.results.TransientSolution(4).Thickness),...
++	(md.results.TransientSolution(4).SurfaceforcingsMassBalance),...
++	};
Index: /issm/oecreview/Archive/17984-18295/ISSM-18002-18003.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18002-18003.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18002-18003.diff	(revision 18296)
@@ -0,0 +1,450 @@
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 18002)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 18003)
+@@ -37,102 +37,72 @@
+ }/*}}}*/
+ ElementMatrix* AdjointBalancethickness2Analysis::CreateKMatrix(Element* element){/*{{{*/
+ 
+-	_error_("not implemented");
+ 	Balancethickness2Analysis* analysis = new Balancethickness2Analysis();
+ 	ElementMatrix* Ke = analysis->CreateKMatrix(element);
+ 	delete analysis;
+ 
+-	/*Transpose and return Ke*/
+-	Ke->Transpose();
+ 	return Ke;
+ }/*}}}*/
+ ElementVector* AdjointBalancethickness2Analysis::CreatePVector(Element* element){/*{{{*/
+ 
+-	_error_("not implemented");
+-	/*Intermediaries*/
+-	int      domaintype;
+-	Element* basalelement;
+-
+-	/*Get basal element*/
+-	element->FindParam(&domaintype,DomainTypeEnum);
+-	switch(domaintype){
+-		case Domain2DhorizontalEnum:
+-			basalelement = element;
+-			break;
+-		case Domain3DEnum:
+-			if(!element->IsOnBase()) return NULL;
+-			basalelement = element->SpawnBasalElement();
+-			break;
+-		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+-	}
+-
+ 	/*Intermediaries */
+ 	int         num_responses,i;
+-	IssmDouble  dH[2];
+-	IssmDouble  vx,vy,vel,Jdet;
+-	IssmDouble  thickness,thicknessobs,weight;
++	IssmDouble  hobs,hu2,weight,NUMx,NUMy,DEN,Jdet;
++	IssmDouble  vx,vy,vbar2,nux,nuy,dphi[2];
+ 	int        *responses = NULL;
+ 	IssmDouble *xyz_list  = NULL;
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+-	int numnodes = basalelement->GetNumberOfNodes();
++	int numnodes = element->GetNumberOfNodes();
+ 
+ 	/*Initialize Element vector and vectors*/
+-	ElementVector* pe     = basalelement->NewElementVector(SSAApproximationEnum);
++	ElementVector* pe     = element->NewElementVector(SSAApproximationEnum);
+ 	IssmDouble*    basis  = xNew<IssmDouble>(numnodes);
+ 	IssmDouble*    dbasis = xNew<IssmDouble>(2*numnodes);
+ 
+ 	/*Retrieve all inputs and parameters*/
+-	basalelement->GetVerticesCoordinates(&xyz_list);
+-	basalelement->FindParam(&num_responses,InversionNumCostFunctionsEnum);
+-	basalelement->FindParam(&responses,NULL,InversionCostFunctionsEnum);
+-	Input* thickness_input    = basalelement->GetInput(ThicknessEnum);                          _assert_(thickness_input);
+-	Input* thicknessobs_input = basalelement->GetInput(InversionThicknessObsEnum);              _assert_(thicknessobs_input);
+-	Input* weights_input      = basalelement->GetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
+-	Input* vx_input           = basalelement->GetInput(VxEnum);                                 _assert_(vx_input);
+-	Input* vy_input           = basalelement->GetInput(VyEnum);                                 _assert_(vy_input);
++	element->GetVerticesCoordinates(&xyz_list);
++	element->FindParam(&num_responses,InversionNumCostFunctionsEnum);
++	element->FindParam(&responses,NULL,InversionCostFunctionsEnum);
++	Input* thicknessobs_input = element->GetInput(InversionThicknessObsEnum);              _assert_(thicknessobs_input);
++	Input* weights_input      = element->GetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
++	Input* potential_input = element->GetInput(PotentialEnum);             _assert_(potential_input);
++	Input* vx_input        = element->GetInput(BalancethicknessVxObsEnum); _assert_(vx_input);
++	Input* vy_input        = element->GetInput(BalancethicknessVyObsEnum); _assert_(vy_input);
++	Input* nux_input       = element->GetInput(BalancethicknessNuxEnum);   _assert_(nux_input);
++	Input* nuy_input       = element->GetInput(BalancethicknessNuyEnum);   _assert_(nuy_input);
+ 
+ 	/* Start  looping on the number of gaussian points: */
+-	Gauss* gauss=basalelement->NewGauss(2);
++	Gauss* gauss=element->NewGauss(2);
+ 	for(int ig=gauss->begin();ig<gauss->end();ig++){
+ 		gauss->GaussPoint(ig);
+ 
+-		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
+-		basalelement->NodalFunctions(basis,gauss);
+-		basalelement->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
++		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		element->NodalFunctions(basis,gauss);
++		element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+ 
+-		thickness_input->GetInputValue(&thickness, gauss);
+-		thickness_input->GetInputDerivativeValue(&dH[0],xyz_list,gauss);
+-		thicknessobs_input->GetInputValue(&thicknessobs, gauss);
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		nux_input->GetInputValue(&nux,gauss);
++		nuy_input->GetInputValue(&nuy,gauss);
++		potential_input->GetInputDerivativeValue(&dphi[0],xyz_list,gauss);
++		thicknessobs_input->GetInputValue(&hobs,gauss);
+ 
++		vbar2 = (nux*nux*vx*vx + nuy*nuy*vy*vy);
++		hu2 = hobs*hobs*vbar2;
++
++		NUMx = 2.*dbasis[0]*dphi[0]*(dphi[0]*dphi[0] + dphi[1]*dphi[1] - hu2);
++		NUMy = 2.*dbasis[1]*dphi[1]*(dphi[0]*dphi[0] + dphi[1]*dphi[1] - hu2);
++		DEN = vbar2*vbar2;
++
+ 		/*Loop over all requested responses*/
+ 		for(int resp=0;resp<num_responses;resp++){
+ 			weights_input->GetInputValue(&weight,gauss,responses[resp]);
+ 
+ 			switch(responses[resp]){
+-				case ThicknessAbsMisfitEnum:
+-					for(i=0;i<numnodes;i++) pe->values[i]+=(thicknessobs-thickness)*weight*Jdet*gauss->weight*basis[i];
++				case Balancethickness2MisfitEnum:
++					for(i=0;i<numnodes;i++) pe->values[i]+=(NUMx+NUMy)/DEN *weight*Jdet*gauss->weight*basis[i];
+ 					break;
+-				case ThicknessAbsGradientEnum:
+-					for(i=0;i<numnodes;i++) pe->values[i]+= - weight*dH[0]*dbasis[0*numnodes+i]*Jdet*gauss->weight;
+-					for(i=0;i<numnodes;i++) pe->values[i]+= - weight*dH[1]*dbasis[1*numnodes+i]*Jdet*gauss->weight;
+-					break;
+-				case ThicknessAlongGradientEnum:
+-					vx_input->GetInputValue(&vx,gauss);
+-					vy_input->GetInputValue(&vy,gauss);
+-					vel = sqrt(vx*vx+vy*vy);
+-					vx  = vx/(vel+1.e-9);
+-					vy  = vy/(vel+1.e-9);
+-					for(i=0;i<numnodes;i++) pe->values[i]+= - weight*(dH[0]*vx+dH[1]*vy)*(dbasis[0*numnodes+i]*vx+dbasis[1*numnodes+i]*vy)*Jdet*gauss->weight;
+-					break;
+-				case ThicknessAcrossGradientEnum:
+-					vx_input->GetInputValue(&vx,gauss);
+-					vy_input->GetInputValue(&vy,gauss);
+-					vel = sqrt(vx*vx+vy*vy);
+-					vx  = vx/(vel+1.e-9);
+-					vy  = vy/(vel+1.e-9);
+-					for(i=0;i<numnodes;i++) pe->values[i]+= - weight*(dH[0]*(-vy)+dH[1]*vx)*(dbasis[0*numnodes+i]*(-vy)+dbasis[1*numnodes+i]*vx)*Jdet*gauss->weight;
+-					break;
+ 				default:
+ 					_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
+ 			}
+@@ -144,7 +114,6 @@
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(basis);
+ 	xDelete<IssmDouble>(dbasis);
+-	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+ 	delete gauss;
+ 	return pe;
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp	(revision 18002)
++++ ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp	(revision 18003)
+@@ -182,7 +182,7 @@
+ 		element->JacobianDeterminantSurface(&Jdet,xyz_list_front,gauss);
+ 		element->NodalFunctions(basis,gauss);
+ 
+-		for(int i=0;i<numnodes;i++) pe->values[i] += - Jdet*gauss->weight*thickness*(vx*normal[0] + vy*normal[1])*basis[i];
++		for(int i=0;i<numnodes;i++) pe->values[i] += Jdet*gauss->weight*thickness*(vx*normal[0] + vy*normal[1])*basis[i];
+ 	}
+ 
+ 	/*Clean up and return*/
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 18002)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp	(revision 18003)
+@@ -11,8 +11,7 @@
+ void	UpdateElementsAndMaterialsControl(Elements* elements,Materials* materials, IoModel* iomodel){
+ 
+ 	/*Intermediary*/
+-	int       i;
+-	int       counter;
++	int       control;
+ 	Element  *element = NULL;
+ 	Material *material = NULL;
+ 	int       num_control_type;
+@@ -32,8 +31,8 @@
+ 
+ 	iomodel->FetchData(5,InversionControlParametersEnum,InversionCostFunctionsEnum,InversionCostFunctionsCoefficientsEnum,InversionMinParametersEnum,InversionMaxParametersEnum);
+ 
+-	for(i=0;i<num_control_type;i++){
+-		int control = reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i]);
++	for(int i=0;i<num_control_type;i++){
++		control = reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i]);
+ 		switch(control){
+ 			/*List of supported controls*/
+ 			case BalancethicknessThickeningRateEnum: 
+@@ -43,6 +42,7 @@
+ 			case FrictionCoefficientEnum:
+ 			case BalancethicknessNuxEnum:
+ 			case BalancethicknessNuyEnum:
++			case BalancethicknessApparentMassbalanceEnum:
+ 				iomodel->FetchData(1,control); 
+ 				break;
+ 
+@@ -55,8 +55,8 @@
+ 	}
+ 
+ 	/*Update elements: */
+-	counter=0;
+-	for (i=0;i<iomodel->numberofelements;i++){
++	int counter=0;
++	for(int i=0;i<iomodel->numberofelements;i++){
+ 		if(iomodel->my_elements[i]){
+ 			element=(Element*)elements->GetObjectByOffset(counter);
+ 			element->InputUpdateFromIoModel(i,iomodel); //we need i to index into elements.
+@@ -65,5 +65,15 @@
+ 	}
+ 
+ 	/*Free data: */
+-	iomodel->DeleteData(5+7,InversionControlParametersEnum,InversionCostFunctionsCoefficientsEnum,InversionCostFunctionsEnum,InversionMinParametersEnum,InversionMaxParametersEnum,BalancethicknessThickeningRateEnum,VxEnum,VyEnum,ThicknessEnum,FrictionCoefficientEnum,MaterialsRheologyBEnum,DamageDEnum);
++	for(int i=0;i<num_control_type;i++){
++		control = reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i]);
++		switch(control){
++			case MaterialsRheologyBbarEnum: iomodel->DeleteData(1,MaterialsRheologyBEnum); break;
++			case DamageDbarEnum:            iomodel->DeleteData(1,DamageDEnum);            break;
++			default:                        iomodel->DeleteData(1,control); 
++		}
++	}
++	iomodel->DeleteData(5,InversionControlParametersEnum,InversionCostFunctionsCoefficientsEnum,InversionCostFunctionsEnum,InversionMinParametersEnum,InversionMaxParametersEnum);
++
++
+ }
+Index: ../trunk-jpl/src/c/cores/control_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/control_core.cpp	(revision 18002)
++++ ../trunk-jpl/src/c/cores/control_core.cpp	(revision 18003)
+@@ -144,18 +144,23 @@
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+ 
+ 	/*set analysis type to compute velocity: */
+-	if (solution_type==SteadystateSolutionEnum || solution_type==StressbalanceSolutionEnum){
+-		femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
++	switch(solution_type){
++		case SteadystateSolutionEnum:
++		case StressbalanceSolutionEnum:
++			femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
++			break;
++		case BalancethicknessSolutionEnum:
++			femmodel->SetCurrentConfiguration(BalancethicknessAnalysisEnum);
++			break;
++		case BalancethicknessSoftSolutionEnum:
++			femmodel->SetCurrentConfiguration(BalancethicknessAnalysisEnum);
++			break;
++		case Balancethickness2SolutionEnum:
++			femmodel->SetCurrentConfiguration(Balancethickness2AnalysisEnum);
++			break;
++		default:
++			_error_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
+ 	}
+-	else if (solution_type==BalancethicknessSolutionEnum){
+-		femmodel->SetCurrentConfiguration(BalancethicknessAnalysisEnum);
+-	}
+-	else if (solution_type==BalancethicknessSoftSolutionEnum){
+-		femmodel->SetCurrentConfiguration(BalancethicknessAnalysisEnum);
+-	}
+-	else{
+-		_error_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
+-	}
+ 
+ 	/*update parameter according to scalar: */ //false means: do not save control
+ 	InputControlUpdatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,search_scalar,false);
+@@ -170,6 +175,9 @@
+ 	else if (solution_type==BalancethicknessSolutionEnum){
+ 		solutionsequence_linear(femmodel); 
+ 	}
++	else if (solution_type==Balancethickness2SolutionEnum){
++		solutionsequence_linear(femmodel); 
++	}
+ 	else if (solution_type==BalancethicknessSoftSolutionEnum){
+ 		/*Don't do anything*/
+ 	}
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18002)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18003)
+@@ -435,17 +435,17 @@
+ 		case IceVolumeEnum:                this->IceVolumex(responses); break;
+ 		case IceVolumeAboveFloatationEnum: this->IceVolumeAboveFloatationx(responses); break;
+ 		case MinVelEnum:                   this->MinVelx(responses); break;
+-		case MaxVelEnum:                   this->MaxVelx(                  responses); break;
++		case MaxVelEnum:                   this->MaxVelx(responses); break;
+ 		case MinVxEnum:                    this->MinVxx(responses); break;
+-		case MaxVxEnum:                    this->MaxVxx(                   responses); break;
+-		case MaxAbsVxEnum:                 this->MaxAbsVxx(                responses); break;
++		case MaxVxEnum:                    this->MaxVxx(responses); break;
++		case MaxAbsVxEnum:                 this->MaxAbsVxx(responses); break;
+ 		case MinVyEnum:                    this->MinVyx(responses); break;
+-		case MaxVyEnum:                    this->MaxVyx(                   responses); break;
+-		case MaxAbsVyEnum:                 this->MaxAbsVyx(                responses); break;
++		case MaxVyEnum:                    this->MaxVyx(responses); break;
++		case MaxAbsVyEnum:                 this->MaxAbsVyx(responses); break;
+ 		case MinVzEnum:                    this->MinVzx(responses); break;
+-		case MaxVzEnum:                    this->MaxVzx(                   responses); break;
+-		case MaxAbsVzEnum:                 this->MaxAbsVzx(                responses); break;
+-		case MassFluxEnum:                 this->MassFluxx(         responses); break;
++		case MaxVzEnum:                    this->MaxVzx(responses); break;
++		case MaxAbsVzEnum:                 this->MaxAbsVzx(responses); break;
++		case MassFluxEnum:                 this->MassFluxx(responses); break;
+ 		case SurfaceAbsVelMisfitEnum:      SurfaceAbsVelMisfitx(responses, elements,nodes, vertices, loads, materials,parameters); break;
+ 		case SurfaceRelVelMisfitEnum:      SurfaceRelVelMisfitx(responses, elements,nodes, vertices, loads, materials,parameters); break;
+ 		case SurfaceLogVelMisfitEnum:      SurfaceLogVelMisfitx(responses, elements,nodes, vertices, loads, materials,parameters); break;
+@@ -458,6 +458,7 @@
+ 		case RheologyBbarAbsGradientEnum:  RheologyBbarAbsGradientx(responses, elements,nodes, vertices, loads, materials, parameters); break;
+ 		case DragCoefficientAbsGradientEnum:DragCoefficientAbsGradientx(responses, elements,nodes, vertices, loads, materials, parameters); break;
+ 		case BalancethicknessMisfitEnum:   BalancethicknessMisfitx(responses); break;
++		case Balancethickness2MisfitEnum:  Balancethickness2Misfitx(responses); break;
+ 		case TotalSmbEnum:					  this->TotalSmbx(responses); break;
+ 		case MaterialsRheologyBbarEnum:    this->ElementResponsex(responses,MaterialsRheologyBbarEnum); break;
+ 		case VelEnum:                      this->ElementResponsex(responses,VelEnum); break;
+@@ -1199,6 +1200,61 @@
+ 	*presponse=J;
+ 
+ }/*}}}*/
++void FemModel::Balancethickness2Misfitx(IssmDouble* presponse){/*{{{*/
++
++	/*output: */
++	IssmDouble J=0.;
++	IssmDouble J_sum;
++
++	IssmDouble  weight,thicknessobs,thickness;
++	IssmDouble  Jdet;
++	IssmDouble* xyz_list = NULL;
++
++	/*Compute Misfit: */
++	for(int i=0;i<elements->Size();i++){
++		Element* element=dynamic_cast<Element*>(elements->GetObjectByOffset(i));
++
++		/*If on water, return 0: */
++		if(!element->IsIceInElement()) continue;
++
++		/* Get node coordinates*/
++		element->GetVerticesCoordinates(&xyz_list);
++		Input* weights_input     =element->GetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
++		Input* thickness_input   =element->GetInput(ThicknessEnum);                          _assert_(thickness_input);
++		Input* thicknessobs_input=element->GetInput(InversionThicknessObsEnum);              _assert_(thicknessobs_input);
++
++		/* Start  looping on the number of gaussian points: */
++		Gauss* gauss=element->NewGauss(2);
++		for(int ig=gauss->begin();ig<gauss->end();ig++){
++
++			gauss->GaussPoint(ig);
++
++			/* Get Jacobian determinant: */
++			element->JacobianDeterminant(&Jdet,xyz_list,gauss);
++
++			/*Get all parameters at gaussian point*/
++			weights_input->GetInputValue(&weight,gauss,Balancethickness2MisfitEnum);
++			thickness_input->GetInputValue(&thickness,gauss);
++			thicknessobs_input->GetInputValue(&thicknessobs,gauss);
++			gauss->GaussPoint(ig);
++
++			J +=0.5*(thickness*thickness - thicknessobs*thicknessobs)*weight*Jdet*gauss->weight;
++		}
++
++		/*clean up and Return: */
++		xDelete<IssmDouble>(xyz_list);
++		delete gauss;
++	}
++
++	/*Sum all J from all cpus of the cluster:*/
++	ISSM_MPI_Reduce (&J,&J_sum,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
++	ISSM_MPI_Bcast(&J_sum,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
++	J=J_sum;
++
++	/*Assign output pointers: */
++	*presponse=J;
++
++}/*}}}*/
+ void FemModel::ThicknessAbsGradientx( IssmDouble* pJ){/*{{{*/
+ 
+ 	/*output: */
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18002)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18003)
+@@ -990,6 +990,7 @@
+ 			switch(control){
+ 				/*yts conversion*/
+ 				case BalancethicknessThickeningRateEnum:
++				case BalancethicknessApparentMassbalanceEnum:
+ 				case VxEnum:
+ 				case VyEnum:
+ 					if(iomodel->Data(control)){
+@@ -2802,8 +2803,11 @@
+ 		case ThicknessEnum:
+ 			GradjThicknessBalancethicknessSoft(gradient,control_index);
+ 			break;
++		case BalancethicknessApparentMassbalanceEnum:
++			GradjAdotBulancethickness2(gradient,control_index);
++			break;
+ 		default:
+-			_error_("control type not supported yet: " << control_type);
++			_error_("control type not supported yet: " << EnumToStringx(control_type));
+ 	}
+ 
+ 	/*Now deal with ∂J/∂alpha*/
+@@ -2820,6 +2824,7 @@
+ 		case ThicknessAlongGradientEnum:
+ 		case ThicknessAcrossGradientEnum:
+ 		case BalancethicknessMisfitEnum:
++		case Balancethickness2MisfitEnum:
+ 		case SurfaceAbsVelMisfitEnum:
+ 		case SurfaceRelVelMisfitEnum:
+ 		case SurfaceLogVelMisfitEnum:
+@@ -3167,6 +3172,21 @@
+ 	gradient->SetValues(NUMVERTICES,vertexpidlist,gradient_g,INS_VAL);
+ }
+ /*}}}*/
++void       Tria::GradjAdotBulancethickness2(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++
++	/*Intermediaries*/
++	int    vertexpidlist[NUMVERTICES];
++	IssmDouble lambda[NUMVERTICES];
++	IssmDouble gradient_g[NUMVERTICES];
++
++	/*Compute Gradient*/
++	GradientIndexing(&vertexpidlist[0],control_index);
++	GetInputListOnVertices(&lambda[0],AdjointEnum);
++	for(int i=0;i<NUMVERTICES;i++) gradient_g[i]=lambda[i];
++
++	gradient->SetValues(NUMVERTICES,vertexpidlist,gradient_g,INS_VAL);
++}
++/*}}}*/
+ void       Tria::GradjVxBalancedthickness(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+ 
+ 	/*Intermediaries*/
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18002)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18003)
+@@ -148,6 +148,7 @@
+ 		void       GradjVxBalancedthickness(Vector<IssmDouble>* gradient,int control_index);
+ 		void       GradjVyBalancedthickness(Vector<IssmDouble>* gradient,int control_index);
+ 		void       GradjThicknessBalancethicknessSoft(Vector<IssmDouble>* gradient,int control_index);
++		void       GradjAdotBulancethickness2(Vector<IssmDouble>* gradient,int control_index);
+ 		void       GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data);
+ 		void       SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index);
+ 		void       ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index);
+Index: ../trunk-jpl/src/c/classes/FemModel.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.h	(revision 18002)
++++ ../trunk-jpl/src/c/classes/FemModel.h	(revision 18003)
+@@ -76,6 +76,7 @@
+ 		void IceVolumeAboveFloatationx(IssmDouble* pV);
+ 		void ElementResponsex(IssmDouble* presponse,int response_enum);
+ 		void BalancethicknessMisfitx(IssmDouble* pV);
++		void Balancethickness2Misfitx(IssmDouble* pV);
+ 		#ifdef  _HAVE_DAKOTA_
+ 		void DakotaResponsesx(double* d_responses,char** responses_descriptors,int numresponsedescriptors,int d_numresponses);
+ 		#endif
Index: /issm/oecreview/Archive/17984-18295/ISSM-18005-18006.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18005-18006.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18005-18006.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/model.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.py	(revision 18005)
++++ ../trunk-jpl/src/m/classes/model.py	(revision 18006)
+@@ -10,6 +10,8 @@
+ from SMB import SMB
+ from SMBpdd import SMBpdd
+ from SMBgradients import SMBgradients
++from SMBcomponents import SMBcomponents
++from SMBmeltcomponents import SMBmeltcomponents
+ from basalforcings import basalforcings
+ from matice import matice
+ from damage import damage
Index: /issm/oecreview/Archive/17984-18295/ISSM-18006-18007.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18006-18007.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18006-18007.diff	(revision 18296)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/m/classes/SMBcomponents.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBcomponents.py	(revision 18006)
++++ ../trunk-jpl/src/m/classes/SMBcomponents.py	(revision 18007)
+@@ -73,7 +73,7 @@
+ 
+ 		yts=365.0*24.0*3600.0
+ 
+-		WriteData(fid,'enum',SurfaceforcingsEnum(),'data',SMBEnum(),'format','Integer');
++		WriteData(fid,'enum',SurfaceforcingsEnum(),'data',SMBcomponentsEnum(),'format','Integer');
+ 		WriteData(fid,'object',self,'class','surfaceforcings','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
+ 		WriteData(fid,'object',self,'class','surfaceforcings','fieldname','runoff','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
+ 		WriteData(fid,'object',self,'class','surfaceforcings','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
+Index: ../trunk-jpl/src/m/classes/SMBmeltcomponents.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBmeltcomponents.py	(revision 18006)
++++ ../trunk-jpl/src/m/classes/SMBmeltcomponents.py	(revision 18007)
+@@ -85,7 +85,7 @@
+ 
+ 		yts=365.0*24.0*3600.0
+ 
+-		WriteData(fid,'enum',SurfaceforcingsEnum(),'data',SMBEnum(),'format','Integer');
++		WriteData(fid,'enum',SurfaceforcingsEnum(),'data',SMBmeltcomponentsEnum(),'format','Integer');
+ 		WriteData(fid,'object',self,'class','surfaceforcings','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
+ 		WriteData(fid,'object',self,'class','surfaceforcings','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
+ 		WriteData(fid,'object',self,'class','surfaceforcings','fieldname','melt','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
Index: /issm/oecreview/Archive/17984-18295/ISSM-18007-18008.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18007-18008.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18007-18008.diff	(revision 18296)
@@ -0,0 +1,145 @@
+Index: ../trunk-jpl/src/m/classes/inversionvalidation.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/inversionvalidation.m	(revision 0)
++++ ../trunk-jpl/src/m/classes/inversionvalidation.m	(revision 18008)
+@@ -0,0 +1,140 @@
++%INVERSIONVALIDATION class definition
++%
++%   Usage:
++%      inversionvalidation=inversionvalidation();
++
++classdef inversionvalidation
++	properties (SetAccess=public) 
++		iscontrol                   = 0
++		incomplete_adjoint          = 0
++		control_parameters          = NaN
++		cost_functions              = NaN
++		cost_functions_coefficients = NaN
++		min_parameters              = NaN
++		max_parameters              = NaN
++		vx_obs                      = NaN
++		vy_obs                      = NaN
++		vz_obs                      = NaN
++		vel_obs                     = NaN
++		thickness_obs               = NaN
++	end
++	methods
++		function obj = inversionvalidation(varargin) % {{{
++			switch nargin
++				case 0
++					obj=setdefaultparameters(obj);
++				case 1
++					obj=structtoobj(inversionvalidation(),varargin{1});
++				otherwise
++					error('constructor not supported');
++			end
++		end % }}}
++		function self = setdefaultparameters(self) % {{{
++
++			%default is incomplete adjoint for now
++			self.incomplete_adjoint=1;
++
++			%parameter to be inferred by control methods (only
++			%drag and B are supported yet)
++			self.control_parameters={'FrictionCoefficient'};
++
++			%several responses can be used:
++			self.cost_functions=101;
++		end % }}}
++		function md = checkconsistency(obj,md,solution,analyses) % {{{
++
++			%Early return
++			if ~obj.iscontrol, return; end
++
++			num_controls=numel(md.inversion.control_parameters);
++			num_costfunc=size(md.inversion.cost_functions,2);
++
++			md = checkfield(md,'fieldname','inversion.iscontrol','values',[0 1]);
++			md = checkfield(md,'fieldname','inversion.incomplete_adjoint','values',[0 1]);
++			md = checkfield(md,'fieldname','inversion.control_parameters','cell',1,'values',...
++				{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'MaterialsRheologyZbar' 'Vx' 'Vy' 'Thickness'});
++			md = checkfield(md,'fieldname','inversion.cost_functions','size',[1 num_costfunc],'values',[101:105 201 501:506]);
++			md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
++			md = checkfield(md,'fieldname','inversion.min_parameters','size',[md.mesh.numberofvertices num_controls]);
++			md = checkfield(md,'fieldname','inversion.max_parameters','size',[md.mesh.numberofvertices num_controls]);
++
++			if solution==BalancethicknessSolutionEnum()
++				md = checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices 1],'NaN',1);
++			elseif solution==BalancethicknessSoftSolutionEnum()
++				md = checkfield(md,'fieldname','inversion.thickness_obs','size',[md.mesh.numberofvertices 1],'NaN',1);
++			else
++				md = checkfield(md,'fieldname','inversion.vx_obs','size',[md.mesh.numberofvertices 1],'NaN',1);
++				if ~strcmp(domaintype(md.mesh),'2Dvertical'),
++					md = checkfield(md,'fieldname','inversion.vy_obs','size',[md.mesh.numberofvertices 1],'NaN',1);
++				end
++			end
++		end % }}}
++		function disp(obj) % {{{
++			disp(sprintf('   inversionvalidation parameters:'));
++			fielddisplay(obj,'iscontrol','is inversion activated?');
++			fielddisplay(obj,'incomplete_adjoint','1: linear viscosity, 0: non-linear viscosity');
++			fielddisplay(obj,'control_parameters','ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}');
++			fielddisplay(obj,'cost_functions','indicate the type of response for each optimization step');
++			fielddisplay(obj,'cost_functions_coefficients','cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter');
++			fielddisplay(obj,'min_parameters','absolute minimum acceptable value of the inversed parameter on each vertex');
++			fielddisplay(obj,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex');
++			fielddisplay(obj,'vx_obs','observed velocity x component [m/yr]');
++			fielddisplay(obj,'vy_obs','observed velocity y component [m/yr]');
++			fielddisplay(obj,'vel_obs','observed velocity magnitude [m/yr]');
++			fielddisplay(obj,'thickness_obs','observed thickness [m]');
++			disp('Available cost functions:');
++			disp('   101: SurfaceAbsVelMisfit');
++			disp('   102: SurfaceRelVelMisfit');
++			disp('   103: SurfaceLogVelMisfit');
++			disp('   104: SurfaceLogVxVyMisfit');
++			disp('   105: SurfaceAverageVelMisfit');
++			disp('   201: ThicknessAbsMisfit');
++			disp('   501: DragCoefficientAbsGradient');
++			disp('   502: RheologyBbarAbsGradient');
++			disp('   503: ThicknessAbsGradient');
++		end % }}}
++		function marshall(obj,md,fid) % {{{
++
++			yts=365.0*24.0*3600.0;
++
++			WriteData(fid,'object',obj,'class','inversion','fieldname','iscontrol','format','Boolean');
++			WriteData(fid,'enum',InversionTypeEnum(),'data',3,'format','Integer');
++			if ~obj.iscontrol, return; end
++			WriteData(fid,'object',obj,'class','inversion','fieldname','incomplete_adjoint','format','Boolean');
++			WriteData(fid,'object',obj,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);
++			WriteData(fid,'object',obj,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3);
++			WriteData(fid,'object',obj,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3);
++			WriteData(fid,'object',obj,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);
++			WriteData(fid,'object',obj,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);
++			WriteData(fid,'object',obj,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);
++			WriteData(fid,'object',obj,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',1);
++
++			%process control parameters
++			num_control_parameters=numel(obj.control_parameters);
++			data=zeros(1,num_control_parameters);
++			for i=1:num_control_parameters,
++				data(i)=StringToEnum(obj.control_parameters{i});
++			end
++			WriteData(fid,'data',data,'enum',InversionControlParametersEnum(),'format','DoubleMat','mattype',3);
++			WriteData(fid,'data',num_control_parameters,'enum',InversionNumControlParametersEnum(),'format','Integer');
++
++			%process cost functions
++			num_cost_functions=size(obj.cost_functions,2);
++			data=obj.cost_functions;
++			pos=find(obj.cost_functions==101); data(pos)=SurfaceAbsVelMisfitEnum();
++			pos=find(obj.cost_functions==102); data(pos)=SurfaceRelVelMisfitEnum();
++			pos=find(obj.cost_functions==103); data(pos)=SurfaceLogVelMisfitEnum();
++			pos=find(obj.cost_functions==104); data(pos)=SurfaceLogVxVyMisfitEnum();
++			pos=find(obj.cost_functions==105); data(pos)=SurfaceAverageVelMisfitEnum();
++			pos=find(obj.cost_functions==201); data(pos)=ThicknessAbsMisfitEnum();
++			pos=find(obj.cost_functions==501); data(pos)=DragCoefficientAbsGradientEnum();
++			pos=find(obj.cost_functions==502); data(pos)=RheologyBbarAbsGradientEnum();
++			pos=find(obj.cost_functions==503); data(pos)=ThicknessAbsGradientEnum();
++			pos=find(obj.cost_functions==504); data(pos)=ThicknessAlongGradientEnum();
++			pos=find(obj.cost_functions==505); data(pos)=ThicknessAcrossGradientEnum();
++			pos=find(obj.cost_functions==506); data(pos)=BalancethicknessMisfitEnum();
++			WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3);
++			WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer');
++		end % }}}
++	end
++end
Index: /issm/oecreview/Archive/17984-18295/ISSM-18008-18009.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18008-18009.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18008-18009.diff	(revision 18296)
@@ -0,0 +1,131 @@
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp	(revision 18008)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp	(revision 18009)
+@@ -73,6 +73,8 @@
+ 				parameters->AddObject(iomodel->CopyConstantObject(InversionMaxstepsEnum));
+ 				parameters->AddObject(iomodel->CopyConstantObject(InversionMaxiterEnum));
+ 				break;
++			case 3:/*Validation*/
++				break;
+ 			default:
+ 				_error_("not supported");
+ 
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 18008)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 18009)
+@@ -417,6 +417,7 @@
+ 					./cores/control_core.cpp\
+ 					./cores/controltao_core.cpp\
+ 					./cores/controlm1qn3_core.cpp\
++					./cores/controlvalidation_core.cpp\
+ 					./cores/gradient_core.cpp\
+ 					./cores/adjointstressbalance_core.cpp\
+ 					./cores/adjointbalancethickness_core.cpp\
+Index: ../trunk-jpl/src/c/cores/WrapperCorePointerFromSolutionEnum.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/WrapperCorePointerFromSolutionEnum.cpp	(revision 18008)
++++ ../trunk-jpl/src/c/cores/WrapperCorePointerFromSolutionEnum.cpp	(revision 18009)
+@@ -45,6 +45,7 @@
+ 			case 0: solutioncore=control_core; break;
+ 			case 1: solutioncore=controltao_core; break;
+ 			case 2: solutioncore=controlm1qn3_core; break;
++			case 3: solutioncore=controlvalidation_core; break;
+ 			default: _error_("control type not supported");
+ 		}
+ 	}
+Index: ../trunk-jpl/src/c/cores/controlvalidation_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 0)
++++ ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 18009)
+@@ -0,0 +1,77 @@
++/*!\file: controlvalidation_core.cpp
++ * \brief: core of the control solution 
++ */ 
++
++#include "./cores.h"
++#include "../toolkits/toolkits.h"
++#include "../classes/classes.h"
++#include "../shared/shared.h"
++#include "../modules/modules.h"
++
++void controlvalidation_core(FemModel* femmodel){
++
++	int         solution_type,n;
++	IssmDouble  j0,j;
++	IssmDouble  Ialpha,alpha;
++	IssmDouble *G = NULL;
++	IssmDouble *X = NULL;
++	IssmDouble *X0= NULL;
++
++	/*Solution and Adjoint core pointer*/
++	void (*solutioncore)(FemModel*) = NULL;
++	void (*adjointcore)(FemModel*)  = NULL;
++
++	/*Recover parameters used throughout the solution*/
++	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
++	femmodel->parameters->SetParam(false,SaveResultsEnum);
++
++	/*Get initial guess*/
++	Vector<IssmDouble> *Xpetsc = NULL;
++	GetVectorFromControlInputsx(&Xpetsc,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"value");
++	Xpetsc->GetSize(&n);
++	X0 = Xpetsc->ToMPISerial();
++	delete Xpetsc;
++
++	/*Allocate Gradient and current vector*/
++	G = xNew<double>(n);
++	X = xNew<double>(n);
++
++	/*out of solution_type, figure out solution core and adjoint function pointer*/
++	CorePointerFromSolutionEnum(&solutioncore,femmodel->parameters,solution_type);
++	AdjointCorePointerFromSolutionEnum(&adjointcore,solution_type);
++
++	if(VerboseControl()) _printf0_("   Compute Initial solution\n");
++	solutioncore(femmodel);
++	if(VerboseControl()) _printf0_("   Compute Adjoint\n");
++	adjointcore(femmodel);
++	if(VerboseControl()) _printf0_("   Compute Initial cost function\n");
++	femmodel->CostFunctionx(&j0,NULL,NULL);
++	if(VerboseControl()) _printf0_("   Compute Gradient\n");
++	Gradjx(&G,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
++	for(int i=0;i<n;i++) G[i] = -G[i];
++
++	_printf0_("j0 = "<<j0<<"\n");
++	for(IssmDouble exponent = 4.; exponent > -4. ; exponent-=0.2){
++	//for(IssmDouble exponent = -1.; exponent > -9. ; exponent-=0.2){
++
++		alpha = pow(10.,exponent);
++
++		/*Create new vector*/
++		for(int i=0;i<n;i++) X[i] = X0[i] + alpha;
++
++		/*Calculate j(k+alpha delta k) */
++		SetControlInputsFromVectorx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,X);
++		solutioncore(femmodel);
++		femmodel->CostFunctionx(&j,NULL,NULL);
++
++		IssmDouble Den = 0.;
++		for(int i=0;i<n;i++) Den += alpha * G[i] * 1.;
++		Ialpha = fabs((j - j0)/Den - 1.);
++
++		//_printf0_("alpha = "<<alpha<<" Ialpha = "<<Ialpha<<"\n");
++		_printf0_(alpha<<" "<<Ialpha<<"\n");
++	}
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(G);
++}
+Index: ../trunk-jpl/src/c/cores/cores.h
+===================================================================
+--- ../trunk-jpl/src/c/cores/cores.h	(revision 18008)
++++ ../trunk-jpl/src/c/cores/cores.h	(revision 18009)
+@@ -29,6 +29,7 @@
+ void control_core(FemModel* femmodel);
+ void controltao_core(FemModel* femmodel);
+ void controlm1qn3_core(FemModel* femmodel);
++void controlvalidation_core(FemModel* femmodel);
+ void masstransport_core(FemModel* femmodel);
+ void depthaverage_core(FemModel* femmodel);
+ void extrudefrombase_core(FemModel* femmodel);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18009-18010.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18009-18010.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18009-18010.diff	(revision 18296)
@@ -0,0 +1,60 @@
+Index: ../trunk-jpl/src/c/cores/controlvalidation_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 18009)
++++ ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 18010)
+@@ -12,7 +12,7 @@
+ 
+ 	int         solution_type,n;
+ 	IssmDouble  j0,j;
+-	IssmDouble  Ialpha,alpha;
++	IssmDouble  Ialpha,exponent,alpha;
+ 	IssmDouble *G = NULL;
+ 	IssmDouble *X = NULL;
+ 	IssmDouble *X0= NULL;
+@@ -50,12 +50,24 @@
+ 	Gradjx(&G,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+ 	for(int i=0;i<n;i++) G[i] = -G[i];
+ 
+-	_printf0_("j0 = "<<j0<<"\n");
+-	for(IssmDouble exponent = 4.; exponent > -4. ; exponent-=0.2){
+-	//for(IssmDouble exponent = -1.; exponent > -9. ; exponent-=0.2){
++	/*Range of tests*/
++	IssmDouble exp0 = 0.;
++	IssmDouble incr = -0.2;
++	IssmDouble exp1 = -8.;
++	int        num  = int((exp1-exp0)/incr);
+ 
+-		alpha = pow(10.,exponent);
++	/*Allocate output*/
++	IssmDouble* output = xNew<IssmDouble>(2*num);
+ 
++	/*Start loop*/
++	_printf0_("       alpha      Ialpha \n");
++	_printf0_("_________________________\n");
++	for(int m=0;m<num;m++){
++
++		/*Calculate alpha = 10^-exponent*/
++		exponent = exp0+m*incr;
++		alpha    = pow(10.,exponent);
++
+ 		/*Create new vector*/
+ 		for(int i=0;i<n;i++) X[i] = X0[i] + alpha;
+ 
+@@ -68,10 +80,15 @@
+ 		for(int i=0;i<n;i++) Den += alpha * G[i] * 1.;
+ 		Ialpha = fabs((j - j0)/Den - 1.);
+ 
+-		//_printf0_("alpha = "<<alpha<<" Ialpha = "<<Ialpha<<"\n");
+-		_printf0_(alpha<<" "<<Ialpha<<"\n");
++
++		_printf0_(" " << setw(11) << setprecision (5)<<alpha<<" " << setw(11) << setprecision (5)<<Ialpha<<"\n");
++		output[m*2+0] = alpha;
++		output[m*2+1] = Ialpha;
+ 	}
+ 
++	/*output*/
++	femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,JEnum,output,num,2,1,0));
++
+ 	/*Clean up and return*/
+ 	xDelete<IssmDouble>(G);
+ }
Index: /issm/oecreview/Archive/17984-18295/ISSM-18010-18011.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18010-18011.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18010-18011.diff	(revision 18296)
@@ -0,0 +1,181 @@
+Index: ../trunk-jpl/src/m/mech/backstressfrominversion.m
+===================================================================
+--- ../trunk-jpl/src/m/mech/backstressfrominversion.m	(revision 18010)
++++ ../trunk-jpl/src/m/mech/backstressfrominversion.m	(revision 18011)
+@@ -22,9 +22,8 @@
+ %				'xy': x and y axes same as in polar stereographic projection 
+ %
+ %   Return values:
+-%		'backstress' is the inferred backstress necessary to balance the
+-%		analytical solution (keeping damage within its appropriate limits, e.g. D
+-%		in [0,1]).
++%		'backstress' is the inferred backstress based on the analytical
++%		solution for ice shelf creep
+ %
+ %   Usage:
+ %      backstress=backstressfrominversion(md,options)
+Index: ../trunk-jpl/src/m/mech/calcbackstress.m
+===================================================================
+--- ../trunk-jpl/src/m/mech/calcbackstress.m	(revision 0)
++++ ../trunk-jpl/src/m/mech/calcbackstress.m	(revision 18011)
+@@ -0,0 +1,64 @@
++function backstress=calcbackstress(md,varargin)
++%BACKSTRESSFROMINVERSION - compute ice shelf backstress  
++%
++%	 This routine computes backstress based on the analytical formalism of
++%	 Thomas (1973) and Borstad et al. (2013) based on the ice rigidity,
++%	 thickness, the densities of ice and seawater, and (optionally)
++%	 damage. Strain rates must also be included, either from observed or
++%	 modeled velocities.
++
++%   Available options:
++%		- 'smoothing'	: the amount of smoothing to be applied to the strain rate data.
++%								Type 'help averaging' for more information on its
++%								usage. Defaults to 0.
++%		- 'coordsys'	: coordinate system for calculating the strain rate
++%							components. Must be one of: 
++%				'longitudinal': x axis aligned along a flowline at every point (default)
++%				'principal': x axis aligned along maximum principal strain rate
++%					at every point
++%				'xy': x and y axes same as in polar stereographic projection 
++%
++%   Return values:
++%		'backstress' is the inferred backstress based on the analytical
++%		solution for ice shelf creep
++%
++%   Usage:
++%      backstress=calcbackstress(md,options)
++%
++%   Example:
++%      backstress=backstressfrominversion(md,'smoothing',2,'coordsys','longitudinal');
++
++% check inputs
++if (nargin<1),
++	help backstressfrominversion
++	error('bad usage');
++end
++if isempty(fieldnames(md.results)),
++	error(['md.results.strainrate is not present.  Calculate using md=mechanicalproperties(md,vx,vy)']);
++end
++if dimension(md.mesh)~=2,
++	error('only 2d model supported currently');
++end
++if any(md.flowequation.element_equation~=2),
++	disp('Warning: the model has some non SSA elements. These will be treated like SSA elements');
++end
++
++% process options
++options = pairoptions(varargin{:});
++smoothing = getfieldvalue(options,'smoothing',0);
++coordsys = getfieldvalue(options,'coordsys','longitudinal');
++tempmask = getfieldvalue(options,'tempmask',false);
++
++T=0.5*md.materials.rho_ice*md.constants.g*(1-md.materials.rho_ice/md.materials.rho_water)*md.geometry.thickness;
++n=averaging(md,md.materials.rheology_n,0);
++B=md.materials.rheology_B;
++if md.damage.isdamage,
++	D=md.damage.D
++else
++	D=0.
++
++[a0,b0,theta0,ex0]=thomasparams(md,'eq','Thomas','smoothing',smoothing,'coordsys',coordsys);
++
++% analytical backstress solution
++backstress=T-(1.-D).*B.*sign(ex0).*(2+a0).*abs(ex0).^(1./n)./((1+a0+a0.^2+b0.^2).^((n-1)/2./n));
++backstress(find(backstress<0))=0;
+Index: ../trunk-jpl/src/m/mech/backstressfrominversion.py
+===================================================================
+--- ../trunk-jpl/src/m/mech/backstressfrominversion.py	(revision 18010)
++++ ../trunk-jpl/src/m/mech/backstressfrominversion.py	(revision 18011)
+@@ -7,7 +7,7 @@
+ 	Compute ice shelf backstress from inversion results.
+ 
+ 	This routine computes backstress based on the analytical formalism of
+-	Thomas (1973) and Borstad et al. (2013, The Cryoshpere).  The model
++	Thomas (1973) and Borstad et al. (2013, The Cryosphere).  The model
+ 	must contain inversion results for ice rigidity.  Strain rates must
+ 	also be included, either from observed or modeled velocities.  Ice
+ 	rigidity B is assumed to be parameterized by the ice temperature in
+@@ -28,9 +28,8 @@
+ 				'xy': x and y axes same as in polar stereographic projection 
+ 
+    Return values:
+-		'backstress' is the inferred backstress necessary to balance the
+-		analytical solution (keeping damage within its appropriate limits, e.g. D
+-		in [0,1]).
++		'backstress' is the inferred backstress based on the analytical
++		solution for ice shelf creep
+ 
+    Usage:
+       backstress=backstressfrominversion(md,options)
+Index: ../trunk-jpl/src/m/mech/calcbackstress.py
+===================================================================
+--- ../trunk-jpl/src/m/mech/calcbackstress.py	(revision 0)
++++ ../trunk-jpl/src/m/mech/calcbackstress.py	(revision 18011)
+@@ -0,0 +1,66 @@
++import numpy as npy
++from averaging import averaging
++from thomasparams import thomasparams
++
++def calcbackstress(md,**kwargs):
++	'''
++	Compute ice shelf backstress.
++
++	This routine computes backstress based on the analytical formalism of
++	Thomas (1973) and Borstad et al. (2013, The Cryosphere) based on the
++	ice rigidity, thickness, the densities of ice and seawater, and
++	(optionally) damage.  Strain rates must also be included, either from
++	observed or modeled velocities. 
++	
++	Available options:
++		- 'smoothing'	: the amount of smoothing to be applied to the strain rate data.
++								Type 'help averaging' for more information on its
++								usage. Defaults to 0.
++		- 'coordsys'	: coordinate system for calculating the strain rate
++							components. Must be one of: 
++				'longitudinal': x axis aligned along a flowline at every point (default)
++				'principal': x axis aligned along maximum principal strain rate
++					at every point
++				'xy': x and y axes same as in polar stereographic projection 
++
++   Return values:
++		'backstress' is the inferred backstress based on the analytical
++		solution for ice shelf creep
++
++   Usage:
++      backstress=calcbackstress(md,options)
++
++   Example:
++      backstress=calcbackstress(md,'smoothing',2,'coordsys','longitudinal')
++	'''
++
++	# unpack kwargs
++	smoothing=kwargs.pop('smoothing',0)
++	if 'smoothing' in kwargs: del kwargs['smoothing']
++	coordsys=kwargs.pop('coordsys','longitudinal')
++	if 'coordsys' in kwargs: del kwargs['coordsys']
++	assert len(kwargs)==0, 'error, unexpected or misspelled kwargs'
++
++	# some checks
++	if not hasattr(md.results,'strainrate'):
++		raise StandardError('md.results.strainrate not present.  Calculate using md=mechanicalproperties(md,vx,vy)')
++	if not '2d' in md.mesh.__doc__:
++		raise StandardError('only 2d (planview) model supported currently')
++	if any(md.flowequation.element_equation!=2):
++		raise StandardError('Warning: the model has some non-SSA elements.  These will be treated like SSA elements')
++
++	T=0.5*md.materials.rho_ice*md.constants.g*(1-md.materials.rho_ice/md.materials.rho_water)*md.geometry.thickness
++	n=averaging(md,md.materials.rheology_n,0)
++	B=md.materials.rheology_B
++	if md.damage.isdamage:
++		D=md.damage.D
++	else:
++		D=0.
++	
++	a0,b0,theta0,ex0=thomasparams(md,eq='Thomas',smoothing=smoothing,coordsys=coordsys)
++	
++	# analytical backstress solution
++	backstress=T-(1.-D)*B*npy.sign(ex0)*(2+a0)*npy.abs(ex0)**(1./n)/((1+a0+a0**2+b0**2)**((n-1.)/2./n))
++	backstress[npy.nonzero(backstress<0)]=0
++
++	return backstress
Index: /issm/oecreview/Archive/17984-18295/ISSM-18011-18012.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18011-18012.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18011-18012.diff	(revision 18296)
@@ -0,0 +1,39 @@
+Index: ../trunk-jpl/src/m/plot/checkplotoptions.py
+===================================================================
+--- ../trunk-jpl/src/m/plot/checkplotoptions.py	(revision 18011)
++++ ../trunk-jpl/src/m/plot/checkplotoptions.py	(revision 18012)
+@@ -17,7 +17,7 @@
+ 	if options.exist('unit'):
+ 		if 'km' in options.getfieldvalue('unit','km'):
+ 			options.changefieldvalue('unit',10**-3)
+-		if '100km' in options.getfieldvalue('unit','100km'):
++		elif '100km' in options.getfieldvalue('unit','100km'):
+ 			options.changefieldvalue('unit',10**-5)
+ 	
+ 	#density
+Index: ../trunk-jpl/src/m/plot/applyoptions.py
+===================================================================
+--- ../trunk-jpl/src/m/plot/applyoptions.py	(revision 18011)
++++ ../trunk-jpl/src/m/plot/applyoptions.py	(revision 18012)
+@@ -218,11 +218,12 @@
+ 		elif cbar_extend==3:
+ 			extend='both'
+ 		cb = mpl.colorbar.ColorbarBase(ax.cax, cmap=cmap, norm=norm, extend=extend)
+-		cb.locator=MaxNLocator(nbins=5) # default 5 ticks
+ 		if options.exist('alpha'):
+ 			cb.set_alpha(options.getfieldvalue('alpha'))
+ 		if options.exist('colorbarnumticks'):
+ 			cb.locator=MaxNLocator(nbins=options.getfieldvalue('colorbarnumticks',5))
++		else:
++			cb.locator=MaxNLocator(nbins=5) # default 5 ticks
+ 		if options.exist('colorbartickspacing'):
+ 			locs=npy.arange(lims[0],lims[1]+1,options.getfieldvalue('colorbartickspacing'))
+ 			cb.set_ticks(locs)
+@@ -236,6 +237,7 @@
+ 			else:
+ 				cb.set_label(options.getfieldvalue('colorbartitle'),fontsize=fontsize)
+ 		cb.ax.tick_params(labelsize=fontsize)
++		cb.update_ticks()
+ 		plt.sca(ax) # return to original axes control
+ 	#}}}
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18024-18025.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18024-18025.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18024-18025.diff	(revision 18296)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18024)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18025)
+@@ -535,6 +535,7 @@
+ 				case RheologyBbarAbsGradientEnum:   RheologyBbarAbsGradientx(&double_result,elements,nodes,vertices,loads,materials,parameters);    break;
+ 				case DragCoefficientAbsGradientEnum:DragCoefficientAbsGradientx(&double_result,elements,nodes,vertices,loads,materials,parameters); break;
+ 				case BalancethicknessMisfitEnum:    BalancethicknessMisfitx(&double_result);                                                        break;
++				case Balancethickness2MisfitEnum:  Balancethickness2Misfitx(&double_result); break;
+ 
+ 			   /*Vector */
+ 				default:
Index: /issm/oecreview/Archive/17984-18295/ISSM-18025-18026.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18025-18026.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18025-18026.diff	(revision 18296)
@@ -0,0 +1,39 @@
+Index: ../trunk-jpl/test/NightlyRun/test435.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test435.m	(revision 18025)
++++ ../trunk-jpl/test/NightlyRun/test435.m	(revision 18026)
+@@ -46,7 +46,7 @@
+ field_names     ={'Bed1','Surface1','Thickness1','Floatingice1','Vx1','Vy1','Vz1','Pressure1',...
+ 	'Bed2','Surface2','Thickness2','Floatingice2','Vx2','Vy2','Vz2','Pressure2',...
+ 	'Bed3','Surface3','Thickness3','Floatingice3','Vx3','Vy3','Vz3','Pressure3'};
+-field_tolerances={2e-11,5e-12,2e-11,1e-11,4e-10,1e-08,6e-10,1e-13,...
++field_tolerances={2e-11,5e-12,2e-11,1e-11,5e-10,1e-08,6e-10,1e-13,...
+ 	3e-11,3e-11,9e-10,7e-11,1e-09,5e-08,1e-09,1e-10,...
+ 	1e-10,3e-11,1e-10,7e-11,1e-09,5e-08,1e-09,1e-10};
+ field_values={...
+Index: ../trunk-jpl/test/NightlyRun/test415.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test415.py	(revision 18025)
++++ ../trunk-jpl/test/NightlyRun/test415.py	(revision 18026)
+@@ -35,7 +35,7 @@
+ 
+ #Fields and tolerances to track changes
+ field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsMeltingRate']
+-field_tolerances=[5e-10,1e-9,1e-10,1e-13,1e-09,1e-09,1e-09,1e-8,1e-09,1e-6]
++field_tolerances=[1e-9,1e-9,2e-10,1e-13,1e-09,1e-09,1e-09,1e-8,1e-09,1e-6]
+ field_values=[\
+ 	md.results.SteadystateSolution.Gradient1,\
+ 	md.results.SteadystateSolution.J,\
+Index: ../trunk-jpl/test/NightlyRun/test415.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test415.m	(revision 18025)
++++ ../trunk-jpl/test/NightlyRun/test415.m	(revision 18026)
+@@ -23,7 +23,7 @@
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsMeltingRate'};
+-field_tolerances={9e-10,1e-9,1e-10,1e-13,1e-09,1e-09,1e-09,1e-8,1e-09,1e-6};
++field_tolerances={1e-09,1e-9,2e-10,1e-13,1e-09,1e-09,1e-09,1e-8,1e-09,1e-6};
+ field_values={...
+ 	(md.results.SteadystateSolution.Gradient1),...
+ 	md.results.SteadystateSolution.J,...
Index: /issm/oecreview/Archive/17984-18295/ISSM-18026-18027.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18026-18027.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18026-18027.diff	(revision 18296)
@@ -0,0 +1,31 @@
+Index: ../trunk-jpl/src/c/cores/controlvalidation_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 18026)
++++ ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 18027)
+@@ -33,8 +33,8 @@
+ 	delete Xpetsc;
+ 
+ 	/*Allocate Gradient and current vector*/
+-	G = xNew<double>(n);
+-	X = xNew<double>(n);
++	G = xNew<IssmDouble>(n);
++	X = xNew<IssmDouble>(n);
+ 
+ 	/*out of solution_type, figure out solution core and adjoint function pointer*/
+ 	CorePointerFromSolutionEnum(&solutioncore,femmodel->parameters,solution_type);
+@@ -54,7 +54,7 @@
+ 	IssmDouble exp0 = 0.;
+ 	IssmDouble incr = -0.2;
+ 	IssmDouble exp1 = -8.;
+-	int        num  = int((exp1-exp0)/incr);
++	int        num  = reCast<int>((exp1-exp0)/incr);
+ 
+ 	/*Allocate output*/
+ 	IssmDouble* output = xNew<IssmDouble>(2*num);
+@@ -91,4 +91,6 @@
+ 
+ 	/*Clean up and return*/
+ 	xDelete<IssmDouble>(G);
++	xDelete<IssmDouble>(X);
++	xDelete<IssmDouble>(X0);
+ }
Index: /issm/oecreview/Archive/17984-18295/ISSM-18027-18028.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18027-18028.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18027-18028.diff	(revision 18296)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/c/cores/controlvalidation_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 18027)
++++ ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 18028)
+@@ -80,14 +80,20 @@
+ 		for(int i=0;i<n;i++) Den += alpha * G[i] * 1.;
+ 		Ialpha = fabs((j - j0)/Den - 1.);
+ 
+-
+ 		_printf0_(" " << setw(11) << setprecision (5)<<alpha<<" " << setw(11) << setprecision (5)<<Ialpha<<"\n");
+ 		output[m*2+0] = alpha;
+ 		output[m*2+1] = Ialpha;
+ 	}
+ 
+ 	/*output*/
++	#ifdef _HAVE_ADOLC_
++	IssmPDouble* J_passive=xNew<IssmPDouble>(2*num);
++	for(int i=0;i<2*num;i++) J_passive[i]=reCast<IssmPDouble>(J[i]);
++	femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,JEnum,J_passive,num,2,1,0));
++	xDelete<IssmPDouble>(J_passive);
++	#else
+ 	femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,JEnum,output,num,2,1,0));
++	#endif
+ 
+ 	/*Clean up and return*/
+ 	xDelete<IssmDouble>(G);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18028-18029.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18028-18029.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18028-18029.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/cores/controlvalidation_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 18028)
++++ ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 18029)
+@@ -88,7 +88,7 @@
+ 	/*output*/
+ 	#ifdef _HAVE_ADOLC_
+ 	IssmPDouble* J_passive=xNew<IssmPDouble>(2*num);
+-	for(int i=0;i<2*num;i++) J_passive[i]=reCast<IssmPDouble>(J[i]);
++	for(int i=0;i<2*num;i++) J_passive[i]=reCast<IssmPDouble>(output[i]);
+ 	femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,JEnum,J_passive,num,2,1,0));
+ 	xDelete<IssmPDouble>(J_passive);
+ 	#else
Index: /issm/oecreview/Archive/17984-18295/ISSM-18029-18030.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18029-18030.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18029-18030.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/cores/controlvalidation_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 18029)
++++ ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 18030)
+@@ -54,7 +54,7 @@
+ 	IssmDouble exp0 = 0.;
+ 	IssmDouble incr = -0.2;
+ 	IssmDouble exp1 = -8.;
+-	int        num  = reCast<int>((exp1-exp0)/incr);
++	int        num  = reCast<int,IssmDouble>((exp1-exp0)/incr);
+ 
+ 	/*Allocate output*/
+ 	IssmDouble* output = xNew<IssmDouble>(2*num);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18030-18031.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18030-18031.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18030-18031.diff	(revision 18296)
@@ -0,0 +1,29 @@
+Index: ../trunk-jpl/src/m/classes/damage.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/damage.py	(revision 18030)
++++ ../trunk-jpl/src/m/classes/damage.py	(revision 18031)
+@@ -165,9 +165,9 @@
+ 			WriteData(fid,'object',self,'fieldname','spcdamage','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1)
+ 			WriteData(fid,'object',self,'fieldname','max_damage','format','Double')
+ 			WriteData(fid,'object',self,'fieldname','stabilization','format','Integer')
+-			WriteData(fid,'object',self,'fieldname','elementinterp','format','String')
++			WriteData(fid,'object',self,'fieldname','maxiter','format','Integer')
++			WriteData(fid,'enum',DamageElementinterpEnum(),'data',StringToEnum(self.elementinterp)[0],'format','Integer')
+ 			WriteData(fid,'object',self,'fieldname','penalty_threshold','format','Integer')
+-			WriteData(fid,'object',self,'fieldname','maxiter','format','Integer')
+ 			WriteData(fid,'object',self,'fieldname','penalty_lock','format','Integer')
+ 			WriteData(fid,'object',self,'fieldname','penalty_factor','format','Double')
+ 
+Index: ../trunk-jpl/src/m/classes/damage.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/damage.m	(revision 18030)
++++ ../trunk-jpl/src/m/classes/damage.m	(revision 18031)
+@@ -226,7 +226,7 @@
+ 
+ 				WriteData(fid,'object',obj,'fieldname','stabilization','format','Integer');
+ 				WriteData(fid,'object',obj,'fieldname','maxiter','format','Integer');
+-				WriteData(fid,'object',obj,'fieldname','elementinterp','format','String');
++				WriteData(fid,'enum',DamageElementinterpEnum(),'data',StringToEnum(self.elementinterp)[0],'format','Integer');
+ 				WriteData(fid,'object',obj,'fieldname','penalty_threshold','format','Integer');
+ 				WriteData(fid,'object',obj,'fieldname','penalty_lock','format','Integer');
+ 				WriteData(fid,'object',obj,'fieldname','penalty_factor','format','Double');
Index: /issm/oecreview/Archive/17984-18295/ISSM-18031-18032.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18031-18032.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18031-18032.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/damage.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/damage.m	(revision 18031)
++++ ../trunk-jpl/src/m/classes/damage.m	(revision 18032)
+@@ -226,7 +226,7 @@
+ 
+ 				WriteData(fid,'object',obj,'fieldname','stabilization','format','Integer');
+ 				WriteData(fid,'object',obj,'fieldname','maxiter','format','Integer');
+-				WriteData(fid,'enum',DamageElementinterpEnum(),'data',StringToEnum(self.elementinterp)[0],'format','Integer');
++				WriteData(fid,'enum',DamageElementinterpEnum(),'data',StringToEnum(obj.elementinterp),'format','Integer');
+ 				WriteData(fid,'object',obj,'fieldname','penalty_threshold','format','Integer');
+ 				WriteData(fid,'object',obj,'fieldname','penalty_lock','format','Integer');
+ 				WriteData(fid,'object',obj,'fieldname','penalty_factor','format','Double');
Index: /issm/oecreview/Archive/17984-18295/ISSM-18032-18033.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18032-18033.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18032-18033.diff	(revision 18296)
@@ -0,0 +1,65 @@
+Index: ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 18032)
++++ ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 18033)
+@@ -22,6 +22,7 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject(DamagePenaltyFactorEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(DamageMaxiterEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(DamageMaxDamageEnum));
++	parameters->AddObject(iomodel->CopyConstantObject(DamageElementinterpEnum));
+ 
+ 	/*Requested outputs*/
+ 	iomodel->FetchData(&requestedoutputs,&numoutputs,DamageEvolutionRequestedOutputsEnum);
+@@ -46,8 +47,10 @@
+ }/*}}}*/
+ void DamageEvolutionAnalysis::UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
+ 
+-	int finiteelement = P1Enum;
++	int finiteelement;
+ 
++	iomodel->Constant(&finiteelement,DamageElementinterpEnum);
++
+ 	/*Update elements: */
+ 	int counter=0;
+ 	for(int i=0;i<iomodel->numberofelements;i++){
+@@ -74,8 +77,10 @@
+ }/*}}}*/
+ void DamageEvolutionAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+ 
+-	int finiteelement = P1Enum;
++	int finiteelement;
+ 
++	iomodel->Constant(&finiteelement,DamageElementinterpEnum);
++
+ 	if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(1,MeshVertexonbaseEnum);
+ 	::CreateNodes(nodes,iomodel,DamageEvolutionAnalysisEnum,finiteelement);
+ 	iomodel->DeleteData(1,MeshVertexonbaseEnum);
+@@ -83,8 +88,9 @@
+ void DamageEvolutionAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+ 
+ 	int stabilization;
+-	int finiteelement = P1Enum;
++	int finiteelement;
+ 	iomodel->Constant(&stabilization,DamageStabilizationEnum);
++	iomodel->Constant(&finiteelement,DamageElementinterpEnum);
+ 
+ 	IoModelToConstraintsx(constraints,iomodel,DamageSpcdamageEnum,DamageEvolutionAnalysisEnum,finiteelement);
+ 
+@@ -469,8 +475,6 @@
+ 		damage_input = element->GetInput(DamageDEnum);   _assert_(damage_input);
+ 	}
+ 
+-
+-
+ 	/*retrieve the desired type of equivalent stress*/
+ 	element->FindParam(&equivstress,DamageEquivStressEnum);
+ 
+@@ -508,7 +512,7 @@
+ 	}
+ 
+ 	/*Add input*/
+-	element->AddInput(DamageFEnum,f,P1Enum);
++	element->AddInput(DamageFEnum,f,element->GetElementType());
+ 	
+ 	/*Clean up and return*/
+ 	xDelete<IssmDouble>(f);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18033-18034.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18033-18034.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18033-18034.diff	(revision 18296)
@@ -0,0 +1,45 @@
+Index: ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 18033)
++++ ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 18034)
+@@ -87,9 +87,7 @@
+ }/*}}}*/
+ void DamageEvolutionAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/
+ 
+-	int stabilization;
+ 	int finiteelement;
+-	iomodel->Constant(&stabilization,DamageStabilizationEnum);
+ 	iomodel->Constant(&finiteelement,DamageElementinterpEnum);
+ 
+ 	IoModelToConstraintsx(constraints,iomodel,DamageSpcdamageEnum,DamageEvolutionAnalysisEnum,finiteelement);
+@@ -449,8 +447,8 @@
+ 	int equivstress,domaintype;
+ 
+ 	/*Fetch number of vertices and allocate output*/
+-	int numvertices = element->GetNumberOfVertices();
+-	IssmDouble* f   = xNew<IssmDouble>(numvertices);
++	int numnodes = element->GetNumberOfNodes();
++	IssmDouble* f   = xNew<IssmDouble>(numnodes);
+ 
+ 	/*retrieve parameters:*/
+ 	element->FindParam(&c1,DamageC1Enum);
+@@ -480,8 +478,8 @@
+ 
+ 	/*Calculate damage evolution source term: */
+ 	Gauss* gauss=element->NewGauss();
+-	for (int iv=0;iv<numvertices;iv++){
+-		gauss->GaussVertex(iv);
++	for (int i=0;i<numnodes;i++){
++		gauss->GaussNode(element->GetElementType(),i);
+ 		
+ 		damage_input->GetInputValue(&damage,gauss);
+ 		tau_xx_input->GetInputValue(&tau_xx,gauss);
+@@ -508,7 +506,7 @@
+ 		PosPsi=max(Psi,0.);
+ 		NegPsi=max(-Chi,0.); /* healing only for compressive stresses */
+ 
+-		f[iv]= c1*(pow(PosPsi,c2) - healing*pow(NegPsi,c2))*pow((1.-damage),-c3);
++		f[i]= c1*(pow(PosPsi,c2) - healing*pow(NegPsi,c2))*pow((1.-damage),-c3);
+ 	}
+ 
+ 	/*Add input*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18034-18035.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18034-18035.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18034-18035.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18034)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18035)
+@@ -1239,7 +1239,7 @@
+ 			thicknessobs_input->GetInputValue(&thicknessobs,gauss);
+ 			gauss->GaussPoint(ig);
+ 
+-			J +=0.5*(thickness*thickness - thicknessobs*thicknessobs)*weight*Jdet*gauss->weight;
++			J +=0.5*(thickness*thickness - thicknessobs*thicknessobs)*(thickness*thickness - thicknessobs*thicknessobs)*weight*Jdet*gauss->weight;
+ 		}
+ 
+ 		/*clean up and Return: */
Index: /issm/oecreview/Archive/17984-18295/ISSM-18035-18036.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18035-18036.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18035-18036.diff	(revision 18296)
@@ -0,0 +1,31 @@
+Index: ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp	(revision 18035)
++++ ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp	(revision 18036)
+@@ -71,7 +71,8 @@
+ 	int numnodes = element->GetNumberOfNodes();
+ 
+ 	/*Initialize Element vector and other vectors*/
+-	ElementMatrix* Ke  = element->NewElementMatrix();
++	ElementMatrix* Ke     = element->NewElementMatrix();
++	IssmDouble*    dbasis = xNew<IssmDouble>(2*numnodes);
+ 
+ 	/*Retrieve all inputs and parameters*/
+ 	element->GetVerticesCoordinates(&xyz_list);
+@@ -80,8 +81,6 @@
+ 	Gauss* gauss=element->NewGauss(2);
+ 	for(int ig=gauss->begin();ig<gauss->end();ig++){
+ 		gauss->GaussPoint(ig);
+-
+-		IssmDouble* dbasis=xNew<IssmDouble>(2*numnodes);
+ 		element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+ 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
+ 
+@@ -94,6 +93,7 @@
+ 
+ 	/*Clean up and return*/
+ 	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(dbasis);
+ 	delete gauss;
+ 	return Ke;
+ }/*}}}*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18036-18037.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18036-18037.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18036-18037.diff	(revision 18296)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 18036)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 18037)
+@@ -93,7 +93,7 @@
+ 
+ 		NUMx = 2.*dbasis[0]*dphi[0]*(dphi[0]*dphi[0] + dphi[1]*dphi[1] - hu2);
+ 		NUMy = 2.*dbasis[1]*dphi[1]*(dphi[0]*dphi[0] + dphi[1]*dphi[1] - hu2);
+-		DEN = vbar2*vbar2;
++		DEN = vbar2*vbar2+1.e-14;
+ 
+ 		/*Loop over all requested responses*/
+ 		for(int resp=0;resp<num_responses;resp++){
+@@ -101,7 +101,7 @@
+ 
+ 			switch(responses[resp]){
+ 				case Balancethickness2MisfitEnum:
+-					for(i=0;i<numnodes;i++) pe->values[i]+=(NUMx+NUMy)/DEN *weight*Jdet*gauss->weight*basis[i];
++					for(i=0;i<numnodes;i++) pe->values[i]+=(NUMx+NUMy)/DEN *weight*Jdet*gauss->weight;
+ 					break;
+ 				default:
+ 					_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
Index: /issm/oecreview/Archive/17984-18295/ISSM-18041-18042.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18041-18042.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18041-18042.diff	(revision 18296)
@@ -0,0 +1,52 @@
+Index: ../trunk-jpl/test/NightlyRun/test275.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test275.py	(revision 18041)
++++ ../trunk-jpl/test/NightlyRun/test275.py	(revision 18042)
+@@ -18,7 +18,7 @@
+ md.damage.isdamage=1
+ md.damage.D=0.1*numpy.ones(md.mesh.numberofvertices)
+ md.damage.spcdamage=numpy.nan*numpy.ones(md.mesh.numberofvertices)
+-md.damage.law='pralong'
++md.damage.law=1
+ 
+ md.damage.c1=1.e-11
+ md.damage.c2=0.4
+Index: ../trunk-jpl/test/NightlyRun/test275.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test275.m	(revision 18041)
++++ ../trunk-jpl/test/NightlyRun/test275.m	(revision 18042)
+@@ -5,7 +5,7 @@
+ md.damage.isdamage=1;
+ md.damage.D=0.1*ones(md.mesh.numberofvertices,1);
+ md.damage.spcdamage=NaN*ones(md.mesh.numberofvertices,1);
+-md.damage.law='pralong';
++md.damage.law=1;
+ 
+ md.damage.c1=1.e-11;
+ md.damage.c2=0.4;
+Index: ../trunk-jpl/test/NightlyRun/test271.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test271.py	(revision 18041)
++++ ../trunk-jpl/test/NightlyRun/test271.py	(revision 18042)
+@@ -18,7 +18,7 @@
+ md.damage.isdamage=1
+ md.damage.D=numpy.zeros(md.mesh.numberofvertices)
+ md.damage.spcdamage=numpy.nan*numpy.ones(md.mesh.numberofvertices)
+-md.damage.law='pralong'
++md.damage.law=1
+ md.damage.stabilization=1;
+ 
+ pos=numpy.nonzero(numpy.logical_and(md.mask.ice_levelset!=0,md.mesh.vertexonboundary==1))
+Index: ../trunk-jpl/test/NightlyRun/test271.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test271.m	(revision 18041)
++++ ../trunk-jpl/test/NightlyRun/test271.m	(revision 18042)
+@@ -5,7 +5,7 @@
+ md.damage.isdamage=1;
+ md.damage.D=zeros(md.mesh.numberofvertices,1);
+ md.damage.spcdamage=NaN*ones(md.mesh.numberofvertices,1);
+-md.damage.law='pralong';
++md.damage.law=1;
+ 
+ %boundary conditions for damage, to be put in SquareShelf.par
+ boundary=zeros(md.mesh.numberofvertices,1);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18042-18043.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18042-18043.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18042-18043.diff	(revision 18296)
@@ -0,0 +1,170 @@
+Index: ../trunk-jpl/src/m/classes/damage.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/damage.py	(revision 18042)
++++ ../trunk-jpl/src/m/classes/damage.py	(revision 18043)
+@@ -18,7 +18,7 @@
+ 		#damage: 
+ 		self.isdamage           = 0.
+ 		self.D						= float('NaN')
+-		self.law						= ''
++		self.law						= float('NaN')
+ 		self.spcdamage				= float('NaN')
+ 		self.max_damage			= float('NaN')
+ 		
+@@ -52,7 +52,7 @@
+ 		s+="%s\n" % fielddisplay(self,"isdamage","is damage mechanics being used? [0 (default) or 1]")
+ 		if self.isdamage:
+ 			s+="%s\n" % fielddisplay(self,"D","damage tensor (scalar for now)")
+-			s+="%s\n" % fielddisplay(self,"law","damage law (string) from ['undamaged','pralong']")
++			s+="%s\n" % fielddisplay(self,"law","damage law ['0: undamaged','1: pralong']")
+ 			s+="%s\n" % fielddisplay(self,"spcdamage","damage constraints (NaN means no constraint)")
+ 			s+="%s\n" % fielddisplay(self,"max_damage","maximum possible damage (0<=max_damage<1)")
+ 
+@@ -63,7 +63,7 @@
+ 			s+="%s\n" % fielddisplay(self,"penalty_threshold","threshold to declare convergence of damage evolution solution (default is 0)")
+ 			s+="%s\n" % fielddisplay(self,"penalty_factor","scaling exponent (default is 3)")
+ 
+-		if (self.law=='pralong'):
++		if self.law== 1 or self.law == 2:
+ 			s+="%s\n" % fielddisplay(self,"c1","damage parameter 1 ")
+ 			s+="%s\n" % fielddisplay(self,"c2","damage parameter 2 ")
+ 			s+="%s\n" % fielddisplay(self,"c3","damage parameter 3 ")
+@@ -80,7 +80,7 @@
+ 		#damage parameters: 
+ 		self.isdamage=0
+ 		self.D=0
+-		self.law='undamaged'
++		self.law=0
+ 
+ 		self.max_damage=1-1e-5 #if damage reaches 1, solve becomes singular, as viscosity becomes nil
+ 		
+@@ -131,7 +131,7 @@
+ 		if self.isdamage:
+ 			md = checkfield(md,'fieldname','damage.D','>=',0,'<=',self.max_damage,'size',[md.mesh.numberofvertices])
+ 			md = checkfield(md,'fieldname','damage.max_damage','<',1,'>=',0)
+-			md = checkfield(md,'fieldname','damage.law','values',['undamaged','pralong'])
++			md = checkfield(md,'fieldname','damage.law','numel',[1],'values',[0,1,2])
+ 			md = checkfield(md,'fieldname','damage.spcdamage','forcing',1)
+ 			md = checkfield(md,'fieldname','damage.stabilization','numel',[1],'values',[0,1,2])
+ 			md = checkfield(md,'fieldname','damage.maxiter','>=0',0)
+@@ -140,7 +140,7 @@
+ 			md = checkfield(md,'fieldname','damage.penalty_lock','>=0',0)
+ 			md = checkfield(md,'fieldname','damage.penalty_threshold','>=0',0)
+ 
+-		if self.law == 'pralong':
++		if self.law == 1 or self.law == 2:
+ 			md = checkfield(md,'fieldname','damage.healing','>=',0)
+ 			md = checkfield(md,'fieldname','damage.c1','>=',0)
+ 			md = checkfield(md,'fieldname','damage.c2','>=',0)
+@@ -150,7 +150,7 @@
+ 			md = checkfield(md,'fieldname','damage.healing','>=',0)
+ 			md = checkfield(md,'fieldname','damage.equiv_stress','numel',[1],'values',[0,1])
+ 			md = checkfield(md,'fieldname','damage.requested_outputs','stringrow',1)
+-		elif m.strcmpi(self.law,'undamaged'):
++		elif self.law != 0:
+ 			if (solution==DamageEvolutionSolutionEnum):
+ 				raise RuntimeError('Invalid evolution law (md.damage.law) for a damage solution')
+ 
+@@ -161,7 +161,7 @@
+ 		WriteData(fid,'object',self,'fieldname','isdamage','format','Boolean')
+ 		if self.isdamage:
+ 			WriteData(fid,'object',self,'fieldname','D','format','DoubleMat','mattype',1)
+-			WriteData(fid,'object',self,'fieldname','law','format','String')
++			WriteData(fid,'object',self,'fieldname','law','format','Integer')
+ 			WriteData(fid,'object',self,'fieldname','spcdamage','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1)
+ 			WriteData(fid,'object',self,'fieldname','max_damage','format','Double')
+ 			WriteData(fid,'object',self,'fieldname','stabilization','format','Integer')
+@@ -171,7 +171,7 @@
+ 			WriteData(fid,'object',self,'fieldname','penalty_lock','format','Integer')
+ 			WriteData(fid,'object',self,'fieldname','penalty_factor','format','Double')
+ 
+-		if self.law=='pralong':
++		if self.law==1 or self.law==2:
+ 			WriteData(fid,'object',self,'fieldname','c1','format','Double')
+ 			WriteData(fid,'object',self,'fieldname','c2','format','Double')
+ 			WriteData(fid,'object',self,'fieldname','c3','format','Double')
+Index: ../trunk-jpl/src/m/classes/damage.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/damage.m	(revision 18042)
++++ ../trunk-jpl/src/m/classes/damage.m	(revision 18043)
+@@ -8,7 +8,7 @@
+ 		%damage 
+ 		isdamage            = 0;
+ 		D                   = NaN;
+-		law                 = '';
++		law                 = NaN;
+ 		spcdamage           = NaN; 
+ 		max_damage          = NaN;
+ 	
+@@ -108,7 +108,7 @@
+ 			%damage parameters: 
+ 			obj.isdamage=0;
+ 			obj.D=0;
+-			obj.law='undamaged';
++			obj.law=0;
+ 			
+ 			obj.max_damage=1-1e-5; %if damage reaches 1, solve becomes singular, as viscosity becomes nil
+ 		
+@@ -147,7 +147,7 @@
+ 			
+ 			md = checkfield(md,'fieldname','damage.isdamage','values',[1,0]);
+ 			if obj.isdamage,
+-				md = checkfield(md,'fieldname','damage.law','values',{'undamaged','pralong'});
++				md = checkfield(md,'fieldname','damage.law','numel',[1],'values',[0,1,2]);
+ 				md = checkfield(md,'fieldname','damage.D','>=',0,'<=',obj.max_damage,'size',[md.mesh.numberofvertices 1]);
+ 				md = checkfield(md,'fieldname','damage.spcdamage','forcing',1);
+ 				md = checkfield(md,'fieldname','damage.max_damage','<',1,'>=',0);
+@@ -159,7 +159,7 @@
+ 				md = checkfield(md,'fieldname','damage.penalty_threshold','>=0',0);
+ 			end
+ 
+-			if strcmpi(obj.law,'pralong'),
++			if (obj.law==1 | obj.law==2),
+ 				md = checkfield(md,'fieldname','damage.healing','>=',0);
+ 				md = checkfield(md,'fieldname','damage.c1','>=',0);
+ 				md = checkfield(md,'fieldname','damage.c2','>=',0);
+@@ -168,7 +168,7 @@
+ 				md = checkfield(md,'fieldname','damage.stress_threshold','>=',0);
+ 				md = checkfield(md,'fieldname','damage.equiv_stress','numel',[1],'values',[0 1]);
+ 				md = checkfield(md,'fieldname','damage.requested_outputs','stringrow',1);
+-			elseif strcmpi(obj.law,'undamaged'),
++			elseif (obj.law>0),
+ 				if (solution==DamageEvolutionSolutionEnum),
+ 					error('Invalid evolution law (md.damage.law) for a damage solution');
+ 				end
+@@ -190,7 +190,7 @@
+ 
+ 			fielddisplay(obj,'isdamage','is damage mechanics being used? {true,false}');
+ 			if obj.isdamage,
+-				fielddisplay(obj,'law','damage law (string) from {''undamaged'',''pralong''}');
++				fielddisplay(obj,'law','damage law {''0: undamaged'',''1: pralong''}');
+ 				fielddisplay(obj,'D','damage tensor (scalar)');
+ 				fielddisplay(obj,'spcdamage','damage constraints (NaN means no constraint)');
+ 				fielddisplay(obj,'max_damage','maximum possible damage (0<=max_damage<1)');
+@@ -203,7 +203,7 @@
+ 				fielddisplay(obj,'penalty_factor','scaling exponent (default is 3)');
+ 			end
+ 
+-			if strcmpi(obj.law,'pralong'),
++			if (obj.law==1 | obj.law==2),
+ 				fielddisplay(obj,'c1','damage parameter 1');
+ 				fielddisplay(obj,'c2','damage parameter 2');
+ 				fielddisplay(obj,'c3','damage parameter 3');
+@@ -219,7 +219,7 @@
+ 		
+ 			WriteData(fid,'object',obj,'fieldname','isdamage','format','Boolean');
+ 			if obj.isdamage,
+-				WriteData(fid,'object',obj,'fieldname','law','format','String');
++				WriteData(fid,'object',obj,'fieldname','law','format','Integer');
+ 				WriteData(fid,'object',obj,'fieldname','D','format','DoubleMat','mattype',1);
+ 				WriteData(fid,'object',obj,'fieldname','spcdamage','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
+ 				WriteData(fid,'object',obj,'fieldname','max_damage','format','Double');
+@@ -232,7 +232,7 @@
+ 				WriteData(fid,'object',obj,'fieldname','penalty_factor','format','Double');
+ 			end
+ 	
+-			if strcmpi(obj.law,'pralong'),
++			if (obj.law==1 | obj.law==2),
+ 				WriteData(fid,'object',obj,'fieldname','c1','format','Double');
+ 				WriteData(fid,'object',obj,'fieldname','c2','format','Double');
+ 				WriteData(fid,'object',obj,'fieldname','c3','format','Double');
Index: /issm/oecreview/Archive/17984-18295/ISSM-18043-18044.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18043-18044.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18043-18044.diff	(revision 18296)
@@ -0,0 +1,166 @@
+Index: ../trunk-jpl/src/m/classes/damage.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/damage.m	(revision 18043)
++++ ../trunk-jpl/src/m/classes/damage.m	(revision 18044)
+@@ -8,82 +8,82 @@
+ 		%damage 
+ 		isdamage            = 0;
+ 		D                   = NaN;
+-		law                 = NaN;
++		law                 = 0;
+ 		spcdamage           = NaN; 
+-		max_damage          = NaN;
++		max_damage          = 0;
+ 	
+ 		%numerical
+-		stabilization       = NaN;
+-		maxiter             = NaN;
++		stabilization       = 0;
++		maxiter             = 0;
+ 		elementinterp       = '';
+-		penalty_threshold   = NaN;
+-		penalty_lock        = NaN;
+-		penalty_factor      = NaN;
++		penalty_threshold   = 0;
++		penalty_lock        = 0;
++		penalty_factor      = 0;
+ 		
+ 		%general parameters for evolution law: 
+-		stress_threshold    = NaN;
+-		c1                  = NaN;
+-		c2                  = NaN;
+-		c3                  = NaN;
+-		c4                  = NaN;
+-		healing             = NaN;
+-		equiv_stress		  = NaN;
++		stress_threshold    = 0;
++		c1                  = 0;
++		c2                  = 0;
++		c3                  = 0;
++		c4                  = 0;
++		healing             = 0;
++		equiv_stress		  = 0;
+ 		requested_outputs   = {};
+ 	end
+ 	methods
+-        function createxml(obj,fid) % {{{
+-            fprintf(fid, '\n\n');
+-            fprintf(fid, '%s\n', '<!-- damage -->');
+-            fprintf(fid, '%s\n', '<!-- Note: this class depends on different input of law -->');
+-            
+-            %fprintf(fid,'%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="law" type="logical"',           '" default="',                num2str(obj.law),'">',   '     <section name="damage" />','     <help> damage law (string) from {"undamaged","pralong"} </help>','</parameter>');
+-            % drop-down 
+-            fprintf(fid,'%s%s%s%s%s\n\t%s\n','<parameter key ="law" type="','alternative','" optional="','false','">','<section name="damage" />');
+-            
+-            % law = 'undamage'
+-            fprintf(fid,'\t%s%s%s%s%s\n\t\t%s\n','<option value="undamage" type="','string','" default="','true','">','<help> law = undamage </help>');
+-            % footer for option
+-            fprintf(fid,'\t%s\n%s\n','</option>');
+-            
+-            % law = 'pralong'
+-            fprintf(fid,'\t%s%s%s%s%s\n\t\t%s\n','<option value="pralong" type="','string','" default="','false','">','<help> law = pralong </help>');
+-                
+-            fprintf(fid,'\t\t%s%s%s%s%s\n\t\t\t%s\n\t\t%s\n',   '<parameter key ="stress_threshold" type="',class(obj.stress_threshold),'" default="',num2str(obj.stress_threshold),'">','<help> damage stress threshold [Pa] </help>','</parameter>');
+-            fprintf(fid,'\t\t%s%s%s%s%s\n\t\t\t%s\n\t\t%s\n',	'<parameter key ="c1" type="', class(obj.c1),'" default="',   num2str(obj.c1),'">',   '<help> damage parameter 1 </help>','</parameter>');
+-            fprintf(fid,'\t\t%s%s%s%s%s\n\t\t\t%s\n\t\t%s\n',  	'<parameter key ="c2" type="',          class(obj.c2),'" default="',            num2str(obj.c2),'">','<help> damage parameter 2 </help>','</parameter>');
+-            fprintf(fid,'\t\t%s%s%s%s%s\n\t\t\t%s\n\t\t%s\n',  	'<parameter key ="c3" type="',          class(obj.c3),'" default="',            num2str(obj.c3),'">','<help> damage parameter 3 [W/m^2] </help>','</parameter>');
+-            fprintf(fid,'\t\t%s%s%s%s%s\n\t\t\t%s\n\t\t%s\n',  	'<parameter key ="c4" type="',            class(obj.c4),'" default="',              num2str(obj.c4),'">','<help> damage parameter 4 </help>','</parameter>');
+-            fprintf(fid,'\t\t%s%s%s%s%s\n\t\t\t%s\n\t\t%s\n',  	'<parameter key ="healing" type="', class(obj.healing),'" default="',   num2str(obj.healing),'">','<help> damage healing parameter 1 </help>','</parameter>');
+-            fprintf(fid,'\t\t%s%s%s%s%s\n\t\t\t%s\n\t\t%s\n',  	'<parameter key ="equiv_stress" type="',          class(obj.equiv_stress),'" default="',convert2str(obj.equiv_stress),'">','<help> 0: von Mises </help>','</parameter>');
+-            fprintf(fid,'\t\t%s%s%s%s%s\n\t\t\t%s\n\t\t%s\n',  	'<parameter key ="requested_outputs" type="',          class(obj.requested_outputs),'" default="',convert2str(obj.requested_outputs),'">','<help> additional outputs requested </help>','</parameter>');
+-             
+-                
+-            % footer for option
+-            fprintf(fid,'\t%s\n%s\n','</option>');
+-                 
+-            
+-            % footer for drop-down
+-            fprintf(fid,'\t%s\n%s\n%s','<help> damage law (string) from {"undamaged","pralong"} </help>','</parameter>');
+-            
+-            
++		function createxml(obj,fid) % {{{
++			fprintf(fid, '\n\n');
++			fprintf(fid, '%s\n', '<!-- damage -->');
++			fprintf(fid, '%s\n', '<!-- Note: this class depends on different input of law -->');
++
++			%fprintf(fid,'%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="law" type="logical"',           '" default="',                num2str(obj.law),'">',   '     <section name="damage" />','     <help> damage law (string) from {"undamaged","pralong"} </help>','</parameter>');
++			% drop-down 
++			fprintf(fid,'%s%s%s%s%s\n\t%s\n','<parameter key ="law" type="','alternative','" optional="','false','">','<section name="damage" />');
++
++			% law = 'undamage'
++			fprintf(fid,'\t%s%s%s%s%s\n\t\t%s\n','<option value="undamage" type="','string','" default="','true','">','<help> law = undamage </help>');
++			% footer for option
++			fprintf(fid,'\t%s\n%s\n','</option>');
++
++			% law = 'pralong'
++			fprintf(fid,'\t%s%s%s%s%s\n\t\t%s\n','<option value="pralong" type="','string','" default="','false','">','<help> law = pralong </help>');
++
++			fprintf(fid,'\t\t%s%s%s%s%s\n\t\t\t%s\n\t\t%s\n',   '<parameter key ="stress_threshold" type="',class(obj.stress_threshold),'" default="',num2str(obj.stress_threshold),'">','<help> damage stress threshold [Pa] </help>','</parameter>');
++			fprintf(fid,'\t\t%s%s%s%s%s\n\t\t\t%s\n\t\t%s\n',	'<parameter key ="c1" type="', class(obj.c1),'" default="',   num2str(obj.c1),'">',   '<help> damage parameter 1 </help>','</parameter>');
++			fprintf(fid,'\t\t%s%s%s%s%s\n\t\t\t%s\n\t\t%s\n',  	'<parameter key ="c2" type="',          class(obj.c2),'" default="',            num2str(obj.c2),'">','<help> damage parameter 2 </help>','</parameter>');
++			fprintf(fid,'\t\t%s%s%s%s%s\n\t\t\t%s\n\t\t%s\n',  	'<parameter key ="c3" type="',          class(obj.c3),'" default="',            num2str(obj.c3),'">','<help> damage parameter 3 [W/m^2] </help>','</parameter>');
++			fprintf(fid,'\t\t%s%s%s%s%s\n\t\t\t%s\n\t\t%s\n',  	'<parameter key ="c4" type="',            class(obj.c4),'" default="',              num2str(obj.c4),'">','<help> damage parameter 4 </help>','</parameter>');
++			fprintf(fid,'\t\t%s%s%s%s%s\n\t\t\t%s\n\t\t%s\n',  	'<parameter key ="healing" type="', class(obj.healing),'" default="',   num2str(obj.healing),'">','<help> damage healing parameter 1 </help>','</parameter>');
++			fprintf(fid,'\t\t%s%s%s%s%s\n\t\t\t%s\n\t\t%s\n',  	'<parameter key ="equiv_stress" type="',          class(obj.equiv_stress),'" default="',convert2str(obj.equiv_stress),'">','<help> 0: von Mises </help>','</parameter>');
++			fprintf(fid,'\t\t%s%s%s%s%s\n\t\t\t%s\n\t\t%s\n',  	'<parameter key ="requested_outputs" type="',          class(obj.requested_outputs),'" default="',convert2str(obj.requested_outputs),'">','<help> additional outputs requested </help>','</parameter>');
++
++
++			% footer for option
++			fprintf(fid,'\t%s\n%s\n','</option>');
++
++
++			% footer for drop-down
++			fprintf(fid,'\t%s\n%s\n%s','<help> damage law (string) from {"undamaged","pralong"} </help>','</parameter>');
++
++
+ 			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="D" type="',              class(obj.D),'" default="',                  num2str(obj.D),'">',              '     <section name="damage" />','     <help> damage tensor (scalar) </help>','</parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="law" type="',            class(obj.law),'" default="',                num2str(obj.law),'">',   '     <section name="damage" />','     <help> damage law (string) from {"undamaged","pralong"} </help>','</parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',        '<parameter key ="spcdamage" type="',      class(obj.spcdamage),'" default="',          num2str(obj.spcdamage),'">',            '     <section name="damage" />','     <help> damage constraints (NaN means no constraint) </help>','</parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',        '<parameter key ="max_damage" type="',     class(obj.max_damage),'" default="',         num2str(obj.max_damage),'">',            '     <section name="damage" />','     <help> maximum possible damage (0&amp;lt;=max_damage&amp;lt;1) </help>','</parameter>');
+-             
+-            % stabilization (0,1, or 2) drop-down
+-            fprintf(fid,'%s\n%s\n%s\n%s\n',    '<parameter key ="stabilization" type="alternative" optional="false">','     <section name="damage" />','     <help> 0: no, 1: artificial_diffusivity, 2: SUPG </help>');
+-            fprintf(fid, '%s\n', '       <option value="0" type="string" default="true"></option>');
+-            fprintf(fid, '%s\n', '       <option value="1" type="string" default="false"></option>');
+-            fprintf(fid, '%s\n', '       <option value="2" type="string" default="false"></option>');
+-            fprintf(fid, '%s\n','</parameter>');
+-            
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="maxiter" type="',             class(obj.maxiter),'" default="',   num2str(obj.maxiter),'">',   '     <section name="damage" />','     <help> maximum number of non linear iterations </help>','</parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',        '<parameter key ="penalty_lock" type="',        class(obj.penalty_lock),'" default="',            num2str(obj.penalty_lock),'">',            '     <section name="damage" />','     <help> stabilize unstable damage constraints that keep zigzagging after n iteration (default is 0, no stabilization) </help>','</parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',        '<parameter key ="penalty_threshold" type="',   class(obj.penalty_threshold),'" default="',            num2str(obj.penalty_threshold),'">',            '     <section name="damage" />','     <help> threshold to declare convergence of damage evolution solution (default is 0) </help>','</parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',        '<parameter key ="penalty_factor" type="',      class(obj.penalty_factor),'" default="',            num2str(obj.penalty_factor),'">',            '     <section name="damage" />','     <help> scaling exponent (default is 3) </help>','</parameter>');
+- 
+-        end % }}}
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="law" type="',            class(obj.law),'" default="',                num2str(obj.law),'">',   '     <section name="damage" />','     <help> damage law (string) from {"undamaged","pralong"} </help>','</parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',        '<parameter key ="spcdamage" type="',      class(obj.spcdamage),'" default="',          num2str(obj.spcdamage),'">',            '     <section name="damage" />','     <help> damage constraints (NaN means no constraint) </help>','</parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',        '<parameter key ="max_damage" type="',     class(obj.max_damage),'" default="',         num2str(obj.max_damage),'">',            '     <section name="damage" />','     <help> maximum possible damage (0&amp;lt;=max_damage&amp;lt;1) </help>','</parameter>');
++
++			% stabilization (0,1, or 2) drop-down
++			fprintf(fid,'%s\n%s\n%s\n%s\n',    '<parameter key ="stabilization" type="alternative" optional="false">','     <section name="damage" />','     <help> 0: no, 1: artificial_diffusivity, 2: SUPG </help>');
++			fprintf(fid, '%s\n', '       <option value="0" type="string" default="true"></option>');
++			fprintf(fid, '%s\n', '       <option value="1" type="string" default="false"></option>');
++			fprintf(fid, '%s\n', '       <option value="2" type="string" default="false"></option>');
++			fprintf(fid, '%s\n','</parameter>');
++
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="maxiter" type="',             class(obj.maxiter),'" default="',   num2str(obj.maxiter),'">',   '     <section name="damage" />','     <help> maximum number of non linear iterations </help>','</parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',        '<parameter key ="penalty_lock" type="',        class(obj.penalty_lock),'" default="',            num2str(obj.penalty_lock),'">',            '     <section name="damage" />','     <help> stabilize unstable damage constraints that keep zigzagging after n iteration (default is 0, no stabilization) </help>','</parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',        '<parameter key ="penalty_threshold" type="',   class(obj.penalty_threshold),'" default="',            num2str(obj.penalty_threshold),'">',            '     <section name="damage" />','     <help> threshold to declare convergence of damage evolution solution (default is 0) </help>','</parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',        '<parameter key ="penalty_factor" type="',      class(obj.penalty_factor),'" default="',            num2str(obj.penalty_factor),'">',            '     <section name="damage" />','     <help> scaling exponent (default is 3) </help>','</parameter>');
++
++		end % }}}
+         
+ 		function obj = damage(varargin) % {{{
+ 			switch nargin
+@@ -154,9 +154,9 @@
+ 				md = checkfield(md,'fieldname','damage.stabilization','numel',[1],'values',[0 1 2]);
+ 				md = checkfield(md,'fieldname','damage.maxiter','>=0',0);
+ 				md = checkfield(md,'fieldname','damage.elementinterp','values',{'P1','P2'});
+-				md = checkfield(md,'fieldname','damage.penalty_factor','>=0',0);
+-				md = checkfield(md,'fieldname','damage.penalty_lock','>=0',0);
+-				md = checkfield(md,'fieldname','damage.penalty_threshold','>=0',0);
++				md = checkfield(md,'fieldname','damage.penalty_factor','>=',0);
++				md = checkfield(md,'fieldname','damage.penalty_lock','>=',0);
++				md = checkfield(md,'fieldname','damage.penalty_threshold','>=',0);
+ 			end
+ 
+ 			if (obj.law==1 | obj.law==2),
Index: /issm/oecreview/Archive/17984-18295/ISSM-18044-18045.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18044-18045.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18044-18045.diff	(revision 18296)
@@ -0,0 +1,20 @@
+Index: ../trunk-jpl/src/m/classes/damage.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/damage.m	(revision 18044)
++++ ../trunk-jpl/src/m/classes/damage.m	(revision 18045)
+@@ -168,14 +168,11 @@
+ 				md = checkfield(md,'fieldname','damage.stress_threshold','>=',0);
+ 				md = checkfield(md,'fieldname','damage.equiv_stress','numel',[1],'values',[0 1]);
+ 				md = checkfield(md,'fieldname','damage.requested_outputs','stringrow',1);
+-			elseif (obj.law>0),
++			elseif (obj.law~=0),
+ 				if (solution==DamageEvolutionSolutionEnum),
+ 					error('Invalid evolution law (md.damage.law) for a damage solution');
+ 				end
+-			else 
+-				error('invalid damage evolution law');
+ 			end
+-
+ 		end % }}}
+ 		function list=defaultoutputs(self,md) % {{{
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18049-18050.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18049-18050.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18049-18050.diff	(revision 18296)
@@ -0,0 +1,51 @@
+Index: ../trunk-jpl/externalpackages/petsc/install-3.2-discover-intel13.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.2-discover-intel13.sh	(revision 0)
++++ ../trunk-jpl/externalpackages/petsc/install-3.2-discover-intel13.sh	(revision 18050)
+@@ -0,0 +1,39 @@
++#!/bin/bash
++set -eu
++
++#Some cleanup
++rm -rf install petsc-3.2-p3 src
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-3.2-p3.tar.gz' 'petsc-3.2-p3.tar.gz'
++
++#Untar and move petsc to install directory
++tar -zxvf  petsc-3.2-p3.tar.gz
++mv petsc-3.2-p3/* src/
++rm -rf petsc-3.2-p3
++
++#configure
++cd src
++./config/configure.py \
++	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
++	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
++	--PETSC_ARCH="$ISSM_ARCH" \
++	--with-batch=1 \
++	--with-debugging=0 \
++	--with-shared-libraries=1 \
++	--known-mpi-shared-libraries=1 \
++	--with-mpi-dir=/usr/local/intel/mpi/4.0.3.008/lib64/ \
++	--with-blas-lapack-dir=/usr/local/intel/Composer/composer_xe_2013.3.163/mkl/ \
++	--with-scalapack-lib=/usr/local/intel/Composer/composer_xe_2013.3.163/mkl/lib/intel64/libmkl_scalapack_lp64.a \
++	--with-scalapack-include=/usr/local/intel/Composer/composer_xe_2013.3.163/mkl/include/ \
++	--with-blacs-lib=/usr/local/intel/Composer/composer_xe_2013.3.163/mkl/lib/intel64/libmkl_blacs_intelmpi_lp64.a \
++	--with-blacs-include=/usr/local/intel/Composer/composer_xe_2013.3.163/mkl/include/ \
++	--download-mumps=yes \
++	--download-scalapack=no \
++	--download-blacs=no \
++	--download-plapack=no \
++	--download-parmetis=yes \
++	--with-pic=1
++
++echo "== Follow PETSc's instructions"
+
+Property changes on: ../trunk-jpl/externalpackages/petsc/install-3.2-discover-intel13.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/17984-18295/ISSM-18052-18053.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18052-18053.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18052-18053.diff	(revision 18296)
@@ -0,0 +1,227 @@
+Index: ../trunk-jpl/src/perl/m2cpp.pl
+===================================================================
+--- ../trunk-jpl/src/perl/m2cpp.pl	(revision 18052)
++++ ../trunk-jpl/src/perl/m2cpp.pl	(revision 18053)
+@@ -1,211 +0,0 @@
+-#!/usr/bin/perl --
+-if ($#ARGV != 0){
+-  die "Argument must contain filename $#ARGV"
+-}
+-else{
+-  $fname=$ARGV[0];
+-}
+-
+-# If we have a .m file inside a (@)-folder with the same name :
+-# we will read each file of this folder
+-if ($fname =~ /^(.*)\@([\d\w-_]*)[\/\\](\2)\.m/){
+-  $name = $2;
+-  $nameExt = $name.".m";
+-  $dir = $1."@".$name."/\*.m";
+-  @fic = glob($dir);
+-  $i = 0;
+-  @listeFic[0] = $fname;
+-  foreach $my_test (@fic){
+-    if (!($my_test =~ $nameExt)){
+-      $i++;
+-      @listeFic[$i] = $my_test;
+-    }
+-  }
+-}
+-# otherwise @-folder, but .m with a different name : ignore it
+-elsif ($fname =~ /^(.*)\@([\d\w-_]*)[\/\\](.*)\.m/){
+-}
+-# otherwise
+-else{
+-  @listeFic[0] = $fname;
+-}
+-foreach $my_fic (@listeFic){
+-
+-  open(my $in, $my_fic);
+-
+-  $declTypeDef="";
+-  $inClass = 0;
+-  $inAbstractMethodBlock = 0;
+-  $listeProperties = 0;
+-  $listeEnumeration = 0;
+-
+-  $methodAttribute = "";
+-
+-  while (<$in>){
+-	  #if (/(^\s*)(%)(.*)/){
+-	  #  $output=$output."$1/// \@brief $3";
+-	  #}
+-    if (/(^\s*)(%>)(.*)/){
+-      $output=$output."$1///$3";
+-    }
+-    if (($listeProperties == 1) && (/(^\s*\bend\b\s*)/)){
+-      $listeProperties = 0;
+-    }
+-    if (($inAbstractMethodBlock == 1) && (/(^\s*\bend\b\s*)/)){
+-      $inAbstractMethodBlock = 0;
+-    }
+-    if (($listeProperties == 1) && (/^\s*([\w\d]*)\s*(=\s*[\w\d{}'',\s\[\]\.]*)?.*(%>.*)?/)){
+-      $propertyName = $1;
+-      $propertyValue = $2;
+-      $propertyComment = $3;
+-      if (!($propertyName =~ /^$/)){
+-        if ($typeProperties =~ /Constant/){
+-          $properties = $propertyName."$propertyValue;$propertyComment";
+-        }
+-        else{
+-          $properties = $propertyName.";$propertyComment";
+-        }
+-
+-        $properties =~ s/%>/\/\/\//g;
+-        $properties =~ s/%/\/\//g;
+-        $output=$output.$typeProperties."Property ".$properties;
+-      }
+-    }
+-    if (($listeEnumeration == 1) && (/(^\s*\bend\b\s*)/)){
+-      $listeEnumeration = 0;
+-      $output=$output."};";
+-    }
+-    if (($listeEvents == 1) && (/(^\s*\bend\b\s*)/)){
+-      $listeEvents = 0;
+-      $output=$output."};";
+-    }
+-    if (($listeEvents == 1) && (/^\s*([\w\d]*)\s*/)){
+-      $name_event = $1;
+-      if (!($name_event =~ /^$/)){
+-        $event = $name_event.",";
+-        $event =~ s/%>/\/\/\//g;
+-        $event =~ s/%/\/\//g;
+-        $output=$output.$event;
+-      }
+-    }
+-    if (($listeEnumeration == 1) && (/^\s*([\w\d]*)\s*(\(.*\))?(%>.*)?/)){
+-      $name_enum = $1;
+-      $val_enum = $2;
+-      if (!($name_enum =~ /^$/)){
+-        if (!($val_enum =~ /^$/)){
+-          $enum = "$name_enum=$val_enum,";
+-          $enum =~ s/%>/\/\/\//g;
+-          $enum =~ s/%/\/\//g;
+-          $output=$output.$enum;
+-        }
+-        else{
+-          $enum = "$name_enum,";
+-          $enum =~ s/%>/\/\/\//g;
+-          $enum =~ s/%/\/\//g;
+-          $output=$output.$enum;
+-        }
+-      }
+-    }
+-    if (/(^\s*function)\s*([\] \w\d,_\[]+=)?\s*([.\w\d_-]*)\s*\(?([\w\d\s,~]*)\)?(%?.*)/){
+-      $functionKeyWord = $1;
+-      $functionName = $3;
+-      $arguments = $4;
+-      if ($inClass == 0){
+-        $output = $declTypeDef.$output;
+-        $declTypeDef = "";
+-      }
+-      $arguments =~ s/,/,in /g;
+-      $arguments =~ s/~/ignoredArg/g;
+-      $arguments = "in $arguments";
+-      if ($arguments =~ /^in $/){
+-        $arguments = "";
+-      }
+-      $ligne = "$methodAttribute $functionKeyWord $functionName($arguments);"; 
+-      $output=$output.$ligne;
+-    }
+-    # Signature of functions in abstract methods
+-    elsif ((/^\s*([\] \w\d,_\[]+=)?\s*([.\w\d_-]+)\s*\(?([\w\d\s,~]*)\)?(%?.*)/) & ($inAbstractMethodBlock == 1) ){
+-      $functionName = $2;
+-      $arguments = $3;
+-      $arguments =~ s/,/,in /g;
+-      $arguments =~ s/~/ignoredArg/g;
+-      $arguments = "in $arguments";
+-      if ($arguments =~ /^in $/){
+-        $arguments = "";
+-      }
+-      $ligne = "$methodAttribute $functionKeyWord $functionName($arguments);"; 
+-      $output=$output.$ligne;
+-    }
+-    # inheritance for classes
+-    if (/(^\s*classdef)\s*(\s*\([\{\}\?\w,=\s]+\s*\))?\s*([\w\d_]+)\s*<?\s*([\s\w\d._&]+)?(.*)/){
+-      $className = $3;
+-      $classInheritance = $4;
+-      $classAttributes = $2;
+-      if (!($classInheritance =~ /^$/)){
+-        $classInheritance =~ s/&/,public /g;
+-        $classDef = "class ".$className.":public $classInheritance";
+-      }
+-      else{
+-        $classDef = "class ".$className;
+-      }
+-      $output=$output.$classDef;
+-      $output=$output."{";
+-      $output=$output.$declTypeDef;
+-      $output=$output."public:\n";
+-      $inClass = 1;
+-    }
+-    if (/(^\s*properties)\s*(\s*\([\w,=\s]+\s*\))?(.*)/){
+-      $listeProperties = 1;
+-      $propertiesAttributes = $2;
+-      $typeProperties = "public:\n";
+-      if (lc($propertiesAttributes) =~ /(access\s*=\s*private)/){
+-        $typeProperties = "private:\n"
+-      }
+-      elsif (lc($propertiesAttributes) =~ /(access\s*=\s*public)/){
+-        $typeProperties = "public:\n"
+-      }
+-      elsif (lc($propertiesAttributes) =~ /(access\s*=\s*protected)/){
+-        $typeProperties = "protected:\n"
+-      }
+-      if ((lc($propertiesAttributes) =~ /(constant\s*=\s*false)/) || (lc($propertiesAttributes) =~ /(~constant)/)){
+-      }
+-      elsif (lc($propertiesAttributes) =~ /(constant(\s*=\s*true\s*)?)/){
+-        $typeProperties = $typeProperties." Constant ";
+-      }
+-    }
+-    if (/(^\s*enumeration)\s*(.*)/){
+-      $listeEnumeration = 1;
+-      $output=$output."public:\nenum ".$className." {";
+-    }
+-    if (/(^\s*events)\s*(.*)/){
+-      $listeEvents = 1;
+-      $output=$output."public:\nenum Events {";
+-    }
+-    if (/(^\s*methods)\s*(\s*\([\w,=\s]+\s*\))?(.*)/){
+-      $methodAttribute = "public:\n";
+-      $methodsAttributes = $2;
+-      if (lc($methodsAttributes) =~ /(access\s*=\s*private)/){
+-        $methodAttribute = "private:\n"
+-      }
+-      elsif (lc($methodsAttributes) =~ /(access\s*=\s*protected)/){
+-        $methodAttribute = "protected:\n"
+-      }
+-      elsif (lc($methodsAttributes) =~ /(access\s*=\s*public)/){
+-        $methodAttribute = "public:\n"
+-      }
+-      if (lc($methodsAttributes) =~ /(abstract(\s*=\s*true\s*)?)/){
+-        $inAbstractMethodBlock = 1;
+-        $methodAttribute = $methodAttribute." virtual ";
+-      }
+-      if ((lc($methodsAttributes) =~ /(static\s*=\s*false)/) || (lc($methodsAttributes) =~ /(~static)/)){
+-      }
+-      elsif (lc($methodsAttributes) =~ /(static(\s*=\s*true\s*)?)/){
+-        $methodAttribute = $methodAttribute." static";
+-      }
+-    }
+-	 $output=$output."\n";
+-  }
+-  close $in;
+-}
+-$output=$output."};\n";
+-print $output;
+Index: ../trunk-jpl/src/dox/issm.dox
+===================================================================
+--- ../trunk-jpl/src/dox/issm.dox	(revision 18052)
++++ ../trunk-jpl/src/dox/issm.dox	(revision 18053)
+@@ -86,5 +86,5 @@
+ </tr>
+ </table>
+ 
+-	<I> Copyright (C) 2013 </I>
++	<I> Copyright (C) 2014 </I>
+   */
Index: /issm/oecreview/Archive/17984-18295/ISSM-18053-18054.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18053-18054.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18053-18054.diff	(revision 18296)
@@ -0,0 +1,31 @@
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 18053)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 18054)
+@@ -48,7 +48,7 @@
+ 	/*Intermediaries */
+ 	int         num_responses,i;
+ 	IssmDouble  hobs,hu2,weight,NUMx,NUMy,DEN,Jdet;
+-	IssmDouble  vx,vy,vbar2,nux,nuy,dphi[2];
++	IssmDouble  vx,vy,vbar2,nux,nuy,phi,dphi[2];
+ 	int        *responses = NULL;
+ 	IssmDouble *xyz_list  = NULL;
+ 
+@@ -85,6 +85,7 @@
+ 		vy_input->GetInputValue(&vy,gauss);
+ 		nux_input->GetInputValue(&nux,gauss);
+ 		nuy_input->GetInputValue(&nuy,gauss);
++		potential_input->GetInputValue(&phi,gauss);
+ 		potential_input->GetInputDerivativeValue(&dphi[0],xyz_list,gauss);
+ 		thicknessobs_input->GetInputValue(&hobs,gauss);
+ 
+@@ -101,7 +102,8 @@
+ 
+ 			switch(responses[resp]){
+ 				case Balancethickness2MisfitEnum:
+-					for(i=0;i<numnodes;i++) pe->values[i]+=(NUMx+NUMy)/DEN *weight*Jdet*gauss->weight;
++					//for(i=0;i<numnodes;i++) pe->values[i]+=(NUMx+NUMy)/DEN *weight*Jdet*gauss->weight;
++					for(i=0;i<numnodes;i++) pe->values[i]+= phi*basis[i]*weight*Jdet*gauss->weight;
+ 					break;
+ 				default:
+ 					_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
Index: /issm/oecreview/Archive/17984-18295/ISSM-18054-18055.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18054-18055.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18054-18055.diff	(revision 18296)
@@ -0,0 +1,859 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.h	(revision 18055)
+@@ -30,6 +30,7 @@
+ 		ElementVector* CreatePVector2D(Element* element);
+ 		ElementVector* CreatePVector3D(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/ThermalAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ThermalAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/ThermalAnalysis.h	(revision 18055)
+@@ -34,6 +34,7 @@
+ 		void GetBAdvec(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBAdvecprime(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp	(revision 18055)
+@@ -478,6 +478,9 @@
+ void BalancethicknessAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void BalancethicknessAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void BalancethicknessAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int domaintype;
+Index: ../trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.h	(revision 18055)
+@@ -30,6 +30,7 @@
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetB(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 18055)
+@@ -899,6 +899,9 @@
+ void AdjointHorizAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void AdjointHorizAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void AdjointHorizAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 	int approximation;
+ 	element->GetInputValue(&approximation,ApproximationEnum);
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 18055)
+@@ -316,6 +316,9 @@
+ void HydrologyDCEfficientAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	element->GetSolutionFromInputsOneDof(solution,EplHeadEnum);
+ }/*}}}*/
++void HydrologyDCEfficientAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void HydrologyDCEfficientAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int domaintype,i;
+Index: ../trunk-jpl/src/c/analyses/MeltingAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MeltingAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/MeltingAnalysis.h	(revision 18055)
+@@ -26,6 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/GiaAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/GiaAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/GiaAnalysis.h	(revision 18055)
+@@ -26,6 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.h	(revision 18055)
+@@ -26,6 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 18055)
+@@ -307,6 +307,9 @@
+ void LevelsetAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	_error_("not implemented yet");
+ }/*}}}*/
++void LevelsetAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void LevelsetAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int domaintype;
+Index: ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 18055)
+@@ -356,6 +356,9 @@
+ void StressbalanceVerticalAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	element->GetSolutionFromInputsOneDof(solution,VzEnum);
+ }/*}}}*/
++void StressbalanceVerticalAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void StressbalanceVerticalAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int          numnodes = element->GetNumberOfNodes();
+Index: ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.h	(revision 18055)
+@@ -34,6 +34,7 @@
+ 		void GetBAdvec(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBAdvecprime(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ 
+Index: ../trunk-jpl/src/c/analyses/MeshdeformationAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MeshdeformationAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/MeshdeformationAnalysis.h	(revision 18055)
+@@ -26,6 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.h	(revision 18055)
+@@ -30,6 +30,7 @@
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetB(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.h	(revision 18055)
+@@ -26,6 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/MeltingAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MeltingAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/MeltingAnalysis.cpp	(revision 18055)
+@@ -150,6 +150,9 @@
+ void MeltingAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void MeltingAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void MeltingAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 	element->InputUpdateFromSolutionOneDof(solution,BasalforcingsMeltingRateEnum);
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.cpp	(revision 18055)
+@@ -221,6 +221,9 @@
+ void ExtrudeFromBaseAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void ExtrudeFromBaseAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void ExtrudeFromBaseAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int inputenum;
+Index: ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.h	(revision 18055)
+@@ -26,6 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ 
+Index: ../trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.h	(revision 18055)
+@@ -26,6 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/DepthAverageAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DepthAverageAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/DepthAverageAnalysis.h	(revision 18055)
+@@ -27,6 +27,7 @@
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetB(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.h	(revision 18055)
+@@ -27,6 +27,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ 
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.h	(revision 18055)
+@@ -32,6 +32,7 @@
+ 		ElementVector* CreatePVectorHO(Element* element);
+ 		ElementVector* CreatePVectorFS(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ 		void InputUpdateFromSolutionHoriz(IssmDouble* solution,Element* element);
+Index: ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.h	(revision 18055)
+@@ -26,6 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp	(revision 18055)
+@@ -149,6 +149,9 @@
+ void AdjointBalancethicknessAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	_error_("not implemented yet");
+ }/*}}}*/
++void AdjointBalancethicknessAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void AdjointBalancethicknessAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int domaintype;
+Index: ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp	(revision 18055)
+@@ -228,6 +228,9 @@
+ void L2ProjectionEPLAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void L2ProjectionEPLAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void L2ProjectionEPLAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 	int inputenum,domaintype;
+ 
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 18055)
+@@ -674,6 +674,9 @@
+ void MasstransportAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void MasstransportAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void MasstransportAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int        i,hydroadjustment,domaintype;
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.h	(revision 18055)
+@@ -28,6 +28,7 @@
+ 		void GetB(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBprime(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.cpp	(revision 18055)
+@@ -171,6 +171,9 @@
+ void SmoothedSurfaceSlopeXAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void SmoothedSurfaceSlopeXAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void SmoothedSurfaceSlopeXAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 	element->InputUpdateFromSolutionOneDof(solution,SurfaceSlopeXEnum);
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.cpp	(revision 18055)
+@@ -170,6 +170,9 @@
+ void SmoothedSurfaceSlopeYAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void SmoothedSurfaceSlopeYAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void SmoothedSurfaceSlopeYAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 	element->InputUpdateFromSolutionOneDof(solution,SurfaceSlopeYEnum);
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.cpp	(revision 18055)
+@@ -221,6 +221,9 @@
+ void ExtrudeFromTopAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void ExtrudeFromTopAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void ExtrudeFromTopAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int inputenum;
+Index: ../trunk-jpl/src/c/analyses/LsfReinitializationAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LsfReinitializationAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/LsfReinitializationAnalysis.h	(revision 18055)
+@@ -25,7 +25,8 @@
+ 	ElementMatrix* CreateJacobianMatrix(Element* element);
+ 	ElementMatrix* CreateKMatrix(Element* element);
+ 	ElementVector* CreatePVector(Element* element);
+-	void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 	void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 	void UpdateConstraints(FemModel* femmodel);
+ 	void GetB(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 18055)
+@@ -122,6 +122,9 @@
+ void AdjointBalancethickness2Analysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	_error_("not implemented yet");
+ }/*}}}*/
++void AdjointBalancethickness2Analysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void AdjointBalancethickness2Analysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 	element->InputUpdateFromSolutionOneDof(solution,AdjointEnum);
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.cpp	(revision 18055)
+@@ -44,6 +44,9 @@
+ void BalancethicknessSoftAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void BalancethicknessSoftAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void BalancethicknessSoftAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 	_error_("not implemented yet");
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp	(revision 18055)
+@@ -291,6 +291,9 @@
+ void HydrologyShreveAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	element->GetSolutionFromInputsOneDof(solution,WatercolumnEnum);
+ }/*}}}*/
++void HydrologyShreveAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void HydrologyShreveAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	/*Intermediary*/
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h	(revision 18055)
+@@ -26,6 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void GetSolutionFromInputsHoriz(Vector<IssmDouble>* solution,Element* element);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+Index: ../trunk-jpl/src/c/analyses/DepthAverageAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DepthAverageAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/DepthAverageAnalysis.cpp	(revision 18055)
+@@ -159,6 +159,9 @@
+ void DepthAverageAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void DepthAverageAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void DepthAverageAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int inputenum;
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h	(revision 18055)
+@@ -27,6 +27,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ 
+Index: ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp	(revision 18055)
+@@ -240,6 +240,9 @@
+ void BalancevelocityAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void BalancevelocityAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void BalancevelocityAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int domaintype;
+Index: ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp	(revision 18055)
+@@ -198,6 +198,9 @@
+ void L2ProjectionBaseAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void L2ProjectionBaseAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void L2ProjectionBaseAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int inputenum,domaintype,elementtype;
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp	(revision 18055)
+@@ -366,6 +366,9 @@
+ void FreeSurfaceTopAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void FreeSurfaceTopAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void FreeSurfaceTopAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	element->InputUpdateFromSolutionOneDof(solution,SurfaceEnum);
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.h	(revision 18055)
+@@ -26,6 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/LsfReinitializationAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LsfReinitializationAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/LsfReinitializationAnalysis.cpp	(revision 18055)
+@@ -283,6 +283,9 @@
+ 	xDelete<int>(doflist);
+ 
+ }/*}}}*/
++void LsfReinitializationAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void LsfReinitializationAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int domaintype;
+Index: ../trunk-jpl/src/c/analyses/Analysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/Analysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/Analysis.h	(revision 18055)
+@@ -39,6 +39,7 @@
+ 		virtual ElementMatrix* CreateKMatrix(Element* element)=0;
+ 		virtual ElementVector* CreatePVector(Element* element)=0;
+ 		virtual void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element)=0;
++		virtual void GradientJ(Vector<IssmDouble>* gradient,int control_index)=0;
+ 		virtual void InputUpdateFromSolution(IssmDouble* solution,Element* element)=0;
+ 		virtual void UpdateConstraints(FemModel* femmodel)=0;
+ };
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.h	(revision 18055)
+@@ -32,6 +32,7 @@
+ 		void GetB(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBprime(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp	(revision 18055)
+@@ -492,6 +492,9 @@
+ 	xDelete<int>(doflist);
+ 	xDelete<IssmDouble>(values);
+ }/*}}}*/
++void StressbalanceSIAAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void StressbalanceSIAAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int         i,domaintype;
+Index: ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h	(revision 18055)
+@@ -28,6 +28,7 @@
+ 		void GetB(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBprime(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ 
+Index: ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.h	(revision 18055)
+@@ -28,6 +28,7 @@
+ 		ElementVector* CreatePVectorVolume(Element* element);
+ 		ElementVector* CreatePVectorBoundary(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18055)
+@@ -1039,6 +1039,9 @@
+ 	xDelete<IssmDouble>(values);
+ 	xDelete<int>(doflist);
+ }/*}}}*/
++void StressbalanceAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void StressbalanceAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int approximation;
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.h	(revision 18055)
+@@ -28,6 +28,7 @@
+ 		void GetB(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBprime(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 18055)
+@@ -392,6 +392,9 @@
+ void HydrologyDCInefficientAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	element->GetSolutionFromInputsOneDof(solution,SedimentHeadEnum);
+ }/*}}}*/
++void HydrologyDCInefficientAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void HydrologyDCInefficientAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int        domaintype;
+Index: ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.h	(revision 18055)
+@@ -26,6 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp	(revision 18055)
+@@ -653,6 +653,9 @@
+ 	/*Clean-up*/
+ 	xDelete<IssmDouble>(dbasis);
+ }/*}}}*/
++void ThermalAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void ThermalAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	bool        converged;
+Index: ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.h	(revision 18055)
+@@ -25,7 +25,8 @@
+ 	ElementMatrix* CreateJacobianMatrix(Element* element);
+ 	ElementMatrix* CreateKMatrix(Element* element);
+ 	ElementVector* CreatePVector(Element* element);
+-	void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 	void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 	void UpdateConstraints(FemModel* femmodel);
+ 	void GetB(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+Index: ../trunk-jpl/src/c/analyses/GiaAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/GiaAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/GiaAnalysis.cpp	(revision 18055)
+@@ -56,6 +56,9 @@
+ void GiaAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void GiaAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void GiaAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 	_error_("not implemented yet");
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.h	(revision 18055)
+@@ -26,6 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.h	(revision 18055)
+@@ -32,6 +32,7 @@
+ 		void GetB(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBprime(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.h	(revision 18055)
+@@ -26,6 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/EnumToAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnumToAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/EnumToAnalysis.h	(revision 18055)
+@@ -21,5 +21,6 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+Index: ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp	(revision 18055)
+@@ -195,6 +195,9 @@
+ void Balancethickness2Analysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void Balancethickness2Analysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void Balancethickness2Analysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	/*Intermediaries */
+Index: ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 18055)
+@@ -382,6 +382,9 @@
+ void DamageEvolutionAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void DamageEvolutionAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void DamageEvolutionAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int domaintype;
+Index: ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 18055)
+@@ -779,6 +779,9 @@
+ void EnthalpyAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	element->GetSolutionFromInputsOneDof(solution,EnthalpyEnum);
+ }/*}}}*/
++void EnthalpyAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void EnthalpyAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	bool        converged;
+Index: ../trunk-jpl/src/c/analyses/MeshdeformationAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MeshdeformationAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/MeshdeformationAnalysis.cpp	(revision 18055)
+@@ -44,6 +44,9 @@
+ void MeshdeformationAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void MeshdeformationAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void MeshdeformationAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 	_error_("not implemented yet");
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 18055)
+@@ -363,6 +363,9 @@
+ void FreeSurfaceBaseAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
++void FreeSurfaceBaseAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void FreeSurfaceBaseAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 	element->InputUpdateFromSolutionOneDof(solution,BaseEnum);
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.h	(revision 18055)
+@@ -26,6 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ 		void GetB(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+Index: ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.h	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.h	(revision 18055)
+@@ -32,6 +32,7 @@
+ 		void GetB(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBprime(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
++		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp	(revision 18054)
++++ ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp	(revision 18055)
+@@ -239,6 +239,9 @@
+ void ExtrapolationAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	_error_("not implemented yet");
+ }/*}}}*/
++void ExtrapolationAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("Not implemented yet");
++}/*}}}*/
+ void ExtrapolationAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int domaintype, extrapolationvariable;
Index: /issm/oecreview/Archive/17984-18295/ISSM-18055-18056.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18055-18056.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18055-18056.diff	(revision 18296)
@@ -0,0 +1,86 @@
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18055)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18056)
+@@ -1207,7 +1207,7 @@
+ 	IssmDouble J=0.;
+ 	IssmDouble J_sum;
+ 
+-	IssmDouble  weight,thicknessobs,thickness;
++	IssmDouble  weight,thicknessobs,thickness,potential;
+ 	IssmDouble  Jdet;
+ 	IssmDouble* xyz_list = NULL;
+ 
+@@ -1223,6 +1223,7 @@
+ 		Input* weights_input     =element->GetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
+ 		Input* thickness_input   =element->GetInput(ThicknessEnum);                          _assert_(thickness_input);
+ 		Input* thicknessobs_input=element->GetInput(InversionThicknessObsEnum);              _assert_(thicknessobs_input);
++		Input* potential_input   =element->GetInput(PotentialEnum);                          _assert_(potential_input);
+ 
+ 		/* Start  looping on the number of gaussian points: */
+ 		Gauss* gauss=element->NewGauss(2);
+@@ -1237,9 +1238,11 @@
+ 			weights_input->GetInputValue(&weight,gauss,Balancethickness2MisfitEnum);
+ 			thickness_input->GetInputValue(&thickness,gauss);
+ 			thicknessobs_input->GetInputValue(&thicknessobs,gauss);
++			potential_input->GetInputValue(&potential,gauss);
+ 			gauss->GaussPoint(ig);
+ 
+-			J +=0.5*(thickness*thickness - thicknessobs*thicknessobs)*(thickness*thickness - thicknessobs*thicknessobs)*weight*Jdet*gauss->weight;
++			//J +=0.5*(thickness*thickness - thicknessobs*thicknessobs)*(thickness*thickness - thicknessobs*thicknessobs)*weight*Jdet*gauss->weight;
++			J +=.5*potential*potential*weight*Jdet*gauss->weight;
+ 		}
+ 
+ 		/*clean up and Return: */
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18055)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18056)
+@@ -3175,16 +3175,40 @@
+ void       Tria::GradjAdotBulancethickness2(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+ 
+ 	/*Intermediaries*/
+-	int    vertexpidlist[NUMVERTICES];
+-	IssmDouble lambda[NUMVERTICES];
+-	IssmDouble gradient_g[NUMVERTICES];
++	IssmDouble lambda,potential,weight,Jdet;
++	IssmDouble grade_g[NUMVERTICES];
++	IssmDouble basis[NUMVERTICES];
++	IssmDouble xyz_list[NUMVERTICES][3];
++	int        vertexpidlist[NUMVERTICES];
+ 
+-	/*Compute Gradient*/
++	/*Recover inputs*/
++	Input* lambda_input  = inputs->GetInput(AdjointEnum);                            _assert_(lambda_input);
++	Input* weights_input = inputs->GetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
++
++	/* Get node coordinates and dof list: */
++	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+ 	GradientIndexing(&vertexpidlist[0],control_index);
+-	GetInputListOnVertices(&lambda[0],AdjointEnum);
+-	for(int i=0;i<NUMVERTICES;i++) gradient_g[i]=lambda[i];
+ 
+-	gradient->SetValues(NUMVERTICES,vertexpidlist,gradient_g,INS_VAL);
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=new GaussTria(2);
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++
++		gauss->GaussPoint(ig);
++
++		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
++		GetNodalFunctions(&basis[0],gauss);
++		weights_input->GetInputValue(&weight,gauss,Balancethickness2MisfitEnum);
++		lambda_input->GetInputValue(&lambda,gauss);
++
++		/*Build gradje_g_gaussian vector (actually -dJ/ddrag): */
++		for(int i=0;i<NUMVERTICES;i++){
++			grade_g[i]+= - weight*Jdet*gauss->weight*basis[i]*lambda;
++		}
++	}
++	gradient->SetValues(NUMVERTICES,vertexpidlist,grade_g,ADD_VAL);
++
++	/*Clean up and return*/
++	delete gauss;
+ }
+ /*}}}*/
+ void       Tria::GradjVxBalancedthickness(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18056-18057.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18056-18057.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18056-18057.diff	(revision 18296)
@@ -0,0 +1,966 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.h	(revision 18057)
+@@ -30,7 +30,7 @@
+ 		ElementVector* CreatePVector2D(Element* element);
+ 		ElementVector* CreatePVector3D(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/ThermalAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ThermalAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/ThermalAnalysis.h	(revision 18057)
+@@ -34,7 +34,7 @@
+ 		void GetBAdvec(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBAdvecprime(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp	(revision 18057)
+@@ -478,7 +478,7 @@
+ void BalancethicknessAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void BalancethicknessAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void BalancethicknessAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void BalancethicknessAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.h	(revision 18057)
+@@ -30,7 +30,7 @@
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetB(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 18057)
+@@ -899,9 +899,106 @@
+ void AdjointHorizAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void AdjointHorizAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-	_error_("Not implemented yet");
++void AdjointHorizAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
++	/*The gradient of the cost function is calculated in 2 parts.
++	 *
++	 * dJ    \partial J   \partial lambda^T(KU-F)
++	 * --  = ---------- + ------------------------
++	 * dk    \partial k   \parial k                  
++	 *
++	 * */
++
++	/*If on water, grad = 0: */
++	if(!element->IsIceInElement()) return;
++
++	/*Get Approximation*/
++	int approximation;
++	element->GetInputValue(&approximation,ApproximationEnum);
++
++	/*Get list of cost functions*/
++	int *responses = NULL;
++	int num_responses,resp;
++	element->FindParam(&num_responses,InversionNumCostFunctionsEnum);
++	element->FindParam(&responses,NULL,InversionCostFunctionsEnum);
++
++	/*Check that control_type is supported*/
++	if(control_type!=MaterialsRheologyBbarEnum || control_type!=FrictionCoefficientEnum || control_type!=DamageDbarEnum){
++		_error_("Control "<<EnumToStringx(control_type)<<" not supported");
++	}
++
++	/*Deal with first part (partial derivative a J with respect to k)*/
++	for(resp=0;resp<num_responses;resp++) switch(responses[resp]){
++		case SurfaceAbsVelMisfitEnum:     /*Nothing, \partial J/\partial k = 0*/ break;
++		case SurfaceRelVelMisfitEnum:     /*Nothing, \partial J/\partial k = 0*/ break;
++		case SurfaceLogVelMisfitEnum:     /*Nothing, \partial J/\partial k = 0*/ break;
++		case SurfaceLogVxVyMisfitEnum:    /*Nothing, \partial J/\partial k = 0*/ break;
++		case SurfaceAverageVelMisfitEnum: /*Nothing, \partial J/\partial k = 0*/ break;
++		case DragCoefficientAbsGradientEnum: GradientJDragGradient(element,gradient,control_index); break;
++		case RheologyBbarAbsGradientEnum:    GradientJBGradient(element,gradient,control_index);    break;
++		default: _error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
++	}
++
++	/*Deal with second term*/
++	switch(control_type){
++		case FrictionCoefficientEnum:
++			switch(approximation){
++				case SSAApproximationEnum: GradientJDragSSA(element,gradient,control_index); break;
++				case HOApproximationEnum:  GradientJDragHO( element,gradient,control_index); break;
++				case FSApproximationEnum:  GradientJDragFS( element,gradient,control_index); break;
++				case NoneApproximationEnum: /*Gradient is 0*/                    break;
++				default: _error_("approximation " << EnumToStringx(approximation) << " not supported yet");
++			}
++			break;
++		case MaterialsRheologyBbarEnum:
++			switch(approximation){
++				case SSAApproximationEnum: GradientJBbarSSA(element,gradient,control_index); break;
++				case HOApproximationEnum:  GradientJBbarHO( element,gradient,control_index); break;
++				case FSApproximationEnum:  GradientJBbarFS( element,gradient,control_index); break;
++				case NoneApproximationEnum: /*Gradient is 0*/                    break;
++				default: _error_("approximation " << EnumToStringx(approximation) << " not supported yet");
++			}
++			break;
++		case DamageDbarEnum:
++			switch(approximation){
++				case SSAApproximationEnum: GradientJDSSA(element,gradient,control_index); break;
++				case NoneApproximationEnum: /*Gradient is 0*/                 break;
++				default: _error_("approximation " << EnumToStringx(approximation) << " not supported yet");
++			}
++			break;
++		default: _error_("control type not supported yet: " << EnumToStringx(control_type));
++	}
++
++	/*Clean up and return*/
++	xDelete<int>(responses);
++                         
+ }/*}}}*/
++void AdjointHorizAnalysis::GradientJDragGradient(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("not implemented yet");
++}/*}}}*/
++void AdjointHorizAnalysis::GradientJBGradient(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("not implemented yet");
++}/*}}}*/
++void AdjointHorizAnalysis::GradientJDragSSA(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("not implemented yet");
++}/*}}}*/
++void AdjointHorizAnalysis::GradientJDragHO(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("not implemented yet");
++}/*}}}*/
++void AdjointHorizAnalysis::GradientJDragFS(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("not implemented yet");
++}/*}}}*/
++void AdjointHorizAnalysis::GradientJBbarSSA(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("not implemented yet");
++}/*}}}*/
++void AdjointHorizAnalysis::GradientJBbarHO(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("not implemented yet");
++}/*}}}*/
++void AdjointHorizAnalysis::GradientJBbarFS(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("not implemented yet");
++}/*}}}*/
++void AdjointHorizAnalysis::GradientJDSSA(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++	_error_("not implemented yet");
++}/*}}}*/
+ void AdjointHorizAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 	int approximation;
+ 	element->GetInputValue(&approximation,ApproximationEnum);
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 18057)
+@@ -316,7 +316,7 @@
+ void HydrologyDCEfficientAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	element->GetSolutionFromInputsOneDof(solution,EplHeadEnum);
+ }/*}}}*/
+-void HydrologyDCEfficientAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void HydrologyDCEfficientAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void HydrologyDCEfficientAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/MeltingAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MeltingAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/MeltingAnalysis.h	(revision 18057)
+@@ -26,7 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/GiaAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/GiaAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/GiaAnalysis.h	(revision 18057)
+@@ -26,7 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.h	(revision 18057)
+@@ -26,7 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp	(revision 18057)
+@@ -307,7 +307,7 @@
+ void LevelsetAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	_error_("not implemented yet");
+ }/*}}}*/
+-void LevelsetAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void LevelsetAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void LevelsetAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 18057)
+@@ -356,7 +356,7 @@
+ void StressbalanceVerticalAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	element->GetSolutionFromInputsOneDof(solution,VzEnum);
+ }/*}}}*/
+-void StressbalanceVerticalAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void StressbalanceVerticalAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void StressbalanceVerticalAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.h	(revision 18057)
+@@ -34,7 +34,7 @@
+ 		void GetBAdvec(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBAdvecprime(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ 
+Index: ../trunk-jpl/src/c/analyses/MeshdeformationAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MeshdeformationAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/MeshdeformationAnalysis.h	(revision 18057)
+@@ -26,7 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.h	(revision 18057)
+@@ -30,7 +30,7 @@
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetB(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.h	(revision 18057)
+@@ -26,7 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/MeltingAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MeltingAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/MeltingAnalysis.cpp	(revision 18057)
+@@ -150,7 +150,7 @@
+ void MeltingAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void MeltingAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void MeltingAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void MeltingAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.cpp	(revision 18057)
+@@ -221,7 +221,7 @@
+ void ExtrudeFromBaseAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void ExtrudeFromBaseAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void ExtrudeFromBaseAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void ExtrudeFromBaseAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.h	(revision 18057)
+@@ -26,7 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ 
+Index: ../trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.h	(revision 18057)
+@@ -26,7 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/DepthAverageAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DepthAverageAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/DepthAverageAnalysis.h	(revision 18057)
+@@ -27,7 +27,7 @@
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetB(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.h	(revision 18057)
+@@ -27,7 +27,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ 
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.h	(revision 18057)
+@@ -32,7 +32,16 @@
+ 		ElementVector* CreatePVectorHO(Element* element);
+ 		ElementVector* CreatePVectorFS(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
++		void GradientJDragGradient(Element* element,Vector<IssmDouble>* gradient,int control_index);
++		void GradientJBGradient(Element* element,Vector<IssmDouble>* gradient,int control_index);
++		void GradientJDragSSA(Element* element,Vector<IssmDouble>* gradient,int control_index);
++		void GradientJDragHO(Element* element,Vector<IssmDouble>* gradient,int control_index);
++		void GradientJDragFS(Element* element,Vector<IssmDouble>* gradient,int control_index);
++		void GradientJBbarSSA(Element* element,Vector<IssmDouble>* gradient,int control_index);
++		void GradientJBbarHO(Element* element,Vector<IssmDouble>* gradient,int control_index);
++		void GradientJBbarFS(Element* element,Vector<IssmDouble>* gradient,int control_index);
++		void GradientJDSSA(Element* element,Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ 		void InputUpdateFromSolutionHoriz(IssmDouble* solution,Element* element);
+Index: ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.h	(revision 18057)
+@@ -26,7 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp	(revision 18057)
+@@ -149,7 +149,7 @@
+ void AdjointBalancethicknessAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	_error_("not implemented yet");
+ }/*}}}*/
+-void AdjointBalancethicknessAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void AdjointBalancethicknessAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void AdjointBalancethicknessAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp	(revision 18057)
+@@ -228,7 +228,7 @@
+ void L2ProjectionEPLAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void L2ProjectionEPLAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void L2ProjectionEPLAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void L2ProjectionEPLAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 18057)
+@@ -674,7 +674,7 @@
+ void MasstransportAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void MasstransportAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void MasstransportAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void MasstransportAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.h	(revision 18057)
+@@ -28,7 +28,7 @@
+ 		void GetB(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBprime(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.cpp	(revision 18057)
+@@ -171,7 +171,7 @@
+ void SmoothedSurfaceSlopeXAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void SmoothedSurfaceSlopeXAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void SmoothedSurfaceSlopeXAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void SmoothedSurfaceSlopeXAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.cpp	(revision 18057)
+@@ -170,7 +170,7 @@
+ void SmoothedSurfaceSlopeYAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void SmoothedSurfaceSlopeYAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void SmoothedSurfaceSlopeYAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void SmoothedSurfaceSlopeYAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.cpp	(revision 18057)
+@@ -221,7 +221,7 @@
+ void ExtrudeFromTopAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void ExtrudeFromTopAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void ExtrudeFromTopAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void ExtrudeFromTopAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/LsfReinitializationAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LsfReinitializationAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/LsfReinitializationAnalysis.h	(revision 18057)
+@@ -26,7 +26,7 @@
+ 	ElementMatrix* CreateKMatrix(Element* element);
+ 	ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 	void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 	void UpdateConstraints(FemModel* femmodel);
+ 	void GetB(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 18057)
+@@ -122,7 +122,7 @@
+ void AdjointBalancethickness2Analysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	_error_("not implemented yet");
+ }/*}}}*/
+-void AdjointBalancethickness2Analysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void AdjointBalancethickness2Analysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void AdjointBalancethickness2Analysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.cpp	(revision 18057)
+@@ -44,7 +44,7 @@
+ void BalancethicknessSoftAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void BalancethicknessSoftAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void BalancethicknessSoftAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void BalancethicknessSoftAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp	(revision 18057)
+@@ -291,7 +291,7 @@
+ void HydrologyShreveAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	element->GetSolutionFromInputsOneDof(solution,WatercolumnEnum);
+ }/*}}}*/
+-void HydrologyShreveAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void HydrologyShreveAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void HydrologyShreveAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h	(revision 18057)
+@@ -26,7 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void GetSolutionFromInputsHoriz(Vector<IssmDouble>* solution,Element* element);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+Index: ../trunk-jpl/src/c/analyses/DepthAverageAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DepthAverageAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/DepthAverageAnalysis.cpp	(revision 18057)
+@@ -159,7 +159,7 @@
+ void DepthAverageAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void DepthAverageAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void DepthAverageAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void DepthAverageAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h	(revision 18057)
+@@ -27,7 +27,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ 
+Index: ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp	(revision 18057)
+@@ -240,7 +240,7 @@
+ void BalancevelocityAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void BalancevelocityAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void BalancevelocityAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void BalancevelocityAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp	(revision 18057)
+@@ -198,7 +198,7 @@
+ void L2ProjectionBaseAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void L2ProjectionBaseAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void L2ProjectionBaseAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void L2ProjectionBaseAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp	(revision 18057)
+@@ -366,7 +366,7 @@
+ void FreeSurfaceTopAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void FreeSurfaceTopAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void FreeSurfaceTopAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void FreeSurfaceTopAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.h	(revision 18057)
+@@ -26,7 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/LsfReinitializationAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LsfReinitializationAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/LsfReinitializationAnalysis.cpp	(revision 18057)
+@@ -283,7 +283,7 @@
+ 	xDelete<int>(doflist);
+ 
+ }/*}}}*/
+-void LsfReinitializationAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void LsfReinitializationAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void LsfReinitializationAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/Analysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/Analysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/Analysis.h	(revision 18057)
+@@ -39,7 +39,7 @@
+ 		virtual ElementMatrix* CreateKMatrix(Element* element)=0;
+ 		virtual ElementVector* CreatePVector(Element* element)=0;
+ 		virtual void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element)=0;
+-		virtual void GradientJ(Vector<IssmDouble>* gradient,int control_index)=0;
++		virtual void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index)=0;
+ 		virtual void InputUpdateFromSolution(IssmDouble* solution,Element* element)=0;
+ 		virtual void UpdateConstraints(FemModel* femmodel)=0;
+ };
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.h	(revision 18057)
+@@ -32,7 +32,7 @@
+ 		void GetB(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBprime(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp	(revision 18057)
+@@ -492,7 +492,7 @@
+ 	xDelete<int>(doflist);
+ 	xDelete<IssmDouble>(values);
+ }/*}}}*/
+-void StressbalanceSIAAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void StressbalanceSIAAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void StressbalanceSIAAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h	(revision 18057)
+@@ -28,7 +28,7 @@
+ 		void GetB(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBprime(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ 
+Index: ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.h	(revision 18057)
+@@ -28,7 +28,7 @@
+ 		ElementVector* CreatePVectorVolume(Element* element);
+ 		ElementVector* CreatePVectorBoundary(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18057)
+@@ -1039,7 +1039,7 @@
+ 	xDelete<IssmDouble>(values);
+ 	xDelete<int>(doflist);
+ }/*}}}*/
+-void StressbalanceAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void StressbalanceAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void StressbalanceAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.h	(revision 18057)
+@@ -28,7 +28,7 @@
+ 		void GetB(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBprime(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 18057)
+@@ -392,7 +392,7 @@
+ void HydrologyDCInefficientAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	element->GetSolutionFromInputsOneDof(solution,SedimentHeadEnum);
+ }/*}}}*/
+-void HydrologyDCInefficientAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void HydrologyDCInefficientAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void HydrologyDCInefficientAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.h	(revision 18057)
+@@ -26,7 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp	(revision 18057)
+@@ -653,7 +653,7 @@
+ 	/*Clean-up*/
+ 	xDelete<IssmDouble>(dbasis);
+ }/*}}}*/
+-void ThermalAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void ThermalAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void ThermalAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.h	(revision 18057)
+@@ -26,7 +26,7 @@
+ 	ElementMatrix* CreateKMatrix(Element* element);
+ 	ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 	void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 	void UpdateConstraints(FemModel* femmodel);
+ 	void GetB(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+Index: ../trunk-jpl/src/c/analyses/GiaAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/GiaAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/GiaAnalysis.cpp	(revision 18057)
+@@ -56,7 +56,7 @@
+ void GiaAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void GiaAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void GiaAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void GiaAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.h	(revision 18057)
+@@ -26,7 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.h	(revision 18057)
+@@ -32,7 +32,7 @@
+ 		void GetB(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBprime(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.h	(revision 18057)
+@@ -26,7 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/EnumToAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnumToAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/EnumToAnalysis.h	(revision 18057)
+@@ -21,6 +21,6 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+Index: ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp	(revision 18057)
+@@ -195,7 +195,7 @@
+ void Balancethickness2Analysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void Balancethickness2Analysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void Balancethickness2Analysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void Balancethickness2Analysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 18057)
+@@ -382,7 +382,7 @@
+ void DamageEvolutionAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void DamageEvolutionAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void DamageEvolutionAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void DamageEvolutionAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 18057)
+@@ -779,7 +779,7 @@
+ void EnthalpyAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	element->GetSolutionFromInputsOneDof(solution,EnthalpyEnum);
+ }/*}}}*/
+-void EnthalpyAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void EnthalpyAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void EnthalpyAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/MeshdeformationAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MeshdeformationAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/MeshdeformationAnalysis.cpp	(revision 18057)
+@@ -44,7 +44,7 @@
+ void MeshdeformationAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void MeshdeformationAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void MeshdeformationAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void MeshdeformationAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 18057)
+@@ -363,7 +363,7 @@
+ void FreeSurfaceBaseAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+-void FreeSurfaceBaseAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void FreeSurfaceBaseAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void FreeSurfaceBaseAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/analyses/LevelsetAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/LevelsetAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/LevelsetAnalysis.h	(revision 18057)
+@@ -26,7 +26,7 @@
+ 		ElementMatrix* CreateKMatrix(Element* element);
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ 		void GetB(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+Index: ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.h	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.h	(revision 18057)
+@@ -32,7 +32,7 @@
+ 		void GetB(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBprime(IssmDouble* B,Element* element,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+-		void GradientJ(Vector<IssmDouble>* gradient,int control_index);
++		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp	(revision 18056)
++++ ../trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp	(revision 18057)
+@@ -239,7 +239,7 @@
+ void ExtrapolationAnalysis::GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 	_error_("not implemented yet");
+ }/*}}}*/
+-void ExtrapolationAnalysis::GradientJ(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++void ExtrapolationAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void ExtrapolationAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18057-18058.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18057-18058.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18057-18058.diff	(revision 18296)
@@ -0,0 +1,239 @@
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 18057)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 18058)
+@@ -973,7 +973,86 @@
+                          
+ }/*}}}*/
+ void AdjointHorizAnalysis::GradientJDragGradient(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-	_error_("not implemented yet");
++
++	/*return if floating*/
++	if(element->IsFloating())return;
++
++	/*Intermediaries*/
++	int      domaintype,dim;
++	Element* basalelement;
++
++	/*Get basal element*/
++	element->FindParam(&domaintype,DomainTypeEnum);
++	switch(domaintype){
++		case Domain2DhorizontalEnum:
++			basalelement = element;
++			dim          = 2;
++			break;
++		case Domain2DverticalEnum:
++			if(!element->IsOnBase()) return;
++			basalelement = element->SpawnBasalElement();
++			dim          = 1;
++			break;
++		case Domain3DEnum:
++			if(!element->IsOnBase()) return;
++			basalelement = element->SpawnBasalElement();
++			dim          = 2;
++			break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
++
++	/*Intermediaries*/
++	IssmDouble Jdet,weight;
++	IssmDouble dk[3]; 
++	IssmDouble *xyz_list= NULL;
++
++	/*Fetch number of vertices for this finite element*/
++	int numvertices = basalelement->GetNumberOfVertices();
++
++	/*Initialize some vectors*/
++	IssmDouble* dbasis        = xNew<IssmDouble>(2*numvertices);
++	IssmDouble* ge            = xNew<IssmDouble>(numvertices);
++	int*        vertexpidlist = xNew<int>(numvertices);
++
++	/*Retrieve all inputs we will be needing: */
++	basalelement->GetVerticesCoordinates(&xyz_list);
++	basalelement->GradientIndexing(&vertexpidlist[0],control_index);
++	Input* dragcoefficient_input = basalelement->GetInput(FrictionCoefficientEnum);                _assert_(dragcoefficient_input);
++	Input* weights_input         = basalelement->GetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
++
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=basalelement->NewGauss(2);
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++		gauss->GaussPoint(ig);
++
++		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		basalelement->NodalFunctionsP1Derivatives(dbasis,xyz_list,gauss);
++		weights_input->GetInputValue(&weight,gauss,DragCoefficientAbsGradientEnum);
++
++		/*Build alpha_complement_list: */
++		dragcoefficient_input->GetInputDerivativeValue(&dk[0],xyz_list,gauss);
++
++		/*Build gradje_g_gaussian vector (actually -dJ/ddrag): */
++		for(int i=0;i<numvertices;i++){
++			if(dim==2){
++				ge[i]+=-weight*Jdet*gauss->weight*(dbasis[0*numvertices+i]*dk[0]+dbasis[1*numvertices+i]*dk[1]);
++			}
++			else{
++				ge[i]+=-weight*Jdet*gauss->weight*dbasis[0*numvertices+i]*dk[0];
++			}
++			_assert_(!xIsNan<IssmDouble>(ge[i]));
++		}
++	}
++	gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(dbasis);
++	xDelete<IssmDouble>(ge);
++	xDelete<int>(vertexpidlist);
++	delete gauss;
++	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
++
+ }/*}}}*/
+ void AdjointHorizAnalysis::GradientJBGradient(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+ 	_error_("not implemented yet");
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18057)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18058)
+@@ -93,6 +93,7 @@
+ 		IssmDouble GetXcoord(IssmDouble* xyz_list,Gauss* gauss);
+ 		IssmDouble GetYcoord(IssmDouble* xyz_list,Gauss* gauss);
+ 		IssmDouble GetZcoord(IssmDouble* xyz_list,Gauss* gauss);
++		void       GradientIndexing(int* indexing,int control_index);
+ 		bool       HasNodeOnBase();
+ 		bool       HasNodeOnSurface();
+ 		int        Id();
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18057)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18058)
+@@ -3402,19 +3402,6 @@
+ 	xDelete<int>(responses);
+ }
+ /*}}}*/
+-void       Tria::GradientIndexing(int* indexing,int control_index){/*{{{*/
+-
+-	/*Get some parameters*/
+-	int num_controls;
+-	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+-
+-	/*get gradient indices*/
+-	for(int i=0;i<NUMVERTICES;i++){
+-		indexing[i]=num_controls*this->vertices[i]->Pid() + control_index;
+-	}
+-
+-}
+-/*}}}*/
+ void       Tria::GetVectorFromControlInputs(Vector<IssmDouble>* vector,int control_enum,int control_index,const char* data){/*{{{*/
+ 
+ 	int vertexpidlist[NUMVERTICES];
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18057)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18058)
+@@ -135,7 +135,6 @@
+ 		void   GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y);
+ 		#endif
+ 
+-		void       GradientIndexing(int* indexing,int control_index);
+ 		void       Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index);
+ 		void       GradjBGradient(Vector<IssmDouble>* gradient,int control_index);
+ 		void       GradjDGradient(Vector<IssmDouble>* gradient,int control_index);
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18057)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18058)
+@@ -2894,19 +2894,6 @@
+ 	vector_gradient->SetValues(NUMVERTICES,&sidlist[0],&gradients[0],ADD_VAL);
+ 
+ }/*}}}*/
+-void       Penta::GradientIndexing(int* indexing,int control_index){/*{{{*/
+-
+-	/*Get some parameters*/
+-	int num_controls;
+-	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+-
+-	/*get gradient indices*/
+-	for(int i=0;i<NUMVERTICES;i++){
+-		indexing[i]=num_controls*this->vertices[i]->Pid() + control_index;
+-	}
+-
+-}
+-/*}}}*/
+ void       Penta::Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index){/*{{{*/
+ 	/*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 18057)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 18058)
+@@ -130,7 +130,6 @@
+ 		void   GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y);
+ 		#endif
+ 
+-		void   GradientIndexing(int* indexing,int control_index);
+ 		void   Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index);
+ 		void   GradjDragSSA(Vector<IssmDouble>* gradient,int control_index);
+ 		void   GradjDragHO(Vector<IssmDouble>* gradient,int control_index);
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.cpp	(revision 18057)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.cpp	(revision 18058)
+@@ -115,19 +115,6 @@
+ 	*pxyz_list = xyz_list;
+ 
+ }/*}}}*/
+-void       Seg::GradientIndexing(int* indexing,int control_index){/*{{{*/
+-
+-	/*Get some parameters*/
+-	int num_controls;
+-	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+-
+-	/*get gradient indices*/
+-	for(int i=0;i<NUMVERTICES;i++){
+-		indexing[i]=num_controls*this->vertices[i]->Pid() + control_index;
+-	}
+-
+-}
+-/*}}}*/
+ void       Seg::GradjDragFS(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+ 
+ 	int        i;
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 18057)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 18058)
+@@ -166,7 +166,6 @@
+ 		void   GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+ #endif
+ 
+-		void       GradientIndexing(int* indexing,int control_index);
+ 		void       Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index){_error_("not implemented yet");};
+ 		void       GradjBGradient(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+ 		void       GradjDGradient(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18057)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18058)
+@@ -602,6 +602,22 @@
+ 	xDelete<IssmDouble>(z_list);
+ 	return z;
+ }/*}}}*/
++void       Element::GradientIndexing(int* indexing,int control_index){/*{{{*/
++
++	/*Get number of controls*/
++	int num_controls;
++	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
++
++	/*Get number of vertices*/
++	int numvertices = this->GetNumberOfVertices();
++
++	/*get gradient indices*/
++	for(int i=0;i<numvertices;i++){
++		indexing[i]=num_controls*this->vertices[i]->Pid() + control_index;
++	}
++
++}
++/*}}}*/
+ bool       Element::HasNodeOnBase(){/*{{{*/
+ 	return (this->inputs->Max(MeshVertexonbaseEnum)>0.);
+ }/*}}}*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18058-18059.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18058-18059.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18058-18059.diff	(revision 18296)
@@ -0,0 +1,251 @@
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 18058)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 18059)
+@@ -975,7 +975,7 @@
+ void AdjointHorizAnalysis::GradientJDragGradient(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+ 
+ 	/*return if floating*/
+-	if(element->IsFloating())return;
++	if(element->IsFloating()) return;
+ 
+ 	/*Intermediaries*/
+ 	int      domaintype,dim;
+@@ -1067,7 +1067,89 @@
+ 	_error_("not implemented yet");
+ }/*}}}*/
+ void AdjointHorizAnalysis::GradientJBbarSSA(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-	_error_("not implemented yet");
++
++	/*Intermediaries*/
++	int      domaintype,dim;
++	Element* basalelement;
++
++	/*Get basal element*/
++	element->FindParam(&domaintype,DomainTypeEnum);
++	switch(domaintype){
++		case Domain2DhorizontalEnum:
++			basalelement = element;
++			dim          = 2;
++			break;
++		case Domain2DverticalEnum:
++			if(!element->IsOnBase()) return;
++			basalelement = element->SpawnBasalElement();
++			dim          = 1;
++			break;
++		case Domain3DEnum:
++			if(!element->IsOnBase()) return;
++			basalelement = element->SpawnBasalElement();
++			dim          = 2;
++			break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
++
++	/*Intermediaries*/
++	IssmDouble Jdet,weight;
++	IssmDouble thickness,dmudB;
++	IssmDouble dvx[3],dvy[3],dadjx[3],dadjy[3]; 
++	IssmDouble *xyz_list= NULL;
++
++	/*Fetch number of vertices for this finite element*/
++	int numvertices = basalelement->GetNumberOfVertices();
++
++	/*Initialize some vectors*/
++	IssmDouble* basis         = xNew<IssmDouble>(numvertices);
++	IssmDouble* ge            = xNew<IssmDouble>(numvertices);
++	int*        vertexpidlist = xNew<int>(numvertices);
++
++	/*Retrieve all inputs we will be needing: */
++	basalelement->GetVerticesCoordinates(&xyz_list);
++	basalelement->GradientIndexing(&vertexpidlist[0],control_index);
++	Input* thickness_input = element->GetInput(ThicknessEnum);             _assert_(thickness_input);
++	Input* vx_input        = element->GetInput(VxEnum);                    _assert_(vx_input);
++	Input* vy_input        = element->GetInput(VyEnum);                    _assert_(vy_input);
++	Input* adjointx_input  = element->GetInput(AdjointxEnum);              _assert_(adjointx_input);
++	Input* adjointy_input  = element->GetInput(AdjointyEnum);              _assert_(adjointy_input);
++	Input* rheologyb_input = element->GetInput(MaterialsRheologyBbarEnum); _assert_(rheologyb_input);
++
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=basalelement->NewGauss(4);
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++		gauss->GaussPoint(ig);
++
++
++		thickness_input->GetInputValue(&thickness,gauss);
++		vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
++		vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
++		adjointx_input->GetInputDerivativeValue(&dadjx[0],xyz_list,gauss);
++		adjointy_input->GetInputDerivativeValue(&dadjy[0],xyz_list,gauss);
++
++		basalelement->dViscositydBSSA(&dmudB,dim,xyz_list,gauss,vx_input,vy_input);
++
++		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		basalelement->NodalFunctionsP1(basis,gauss);
++
++		/*Build gradient vector (actually -dJ/dB): */
++		for(int i=0;i<numvertices;i++){
++			ge[i]+=-dmudB*thickness*(
++						(2*dvx[0]+dvy[1])*2*dadjx[0]+(dvx[1]+dvy[0])*(dadjx[1]+dadjy[0])+(2*dvy[1]+dvx[0])*2*dadjy[1]
++						)*Jdet*gauss->weight*basis[i];
++			_assert_(!xIsNan<IssmDouble>(ge[i]));
++		}
++	}
++	gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(basis);
++	xDelete<IssmDouble>(ge);
++	xDelete<int>(vertexpidlist);
++	delete gauss;
++	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+ void AdjointHorizAnalysis::GradientJBbarHO(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+ 	_error_("not implemented yet");
+Index: ../trunk-jpl/src/c/classes/Materials/Matice.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 18058)
++++ ../trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 18059)
+@@ -283,6 +283,56 @@
+ 	*pviscosity=viscosity;
+ }
+ /*}}}*/
++/*FUNCTION Matice::GetViscosity_B {{{*/
++void  Matice::GetViscosity_B(IssmDouble* pviscosity,IssmDouble eps_eff){
++	/*From a string tensor and a material object, return viscosity, using Glen's flow law.
++	  (1-D)
++	  viscosity= -----------------------
++	  2 eps_eff ^[(n-1)/n]
++
++	  where viscosity is the viscotiy, B the flow law parameter , eps_eff is the effective strain rate
++	  and n the flow law exponent.
++
++	  If eps_eff = 0 , it means this is the first time SystemMatrices is being run, and we 
++	  return 10^14, initial viscosity.
++	  */
++
++	/*output: */
++	IssmDouble viscosity;
++
++	/*Intermediary: */
++	IssmDouble D=0.,n;
++
++	/*Get B and n*/
++	n=GetN(); _assert_(n>0.);
++	if(this->isdamaged){
++		D=GetD();
++		_assert_(D>=0. && D<1.);
++	}
++
++	if (n==1.){
++		/*Linear Viscous behavior (Newtonian fluid) viscosity=B/2: */
++		viscosity=(1.-D)/2.;
++	}
++	else{
++
++		/*if no strain rate, return maximum viscosity*/
++		if(eps_eff==0.){
++			viscosity = 1.e+14/2.;
++		}
++
++		else{
++			viscosity=(1.-D)/(2.*pow(eps_eff,(n-1.)/n));
++		}
++	}
++
++	/*Checks in debugging mode*/
++	if(viscosity<=0) _error_("Negative viscosity");
++
++	/*Return: */
++	*pviscosity=viscosity;
++}
++/*}}}*/
+ /*FUNCTION Matice::GetViscosityBar {{{*/
+ void  Matice::GetViscosityBar(IssmDouble* pviscosity,IssmDouble eps_eff){
+ 	/*From a string tensor and a material object, return viscosity, using Glen's flow law.
+Index: ../trunk-jpl/src/c/classes/Materials/Material.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Material.h	(revision 18058)
++++ ../trunk-jpl/src/c/classes/Materials/Material.h	(revision 18059)
+@@ -25,6 +25,7 @@
+ 		virtual Material*  copy2(Element* element)=0;
+ 		virtual void       Configure(Elements* elements)=0;
+ 		virtual void       GetViscosity(IssmDouble* pviscosity,IssmDouble epseff)=0;
++		virtual void       GetViscosity_B(IssmDouble* pviscosity,IssmDouble epseff)=0;
+ 		virtual void       GetViscosityBar(IssmDouble* pviscosity,IssmDouble epseff)=0;
+ 		virtual void       GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon)=0;
+ 		virtual void       GetViscosityDComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon)=0;
+Index: ../trunk-jpl/src/c/classes/Materials/Matice.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matice.h	(revision 18058)
++++ ../trunk-jpl/src/c/classes/Materials/Matice.h	(revision 18059)
+@@ -54,6 +54,7 @@
+ 		Material*  copy2(Element* element);
+ 		void       SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
+ 		void       GetViscosity(IssmDouble* pviscosity, IssmDouble eps_eff);
++		void       GetViscosity_B(IssmDouble* pviscosity, IssmDouble eps_eff);
+ 		void       GetViscosityBar(IssmDouble* pviscosity, IssmDouble eps_eff);
+ 		void       GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon);
+ 		void       GetViscosityDComplement(IssmDouble*, IssmDouble*);
+Index: ../trunk-jpl/src/c/classes/Materials/Matpar.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matpar.h	(revision 18058)
++++ ../trunk-jpl/src/c/classes/Materials/Matpar.h	(revision 18059)
+@@ -75,6 +75,7 @@
+ 		Material*  copy2(Element* element){_error_("not implemented");};
+ 		void       Configure(Elements* elements);
+ 		void       GetViscosity(IssmDouble* pviscosity,IssmDouble eps_eff){_error_("not supported");};
++		void       GetViscosity_B(IssmDouble* pviscosity,IssmDouble eps_eff){_error_("not supported");};
+ 		void       GetViscosityBar(IssmDouble* pviscosity,IssmDouble eps_eff){_error_("not supported");};
+ 		void       GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon){_error_("not supported");};
+ 		void       GetViscosityDComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon){_error_("not supported");};
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18058)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18059)
+@@ -59,6 +59,7 @@
+ 		void       Echo();
+ 		void       DeepEcho();
+ 		void       DeleteMaterials(void);
++		void       dViscositydBSSA(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+ 		IssmDouble Divergence(void);
+ 		void       ThermalToEnthalpy(IssmDouble* penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure);
+ 		void       EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure);
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18058)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18059)
+@@ -212,6 +212,33 @@
+ 	delete gauss;
+ 	return divergence;
+ }/*}}}*/
++void       Element::dViscositydBSSA(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){/*{{{*/
++
++	/*Intermediaries*/
++	IssmDouble dmudB;
++	IssmDouble epsilon2d[3];/* epsilon=[exx,eyy,exy];    */
++	IssmDouble epsilon1d;   /* epsilon=[exx];    */
++	IssmDouble eps_eff;
++
++	 if(dim==2){
++		 /* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exx*eyy*/
++		 this->StrainRateSSA(&epsilon2d[0],xyz_list,gauss,vx_input,vy_input);
++		 eps_eff = sqrt(epsilon2d[0]*epsilon2d[0] + epsilon2d[1]*epsilon2d[1] + epsilon2d[2]*epsilon2d[2] + epsilon2d[0]*epsilon2d[1]);
++	 }
++	 else{
++		 /* eps_eff^2 = 1/2 exx^2*/
++		 this->StrainRateSSA1d(&epsilon1d,xyz_list,gauss,vx_input);
++		 eps_eff = sqrt(epsilon1d*epsilon1d/2.);
++	 }
++
++	/*Get viscosity*/
++	material->GetViscosity_B(&dmudB,eps_eff);
++
++	/*Assign output pointer*/
++	*pdmudB=dmudB;
++
++}
++/*}}}*/
+ void       Element::ThermalToEnthalpy(IssmDouble* penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure){/*{{{*/
+ 	matpar->ThermalToEnthalpy(penthalpy,temperature,waterfraction,pressure);
+ }/*}}}*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18059-18060.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18059-18060.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18059-18060.diff	(revision 18296)
@@ -0,0 +1,995 @@
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 18059)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 18060)
+@@ -922,7 +922,9 @@
+ 	element->FindParam(&responses,NULL,InversionCostFunctionsEnum);
+ 
+ 	/*Check that control_type is supported*/
+-	if(control_type!=MaterialsRheologyBbarEnum || control_type!=FrictionCoefficientEnum || control_type!=DamageDbarEnum){
++	if(control_type!=MaterialsRheologyBbarEnum && 
++		control_type!=FrictionCoefficientEnum   && 
++		control_type!=DamageDbarEnum){
+ 		_error_("Control "<<EnumToStringx(control_type)<<" not supported");
+ 	}
+ 
+@@ -974,7 +976,7 @@
+ }/*}}}*/
+ void AdjointHorizAnalysis::GradientJDragGradient(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+ 
+-	/*return if floating*/
++	/*return if floating (gradient is 0)*/
+ 	if(element->IsFloating()) return;
+ 
+ 	/*Intermediaries*/
+@@ -1011,7 +1013,7 @@
+ 
+ 	/*Initialize some vectors*/
+ 	IssmDouble* dbasis        = xNew<IssmDouble>(2*numvertices);
+-	IssmDouble* ge            = xNew<IssmDouble>(numvertices);
++	IssmDouble* ge            = xNewZeroInit<IssmDouble>(numvertices);
+ 	int*        vertexpidlist = xNew<int>(numvertices);
+ 
+ 	/*Retrieve all inputs we will be needing: */
+@@ -1055,16 +1057,309 @@
+ 
+ }/*}}}*/
+ void AdjointHorizAnalysis::GradientJBGradient(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-	_error_("not implemented yet");
++
++	/*Intermediaries*/
++	int      domaintype,dim;
++	Element* basalelement;
++
++	/*Get basal element*/
++	element->FindParam(&domaintype,DomainTypeEnum);
++	switch(domaintype){
++		case Domain2DhorizontalEnum:
++			basalelement = element;
++			dim          = 2;
++			break;
++		case Domain2DverticalEnum:
++			if(!element->IsOnBase()) return;
++			basalelement = element->SpawnBasalElement();
++			dim          = 1;
++			break;
++		case Domain3DEnum:
++			if(!element->IsOnBase()) return;
++			basalelement = element->SpawnBasalElement();
++			dim          = 2;
++			break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
++
++	/*Intermediaries*/
++	IssmDouble Jdet,weight;
++	IssmDouble dk[3]; 
++	IssmDouble *xyz_list= NULL;
++
++	/*Fetch number of vertices for this finite element*/
++	int numvertices = basalelement->GetNumberOfVertices();
++
++	/*Initialize some vectors*/
++	IssmDouble* dbasis        = xNew<IssmDouble>(2*numvertices);
++	IssmDouble* ge            = xNewZeroInit<IssmDouble>(numvertices);
++	int*        vertexpidlist = xNew<int>(numvertices);
++
++	/*Retrieve all inputs we will be needing: */
++	basalelement->GetVerticesCoordinates(&xyz_list);
++	basalelement->GradientIndexing(&vertexpidlist[0],control_index);
++	Input* rheologyb_input = basalelement->GetInput(MaterialsRheologyBbarEnum);              _assert_(rheologyb_input);
++	Input* weights_input   = basalelement->GetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
++
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=basalelement->NewGauss(2);
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++		gauss->GaussPoint(ig);
++
++		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		basalelement->NodalFunctionsP1Derivatives(dbasis,xyz_list,gauss);
++		weights_input->GetInputValue(&weight,gauss,RheologyBbarAbsGradientEnum);
++
++		/*Build alpha_complement_list: */
++		rheologyb_input->GetInputDerivativeValue(&dk[0],xyz_list,gauss);
++
++		/*Build gradje_g_gaussian vector (actually -dJ/ddrag): */
++		for(int i=0;i<numvertices;i++){
++			if(dim==2){
++				ge[i]+=-weight*Jdet*gauss->weight*(dbasis[0*numvertices+i]*dk[0]+dbasis[1*numvertices+i]*dk[1]);
++			}
++			else{
++				ge[i]+=-weight*Jdet*gauss->weight*dbasis[0*numvertices+i]*dk[0];
++			}
++			_assert_(!xIsNan<IssmDouble>(ge[i]));
++		}
++	}
++	gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(dbasis);
++	xDelete<IssmDouble>(ge);
++	xDelete<int>(vertexpidlist);
++	delete gauss;
++	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+ void AdjointHorizAnalysis::GradientJDragSSA(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-	_error_("not implemented yet");
++
++	/*return if floating (gradient is 0)*/
++	if(element->IsFloating()) return;
++
++	/*Intermediaries*/
++	int      domaintype,dim;
++	Element* basalelement;
++
++	/*Get basal element*/
++	element->FindParam(&domaintype,DomainTypeEnum);
++	switch(domaintype){
++		case Domain2DhorizontalEnum:
++			basalelement = element;
++			dim          = 2;
++			break;
++		case Domain2DverticalEnum:
++			if(!element->IsOnBase()) return;
++			basalelement = element->SpawnBasalElement();
++			dim          = 1;
++			break;
++		case Domain3DEnum:
++			if(!element->IsOnBase()) return;
++			basalelement = element->SpawnBasalElement();
++			dim          = 2;
++			break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
++
++	/*Intermediaries*/
++	IssmDouble Jdet,weight;
++	IssmDouble drag,dalpha2dk;
++	IssmDouble vx,vy,lambda,mu;
++	IssmDouble *xyz_list= NULL;
++
++	/*Fetch number of vertices for this finite element*/
++	int numvertices = basalelement->GetNumberOfVertices();
++
++	/*Initialize some vectors*/
++	IssmDouble* basis         = xNew<IssmDouble>(numvertices);
++	IssmDouble* ge            = xNewZeroInit<IssmDouble>(numvertices);
++	int*        vertexpidlist = xNew<int>(numvertices);
++
++	/*Build friction element, needed later: */
++	Friction* friction=new Friction(basalelement,dim);
++
++	/*Retrieve all inputs we will be needing: */
++	basalelement->GetVerticesCoordinates(&xyz_list);
++	basalelement->GradientIndexing(&vertexpidlist[0],control_index);
++	Input* vx_input        = basalelement->GetInput(VxEnum);                   _assert_(vx_input);
++	Input* vy_input        = basalelement->GetInput(VyEnum);                   _assert_(vy_input);
++	Input* adjointx_input  = basalelement->GetInput(AdjointxEnum);             _assert_(adjointx_input);
++	Input* adjointy_input  = basalelement->GetInput(AdjointyEnum);             _assert_(adjointy_input);
++	Input* dragcoeff_input = basalelement->GetInput(FrictionCoefficientEnum);  _assert_(dragcoeff_input);
++
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=basalelement->NewGauss(4);
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++		gauss->GaussPoint(ig);
++
++		adjointx_input->GetInputValue(&lambda, gauss);
++		adjointy_input->GetInputValue(&mu, gauss);
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		dragcoeff_input->GetInputValue(&drag, gauss);
++
++		friction->GetAlphaComplement(&dalpha2dk,gauss);
++
++		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		basalelement->NodalFunctionsP1(basis,gauss);
++
++		/*Build gradient vector (actually -dJ/dD): */
++		for(int i=0;i<numvertices;i++){
++			ge[i]+=-2.*drag*dalpha2dk*((lambda*vx+mu*vy))*Jdet*gauss->weight*basis[i];
++			_assert_(!xIsNan<IssmDouble>(ge[i]));
++		}
++	}
++	gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(basis);
++	xDelete<IssmDouble>(ge);
++	xDelete<int>(vertexpidlist);
++	delete gauss;
++	delete friction;
++	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+ void AdjointHorizAnalysis::GradientJDragHO(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-	_error_("not implemented yet");
++
++	/*return if floating or not on bed (gradient is 0)*/
++	if(element->IsFloating()) return;
++	if(!element->IsOnBase()) return;
++
++	/*Intermediaries*/
++	int        dim=3;
++	IssmDouble Jdet,weight;
++	IssmDouble drag,dalpha2dk;
++	IssmDouble vx,vy,lambda,mu;
++	IssmDouble *xyz_list_base= NULL;
++
++	/*Fetch number of vertices for this finite element*/
++	int numvertices = element->GetNumberOfVertices();
++
++	/*Initialize some vectors*/
++	IssmDouble* basis         = xNew<IssmDouble>(numvertices);
++	IssmDouble* ge            = xNewZeroInit<IssmDouble>(numvertices);
++	int*        vertexpidlist = xNew<int>(numvertices);
++
++	/*Build friction element, needed later: */
++	Friction* friction=new Friction(element,dim);
++
++	/*Retrieve all inputs we will be needing: */
++	element->GetVerticesCoordinatesBase(&xyz_list_base);
++	element->GradientIndexing(&vertexpidlist[0],control_index);
++	Input* vx_input        = element->GetInput(VxEnum);                   _assert_(vx_input);
++	Input* vy_input        = element->GetInput(VyEnum);                   _assert_(vy_input);
++	Input* adjointx_input  = element->GetInput(AdjointxEnum);             _assert_(adjointx_input);
++	Input* adjointy_input  = element->GetInput(AdjointyEnum);             _assert_(adjointy_input);
++	Input* dragcoeff_input = element->GetInput(FrictionCoefficientEnum);  _assert_(dragcoeff_input);
++
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=element->NewGaussBase(4);
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++		gauss->GaussPoint(ig);
++
++		adjointx_input->GetInputValue(&lambda, gauss);
++		adjointy_input->GetInputValue(&mu, gauss);
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		dragcoeff_input->GetInputValue(&drag, gauss);
++
++		friction->GetAlphaComplement(&dalpha2dk,gauss);
++
++		element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
++		element->NodalFunctionsP1(basis,gauss);
++
++		/*Build gradient vector (actually -dJ/dD): */
++		for(int i=0;i<numvertices;i++){
++			ge[i]+=-2.*drag*dalpha2dk*((lambda*vx+mu*vy))*Jdet*gauss->weight*basis[i];
++			_assert_(!xIsNan<IssmDouble>(ge[i]));
++		}
++	}
++	gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(xyz_list_base);
++	xDelete<IssmDouble>(basis);
++	xDelete<IssmDouble>(ge);
++	xDelete<int>(vertexpidlist);
++	delete gauss;
++	delete friction;
+ }/*}}}*/
+ void AdjointHorizAnalysis::GradientJDragFS(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-	_error_("not implemented yet");
++
++	/*return if floating or not on bed (gradient is 0)*/
++	if(element->IsFloating()) return;
++	if(!element->IsOnBase()) return;
++
++	/*Intermediaries*/
++	int        dim=3;
++	IssmDouble Jdet,weight;
++	IssmDouble drag,dalpha2dk,normal[3];
++	IssmDouble vx,vy,vz,lambda,mu,xi;
++	IssmDouble *xyz_list_base= NULL;
++
++	/*Fetch number of vertices for this finite element*/
++	int numvertices = element->GetNumberOfVertices();
++
++	/*Initialize some vectors*/
++	IssmDouble* basis         = xNew<IssmDouble>(numvertices);
++	IssmDouble* ge            = xNewZeroInit<IssmDouble>(numvertices);
++	int*        vertexpidlist = xNew<int>(numvertices);
++
++	/*Build friction element, needed later: */
++	Friction* friction=new Friction(element,dim);
++
++	/*Retrieve all inputs we will be needing: */
++	element->GetVerticesCoordinatesBase(&xyz_list_base);
++	element->GradientIndexing(&vertexpidlist[0],control_index);
++	Input* vx_input        = element->GetInput(VxEnum);                   _assert_(vx_input);
++	Input* vy_input        = element->GetInput(VyEnum);                   _assert_(vy_input);
++	Input* vz_input        = element->GetInput(VzEnum);                   _assert_(vy_input);
++	Input* adjointx_input  = element->GetInput(AdjointxEnum);             _assert_(adjointx_input);
++	Input* adjointy_input  = element->GetInput(AdjointyEnum);             _assert_(adjointy_input);
++	Input* adjointz_input  = element->GetInput(AdjointzEnum);             _assert_(adjointz_input);
++	Input* dragcoeff_input = element->GetInput(FrictionCoefficientEnum);  _assert_(dragcoeff_input);
++
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=element->NewGaussBase(4);
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++		gauss->GaussPoint(ig);
++
++		adjointx_input->GetInputValue(&lambda, gauss);
++		adjointy_input->GetInputValue(&mu, gauss);
++		adjointz_input->GetInputValue(&xi    ,gauss);
++		vx_input->GetInputValue(&vx,gauss);
++		vy_input->GetInputValue(&vy,gauss);
++		vz_input->GetInputValue(&vz,gauss);
++		dragcoeff_input->GetInputValue(&drag, gauss);
++
++		friction->GetAlphaComplement(&dalpha2dk,gauss);
++		element->NormalBase(&normal[0],xyz_list_base);
++
++		element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
++		element->NodalFunctionsP1(basis,gauss);
++
++		/*Build gradient vector (actually -dJ/dk): */
++		for(int i=0;i<numvertices;i++){
++			ge[i]+=(
++						-lambda*(2*drag*dalpha2dk*(vx - vz*normal[0]*normal[2]))
++						-mu    *(2*drag*dalpha2dk*(vy - vz*normal[1]*normal[2]))
++						-xi    *(2*drag*dalpha2dk*(-vx*normal[0]*normal[2]-vy*normal[1]*normal[2]))
++						)*Jdet*gauss->weight*basis[i];
++			_assert_(!xIsNan<IssmDouble>(ge[i]));
++		}
++	}
++	gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(xyz_list_base);
++	xDelete<IssmDouble>(basis);
++	xDelete<IssmDouble>(ge);
++	xDelete<int>(vertexpidlist);
++	delete gauss;
++	delete friction;
+ }/*}}}*/
+ void AdjointHorizAnalysis::GradientJBbarSSA(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+ 
+@@ -1103,25 +1398,24 @@
+ 
+ 	/*Initialize some vectors*/
+ 	IssmDouble* basis         = xNew<IssmDouble>(numvertices);
+-	IssmDouble* ge            = xNew<IssmDouble>(numvertices);
++	IssmDouble* ge            = xNewZeroInit<IssmDouble>(numvertices);
+ 	int*        vertexpidlist = xNew<int>(numvertices);
+ 
+ 	/*Retrieve all inputs we will be needing: */
+ 	basalelement->GetVerticesCoordinates(&xyz_list);
+ 	basalelement->GradientIndexing(&vertexpidlist[0],control_index);
+-	Input* thickness_input = element->GetInput(ThicknessEnum);             _assert_(thickness_input);
+-	Input* vx_input        = element->GetInput(VxEnum);                    _assert_(vx_input);
+-	Input* vy_input        = element->GetInput(VyEnum);                    _assert_(vy_input);
+-	Input* adjointx_input  = element->GetInput(AdjointxEnum);              _assert_(adjointx_input);
+-	Input* adjointy_input  = element->GetInput(AdjointyEnum);              _assert_(adjointy_input);
+-	Input* rheologyb_input = element->GetInput(MaterialsRheologyBbarEnum); _assert_(rheologyb_input);
++	Input* thickness_input = basalelement->GetInput(ThicknessEnum);             _assert_(thickness_input);
++	Input* vx_input        = basalelement->GetInput(VxEnum);                    _assert_(vx_input);
++	Input* vy_input        = basalelement->GetInput(VyEnum);                    _assert_(vy_input);
++	Input* adjointx_input  = basalelement->GetInput(AdjointxEnum);              _assert_(adjointx_input);
++	Input* adjointy_input  = basalelement->GetInput(AdjointyEnum);              _assert_(adjointy_input);
++	Input* rheologyb_input = basalelement->GetInput(MaterialsRheologyBbarEnum); _assert_(rheologyb_input);
+ 
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss=basalelement->NewGauss(4);
+ 	for(int ig=gauss->begin();ig<gauss->end();ig++){
+ 		gauss->GaussPoint(ig);
+ 
+-
+ 		thickness_input->GetInputValue(&thickness,gauss);
+ 		vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
+ 		vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
+@@ -1152,13 +1446,96 @@
+ 	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+ void AdjointHorizAnalysis::GradientJBbarHO(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-	_error_("not implemented yet");
++
++	/*WARNING: We use SSA as an estimate for now*/
++	this->GradientJBbarSSA(element,gradient,control_index);
+ }/*}}}*/
+ void AdjointHorizAnalysis::GradientJBbarFS(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-	_error_("not implemented yet");
++	/*WARNING: We use SSA as an estimate for now*/
++	this->GradientJBbarSSA(element,gradient,control_index);
+ }/*}}}*/
+ void AdjointHorizAnalysis::GradientJDSSA(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-	_error_("not implemented yet");
++
++	/*Intermediaries*/
++	int      domaintype,dim;
++	Element* basalelement;
++
++	/*Get basal element*/
++	element->FindParam(&domaintype,DomainTypeEnum);
++	switch(domaintype){
++		case Domain2DhorizontalEnum:
++			basalelement = element;
++			dim          = 2;
++			break;
++		case Domain2DverticalEnum:
++			if(!element->IsOnBase()) return;
++			basalelement = element->SpawnBasalElement();
++			dim          = 1;
++			break;
++		case Domain3DEnum:
++			if(!element->IsOnBase()) return;
++			basalelement = element->SpawnBasalElement();
++			dim          = 2;
++			break;
++		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
++	}
++
++	/*Intermediaries*/
++	IssmDouble Jdet,weight;
++	IssmDouble thickness,dmudD;
++	IssmDouble dvx[3],dvy[3],dadjx[3],dadjy[3]; 
++	IssmDouble *xyz_list= NULL;
++
++	/*Fetch number of vertices for this finite element*/
++	int numvertices = basalelement->GetNumberOfVertices();
++
++	/*Initialize some vectors*/
++	IssmDouble* basis         = xNew<IssmDouble>(numvertices);
++	IssmDouble* ge            = xNewZeroInit<IssmDouble>(numvertices);
++	int*        vertexpidlist = xNew<int>(numvertices);
++
++	/*Retrieve all inputs we will be needing: */
++	basalelement->GetVerticesCoordinates(&xyz_list);
++	basalelement->GradientIndexing(&vertexpidlist[0],control_index);
++	Input* thickness_input = basalelement->GetInput(ThicknessEnum);             _assert_(thickness_input);
++	Input* vx_input        = basalelement->GetInput(VxEnum);                    _assert_(vx_input);
++	Input* vy_input        = basalelement->GetInput(VyEnum);                    _assert_(vy_input);
++	Input* adjointx_input  = basalelement->GetInput(AdjointxEnum);              _assert_(adjointx_input);
++	Input* adjointy_input  = basalelement->GetInput(AdjointyEnum);              _assert_(adjointy_input);
++	Input* rheologyb_input = basalelement->GetInput(MaterialsRheologyBbarEnum); _assert_(rheologyb_input);
++
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=basalelement->NewGauss(4);
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++		gauss->GaussPoint(ig);
++
++		thickness_input->GetInputValue(&thickness,gauss);
++		vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
++		vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
++		adjointx_input->GetInputDerivativeValue(&dadjx[0],xyz_list,gauss);
++		adjointy_input->GetInputDerivativeValue(&dadjy[0],xyz_list,gauss);
++
++		basalelement->dViscositydDSSA(&dmudD,dim,xyz_list,gauss,vx_input,vy_input);
++
++		basalelement->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		basalelement->NodalFunctionsP1(basis,gauss);
++
++		for(int i=0;i<numvertices;i++){
++			ge[i]+=-dmudD*thickness*(
++						(2*dvx[0]+dvy[1])*2*dadjx[0]+(dvx[1]+dvy[0])*(dadjx[1]+dadjy[0])+(2*dvy[1]+dvx[0])*2*dadjy[1]
++						)*Jdet*gauss->weight*basis[i];
++			_assert_(!xIsNan<IssmDouble>(ge[i]));
++		}
++	}
++	gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(basis);
++	xDelete<IssmDouble>(ge);
++	xDelete<int>(vertexpidlist);
++	delete gauss;
++	if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
+ }/*}}}*/
+ void AdjointHorizAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 	int approximation;
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp	(revision 18059)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp	(revision 18060)
+@@ -150,8 +150,171 @@
+ 	_error_("not implemented yet");
+ }/*}}}*/
+ void AdjointBalancethicknessAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+-	_error_("Not implemented yet");
++	/*The gradient of the cost function is calculated in 2 parts.
++	 *
++	 * dJ    \partial J   \partial lambda^T(KU-F)
++	 * --  = ---------- + ------------------------
++	 * dk    \partial k   \parial k                  
++	 *
++	 * */
++
++	/*If on water, grad = 0: */
++	if(!element->IsIceInElement()) return;
++
++	/*Get list of cost functions*/
++	int *responses = NULL;
++	int num_responses,resp;
++	element->FindParam(&num_responses,InversionNumCostFunctionsEnum);
++	element->FindParam(&responses,NULL,InversionCostFunctionsEnum);
++
++	/*Check that control_type is supported*/
++	if(control_type!=VxEnum && 
++		control_type!=VyEnum && 
++		control_type!=BalancethicknessThickeningRateEnum){
++		_error_("Control "<<EnumToStringx(control_type)<<" not supported");
++	}
++
++	/*Deal with first part (partial derivative a J with respect to k)*/
++	for(resp=0;resp<num_responses;resp++) switch(responses[resp]){
++		case ThicknessAbsMisfitEnum:      /*Nothing, \partial J/\partial k = 0*/ break;
++		case ThicknessAbsGradientEnum:    /*Nothing, \partial J/\partial k = 0*/ break;
++		case ThicknessAlongGradientEnum:  /*Nothing, \partial J/\partial k = 0*/ break;
++		case ThicknessAcrossGradientEnum: /*Nothing, \partial J/\partial k = 0*/ break;
++		default: _error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
++	}
++
++	/*Deal with second term*/
++	switch(control_type){
++		case BalancethicknessThickeningRateEnum: GradientJDhDt(element,gradient,control_index); break;
++		case VxEnum:                             GradientJVx(  element,gradient,control_index); break;
++		case VyEnum:                             GradientJVy(  element,gradient,control_index); break;
++		default: _error_("control type not supported yet: " << EnumToStringx(control_type));
++	}
++
++	/*Clean up and return*/
++	xDelete<int>(responses);
++
+ }/*}}}*/
++void AdjointBalancethicknessAnalysis::GradientJVx(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++
++	/*Intermediaries*/
++	IssmDouble Jdet,weight;
++	IssmDouble thickness,Dlambda[3],dp[3];
++	IssmDouble *xyz_list= NULL;
++
++	/*Fetch number of vertices for this finite element*/
++	int numvertices = element->GetNumberOfVertices();
++
++	/*Initialize some vectors*/
++	IssmDouble* basis         = xNew<IssmDouble>(numvertices);
++	IssmDouble* ge            = xNewZeroInit<IssmDouble>(numvertices);
++	int*        vertexpidlist = xNew<int>(numvertices);
++
++	/*Retrieve all inputs we will be needing: */
++	element->GetVerticesCoordinates(&xyz_list);
++	element->GradientIndexing(&vertexpidlist[0],control_index);
++	Input* thickness_input = element->GetInput(ThicknessEnum); _assert_(thickness_input);
++	Input* adjoint_input   = element->GetInput(AdjointEnum);   _assert_(adjoint_input);
++
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=element->NewGauss(4);
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++		gauss->GaussPoint(ig);
++
++		adjoint_input->GetInputDerivativeValue(&Dlambda[0],xyz_list,gauss);
++		thickness_input->GetInputValue(&thickness, gauss);
++		thickness_input->GetInputDerivativeValue(&dp[0],xyz_list,gauss);
++
++		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		element->NodalFunctionsP1(basis,gauss);
++
++		/*Build gradient vector (actually -dJ/dD): */
++		for(int i=0;i<numvertices;i++){
++			ge[i]+=thickness*Dlambda[0]*Jdet*gauss->weight*basis[i];
++			_assert_(!xIsNan<IssmDouble>(ge[i]));
++		}
++	}
++	gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(basis);
++	xDelete<IssmDouble>(ge);
++	xDelete<int>(vertexpidlist);
++	delete gauss;
++}/*}}}*/
++void AdjointBalancethicknessAnalysis::GradientJVy(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++
++	/*Intermediaries*/
++	IssmDouble Jdet,weight;
++	IssmDouble thickness,Dlambda[3],dp[3];
++	IssmDouble *xyz_list= NULL;
++
++	/*Fetch number of vertices for this finite element*/
++	int numvertices = element->GetNumberOfVertices();
++
++	/*Initialize some vectors*/
++	IssmDouble* basis         = xNew<IssmDouble>(numvertices);
++	IssmDouble* ge            = xNewZeroInit<IssmDouble>(numvertices);
++	int*        vertexpidlist = xNew<int>(numvertices);
++
++	/*Retrieve all inputs we will be needing: */
++	element->GetVerticesCoordinates(&xyz_list);
++	element->GradientIndexing(&vertexpidlist[0],control_index);
++	Input* thickness_input = element->GetInput(ThicknessEnum); _assert_(thickness_input);
++	Input* adjoint_input   = element->GetInput(AdjointEnum);   _assert_(adjoint_input);
++
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=element->NewGauss(4);
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++		gauss->GaussPoint(ig);
++
++		adjoint_input->GetInputDerivativeValue(&Dlambda[0],xyz_list,gauss);
++		thickness_input->GetInputValue(&thickness, gauss);
++		thickness_input->GetInputDerivativeValue(&dp[0],xyz_list,gauss);
++
++		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		element->NodalFunctionsP1(basis,gauss);
++
++		/*Build gradient vector (actually -dJ/dvy): */
++		for(int i=0;i<numvertices;i++){
++			ge[i]+=thickness*Dlambda[1]*Jdet*gauss->weight*basis[i];
++			_assert_(!xIsNan<IssmDouble>(ge[i]));
++		}
++	}
++	gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(basis);
++	xDelete<IssmDouble>(ge);
++	xDelete<int>(vertexpidlist);
++	delete gauss;
++}/*}}}*/
++void AdjointBalancethicknessAnalysis::GradientJDhDt(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++
++	/*Fetch number of vertices for this finite element*/
++	int numvertices = element->GetNumberOfVertices();
++
++	/*Initialize some vectors*/
++	IssmDouble* ge            = xNewZeroInit<IssmDouble>(numvertices);
++	IssmDouble* lambda        = xNew<IssmDouble>(numvertices);
++	int*        vertexpidlist = xNew<int>(numvertices);
++
++	/*Retrieve all inputs we will be needing: */
++	element->GradientIndexing(&vertexpidlist[0],control_index);
++	element->GetInputListOnVertices(lambda,AdjointEnum);
++	for(int i=0;i<numvertices;i++){
++		ge[i]=-lambda[i];
++		_assert_(!xIsNan<IssmDouble>(ge[i]));
++	}
++	gradient->SetValues(numvertices,vertexpidlist,ge,INS_VAL);
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(ge);
++	xDelete<IssmDouble>(lambda);
++	xDelete<int>(vertexpidlist);
++}/*}}}*/
+ void AdjointBalancethicknessAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int domaintype;
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.h	(revision 18059)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.h	(revision 18060)
+@@ -27,6 +27,9 @@
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+ 		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
++		void GradientJVx(Element* element,Vector<IssmDouble>* gradient,int control_index);
++		void GradientJVy(Element* element,Vector<IssmDouble>* gradient,int control_index);
++		void GradientJDhDt(Element* element,Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
+Index: ../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 18059)
++++ ../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 18060)
+@@ -8,8 +8,8 @@
+ 
+ void Gradjx(Vector<IssmDouble>** pgradient,IssmDouble** pnorm_list, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){
+ 
+-	int     i,j,numberofvertices;
+-	int     num_controls;
++	int          numberofvertices;
++	int          num_controls,analysisenum;
+ 	IssmDouble   norm_inf;
+ 	IssmDouble  *norm_list     = NULL;
+ 	int     *control_type  = NULL;
+@@ -21,38 +21,39 @@
+ 	parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
+ 	numberofvertices=vertices->NumberOfVertices();
+ 
++	/*Get current analysis*/
++	parameters->FindParam(&analysisenum,AnalysisTypeEnum);
++	Analysis* analysis = EnumToAnalysis(analysisenum);
++
+ 	/*Allocate gradient_list */
+ 	gradient_list = xNew<Vector<IssmDouble>*>(num_controls);
+ 	norm_list = xNew<IssmDouble>(num_controls);
+-	for(i=0;i<num_controls;i++){
++	for(int i=0;i<num_controls;i++){
+ 		gradient_list[i]=new Vector<IssmDouble>(num_controls*numberofvertices);
+ 	}
+ 	gradient=new Vector<IssmDouble>(num_controls*numberofvertices);
+ 
+ 	/*Compute all gradient_list*/
+-	for(i=0;i<num_controls;i++){
+-
+-		for(j=0;j<elements->Size();j++){
+-
++	for(int i=0;i<num_controls;i++){
++		for(int j=0;j<elements->Size();j++){
+ 			Element* element=(Element*)elements->GetObjectByOffset(j);
+-			element->Gradj(gradient_list[i],control_type[i],i);
++			//element->Gradj(gradient_list[i],control_type[i],i);
++			analysis->GradientJ(gradient_list[i],element,control_type[i],i);
+ 		}
+-
+ 		gradient_list[i]->Assemble();
+-
+ 		norm_list[i]=gradient_list[i]->Norm(NORM_INF);
+ 	}
+ 
+ 	/*Add all gradient_list together*/
+-	for(i=0;i<num_controls;i++){
++	for(int i=0;i<num_controls;i++){
+ 		gradient->AXPY(gradient_list[i],1.0);
+ 		delete gradient_list[i];
+ 	}
+ 
+ 	/*Check that gradient is clean*/
+ 	norm_inf=gradient->Norm(NORM_INF);
+-	if(norm_inf<=0)    _error_("||∂J/∂α||∞ = 0    gradient norm is zero");
+-	if(xIsNan<IssmDouble>(norm_inf))_error_("||∂J/∂α||∞ = NaN  gradient norm is NaN");
++	if(norm_inf<=0)                 _error_("||dJ/dk|| = 0    gradient norm is zero");
++	if(xIsNan<IssmDouble>(norm_inf))_error_("||dJ/dk|| = NaN  gradient norm is NaN");
+ 
+ 	/*Clean-up and assign output pointer*/
+ 	if(pnorm_list){
+Index: ../trunk-jpl/src/c/modules/Gradjx/Gradjx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/Gradjx/Gradjx.h	(revision 18059)
++++ ../trunk-jpl/src/c/modules/Gradjx/Gradjx.h	(revision 18060)
+@@ -6,6 +6,7 @@
+ #define _GRADJX_H
+ 
+ #include "../../classes/classes.h"
++#include "../../analyses/analyses.h"
+ 
+ /* local prototypes: */
+ void Gradjx(Vector<IssmDouble>** pgrad_g,IssmDouble** pgrad_norm,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters);
+Index: ../trunk-jpl/src/c/classes/Materials/Matice.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 18059)
++++ ../trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 18060)
+@@ -284,21 +284,10 @@
+ }
+ /*}}}*/
+ /*FUNCTION Matice::GetViscosity_B {{{*/
+-void  Matice::GetViscosity_B(IssmDouble* pviscosity,IssmDouble eps_eff){
+-	/*From a string tensor and a material object, return viscosity, using Glen's flow law.
+-	  (1-D)
+-	  viscosity= -----------------------
+-	  2 eps_eff ^[(n-1)/n]
++void  Matice::GetViscosity_B(IssmDouble* pdmudB,IssmDouble eps_eff){
+ 
+-	  where viscosity is the viscotiy, B the flow law parameter , eps_eff is the effective strain rate
+-	  and n the flow law exponent.
+-
+-	  If eps_eff = 0 , it means this is the first time SystemMatrices is being run, and we 
+-	  return 10^14, initial viscosity.
+-	  */
+-
+ 	/*output: */
+-	IssmDouble viscosity;
++	IssmDouble dmudB;
+ 
+ 	/*Intermediary: */
+ 	IssmDouble D=0.,n;
+@@ -310,27 +299,44 @@
+ 		_assert_(D>=0. && D<1.);
+ 	}
+ 
+-	if (n==1.){
+-		/*Linear Viscous behavior (Newtonian fluid) viscosity=B/2: */
+-		viscosity=(1.-D)/2.;
++	if(n==1.){
++		/*Linear Viscous behavior (Newtonian fluid) dmudB=B/2: */
++		dmudB=(1.-D)/2.;
+ 	}
+ 	else{
++		if(eps_eff==0.) dmudB = 0.;
++		else            dmudB = (1.-D)/(2.*pow(eps_eff,(n-1.)/n));
++	}
+ 
+-		/*if no strain rate, return maximum viscosity*/
+-		if(eps_eff==0.){
+-			viscosity = 1.e+14/2.;
+-		}
++	/*Return: */
++	*pdmudB=dmudB;
++}
++/*}}}*/
++/*FUNCTION Matice::GetViscosity_D {{{*/
++void  Matice::GetViscosity_D(IssmDouble* pdmudD,IssmDouble eps_eff){
+ 
+-		else{
+-			viscosity=(1.-D)/(2.*pow(eps_eff,(n-1.)/n));
+-		}
++	/*output: */
++	IssmDouble dmudD;
++
++	/*Intermediary: */
++	IssmDouble n,B;
++
++	/*Get B and n*/
++	n=GetN(); _assert_(n>0.);
++	B=GetBbar();
++	_assert_(this->isdamaged);
++
++	if(n==1.){
++		/*Linear Viscous behavior (Newtonian fluid) dmudB=B/2: */
++		dmudD=-B/2.;
+ 	}
++	else{
++		if(eps_eff==0.) dmudD = 0.;
++		else            dmudD = -B/(2.*pow(eps_eff,(n-1.)/n));
++	}
+ 
+-	/*Checks in debugging mode*/
+-	if(viscosity<=0) _error_("Negative viscosity");
+-
+ 	/*Return: */
+-	*pviscosity=viscosity;
++	*pdmudD=dmudD;
+ }
+ /*}}}*/
+ /*FUNCTION Matice::GetViscosityBar {{{*/
+Index: ../trunk-jpl/src/c/classes/Materials/Material.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Material.h	(revision 18059)
++++ ../trunk-jpl/src/c/classes/Materials/Material.h	(revision 18060)
+@@ -26,6 +26,7 @@
+ 		virtual void       Configure(Elements* elements)=0;
+ 		virtual void       GetViscosity(IssmDouble* pviscosity,IssmDouble epseff)=0;
+ 		virtual void       GetViscosity_B(IssmDouble* pviscosity,IssmDouble epseff)=0;
++		virtual void       GetViscosity_D(IssmDouble* pviscosity,IssmDouble epseff)=0;
+ 		virtual void       GetViscosityBar(IssmDouble* pviscosity,IssmDouble epseff)=0;
+ 		virtual void       GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon)=0;
+ 		virtual void       GetViscosityDComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon)=0;
+Index: ../trunk-jpl/src/c/classes/Materials/Matice.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matice.h	(revision 18059)
++++ ../trunk-jpl/src/c/classes/Materials/Matice.h	(revision 18060)
+@@ -55,6 +55,7 @@
+ 		void       SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
+ 		void       GetViscosity(IssmDouble* pviscosity, IssmDouble eps_eff);
+ 		void       GetViscosity_B(IssmDouble* pviscosity, IssmDouble eps_eff);
++		void       GetViscosity_D(IssmDouble* pviscosity, IssmDouble eps_eff);
+ 		void       GetViscosityBar(IssmDouble* pviscosity, IssmDouble eps_eff);
+ 		void       GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon);
+ 		void       GetViscosityDComplement(IssmDouble*, IssmDouble*);
+Index: ../trunk-jpl/src/c/classes/Materials/Matpar.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matpar.h	(revision 18059)
++++ ../trunk-jpl/src/c/classes/Materials/Matpar.h	(revision 18060)
+@@ -76,6 +76,7 @@
+ 		void       Configure(Elements* elements);
+ 		void       GetViscosity(IssmDouble* pviscosity,IssmDouble eps_eff){_error_("not supported");};
+ 		void       GetViscosity_B(IssmDouble* pviscosity,IssmDouble eps_eff){_error_("not supported");};
++		void       GetViscosity_D(IssmDouble* pviscosity,IssmDouble eps_eff){_error_("not supported");};
+ 		void       GetViscosityBar(IssmDouble* pviscosity,IssmDouble eps_eff){_error_("not supported");};
+ 		void       GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon){_error_("not supported");};
+ 		void       GetViscosityDComplement(IssmDouble* pviscosity_complement, IssmDouble* pepsilon){_error_("not supported");};
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18059)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18060)
+@@ -60,6 +60,7 @@
+ 		void       DeepEcho();
+ 		void       DeleteMaterials(void);
+ 		void       dViscositydBSSA(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
++		void       dViscositydDSSA(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input);
+ 		IssmDouble Divergence(void);
+ 		void       ThermalToEnthalpy(IssmDouble* penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure);
+ 		void       EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure);
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18059)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18060)
+@@ -1456,6 +1456,13 @@
+ 
+ }
+ /*}}}*/
++void       Tria::NodalFunctionsP1(IssmDouble* basis, Gauss* gauss){/*{{{*/
++
++	_assert_(gauss->Enum()==GaussTriaEnum);
++	this->GetNodalFunctions(basis,(GaussTria*)gauss,P1Enum);
++
++}
++/*}}}*/
+ void       Tria::NodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+ 
+ 	_assert_(gauss->Enum()==GaussTriaEnum);
+@@ -1463,6 +1470,13 @@
+ 
+ }
+ /*}}}*/
++void       Tria::NodalFunctionsP1Derivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
++
++	_assert_(gauss->Enum()==GaussTriaEnum);
++	this->GetNodalFunctionsDerivatives(dbasis,xyz_list,(GaussTria*)gauss,P1Enum);
++
++}
++/*}}}*/
+ void       Tria::NodalFunctionsDerivativesVelocity(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+ 
+ 	_assert_(gauss->Enum()==GaussTriaEnum);
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18059)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18060)
+@@ -190,9 +190,9 @@
+ 		Gauss*         NewGaussLine(int vertex1,int vertex2,int order){_error_("not implemented yet");};
+ 		Gauss*         NewGaussTop(int order);
+ 		void           NodalFunctions(IssmDouble* basis,Gauss* gauss);
+-		void           NodalFunctionsP1(IssmDouble* basis,Gauss* gauss){_error_("not implemented yet");};
++		void           NodalFunctionsP1(IssmDouble* basis,Gauss* gauss);
+ 		void           NodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
+-		void           NodalFunctionsP1Derivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
++		void           NodalFunctionsP1Derivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
+ 		void           NodalFunctionsMINIDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
+ 		void           NodalFunctionsDerivativesVelocity(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
+ 		void           NodalFunctionsVelocity(IssmDouble* basis,Gauss* gauss);
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18059)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18060)
+@@ -2999,6 +2999,7 @@
+ } /*}}}*/
+ void       Penta::GradjDragHO(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+ 
++	printf("-------------- file: Penta.cpp line: %i\n",__LINE__); 
+ 	int        i,j;
+ 	int        analysis_type;
+ 	int        vertexpidlist[NUMVERTICES];
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18059)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18060)
+@@ -239,6 +239,33 @@
+ 
+ }
+ /*}}}*/
++void       Element::dViscositydDSSA(IssmDouble* pdmudB,int dim,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input){/*{{{*/
++
++	/*Intermediaries*/
++	IssmDouble dmudB;
++	IssmDouble epsilon2d[3];/* epsilon=[exx,eyy,exy];    */
++	IssmDouble epsilon1d;   /* epsilon=[exx];    */
++	IssmDouble eps_eff;
++
++	if(dim==2){
++		/* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exx*eyy*/
++		this->StrainRateSSA(&epsilon2d[0],xyz_list,gauss,vx_input,vy_input);
++		eps_eff = sqrt(epsilon2d[0]*epsilon2d[0] + epsilon2d[1]*epsilon2d[1] + epsilon2d[2]*epsilon2d[2] + epsilon2d[0]*epsilon2d[1]);
++	}
++	else{
++		/* eps_eff^2 = 1/2 exx^2*/
++		this->StrainRateSSA1d(&epsilon1d,xyz_list,gauss,vx_input);
++		eps_eff = sqrt(epsilon1d*epsilon1d/2.);
++	}
++
++	/*Get viscosity*/
++	material->GetViscosity_D(&dmudB,eps_eff);
++
++	/*Assign output pointer*/
++	*pdmudB=dmudB;
++
++}
++/*}}}*/
+ void       Element::ThermalToEnthalpy(IssmDouble* penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure){/*{{{*/
+ 	matpar->ThermalToEnthalpy(penthalpy,temperature,waterfraction,pressure);
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Elements/TriaRef.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/TriaRef.cpp	(revision 18059)
++++ ../trunk-jpl/src/c/classes/Elements/TriaRef.cpp	(revision 18060)
+@@ -3,7 +3,7 @@
+  */
+ 
+ /*Headers:*/
+-/*{{{*//*{{{*/
++/*{{{*/
+ #ifdef HAVE_CONFIG_H
+ 	#include <config.h>
+ #else
Index: /issm/oecreview/Archive/17984-18295/ISSM-18060-18061.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18060-18061.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18060-18061.diff	(revision 18296)
@@ -0,0 +1,120 @@
+Index: ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 18060)
++++ ../trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp	(revision 18061)
+@@ -1034,7 +1034,7 @@
+ 		/*Build alpha_complement_list: */
+ 		dragcoefficient_input->GetInputDerivativeValue(&dk[0],xyz_list,gauss);
+ 
+-		/*Build gradje_g_gaussian vector (actually -dJ/ddrag): */
++		/*Build gradient vector (actually -dJ/ddrag): */
+ 		for(int i=0;i<numvertices;i++){
+ 			if(dim==2){
+ 				ge[i]+=-weight*Jdet*gauss->weight*(dbasis[0*numvertices+i]*dk[0]+dbasis[1*numvertices+i]*dk[1]);
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 18060)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 18061)
+@@ -123,8 +123,89 @@
+ 	_error_("not implemented yet");
+ }/*}}}*/
+ void AdjointBalancethickness2Analysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+-	_error_("Not implemented yet");
++	/*The gradient of the cost function is calculated in 2 parts.
++	 *
++	 * dJ    \partial J   \partial lambda^T(KU-F)
++	 * --  = ---------- + ------------------------
++	 * dk    \partial k   \parial k                  
++	 *
++	 * */
++
++	/*If on water, grad = 0: */
++	if(!element->IsIceInElement()) return;
++
++	/*Get list of cost functions*/
++	int *responses = NULL;
++	int num_responses,resp;
++	element->FindParam(&num_responses,InversionNumCostFunctionsEnum);
++	element->FindParam(&responses,NULL,InversionCostFunctionsEnum);
++
++	/*Check that control_type is supported*/
++	if(control_type!=BalancethicknessApparentMassbalanceEnum){
++		_error_("Control "<<EnumToStringx(control_type)<<" not supported");
++	}
++
++	/*Deal with first part (partial derivative a J with respect to k)*/
++	for(resp=0;resp<num_responses;resp++) switch(responses[resp]){
++		case Balancethickness2MisfitEnum: /*Nothing, \partial J/\partial k = 0*/ break;
++		default: _error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
++	}
++
++	/*Deal with second term*/
++	switch(control_type){
++		case BalancethicknessApparentMassbalanceEnum: GradientJAdot(element,gradient,control_index); break;
++		default: _error_("control type not supported yet: " << EnumToStringx(control_type));
++	}
++
++	/*Clean up and return*/
++	xDelete<int>(responses);
++
+ }/*}}}*/
++void AdjointBalancethickness2Analysis::GradientJAdot(Element* element,Vector<IssmDouble>* gradient,int control_index){/*{{{*/
++
++	/*Intermediaries*/
++	IssmDouble Jdet,weight;
++	IssmDouble lambda; 
++	IssmDouble *xyz_list= NULL;
++
++	/*Fetch number of vertices for this finite element*/
++	int numvertices = element->GetNumberOfVertices();
++
++	/*Initialize some vectors*/
++	IssmDouble* basis         = xNew<IssmDouble>(numvertices);
++	IssmDouble* ge            = xNewZeroInit<IssmDouble>(numvertices);
++	int*        vertexpidlist = xNew<int>(numvertices);
++
++	/*Retrieve all inputs we will be needing: */
++	element->GetVerticesCoordinates(&xyz_list);
++	element->GradientIndexing(&vertexpidlist[0],control_index);
++	Input* adjoint_input = element->GetInput(AdjointEnum);                            _assert_(adjoint_input);
++	Input* weights_input = element->GetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
++
++	Gauss* gauss=element->NewGauss(2);
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++		gauss->GaussPoint(ig);
++
++		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		element->NodalFunctionsP1(basis,gauss);
++		weights_input->GetInputValue(&weight,gauss,Balancethickness2MisfitEnum);
++		adjoint_input->GetInputValue(&lambda,gauss);
++
++		/*Build gradient vector (actually -dJ/da): */
++		for(int i=0;i<numvertices;i++){
++			ge[i]+= - weight*Jdet*gauss->weight*basis[i]*lambda;
++			_assert_(!xIsNan<IssmDouble>(ge[i]));
++		}
++	}
++	gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(ge);
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(basis);
++	xDelete<int>(vertexpidlist);
++	delete gauss;
++}/*}}}*/
+ void AdjointBalancethickness2Analysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 	element->InputUpdateFromSolutionOneDof(solution,AdjointEnum);
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.h	(revision 18060)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.h	(revision 18061)
+@@ -27,6 +27,7 @@
+ 		ElementVector* CreatePVector(Element* element);
+ 		void GetSolutionFromInputs(Vector<IssmDouble>* solution,Element* element);
+ 		void GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index);
++		void GradientJAdot(Element* element,Vector<IssmDouble>* gradient,int control_index);
+ 		void InputUpdateFromSolution(IssmDouble* solution,Element* element);
+ 		void UpdateConstraints(FemModel* femmodel);
+ };
Index: /issm/oecreview/Archive/17984-18295/ISSM-18061-18062.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18061-18062.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18061-18062.diff	(revision 18296)
@@ -0,0 +1,1332 @@
+Index: ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp	(revision 18061)
++++ ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp	(revision 18062)
+@@ -479,7 +479,120 @@
+ 	   _error_("not implemented yet");
+ }/*}}}*/
+ void BalancethicknessAnalysis::GradientJ(Vector<IssmDouble>* gradient,Element* element,int control_type,int control_index){/*{{{*/
+-	_error_("Not implemented yet");
++	/* WARNING: this gradient is valid for Soft balance thickness only */
++
++	/*If on water, grad = 0: */
++	if(!element->IsIceInElement()) return;
++
++	/*Intermediaries*/
++	IssmDouble Jdet,weight;
++	IssmDouble thickness,thicknessobs,dH[3],dp[3];
++	IssmDouble  vx,vy,vel,dvx[2],dvy[2],dhdt,basal_melting,surface_mass_balance;
++	IssmDouble *xyz_list= NULL;
++
++	/*Get list of cost functions*/
++	int *responses = NULL;
++	int  num_responses,resp,solution;
++	element->FindParam(&num_responses,InversionNumCostFunctionsEnum);
++	element->FindParam(&responses,NULL,InversionCostFunctionsEnum);
++	element->FindParam(&solution,SolutionTypeEnum);
++	if(solution!=BalancethicknessSoftSolutionEnum) _error_("not implemented yet");
++	if(control_type!=ThicknessEnum)                _error_("Control "<<EnumToStringx(control_type)<<" not supported");
++
++	/*Fetch number of vertices for this finite element*/
++	int numvertices = element->GetNumberOfVertices();
++
++	/*Initialize some vectors*/
++	IssmDouble* basis         = xNew<IssmDouble>(numvertices);
++	IssmDouble* dbasis        = xNew<IssmDouble>(2*numvertices);
++	IssmDouble* ge            = xNewZeroInit<IssmDouble>(numvertices);
++	int*        vertexpidlist = xNew<int>(numvertices);
++
++	/*Retrieve all inputs we will be needing: */
++	element->GetVerticesCoordinates(&xyz_list);
++	element->GradientIndexing(&vertexpidlist[0],control_index);
++	Input* thickness_input            = element->GetInput(ThicknessEnum);                          _assert_(thickness_input);
++	Input* thicknessobs_input         = element->GetInput(InversionThicknessObsEnum);              _assert_(thicknessobs_input);
++	Input* weights_input              = element->GetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
++	Input* vx_input                   = element->GetInput(VxEnum);                                 _assert_(vx_input);
++	Input* vy_input                   = element->GetInput(VyEnum);                                 _assert_(vy_input);
++	Input* surface_mass_balance_input = element->GetInput(SurfaceforcingsMassBalanceEnum);         _assert_(surface_mass_balance_input);
++	Input* basal_melting_input        = element->GetInput(BasalforcingsMeltingRateEnum);           _assert_(basal_melting_input);
++	Input* dhdt_input                 = element->GetInput(BalancethicknessThickeningRateEnum);     _assert_(dhdt_input);
++
++	/* Start  looping on the number of gaussian points: */
++	Gauss* gauss=element->NewGauss(4);
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++		gauss->GaussPoint(ig);
++
++		thickness_input->GetInputValue(&thickness, gauss);
++		thickness_input->GetInputDerivativeValue(&dH[0],xyz_list,gauss);
++		thicknessobs_input->GetInputValue(&thicknessobs, gauss);
++
++		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
++		element->NodalFunctionsP1(basis,gauss);
++		element->NodalFunctionsP1Derivatives(dbasis,xyz_list,gauss);
++
++		/*Deal with first part (partial derivative a J with respect to k)*/
++		for(resp=0;resp<num_responses;resp++){
++
++			weights_input->GetInputValue(&weight,gauss,responses[resp]);
++
++			switch(responses[resp]){
++				case ThicknessAbsMisfitEnum:
++					for(int i=0;i<numvertices;i++) ge[i]+= (thicknessobs-thickness)*weight*Jdet*gauss->weight*basis[i];
++					break;
++				case ThicknessAbsGradientEnum:
++					for(int i=0;i<numvertices;i++) ge[i]+= - weight*dH[0]*dbasis[0*numvertices+i]*Jdet*gauss->weight;
++					for(int i=0;i<numvertices;i++) ge[i]+= - weight*dH[1]*dbasis[1*numvertices+i]*Jdet*gauss->weight;
++					break;
++				case ThicknessAlongGradientEnum:
++					vx_input->GetInputValue(&vx,gauss);
++					vy_input->GetInputValue(&vy,gauss);
++					vel = sqrt(vx*vx+vy*vy);
++					vx  = vx/(vel+1.e-9);
++					vy  = vy/(vel+1.e-9);
++					for(int i=0;i<numvertices;i++) ge[i]+= - weight*(dH[0]*vx+dH[1]*vy)*(dbasis[0*numvertices+i]*vx+dbasis[1*numvertices+i]*vy)*Jdet*gauss->weight;
++					break;
++				case ThicknessAcrossGradientEnum:
++					vx_input->GetInputValue(&vx,gauss);
++					vy_input->GetInputValue(&vy,gauss);
++					vel = sqrt(vx*vx+vy*vy);
++					vx  = vx/(vel+1.e-9);
++					vy  = vy/(vel+1.e-9);
++					for(int i=0;i<numvertices;i++) ge[i]+= - weight*(dH[0]*(-vy)+dH[1]*vx)*(dbasis[0*numvertices+i]*(-vy)+dbasis[1*numvertices+i]*vx)*Jdet*gauss->weight;
++					break;
++				case BalancethicknessMisfitEnum:
++					surface_mass_balance_input->GetInputValue(&surface_mass_balance,gauss);
++					basal_melting_input->GetInputValue(&basal_melting,gauss);
++					dhdt_input->GetInputValue(&dhdt,gauss);
++					vx_input->GetInputValue(&vx,gauss);
++					vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
++					vy_input->GetInputValue(&vy,gauss);
++					vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
++					for(int i=0;i<numvertices;i++){
++						ge[i]+= - weight*Jdet*gauss->weight*(
++							(vx*dH[0]+vy*dH[1] + thickness*(dvx[0]+dvy[1]))*(vx*dbasis[0*numvertices+i]+ vy*dbasis[1*numvertices+i] + basis[i]*(dvx[0]+dvy[1]))
++							-(surface_mass_balance-basal_melting-dhdt)*(vx*dbasis[0*numvertices+i]+ vy*dbasis[1*numvertices+i] + basis[i]*(dvx[0]+dvy[1]))
++							);
++					}
++					break;
++				default:
++					_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
++			}
++		}
++	}
++	gradient->SetValues(numvertices,vertexpidlist,ge,ADD_VAL);
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(basis);
++	xDelete<IssmDouble>(ge);
++	xDelete<int>(vertexpidlist);
++	xDelete<int>(responses);
++	delete gauss;
++
++
+ }/*}}}*/
+ void BalancethicknessAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18061)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18062)
+@@ -276,7 +276,6 @@
+ 		virtual void   GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y)=0;
+ 		#endif
+ 
+-		virtual void   Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index)=0;
+ 		virtual void   ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index)=0;
+ 		virtual void   ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index)=0;
+ 		virtual void   ControlInputScaleGradient(int enum_type, IssmDouble scale)=0;
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18061)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18062)
+@@ -2772,650 +2772,6 @@
+ 	vector_gradient->SetValues(NUMVERTICES,&sidlist[0],&gradients[0],ADD_VAL);
+ 
+ }/*}}}*/
+-void       Tria::Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index){/*{{{*/
+-	/*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/
+-
+-	int   approximation;
+-	Seg*  seg=NULL;
+-
+-	/*If on water, grad = 0: */
+-	if(!IsIceInElement()) return;
+-
+-	/*First deal with ∂/∂alpha(KU-F)*/
+-	switch(control_type){
+-		case FrictionCoefficientEnum:
+-			inputs->GetInputValue(&approximation,ApproximationEnum);
+-			switch(approximation){
+-				case SSAApproximationEnum:
+-					GradjDragSSA(gradient,control_index);
+-					break;
+-				case FSApproximationEnum:
+-					GradjDragFS(gradient,control_index);
+-					break;
+-				case NoneApproximationEnum:
+-					/*Gradient is 0*/
+-					break;
+-				default:
+-					_error_("approximation " << EnumToStringx(approximation) << " not supported yet");
+-			}
+-			break;
+-		case MaterialsRheologyBbarEnum:
+-			GradjBSSA(gradient,control_index);
+-			break;
+-		case DamageDbarEnum:
+-			GradjDSSA(gradient,control_index);
+-			break;
+-		case BalancethicknessThickeningRateEnum:
+-			GradjDhDtBalancedthickness(gradient,control_index);
+-			break;
+-		case VxEnum:
+-			GradjVxBalancedthickness(gradient,control_index);
+-			break;
+-		case VyEnum:
+-			GradjVyBalancedthickness(gradient,control_index);
+-			break;
+-		case ThicknessEnum:
+-			GradjThicknessBalancethicknessSoft(gradient,control_index);
+-			break;
+-		case BalancethicknessApparentMassbalanceEnum:
+-			GradjAdotBulancethickness2(gradient,control_index);
+-			break;
+-		default:
+-			_error_("control type not supported yet: " << EnumToStringx(control_type));
+-	}
+-
+-	/*Now deal with ∂J/∂alpha*/
+-	int        *responses = NULL;
+-	int         num_responses,resp;
+-	this->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
+-	this->parameters->FindParam(&responses,NULL,InversionCostFunctionsEnum);
+-
+-	for(resp=0;resp<num_responses;resp++) switch(responses[resp]){
+-		//FIXME: the control type should be checked somewhere (with respect to what variable are we taking the gradient!)
+-
+-		case ThicknessAbsMisfitEnum:
+-		case ThicknessAbsGradientEnum:
+-		case ThicknessAlongGradientEnum:
+-		case ThicknessAcrossGradientEnum:
+-		case BalancethicknessMisfitEnum:
+-		case Balancethickness2MisfitEnum:
+-		case SurfaceAbsVelMisfitEnum:
+-		case SurfaceRelVelMisfitEnum:
+-		case SurfaceLogVelMisfitEnum:
+-		case SurfaceLogVxVyMisfitEnum:
+-		case SurfaceAverageVelMisfitEnum:
+-			/*Nothing, J does not depends on the parameter being inverted for*/
+-			break;
+-		case DragCoefficientAbsGradientEnum:
+-			inputs->GetInputValue(&approximation,ApproximationEnum);
+-			switch(approximation){
+-				case SSAApproximationEnum:
+-					GradjDragGradient(gradient,control_index);
+-					break;
+-				case FSApproximationEnum:{
+-					if(IsFloating() || !IsOnBase()) return;
+-					int index1,index2;
+-					this->EdgeOnBaseIndices(&index1,&index2);
+-					Seg* seg = SpawnSeg(index1,index2);
+-					seg->GradjDragGradient(gradient,control_index);
+-					seg->DeleteMaterials(); delete seg;
+-					break;
+-												 }
+-				case NoneApproximationEnum:
+-					/*Gradient is 0*/
+-					break;
+-				default:
+-					_error_("approximation " << EnumToStringx(approximation) << " not supported yet");
+-			}
+-			break;
+-		case RheologyBbarAbsGradientEnum:
+-			GradjBGradient(gradient,control_index);
+-			break;
+-		default:
+-			_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
+-	}
+-
+-	xDelete<int>(responses);
+-}
+-/*}}}*/
+-void       Tria::GradjBGradient(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	int        i;
+-	int        vertexpidlist[NUMVERTICES];
+-	IssmDouble Jdet,weight;
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble dbasis[NDOF2][NUMVERTICES];
+-	IssmDouble dk[NDOF2]; 
+-	IssmDouble grade_g[NUMVERTICES]={0.0};
+-	GaussTria  *gauss=NULL;
+-
+-	/*Retrieve all inputs we will be needing: */
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-	GradientIndexing(&vertexpidlist[0],control_index);
+-	Input* rheologyb_input=inputs->GetInput(MaterialsRheologyBbarEnum); _assert_(rheologyb_input);
+-	Input* weights_input=inputs->GetInput(InversionCostFunctionsCoefficientsEnum);                _assert_(weights_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for(int ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctionsDerivatives(&dbasis[0][0],&xyz_list[0][0],gauss);
+-		weights_input->GetInputValue(&weight,gauss,RheologyBbarAbsGradientEnum);
+-
+-		/*Build alpha_complement_list: */
+-		rheologyb_input->GetInputDerivativeValue(&dk[0],&xyz_list[0][0],gauss);
+-
+-		/*Build gradje_g_gaussian vector (actually -dJ/ddrag): */
+-		for (i=0;i<NUMVERTICES;i++) grade_g[i]+=-weight*Jdet*gauss->weight*(dbasis[0][i]*dk[0]+dbasis[1][i]*dk[1]);
+-	}
+-	gradient->SetValues(NUMVERTICES,vertexpidlist,grade_g,ADD_VAL);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-}
+-/*}}}*/
+-void       Tria::GradjBSSA(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	/*Intermediaries*/
+-	int        i;
+-	int        doflist[NUMVERTICES];
+-	IssmDouble vx,vy,lambda,mu,thickness,Jdet;
+-	IssmDouble viscosity_complement;
+-	IssmDouble dvx[NDOF2],dvy[NDOF2],dadjx[NDOF2],dadjy[NDOF2],dB[NDOF2]; 
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble basis[3],epsilon[3];
+-	IssmDouble grad[NUMVERTICES]={0.0};
+-	GaussTria *gauss = NULL;
+-
+-	/* Get node coordinates and dof list: */
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-	GradientIndexing(&doflist[0],control_index);
+-
+-	/*Retrieve all inputs*/
+-	Input* thickness_input=inputs->GetInput(ThicknessEnum);                     _assert_(thickness_input);
+-	Input* vx_input=inputs->GetInput(VxEnum);                                   _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum);                                   _assert_(vy_input);
+-	Input* adjointx_input=inputs->GetInput(AdjointxEnum);                       _assert_(adjointx_input);
+-	Input* adjointy_input=inputs->GetInput(AdjointyEnum);                       _assert_(adjointy_input);
+-	Input* rheologyb_input=inputs->GetInput(MaterialsRheologyBbarEnum); _assert_(rheologyb_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(4);
+-	for(int ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		thickness_input->GetInputValue(&thickness,gauss);
+-		rheologyb_input->GetInputDerivativeValue(&dB[0],&xyz_list[0][0],gauss);
+-		vx_input->GetInputDerivativeValue(&dvx[0],&xyz_list[0][0],gauss);
+-		vy_input->GetInputDerivativeValue(&dvy[0],&xyz_list[0][0],gauss);
+-		adjointx_input->GetInputDerivativeValue(&dadjx[0],&xyz_list[0][0],gauss);
+-		adjointy_input->GetInputDerivativeValue(&dadjy[0],&xyz_list[0][0],gauss);
+-
+-		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		material->GetViscosityComplement(&viscosity_complement,&epsilon[0]);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctions(basis,gauss);
+-
+-		/*standard gradient dJ/dki*/
+-		for (i=0;i<NUMVERTICES;i++) grad[i]+=-viscosity_complement*thickness*(
+-					(2*dvx[0]+dvy[1])*2*dadjx[0]+(dvx[1]+dvy[0])*(dadjx[1]+dadjy[0])+(2*dvy[1]+dvx[0])*2*dadjy[1]
+-					)*Jdet*gauss->weight*basis[i];
+-	}
+-
+-	gradient->SetValues(NUMVERTICES,doflist,grad,ADD_VAL);
+-
+-	/*clean-up*/
+-	delete gauss;
+-}
+-/*}}}*/
+-void       Tria::GradjDSSA(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	/*Intermediaries*/
+-	int        i;
+-	int        doflist[NUMVERTICES];
+-	IssmDouble vx,vy,lambda,mu,thickness,Jdet;
+-	IssmDouble viscosity_complement;
+-	IssmDouble dvx[NDOF2],dvy[NDOF2],dadjx[NDOF2],dadjy[NDOF2];
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble basis[3],epsilon[3];
+-	IssmDouble grad[NUMVERTICES]={0.0};
+-	GaussTria *gauss = NULL;
+-
+-	/* Get node coordinates and dof list: */
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-	GradientIndexing(&doflist[0],control_index);
+-
+-	/*Retrieve all inputs*/
+-	Input* thickness_input=inputs->GetInput(ThicknessEnum);                     _assert_(thickness_input);
+-	Input* vx_input=inputs->GetInput(VxEnum);                                   _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum);                                   _assert_(vy_input);
+-	Input* adjointx_input=inputs->GetInput(AdjointxEnum);                       _assert_(adjointx_input);
+-	Input* adjointy_input=inputs->GetInput(AdjointyEnum);                       _assert_(adjointy_input);
+-	if(this->material->IsDamage()){
+-		Input* rheologyd_input=inputs->GetInput(DamageDbarEnum); _assert_(rheologyd_input);
+-	}
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(4);
+-	for(int ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		thickness_input->GetInputValue(&thickness,gauss);
+-		vx_input->GetInputDerivativeValue(&dvx[0],&xyz_list[0][0],gauss);
+-		vy_input->GetInputDerivativeValue(&dvy[0],&xyz_list[0][0],gauss);
+-		adjointx_input->GetInputDerivativeValue(&dadjx[0],&xyz_list[0][0],gauss);
+-		adjointy_input->GetInputDerivativeValue(&dadjy[0],&xyz_list[0][0],gauss);
+-
+-		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-		material->GetViscosityDComplement(&viscosity_complement,&epsilon[0]);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctions(basis,gauss);
+-
+-		/*standard gradient dJ/dki*/
+-		for (i=0;i<NUMVERTICES;i++) grad[i]+=-viscosity_complement*thickness*(
+-					(2*dvx[0]+dvy[1])*2*dadjx[0]+(dvx[1]+dvy[0])*(dadjx[1]+dadjy[0])+(2*dvy[1]+dvx[0])*2*dadjy[1]
+-					)*Jdet*gauss->weight*basis[i];
+-	}
+-
+-	gradient->SetValues(NUMVERTICES,doflist,grad,ADD_VAL);
+-
+-	/*clean-up*/
+-	delete gauss;
+-}
+-/*}}}*/
+-void       Tria::GradjDragSSA(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	int        i;
+-	int        analysis_type;
+-	int        vertexpidlist[NUMVERTICES];
+-	int        connectivity[NUMVERTICES];
+-	IssmDouble vx,vy,lambda,mu,alpha_complement,Jdet;
+-	IssmDouble bed,thickness,Neff,drag;
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble dk[NDOF2]; 
+-	IssmDouble grade_g[NUMVERTICES]={0.0};
+-	IssmDouble grade_g_gaussian[NUMVERTICES];
+-	IssmDouble basis[3];
+-	Friction*  friction=NULL;
+-	GaussTria  *gauss=NULL;
+-
+-	if(IsFloating())return;
+-
+-	/*retrive parameters: */
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-	GradientIndexing(&vertexpidlist[0],control_index);
+-	this->GetVerticesConnectivityList(&connectivity[0]);
+-
+-	/*Build frictoin element, needed later: */
+-	friction=new Friction(this,2);
+-
+-	/*Retrieve all inputs we will be needing: */
+-	Input* adjointx_input=inputs->GetInput(AdjointxEnum);                   _assert_(adjointx_input);
+-	Input* adjointy_input=inputs->GetInput(AdjointyEnum);                   _assert_(adjointy_input);
+-	Input* vx_input=inputs->GetInput(VxEnum);                               _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum);                               _assert_(vy_input);
+-	Input* dragcoefficient_input=inputs->GetInput(FrictionCoefficientEnum); _assert_(dragcoefficient_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(4);
+-	for(int ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctions(basis, gauss);
+-
+-		/*Build alpha_complement_list: */
+-		friction->GetAlphaComplement(&alpha_complement,gauss);
+-
+-		dragcoefficient_input->GetInputValue(&drag, gauss);
+-		adjointx_input->GetInputValue(&lambda, gauss);
+-		adjointy_input->GetInputValue(&mu, gauss);
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		dragcoefficient_input->GetInputDerivativeValue(&dk[0],&xyz_list[0][0],gauss);
+-
+-		/*Build gradje_g_gaussian vector (actually -dJ/ddrag): */
+-		for (i=0;i<NUMVERTICES;i++){
+-			grade_g_gaussian[i]=-2*drag*alpha_complement*((lambda*vx+mu*vy))*Jdet*gauss->weight*basis[i];
+-		}
+-
+-		/*Add gradje_g_gaussian vector to gradje_g: */
+-		for(i=0;i<NUMVERTICES;i++){
+-			_assert_(!xIsNan<IssmDouble>(grade_g[i]));
+-			grade_g[i]+=grade_g_gaussian[i];
+-		}
+-	}
+-	/*Analytical gradient*/
+-	//delete gauss;
+-	//gauss=new GaussTria();
+-	//for (int iv=0;iv<NUMVERTICES;iv++){
+-	//	gauss->GaussVertex(iv);
+-	//	friction->GetAlphaComplement(&alpha_complement,gauss);
+-	//	dragcoefficient_input->GetInputValue(&drag, gauss);
+-	//	adjointx_input->GetInputValue(&lambda, gauss);
+-	//	adjointy_input->GetInputValue(&mu, gauss);
+-	//	vx_input->GetInputValue(&vx,gauss);
+-	//	vy_input->GetInputValue(&vy,gauss);
+-	//	grade_g[iv] = -2*1.e+7*drag*alpha_complement*(lambda*vx+mu*vy)/((IssmDouble)connectivity[iv]);
+-	//}
+-	/*End Analytical gradient*/
+-
+-	gradient->SetValues(NUMVERTICES,vertexpidlist,grade_g,ADD_VAL);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	delete friction;
+-}
+-/*}}}*/
+-void       Tria::GradjDragFS(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	/*Gradient is 0 if on shelf or not on bed*/
+-	if(IsFloating() || !IsOnBase()) return;
+-
+-	int index1,index2;
+-	this->EdgeOnBaseIndices(&index1,&index2);
+-	Seg* seg = SpawnSeg(index1,index2);
+-	seg->GradjDragFS(gradient,control_index);
+-	seg->DeleteMaterials(); delete seg;
+-}
+-/*}}}*/
+-void       Tria::GradjDragGradient(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	int        i;
+-	int        vertexpidlist[NUMVERTICES];
+-	IssmDouble Jdet,weight;
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble dbasis[NDOF2][NUMVERTICES];
+-	IssmDouble dk[NDOF2]; 
+-	IssmDouble grade_g[NUMVERTICES]={0.0};
+-	GaussTria  *gauss=NULL;
+-
+-	/*Retrieve all inputs we will be needing: */
+-	if(IsFloating())return;
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-	GradientIndexing(&vertexpidlist[0],control_index);
+-	Input* dragcoefficient_input=inputs->GetInput(FrictionCoefficientEnum); _assert_(dragcoefficient_input);
+-	Input* weights_input=inputs->GetInput(InversionCostFunctionsCoefficientsEnum);                 _assert_(weights_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for(int ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctionsDerivatives(&dbasis[0][0],&xyz_list[0][0],gauss);
+-		weights_input->GetInputValue(&weight,gauss,DragCoefficientAbsGradientEnum);
+-
+-		/*Build alpha_complement_list: */
+-		dragcoefficient_input->GetInputDerivativeValue(&dk[0],&xyz_list[0][0],gauss);
+-
+-		/*Build gradje_g_gaussian vector (actually -dJ/ddrag): */
+-		for (i=0;i<NUMVERTICES;i++){
+-			grade_g[i]+=-weight*Jdet*gauss->weight*(dbasis[0][i]*dk[0]+dbasis[1][i]*dk[1]);
+-			_assert_(!xIsNan<IssmDouble>(grade_g[i]));
+-		}
+-	}
+-	gradient->SetValues(NUMVERTICES,vertexpidlist,grade_g,ADD_VAL);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-}
+-/*}}}*/
+-void       Tria::GradjDhDtBalancedthickness(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	/*Intermediaries*/
+-	int    vertexpidlist[NUMVERTICES];
+-	IssmDouble lambda[NUMVERTICES];
+-	IssmDouble gradient_g[NUMVERTICES];
+-
+-	/*Compute Gradient*/
+-	GradientIndexing(&vertexpidlist[0],control_index);
+-	GetInputListOnVertices(&lambda[0],AdjointEnum);
+-	for(int i=0;i<NUMVERTICES;i++) gradient_g[i]=-lambda[i];
+-
+-	gradient->SetValues(NUMVERTICES,vertexpidlist,gradient_g,INS_VAL);
+-}
+-/*}}}*/
+-void       Tria::GradjAdotBulancethickness2(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	/*Intermediaries*/
+-	IssmDouble lambda,potential,weight,Jdet;
+-	IssmDouble grade_g[NUMVERTICES];
+-	IssmDouble basis[NUMVERTICES];
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	int        vertexpidlist[NUMVERTICES];
+-
+-	/*Recover inputs*/
+-	Input* lambda_input  = inputs->GetInput(AdjointEnum);                            _assert_(lambda_input);
+-	Input* weights_input = inputs->GetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
+-
+-	/* Get node coordinates and dof list: */
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-	GradientIndexing(&vertexpidlist[0],control_index);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	Gauss* gauss=new GaussTria(2);
+-	for(int ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctions(&basis[0],gauss);
+-		weights_input->GetInputValue(&weight,gauss,Balancethickness2MisfitEnum);
+-		lambda_input->GetInputValue(&lambda,gauss);
+-
+-		/*Build gradje_g_gaussian vector (actually -dJ/ddrag): */
+-		for(int i=0;i<NUMVERTICES;i++){
+-			grade_g[i]+= - weight*Jdet*gauss->weight*basis[i]*lambda;
+-		}
+-	}
+-	gradient->SetValues(NUMVERTICES,vertexpidlist,grade_g,ADD_VAL);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-}
+-/*}}}*/
+-void       Tria::GradjVxBalancedthickness(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	/*Intermediaries*/
+-	int        i;
+-	int        vertexpidlist[NUMVERTICES];
+-	IssmDouble thickness,Jdet;
+-	IssmDouble basis[3];
+-	IssmDouble Dlambda[2],dp[2];
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble grade_g[NUMVERTICES] = {0.0};
+-	GaussTria *gauss                = NULL;
+-
+-	/* Get node coordinates and dof list: */
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-	GradientIndexing(&vertexpidlist[0],control_index);
+-
+-	/*Retrieve all inputs we will be needing: */
+-	Input* adjoint_input=inputs->GetInput(AdjointEnum);     _assert_(adjoint_input);
+-	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for(int ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctions(basis, gauss);
+-
+-		adjoint_input->GetInputDerivativeValue(&Dlambda[0],&xyz_list[0][0],gauss);
+-		thickness_input->GetInputValue(&thickness, gauss);
+-		thickness_input->GetInputDerivativeValue(&dp[0],&xyz_list[0][0],gauss);
+-
+-		for(i=0;i<NUMVERTICES;i++) grade_g[i]+=thickness*Dlambda[0]*Jdet*gauss->weight*basis[i];
+-	}
+-
+-	gradient->SetValues(NUMVERTICES,vertexpidlist,grade_g,ADD_VAL);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-}
+-/*}}}*/
+-void       Tria::GradjVyBalancedthickness(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	/*Intermediaries*/
+-	int        i;
+-	int        vertexpidlist[NUMVERTICES];
+-	IssmDouble thickness,Jdet;
+-	IssmDouble basis[3];
+-	IssmDouble Dlambda[2],dp[2];
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble grade_g[NUMVERTICES] = {0.0};
+-	GaussTria *gauss                = NULL;
+-
+-	/* Get node coordinates and dof list: */
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-	GradientIndexing(&vertexpidlist[0],control_index);
+-
+-	/*Retrieve all inputs we will be needing: */
+-	Input* adjoint_input=inputs->GetInput(AdjointEnum);     _assert_(adjoint_input);
+-	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for(int ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctions(basis, gauss);
+-
+-		adjoint_input->GetInputDerivativeValue(&Dlambda[0],&xyz_list[0][0],gauss);
+-		thickness_input->GetInputValue(&thickness, gauss);
+-		thickness_input->GetInputDerivativeValue(&dp[0],&xyz_list[0][0],gauss);
+-
+-		for(i=0;i<NUMVERTICES;i++) grade_g[i]+=thickness*Dlambda[1]*Jdet*gauss->weight*basis[i];
+-	}
+-	gradient->SetValues(NUMVERTICES,vertexpidlist,grade_g,ADD_VAL);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-}
+-/*}}}*/
+-void       Tria::GradjThicknessBalancethicknessSoft(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	/*Intermediaries */
+-	int         i,resp;
+-	int         vertexpidlist[NUMVERTICES];
+-	IssmDouble  Jdet;
+-	IssmDouble  thickness,thicknessobs,weight;
+-	int         num_responses;
+-	IssmDouble  xyz_list[NUMVERTICES][3];
+-	IssmDouble  basis[3];
+-	IssmDouble  dbasis[NDOF2][NUMVERTICES];
+-	IssmDouble  dH[2];
+-	IssmDouble  vx,vy,vel;
+-	IssmDouble  dvx[2],dvy[2];
+-	IssmDouble dhdt,basal_melting,surface_mass_balance;
+-	GaussTria *gauss     = NULL;
+-	int       *responses = NULL;
+-	IssmDouble grade_g[NUMVERTICES] = {0.0};
+-
+-	/* Get node coordinates and dof list: */
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-	GradientIndexing(&vertexpidlist[0],control_index);
+-
+-	/*Retrieve all inputs and parameters*/
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-	this->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
+-	this->parameters->FindParam(&responses,NULL,InversionCostFunctionsEnum);
+-	Input* thickness_input            = inputs->GetInput(ThicknessEnum);                          _assert_(thickness_input);
+-	Input* thicknessobs_input         = inputs->GetInput(InversionThicknessObsEnum);              _assert_(thicknessobs_input);
+-	Input* weights_input              = inputs->GetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
+-	Input* vx_input                   = inputs->GetInput(VxEnum);                                 _assert_(vx_input);
+-	Input* vy_input                   = inputs->GetInput(VyEnum);                                 _assert_(vy_input);
+-	Input* surface_mass_balance_input = inputs->GetInput(SurfaceforcingsMassBalanceEnum);         _assert_(surface_mass_balance_input);
+-	Input* basal_melting_input        = inputs->GetInput(BasalforcingsMeltingRateEnum);           _assert_(basal_melting_input);
+-	Input* dhdt_input                 = inputs->GetInput(BalancethicknessThickeningRateEnum);     _assert_(dhdt_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussTria(2);
+-	for(int ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctions(basis, gauss);
+-		GetNodalFunctionsDerivatives(&dbasis[0][0],&xyz_list[0][0],gauss);
+-
+-		thickness_input->GetInputValue(&thickness, gauss);
+-		thickness_input->GetInputDerivativeValue(&dH[0],&xyz_list[0][0],gauss);
+-		thicknessobs_input->GetInputValue(&thicknessobs, gauss);
+-
+-		/*Loop over all requested responses*/
+-		for(resp=0;resp<num_responses;resp++){
+-
+-			weights_input->GetInputValue(&weight,gauss,responses[resp]);
+-
+-			switch(responses[resp]){
+-
+-				case ThicknessAbsMisfitEnum:
+-					for(i=0;i<NUMVERTICES;i++) grade_g[i]+= (thicknessobs-thickness)*weight*Jdet*gauss->weight*basis[i];
+-					break;
+-				case ThicknessAbsGradientEnum:
+-					for(i=0;i<NUMVERTICES;i++) grade_g[i]+= - weight*dH[0]*dbasis[0][i]*Jdet*gauss->weight;
+-					for(i=0;i<NUMVERTICES;i++) grade_g[i]+= - weight*dH[1]*dbasis[1][i]*Jdet*gauss->weight;
+-					break;
+-				case ThicknessAlongGradientEnum:
+-					vx_input->GetInputValue(&vx,gauss);
+-					vy_input->GetInputValue(&vy,gauss);
+-					vel = sqrt(vx*vx+vy*vy);
+-					vx  = vx/(vel+1.e-9);
+-					vy  = vy/(vel+1.e-9);
+-					for(i=0;i<NUMVERTICES;i++) grade_g[i]+= - weight*(dH[0]*vx+dH[1]*vy)*(dbasis[0][i]*vx+dbasis[1][i]*vy)*Jdet*gauss->weight;
+-					break;
+-				case ThicknessAcrossGradientEnum:
+-					vx_input->GetInputValue(&vx,gauss);
+-					vy_input->GetInputValue(&vy,gauss);
+-					vel = sqrt(vx*vx+vy*vy);
+-					vx  = vx/(vel+1.e-9);
+-					vy  = vy/(vel+1.e-9);
+-					for(i=0;i<NUMVERTICES;i++) grade_g[i]+= - weight*(dH[0]*(-vy)+dH[1]*vx)*(dbasis[0][i]*(-vy)+dbasis[1][i]*vx)*Jdet*gauss->weight;
+-					break;
+-				case BalancethicknessMisfitEnum:
+-					surface_mass_balance_input->GetInputValue(&surface_mass_balance,gauss);
+-					basal_melting_input->GetInputValue(&basal_melting,gauss);
+-					dhdt_input->GetInputValue(&dhdt,gauss);
+-					vx_input->GetInputValue(&vx,gauss);
+-					vx_input->GetInputDerivativeValue(&dvx[0],&xyz_list[0][0],gauss);
+-					vy_input->GetInputValue(&vy,gauss);
+-					vy_input->GetInputDerivativeValue(&dvy[0],&xyz_list[0][0],gauss);
+-					for(i=0;i<NUMVERTICES;i++){
+-						grade_g[i]+= - weight*Jdet*gauss->weight*(
+-									(vx*dH[0]+vy*dH[1] + thickness*(dvx[0]+dvy[1]))*(vx*dbasis[0][i]+ vy*dbasis[1][i] + basis[i]*(dvx[0]+dvy[1]))
+-									-(surface_mass_balance-basal_melting-dhdt)*(vx*dbasis[0][i]+ vy*dbasis[1][i] + basis[i]*(dvx[0]+dvy[1]))
+-									);
+-					}
+-					break;
+-				default:
+-					_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
+-			}
+-		}
+-	}
+-
+-	gradient->SetValues(NUMVERTICES,vertexpidlist,grade_g,ADD_VAL);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	xDelete<int>(responses);
+-}
+-/*}}}*/
+ void       Tria::GetVectorFromControlInputs(Vector<IssmDouble>* vector,int control_enum,int control_index,const char* data){/*{{{*/
+ 
+ 	int vertexpidlist[NUMVERTICES];
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18061)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18062)
+@@ -135,19 +135,6 @@
+ 		void   GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y);
+ 		#endif
+ 
+-		void       Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index);
+-		void       GradjBGradient(Vector<IssmDouble>* gradient,int control_index);
+-		void       GradjDGradient(Vector<IssmDouble>* gradient,int control_index);
+-		void       GradjBSSA(Vector<IssmDouble>* gradient,int control_index);
+-		void       GradjDSSA(Vector<IssmDouble>* gradient,int control_index);
+-		void       GradjDragSSA(Vector<IssmDouble>* gradient,int control_index);
+-		void       GradjDragFS(Vector<IssmDouble>* gradient,int control_index);
+-		void       GradjDragGradient(Vector<IssmDouble>* gradient,int control_index);
+-		void       GradjDhDtBalancedthickness(Vector<IssmDouble>* gradient,int control_index);
+-		void       GradjVxBalancedthickness(Vector<IssmDouble>* gradient,int control_index);
+-		void       GradjVyBalancedthickness(Vector<IssmDouble>* gradient,int control_index);
+-		void       GradjThicknessBalancethicknessSoft(Vector<IssmDouble>* gradient,int control_index);
+-		void       GradjAdotBulancethickness2(Vector<IssmDouble>* gradient,int control_index);
+ 		void       GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data);
+ 		void       SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index);
+ 		void       ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index);
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18061)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18062)
+@@ -2894,326 +2894,6 @@
+ 	vector_gradient->SetValues(NUMVERTICES,&sidlist[0],&gradients[0],ADD_VAL);
+ 
+ }/*}}}*/
+-void       Penta::Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index){/*{{{*/
+-	/*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/
+-
+-	int   approximation;
+-	Tria* tria=NULL;
+-
+-	/*If on water, skip grad (=0): */
+-	if(!IsIceInElement())return;
+-					
+-	/*First deal with ∂/∂alpha(KU-F)*/
+-	switch(control_type){
+-
+-		case FrictionCoefficientEnum:
+-			inputs->GetInputValue(&approximation,ApproximationEnum);
+-			switch(approximation){
+-				case SSAApproximationEnum:
+-					GradjDragSSA(gradient,control_index);
+-					break;
+-				case HOApproximationEnum:
+-					GradjDragHO(gradient,control_index);
+-					break;
+-				case FSApproximationEnum:
+-					GradjDragFS(gradient,control_index);
+-					break;
+-				case NoneApproximationEnum:
+-					/*Gradient is 0*/
+-					break;
+-				default:
+-					_error_("approximation " << EnumToStringx(approximation) << " not supported yet");
+-			}
+-			break;
+-
+-		case MaterialsRheologyBbarEnum:
+-			inputs->GetInputValue(&approximation,ApproximationEnum);
+-			switch(approximation){
+-				case SSAApproximationEnum:
+-					GradjBbarSSA(gradient,control_index);
+-					break;
+-				case HOApproximationEnum:
+-					GradjBbarHO(gradient,control_index);
+-					break;
+-				case FSApproximationEnum:
+-					GradjBbarFS(gradient,control_index);
+-					break;
+-				case NoneApproximationEnum:
+-					/*Gradient is 0*/
+-					break;
+-				default:
+-					_error_("approximation " << EnumToStringx(approximation) << " not supported yet");
+-			}
+-			break;
+-
+-		default:
+-			_error_("control type " << EnumToStringx(control_type) << " not supported yet: ");
+-	}
+-
+-	/*Now deal with ∂J/∂alpha*/
+-	int *responses = NULL;
+-	int num_responses,resp;
+-	this->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
+-	this->parameters->FindParam(&responses,NULL,InversionCostFunctionsEnum);
+-
+-	for(resp=0;resp<num_responses;resp++) switch(responses[resp]){
+-
+-		case ThicknessAbsMisfitEnum:
+-		case SurfaceAbsVelMisfitEnum:
+-		case SurfaceRelVelMisfitEnum:
+-		case SurfaceLogVelMisfitEnum:
+-		case SurfaceLogVxVyMisfitEnum:
+-		case SurfaceAverageVelMisfitEnum:
+-			/*Nothing, J does not depends on the parameter being inverted for*/
+-			break;
+-		case DragCoefficientAbsGradientEnum:
+-			if(IsOnBase()){
+-				tria=(Tria*)SpawnTria(0,1,2);
+-				tria->GradjDragGradient(gradient,control_index);
+-				delete tria->material; delete tria;
+-			}
+-			break;
+-		case RheologyBbarAbsGradientEnum:
+-			if(IsOnBase()){
+-				tria=(Tria*)SpawnTria(0,1,2);
+-				tria->GradjBGradient(gradient,control_index);
+-				delete tria->material; delete tria;
+-			}
+-			break;
+-		default:
+-			_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
+-	}
+-	xDelete<int>(responses);
+-}
+-/*}}}*/
+-void       Penta::GradjDragSSA(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	/*Gradient is 0 if on shelf or not on bed*/
+-	if(IsFloating() || !IsOnBase()) return;
+-
+-	/*Spawn tria*/
+-	Tria* tria=(Tria*)SpawnTria(0,1,2);
+-	tria->GradjDragSSA(gradient,control_index);
+-	delete tria->material; delete tria;
+-
+-} /*}}}*/
+-void       Penta::GradjDragHO(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	printf("-------------- file: Penta.cpp line: %i\n",__LINE__); 
+-	int        i,j;
+-	int        analysis_type;
+-	int        vertexpidlist[NUMVERTICES];
+-	IssmDouble vx,vy,lambda,mu,alpha_complement,Jdet;
+-	IssmDouble bed,thickness,Neff,drag;
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble xyz_list_tria[NUMVERTICES2D][3]={0.0};
+-	IssmDouble dk[NDOF3]; 
+-	IssmDouble grade_g[NUMVERTICES]={0.0};
+-	IssmDouble grade_g_gaussian[NUMVERTICES];
+-	IssmDouble basis[6];
+-	Friction*  friction=NULL;
+-	GaussPenta *gauss=NULL;
+-
+-	/*Gradient is 0 if on shelf or not on bed*/
+-	if(IsFloating() || !IsOnBase()) return;
+-
+-	/*Retrieve all inputs and parameters*/
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-	GradientIndexing(&vertexpidlist[0],control_index);
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
+-	Input* adjointx_input=inputs->GetInput(AdjointxEnum);               _assert_(adjointx_input);
+-	Input* adjointy_input=inputs->GetInput(AdjointyEnum);               _assert_(adjointy_input);
+-	Input* vx_input=inputs->GetInput(VxEnum);                           _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum);                           _assert_(vy_input);
+-	Input* dragcoefficient_input=inputs->GetInput(FrictionCoefficientEnum); _assert_(dragcoefficient_input);
+-
+-	/*Build frictoin element, needed later: */
+-	friction=new Friction(this,2);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(0,1,2,4);
+-	for(int ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetTriaJacobianDeterminant(&Jdet, &xyz_list_tria[0][0],gauss);
+-		GetNodalFunctionsP1(basis,gauss);
+-
+-		/*Build alpha_complement_list: */
+-		friction->GetAlphaComplement(&alpha_complement,gauss);
+-
+-		dragcoefficient_input->GetInputValue(&drag, gauss);
+-		adjointx_input->GetInputValue(&lambda, gauss);
+-		adjointy_input->GetInputValue(&mu, gauss);
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
+-		dragcoefficient_input->GetInputDerivativeValue(&dk[0],&xyz_list[0][0],gauss);
+-
+-		/*Build gradje_g_gaussian vector (actually -dJ/ddrag): */
+-		for (i=0;i<NUMVERTICES;i++){
+-			grade_g_gaussian[i]=-2*drag*alpha_complement*((lambda*vx+mu*vy))*Jdet*gauss->weight*basis[i];
+-		}
+-
+-		/*Add gradje_g_gaussian vector to gradje_g: */
+-		for(i=0;i<NUMVERTICES;i++){
+-			_assert_(!xIsNan<IssmDouble>(grade_g[i]));
+-			grade_g[i]+=grade_g_gaussian[i];
+-		}
+-	}
+-	gradient->SetValues(NUMVERTICES,vertexpidlist,grade_g,ADD_VAL);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	delete friction;
+-}
+-/*}}}*/
+-void       Penta::GradjDragFS(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	int        i,j;
+-	int        analysis_type;
+-	int        vertexpidlist[NUMVERTICES];
+-	IssmDouble bed,thickness,Neff;
+-	IssmDouble lambda,mu,xi,Jdet,vx,vy,vz;
+-	IssmDouble alpha_complement,drag;
+-	IssmDouble surface_normal[3],bed_normal[3];
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble xyz_list_tria[NUMVERTICES2D][3]={0.0};
+-	IssmDouble dk[NDOF3]; 
+-	IssmDouble basis[6];
+-	IssmDouble grade_g[NUMVERTICES]={0.0};
+-	IssmDouble grade_g_gaussian[NUMVERTICES];
+-	Friction*  friction=NULL;
+-	GaussPenta* gauss=NULL;
+-
+-	/*Gradient is 0 if on shelf or not on bed*/
+-	if(IsFloating() || !IsOnBase()) return;
+-
+-	/*Retrieve all inputs and parameters*/
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
+-	GradientIndexing(&vertexpidlist[0],control_index);
+-	Input* drag_input    =inputs->GetInput(FrictionCoefficientEnum); _assert_(drag_input);
+-	Input* vx_input      =inputs->GetInput(VxEnum);                  _assert_(vx_input);
+-	Input* vy_input      =inputs->GetInput(VyEnum);                  _assert_(vy_input);
+-	Input* vz_input      =inputs->GetInput(VzEnum);                  _assert_(vz_input);
+-	Input* adjointx_input=inputs->GetInput(AdjointxEnum);            _assert_(adjointx_input);
+-	Input* adjointy_input=inputs->GetInput(AdjointyEnum);            _assert_(adjointy_input);
+-	Input* adjointz_input=inputs->GetInput(AdjointzEnum);            _assert_(adjointz_input);
+-
+-	/*Build frictoin element, needed later: */
+-	friction=new Friction(this,3);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussPenta(0,1,2,4);
+-	for(int ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		/*Recover alpha_complement and drag: */
+-		friction->GetAlphaComplement(&alpha_complement,gauss);
+-		drag_input->GetInputValue(&drag,gauss);
+-
+-		/*recover lambda mu and xi: */
+-		adjointx_input->GetInputValue(&lambda,gauss);
+-		adjointy_input->GetInputValue(&mu    ,gauss);
+-		adjointz_input->GetInputValue(&xi    ,gauss);
+-
+-		/*recover vx vy and vz: */
+-		vx_input->GetInputValue(&vx, gauss);
+-		vy_input->GetInputValue(&vy, gauss);
+-		vz_input->GetInputValue(&vz, gauss);
+-
+-		/*Get normal vector to the bed */
+-		NormalTop(&surface_normal[0],&xyz_list_tria[0][0]);
+-
+-		bed_normal[0]=-surface_normal[0]; //Function is for upper surface, so the normal to the bed is the opposite of the result
+-		bed_normal[1]=-surface_normal[1];
+-		bed_normal[2]=-surface_normal[2];
+-
+-		/* Get Jacobian determinant: */
+-		GetTriaJacobianDeterminant(&Jdet,&xyz_list_tria[0][0],gauss);
+-		GetNodalFunctionsP1(basis, gauss);
+-
+-		/*Get k derivative: dk/dx */
+-		drag_input->GetInputDerivativeValue(&dk[0],&xyz_list[0][0],gauss);
+-
+-		/*Build gradje_g_gaussian vector (actually -dJ/ddrag): */
+-		for (i=0;i<NUMVERTICES;i++){
+-			//standard gradient dJ/dki
+-			grade_g_gaussian[i]=(
+-						-lambda*(2*drag*alpha_complement*(vx - vz*bed_normal[0]*bed_normal[2]))
+-						-mu    *(2*drag*alpha_complement*(vy - vz*bed_normal[1]*bed_normal[2]))
+-						-xi    *(2*drag*alpha_complement*(-vx*bed_normal[0]*bed_normal[2]-vy*bed_normal[1]*bed_normal[2]))
+-						)*Jdet*gauss->weight*basis[i]; 
+-		}
+-
+-		/*Add gradje_g_gaussian vector to gradje_g: */
+-		for( i=0; i<NUMVERTICES; i++)grade_g[i]+=grade_g_gaussian[i];
+-	}
+-
+-	gradient->SetValues(NUMVERTICES,vertexpidlist,grade_g,ADD_VAL);
+-
+-	delete friction;
+-	delete gauss;
+-}
+-/*}}}*/
+-void       Penta::GradjBbarSSA(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	/*This element should be collapsed into a tria element at its base*/
+-	if (!IsOnBase()) return; 
+-
+-	/*Depth Average B*/
+-	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum);
+-	if(this->material->IsDamage())this->InputDepthAverageAtBase(DamageDEnum,DamageDbarEnum);
+-
+-	/*Collapse element to the base*/
+-	Tria* tria=(Tria*)SpawnTria(0,1,2);
+-	tria->GradjBSSA(gradient,control_index);
+-	delete tria->material; delete tria;
+-
+-	/*delete Average B*/
+-	this->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+-	this->inputs->DeleteInput(DamageDbarEnum);
+-
+-} /*}}}*/
+-void       Penta::GradjBbarHO(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	/*Gradient is computed on bed only (Bbar)*/
+-	if (!IsOnBase()) return;
+-
+-	/*Depth Average B and D*/
+-	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum);
+-	if(this->material->IsDamage())this->InputDepthAverageAtBase(DamageDEnum,DamageDbarEnum);
+-
+-	/*Collapse element to the base*/
+-	Tria* tria=(Tria*)SpawnTria(0,1,2);
+-	tria->GradjBSSA(gradient,control_index);    //We use SSA as an estimate for now
+-	delete tria->material; delete tria;
+-
+-	/*delete Average B*/
+-	this->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+-	this->inputs->DeleteInput(DamageDbarEnum);
+-} /*}}}*/
+-void       Penta::GradjBbarFS(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	/*Gradient is computed on bed only (Bbar)*/
+-	if (!IsOnBase()) return;
+-
+-	/*Depth Average B and D*/
+-	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum);
+-	if(this->material->IsDamage())this->InputDepthAverageAtBase(DamageDEnum,DamageDbarEnum);
+-
+-	/*Collapse element to the base*/
+-	Tria* tria=(Tria*)SpawnTria(0,1,2);
+-	tria->GradjBSSA(gradient,control_index);    //We use SSA as an estimate for now
+-	delete tria->material; delete tria;
+-
+-	/*delete Average B*/
+-	this->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+-	this->inputs->DeleteInput(DamageDbarEnum);
+-} /*}}}*/
+ void       Penta::InputControlUpdate(IssmDouble scalar,bool save_parameter){/*{{{*/
+ 
+ 	/*Intermediary*/
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 18061)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 18062)
+@@ -130,13 +130,6 @@
+ 		void   GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y);
+ 		#endif
+ 
+-		void   Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index);
+-		void   GradjDragSSA(Vector<IssmDouble>* gradient,int control_index);
+-		void   GradjDragHO(Vector<IssmDouble>* gradient,int control_index);
+-		void   GradjDragFS(Vector<IssmDouble>* gradient,int control_index);
+-		void   GradjBbarSSA(Vector<IssmDouble>* gradient,int control_index);
+-		void   GradjBbarHO(Vector<IssmDouble>* gradient,int control_index);
+-		void   GradjBbarFS(Vector<IssmDouble>* gradient,int control_index);
+ 		void   GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data);
+ 		void   SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index);
+ 		void   ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index);
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.cpp	(revision 18061)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.cpp	(revision 18062)
+@@ -115,115 +115,6 @@
+ 	*pxyz_list = xyz_list;
+ 
+ }/*}}}*/
+-void       Seg::GradjDragFS(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	int        i;
+-	int        analysis_type;
+-	int        vertexpidlist[NUMVERTICES];
+-	int        connectivity[NUMVERTICES];
+-	IssmDouble vx,lambda,alpha_complement,drag,Jdet;
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble dk[NDOF2]; 
+-	IssmDouble grade_g[NUMVERTICES]={0.0};
+-	IssmDouble grade_g_gaussian[NUMVERTICES];
+-	IssmDouble basis[3];
+-	Friction*  friction=NULL;
+-	GaussSeg  *gauss=NULL;
+-
+-	if(IsFloating())return;
+-
+-	/*retrive parameters: */
+-	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-	GradientIndexing(&vertexpidlist[0],control_index);
+-	this->GetVerticesConnectivityList(&connectivity[0]);
+-
+-	/*Build frictoin element, needed later: */
+-	friction=new Friction(this,1);
+-
+-	/*Retrieve all inputs we will be needing: */
+-	Input* adjointx_input=inputs->GetInput(AdjointxEnum);                   _assert_(adjointx_input);
+-	Input* vx_input=inputs->GetInput(VxEnum);                               _assert_(vx_input);
+-	Input* dragcoefficient_input=inputs->GetInput(FrictionCoefficientEnum); _assert_(dragcoefficient_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussSeg(4);
+-	for(int ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctions(basis, gauss);
+-
+-		/*Build alpha_complement_list: */
+-		friction->GetAlphaComplement(&alpha_complement,gauss);
+-
+-		dragcoefficient_input->GetInputValue(&drag, gauss);
+-		adjointx_input->GetInputValue(&lambda, gauss);
+-		vx_input->GetInputValue(&vx,gauss);
+-		dragcoefficient_input->GetInputDerivativeValue(&dk[0],&xyz_list[0][0],gauss);
+-
+-		/*Build gradje_g_gaussian vector (actually -dJ/ddrag): */
+-		for (i=0;i<NUMVERTICES;i++){
+-			grade_g_gaussian[i]=-2*drag*alpha_complement*(lambda*vx)*Jdet*gauss->weight*basis[i];
+-		}
+-
+-		/*Add gradje_g_gaussian vector to gradje_g: */
+-		for(i=0;i<NUMVERTICES;i++){
+-			_assert_(!xIsNan<IssmDouble>(grade_g[i]));
+-			grade_g[i]+=grade_g_gaussian[i];
+-		}
+-	}
+-	gradient->SetValues(NUMVERTICES,vertexpidlist,grade_g,ADD_VAL);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-	delete friction;
+-}
+-/*}}}*/
+-void       Seg::GradjDragGradient(Vector<IssmDouble>* gradient,int control_index){/*{{{*/
+-
+-	int        i;
+-	int        vertexpidlist[NUMVERTICES];
+-	IssmDouble Jdet,weight;
+-	IssmDouble xyz_list[NUMVERTICES][3];
+-	IssmDouble dbasis[NDOF2][NUMVERTICES];
+-	IssmDouble dk[NDOF2]; 
+-	IssmDouble grade_g[NUMVERTICES]={0.0};
+-	GaussSeg  *gauss=NULL;
+-
+-	/*Retrieve all inputs we will be needing: */
+-	if(IsFloating())return;
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-	GradientIndexing(&vertexpidlist[0],control_index);
+-	Input* dragcoefficient_input=inputs->GetInput(FrictionCoefficientEnum); _assert_(dragcoefficient_input);
+-	Input* weights_input=inputs->GetInput(InversionCostFunctionsCoefficientsEnum);                 _assert_(weights_input);
+-
+-	/* Start  looping on the number of gaussian points: */
+-	gauss=new GaussSeg(2);
+-	for(int ig=gauss->begin();ig<gauss->end();ig++){
+-
+-		gauss->GaussPoint(ig);
+-
+-		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+-		GetNodalFunctionsDerivatives(&dbasis[0][0],&xyz_list[0][0],gauss);
+-		weights_input->GetInputValue(&weight,gauss,DragCoefficientAbsGradientEnum);
+-
+-		/*Build alpha_complement_list: */
+-		dragcoefficient_input->GetInputDerivativeValue(&dk[0],&xyz_list[0][0],gauss);
+-
+-		/*Build gradje_g_gaussian vector (actually -dJ/ddrag): */
+-		for (i=0;i<NUMVERTICES;i++){
+-			grade_g[i]+=-weight*Jdet*gauss->weight*dbasis[0][i]*dk[0];
+-			_assert_(!xIsNan<IssmDouble>(grade_g[i]));
+-		}
+-	}
+-	gradient->SetValues(NUMVERTICES,vertexpidlist,grade_g,ADD_VAL);
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-}
+-/*}}}*/
+ bool       Seg::IsIcefront(void){/*{{{*/
+ 
+ 	bool isicefront;
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 18061)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 18062)
+@@ -166,18 +166,6 @@
+ 		void   GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y){_error_("not implemented yet");};
+ #endif
+ 
+-		void       Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index){_error_("not implemented yet");};
+-		void       GradjBGradient(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+-		void       GradjDGradient(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+-		void       GradjBSSA(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+-		void       GradjDSSA(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+-		void       GradjDragSSA(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+-		void       GradjDragFS(Vector<IssmDouble>* gradient,int control_index);
+-		void       GradjDragGradient(Vector<IssmDouble>* gradient,int control_index);
+-		void       GradjDhDtBalancedthickness(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+-		void       GradjVxBalancedthickness(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+-		void       GradjVyBalancedthickness(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+-		void       GradjThicknessBalancethicknessSoft(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+ 		void       GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data){_error_("not implemented yet");};
+ 		void       SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index){_error_("not implemented yet");};
+ 		void       ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 18061)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 18062)
+@@ -172,18 +172,6 @@
+ 
+ 		IssmDouble DragCoefficientAbsGradient(void){_error_("not implemented yet");};
+ 		void       GradientIndexing(int* indexing,int control_index){_error_("not implemented yet");};
+-		void       Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index){_error_("not implemented yet");};
+-		void       GradjBGradient(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+-		void       GradjDGradient(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+-		void       GradjBSSA(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+-		void       GradjDSSA(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+-		void       GradjDragSSA(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+-		void       GradjDragFS(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+-		void       GradjDragGradient(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+-		void       GradjDhDtBalancedthickness(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+-		void       GradjVxBalancedthickness(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+-		void       GradjVyBalancedthickness(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+-		void       GradjThicknessBalancethicknessSoft(Vector<IssmDouble>* gradient,int control_index){_error_("not implemented yet");};
+ 		void       GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data){_error_("not implemented yet");};
+ 		void       SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index){_error_("not implemented yet");};
+ 		void       ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index){_error_("not implemented yet");};
Index: /issm/oecreview/Archive/17984-18295/ISSM-18062-18063.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18062-18063.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18062-18063.diff	(revision 18296)
@@ -0,0 +1,5107 @@
+Index: ../trunk-jpl/src/c/kml/KML_Geometry.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_Geometry.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_Geometry.cpp	(revision 18063)
+@@ -16,15 +16,13 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_Geometry::KML_Geometry(){{{*/
+-KML_Geometry::KML_Geometry(){
++KML_Geometry::KML_Geometry(){/*{{{*/
+ 
+ 	;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_Geometry::~KML_Geometry(){{{*/
+-KML_Geometry::~KML_Geometry(){
++KML_Geometry::~KML_Geometry(){/*{{{*/
+ 
+ 	;
+ 
+@@ -32,16 +30,14 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_Geometry::Echo {{{*/
+-void  KML_Geometry::Echo(){
++void  KML_Geometry::Echo(){/*{{{*/
+ 
+ 	this->KML_Object::Echo();
+ 
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Geometry::DeepEcho {{{*/
+-void  KML_Geometry::DeepEcho(){
++void  KML_Geometry::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -50,24 +46,21 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Geometry::DeepEcho {{{*/
+-void  KML_Geometry::DeepEcho(const char* indent){
++void  KML_Geometry::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	this->KML_Object::DeepEcho(indent);
+ 
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Geometry::Write {{{*/
+-void  KML_Geometry::Write(FILE* filout,const char* indent){
++void  KML_Geometry::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	KML_Object::Write(filout,indent);
+ 
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Geometry::Read {{{*/
+-void  KML_Geometry::Read(FILE* fid,char* kstr){
++void  KML_Geometry::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ /*  process field within opening and closing tags  */
+ 
+Index: ../trunk-jpl/src/c/kml/KML_ColorStyle.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_ColorStyle.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_ColorStyle.cpp	(revision 18063)
+@@ -17,16 +17,14 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_ColorStyle::KML_ColorStyle(){{{*/
+-KML_ColorStyle::KML_ColorStyle(){
++KML_ColorStyle::KML_ColorStyle(){/*{{{*/
+ 
+ 	strcpy(color     ,"ffffffff");
+ 	strcpy(colormode ,"normal");
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_ColorStyle::~KML_ColorStyle(){{{*/
+-KML_ColorStyle::~KML_ColorStyle(){
++KML_ColorStyle::~KML_ColorStyle(){/*{{{*/
+ 
+ 	;
+ 
+@@ -34,8 +32,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_ColorStyle::Echo {{{*/
+-void  KML_ColorStyle::Echo(){
++void  KML_ColorStyle::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -47,8 +44,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_ColorStyle::DeepEcho {{{*/
+-void  KML_ColorStyle::DeepEcho(){
++void  KML_ColorStyle::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -57,8 +53,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_ColorStyle::DeepEcho {{{*/
+-void  KML_ColorStyle::DeepEcho(const char* indent){
++void  KML_ColorStyle::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -68,8 +63,7 @@
+ 	if(flag) _printf0_(indent << "     colormode: " << colormode << "\n");
+ }
+ /*}}}*/
+-/*FUNCTION KML_ColorStyle::Write {{{*/
+-void  KML_ColorStyle::Write(FILE* filout,const char* indent){
++void  KML_ColorStyle::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	KML_SubStyle::Write(filout,indent);
+ 
+@@ -81,8 +75,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_ColorStyle::Read {{{*/
+-void  KML_ColorStyle::Read(FILE* fid,char* kstr){
++void  KML_ColorStyle::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ /*  process field within opening and closing tags  */
+ 
+Index: ../trunk-jpl/src/c/kml/KML_Placemark.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_Placemark.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_Placemark.cpp	(revision 18063)
+@@ -22,15 +22,13 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_Placemark::KML_Placemark(){{{*/
+-KML_Placemark::KML_Placemark(){
++KML_Placemark::KML_Placemark(){/*{{{*/
+ 
+ 	geometry  =new DataSet;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_Placemark::~KML_Placemark(){{{*/
+-KML_Placemark::~KML_Placemark(){
++KML_Placemark::~KML_Placemark(){/*{{{*/
+ 
+ 	if (geometry) {
+ 		delete geometry;
+@@ -41,8 +39,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_Placemark::Echo {{{*/
+-void  KML_Placemark::Echo(){
++void  KML_Placemark::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -54,8 +51,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Placemark::DeepEcho {{{*/
+-void  KML_Placemark::DeepEcho(){
++void  KML_Placemark::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -64,8 +60,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Placemark::DeepEcho {{{*/
+-void  KML_Placemark::DeepEcho(const char* indent){
++void  KML_Placemark::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	int   i;
+ 	char  indent2[81];
+@@ -91,8 +86,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Placemark::Write {{{*/
+-void  KML_Placemark::Write(FILE* filout,const char* indent){
++void  KML_Placemark::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	int   i;
+ 	char  indent2[81];
+@@ -118,8 +112,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Placemark::Read {{{*/
+-void  KML_Placemark::Read(FILE* fid,char* kstr){
++void  KML_Placemark::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	char*        kstri;
+ 	int          ncom=0;
+@@ -189,8 +182,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Placemark::WriteExp {{{*/
+-void  KML_Placemark::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
++void  KML_Placemark::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){/*{{{*/
+ 
+ 	int   i;
+ 	char  nstr2[81];
+Index: ../trunk-jpl/src/c/kml/KML_Unknown.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_Unknown.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_Unknown.cpp	(revision 18063)
+@@ -16,16 +16,14 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_Unknown::KML_Unknown(){{{*/
+-KML_Unknown::KML_Unknown(){
++KML_Unknown::KML_Unknown(){/*{{{*/
+ 
+ 	name      =NULL;
+ 	value     =NULL;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_Unknown::~KML_Unknown(){{{*/
+-KML_Unknown::~KML_Unknown(){
++KML_Unknown::~KML_Unknown(){/*{{{*/
+ 
+ 	if (name      ) xDelete<char>(name);
+ 	if (value     ) xDelete<char>(value);
+@@ -34,8 +32,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_Unknown::Echo {{{*/
+-void  KML_Unknown::Echo(){
++void  KML_Unknown::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -52,8 +49,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Unknown::DeepEcho {{{*/
+-void  KML_Unknown::DeepEcho(){
++void  KML_Unknown::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -62,8 +58,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Unknown::DeepEcho {{{*/
+-void  KML_Unknown::DeepEcho(const char* indent){
++void  KML_Unknown::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	char*        valuei;
+ 	char*        vtoken;
+@@ -92,8 +87,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Unknown::Write {{{*/
+-void  KML_Unknown::Write(FILE* filout,const char* indent){
++void  KML_Unknown::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	char*        valuei;
+ 	char*        vtoken;
+@@ -124,8 +118,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Unknown::Read {{{*/
+-void  KML_Unknown::Read(FILE* fid,char* kstr){
++void  KML_Unknown::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	char*        kstri;
+ 	char*        value2=NULL;
+Index: ../trunk-jpl/src/c/kml/KML_GroundOverlay.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_GroundOverlay.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_GroundOverlay.cpp	(revision 18063)
+@@ -18,8 +18,7 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_GroundOverlay::KML_GroundOverlay(){{{*/
+-KML_GroundOverlay::KML_GroundOverlay(){
++KML_GroundOverlay::KML_GroundOverlay(){/*{{{*/
+ 
+ 	altitude  = 0.;
+ 	memcpy(altmode,"clampToGround",(strlen("clampToGround")+1)*sizeof(char));
+@@ -28,8 +27,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_GroundOverlay::~KML_GroundOverlay(){{{*/
+-KML_GroundOverlay::~KML_GroundOverlay(){
++KML_GroundOverlay::~KML_GroundOverlay(){/*{{{*/
+ 
+ 	if (llbox) {
+ 		delete llbox;
+@@ -40,8 +38,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_GroundOverlay::Echo {{{*/
+-void  KML_GroundOverlay::Echo(){
++void  KML_GroundOverlay::Echo(){/*{{{*/
+ 
+ 	_printf_("KML_GroundOverlay:\n");
+ 	KML_Overlay::Echo();
+@@ -51,8 +48,7 @@
+ 	_printf_("            llbox: " << llbox << "\n");
+ }
+ /*}}}*/
+-/*FUNCTION KML_GroundOverlay::DeepEcho {{{*/
+-void  KML_GroundOverlay::DeepEcho(){
++void  KML_GroundOverlay::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -61,8 +57,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_GroundOverlay::DeepEcho {{{*/
+-void  KML_GroundOverlay::DeepEcho(const char* indent){
++void  KML_GroundOverlay::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	char  indent2[81];
+ 
+@@ -80,8 +75,7 @@
+ 	 _printf_(indent<<"         llbox: " << llbox << "\n");
+ }
+ /*}}}*/
+-/*FUNCTION KML_GroundOverlay::Write {{{*/
+-void  KML_GroundOverlay::Write(FILE* filout,const char* indent){
++void  KML_GroundOverlay::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	char  indent2[81];
+ 
+@@ -106,8 +100,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_GroundOverlay::Read {{{*/
+-void  KML_GroundOverlay::Read(FILE* fid,char* kstr){
++void  KML_GroundOverlay::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	char*        kstri;
+ 	int          ncom=0;
+Index: ../trunk-jpl/src/c/kml/KML_Style.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_Style.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_Style.cpp	(revision 18063)
+@@ -18,8 +18,7 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_Style::KML_Style(){{{*/
+-KML_Style::KML_Style(){
++KML_Style::KML_Style(){/*{{{*/
+ 
+ 	icon      =NULL;
+ 	label     =NULL;
+@@ -30,8 +29,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_Style::~KML_Style(){{{*/
+-KML_Style::~KML_Style(){
++KML_Style::~KML_Style(){/*{{{*/
+ 
+ 	if (list) {
+ //		delete list;
+@@ -62,8 +60,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_Style::Echo {{{*/
+-void  KML_Style::Echo(){
++void  KML_Style::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -80,8 +77,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Style::DeepEcho {{{*/
+-void  KML_Style::DeepEcho(){
++void  KML_Style::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -90,8 +86,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Style::DeepEcho {{{*/
+-void  KML_Style::DeepEcho(const char* indent){
++void  KML_Style::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	char  indent2[81];
+ 	bool  flag=true;
+@@ -130,8 +125,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Style::Write {{{*/
+-void  KML_Style::Write(FILE* filout,const char* indent){
++void  KML_Style::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	char  indent2[81];
+ 
+@@ -164,8 +158,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Style::Read {{{*/
+-void  KML_Style::Read(FILE* fid,char* kstr){
++void  KML_Style::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	char*        kstri;
+ 	int          ncom=0;
+Index: ../trunk-jpl/src/c/kml/KML_Comment.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_Comment.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_Comment.cpp	(revision 18063)
+@@ -15,15 +15,13 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_Comment::KML_Comment(){{{*/
+-KML_Comment::KML_Comment(){
++KML_Comment::KML_Comment(){/*{{{*/
+ 
+ 	value     =NULL;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_Comment::~KML_Comment(){{{*/
+-KML_Comment::~KML_Comment(){
++KML_Comment::~KML_Comment(){/*{{{*/
+ 
+ 	if (value     ) xDelete<char>(value);
+ 
+@@ -31,8 +29,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_Comment::Echo {{{*/
+-void  KML_Comment::Echo(){
++void  KML_Comment::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -42,8 +39,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Comment::DeepEcho {{{*/
+-void  KML_Comment::DeepEcho(){
++void  KML_Comment::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -52,8 +48,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Comment::DeepEcho {{{*/
+-void  KML_Comment::DeepEcho(const char* indent){
++void  KML_Comment::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -63,8 +58,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Comment::Write {{{*/
+-void  KML_Comment::Write(FILE* filout,const char* indent){
++void  KML_Comment::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	if (strncmp(&value[0]              ,"<!--",4))
+ 		fprintf(filout,"%s<!--\n",indent);
+@@ -75,8 +69,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Comment::Read {{{*/
+-void  KML_Comment::Read(FILE* fid,char* kstr){
++void  KML_Comment::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ //  comments always read as part of KMLFileToken
+ 
+@@ -85,8 +78,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Comment::Alloc {{{*/
+-void  KML_Comment::Alloc(const char* valuei){
++void  KML_Comment::Alloc(const char* valuei){/*{{{*/
+ 
+ 	value=xNew<char>(strlen(valuei)+1);
+ 	memcpy(value,valuei,(strlen(valuei)+1)*sizeof(char));
+@@ -94,16 +86,14 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Comment::Add {{{*/
+-void  KML_Comment::Add(DataSet* commnt){
++void  KML_Comment::Add(DataSet* commnt){/*{{{*/
+ 
+ 	commnt->AddObject((Object*)this);
+ 
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Comment::Get {{{*/
+-void  KML_Comment::Get(char** pvalueo){
++void  KML_Comment::Get(char** pvalueo){/*{{{*/
+ 
+ 	*pvalueo=xNew<char>(strlen(value)+1);
+ 	memcpy(*pvalueo,value,(strlen(value)+1)*sizeof(char));
+Index: ../trunk-jpl/src/c/kml/KML_MultiGeometry.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_MultiGeometry.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_MultiGeometry.cpp	(revision 18063)
+@@ -21,15 +21,13 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_MultiGeometry::KML_MultiGeometry(){{{*/
+-KML_MultiGeometry::KML_MultiGeometry(){
++KML_MultiGeometry::KML_MultiGeometry(){/*{{{*/
+ 
+ 	geometry  =new DataSet;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_MultiGeometry::~KML_MultiGeometry(){{{*/
+-KML_MultiGeometry::~KML_MultiGeometry(){
++KML_MultiGeometry::~KML_MultiGeometry(){/*{{{*/
+ 
+ 	if (geometry) {
+ 		delete geometry;
+@@ -40,8 +38,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_MultiGeometry::Echo {{{*/
+-void  KML_MultiGeometry::Echo(){
++void  KML_MultiGeometry::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -53,8 +50,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_MultiGeometry::DeepEcho {{{*/
+-void  KML_MultiGeometry::DeepEcho(){
++void  KML_MultiGeometry::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -63,8 +59,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_MultiGeometry::DeepEcho {{{*/
+-void  KML_MultiGeometry::DeepEcho(const char* indent){
++void  KML_MultiGeometry::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	int   i;
+ 	char  indent2[81];
+@@ -90,8 +85,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_MultiGeometry::Write {{{*/
+-void  KML_MultiGeometry::Write(FILE* filout,const char* indent){
++void  KML_MultiGeometry::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	int   i;
+ 	char  indent2[81];
+@@ -117,8 +111,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_MultiGeometry::Read {{{*/
+-void  KML_MultiGeometry::Read(FILE* fid,char* kstr){
++void  KML_MultiGeometry::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	char*        kstri;
+ 	int          ncom=0;
+@@ -188,8 +181,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_MultiGeometry::WriteExp {{{*/
+-void  KML_MultiGeometry::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
++void  KML_MultiGeometry::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){/*{{{*/
+ 
+ 	int   i;
+ 
+Index: ../trunk-jpl/src/c/kml/KML_LineStyle.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_LineStyle.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_LineStyle.cpp	(revision 18063)
+@@ -16,15 +16,13 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_LineStyle::KML_LineStyle(){{{*/
+-KML_LineStyle::KML_LineStyle(){
++KML_LineStyle::KML_LineStyle(){/*{{{*/
+ 
+ 	width     =1.;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_LineStyle::~KML_LineStyle(){{{*/
+-KML_LineStyle::~KML_LineStyle(){
++KML_LineStyle::~KML_LineStyle(){/*{{{*/
+ 
+ 	;
+ 
+@@ -32,8 +30,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_LineStyle::Echo {{{*/
+-void  KML_LineStyle::Echo(){
++void  KML_LineStyle::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -45,8 +42,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_LineStyle::DeepEcho {{{*/
+-void  KML_LineStyle::DeepEcho(){
++void  KML_LineStyle::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -55,8 +51,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_LineStyle::DeepEcho {{{*/
+-void  KML_LineStyle::DeepEcho(const char* indent){
++void  KML_LineStyle::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -68,8 +63,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_LineStyle::Write {{{*/
+-void  KML_LineStyle::Write(FILE* filout,const char* indent){
++void  KML_LineStyle::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	fprintf(filout,"%s<LineStyle",indent);
+ 	WriteAttrib(filout," ");
+@@ -85,8 +79,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_LineStyle::Read {{{*/
+-void  KML_LineStyle::Read(FILE* fid,char* kstr){
++void  KML_LineStyle::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	char*        kstri;
+ 	int          ncom=0;
+Index: ../trunk-jpl/src/c/kml/KML_Folder.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_Folder.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_Folder.cpp	(revision 18063)
+@@ -16,15 +16,13 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_Folder::KML_Folder(){{{*/
+-KML_Folder::KML_Folder(){
++KML_Folder::KML_Folder(){/*{{{*/
+ 
+ 	;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_Folder::~KML_Folder(){{{*/
+-KML_Folder::~KML_Folder(){
++KML_Folder::~KML_Folder(){/*{{{*/
+ 
+ 	;
+ 
+@@ -32,8 +30,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_Folder::Echo {{{*/
+-void  KML_Folder::Echo(){
++void  KML_Folder::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -43,8 +40,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Folder::DeepEcho {{{*/
+-void  KML_Folder::DeepEcho(){
++void  KML_Folder::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -53,8 +49,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Folder::DeepEcho {{{*/
+-void  KML_Folder::DeepEcho(const char* indent){
++void  KML_Folder::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -64,8 +59,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Folder::Write {{{*/
+-void  KML_Folder::Write(FILE* filout,const char* indent){
++void  KML_Folder::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	fprintf(filout,"%s<Folder",indent);
+ 	WriteAttrib(filout," ");
+@@ -79,8 +73,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Folder::Read {{{*/
+-void  KML_Folder::Read(FILE* fid,char* kstr){
++void  KML_Folder::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	char*        kstri;
+ 	int          ncom=0;
+Index: ../trunk-jpl/src/c/kml/KML_Document.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_Document.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_Document.cpp	(revision 18063)
+@@ -16,15 +16,13 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_Document::KML_Document(){{{*/
+-KML_Document::KML_Document(){
++KML_Document::KML_Document(){/*{{{*/
+ 
+ 	;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_Document::~KML_Document(){{{*/
+-KML_Document::~KML_Document(){
++KML_Document::~KML_Document(){/*{{{*/
+ 
+ 	;
+ 
+@@ -32,8 +30,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_Document::Echo {{{*/
+-void  KML_Document::Echo(){
++void  KML_Document::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -43,8 +40,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Document::DeepEcho {{{*/
+-void  KML_Document::DeepEcho(){
++void  KML_Document::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -53,8 +49,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Document::DeepEcho {{{*/
+-void  KML_Document::DeepEcho(const char* indent){
++void  KML_Document::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -64,8 +59,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Document::Write {{{*/
+-void  KML_Document::Write(FILE* filout,const char* indent){
++void  KML_Document::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	fprintf(filout,"%s<Document",indent);
+ 	WriteAttrib(filout," ");
+@@ -79,8 +73,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Document::Read {{{*/
+-void  KML_Document::Read(FILE* fid,char* kstr){
++void  KML_Document::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	char*        kstri;
+ 	int          ncom=0;
+Index: ../trunk-jpl/src/c/kml/KML_File.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_File.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_File.cpp	(revision 18063)
+@@ -17,15 +17,13 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_File::KML_File(){{{*/
+-KML_File::KML_File(){
++KML_File::KML_File(){/*{{{*/
+ 
+ 	;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_File::~KML_File(){{{*/
+-KML_File::~KML_File(){
++KML_File::~KML_File(){/*{{{*/
+ 
+ 	;
+ 
+@@ -33,8 +31,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_File::Echo {{{*/
+-void  KML_File::Echo(){
++void  KML_File::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -44,8 +41,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_File::DeepEcho {{{*/
+-void  KML_File::DeepEcho(){
++void  KML_File::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -54,8 +50,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_File::DeepEcho {{{*/
+-void  KML_File::DeepEcho(const char* indent){
++void  KML_File::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -65,8 +60,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_File::Write {{{*/
+-void  KML_File::Write(FILE* filout,const char* indent){
++void  KML_File::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	fprintf(filout,"%s<kml",indent);
+ 	WriteAttrib(filout," ");
+@@ -80,8 +74,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_File::Read {{{*/
+-void  KML_File::Read(FILE* fid,char* kstr){
++void  KML_File::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	char*        kstri;
+ 	int          ncom=0;
+@@ -119,8 +112,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_File::WriteExp {{{*/
+-void  KML_File::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
++void  KML_File::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){/*{{{*/
+ 
+ 	int   i;
+ 
+Index: ../trunk-jpl/src/c/kml/KML_Icon.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_Icon.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_Icon.cpp	(revision 18063)
+@@ -16,8 +16,7 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_Icon::KML_Icon(){{{*/
+-KML_Icon::KML_Icon(){
++KML_Icon::KML_Icon(){/*{{{*/
+ 
+ 	strcpy(href      ,"");
+ 	strcpy(refmode   ,"onChange");
+@@ -30,8 +29,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_Icon::~KML_Icon(){{{*/
+-KML_Icon::~KML_Icon(){
++KML_Icon::~KML_Icon(){/*{{{*/
+ 
+ 	;
+ 
+@@ -39,8 +37,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_Icon::Echo {{{*/
+-void  KML_Icon::Echo(){
++void  KML_Icon::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -59,8 +56,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Icon::DeepEcho {{{*/
+-void  KML_Icon::DeepEcho(){
++void  KML_Icon::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -69,8 +65,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Icon::DeepEcho {{{*/
+-void  KML_Icon::DeepEcho(const char* indent){
++void  KML_Icon::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -89,8 +84,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Icon::Write {{{*/
+-void  KML_Icon::Write(FILE* filout,const char* indent){
++void  KML_Icon::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	fprintf(filout,"%s<Icon",indent);
+ 	WriteAttrib(filout," ");
+@@ -118,8 +112,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Icon::Read {{{*/
+-void  KML_Icon::Read(FILE* fid,char* kstr){
++void  KML_Icon::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	char*        kstri;
+ 	int          ncom=0;
+Index: ../trunk-jpl/src/c/kml/KML_Point.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_Point.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_Point.cpp	(revision 18063)
+@@ -16,8 +16,7 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_Point::KML_Point(){{{*/
+-KML_Point::KML_Point(){
++KML_Point::KML_Point(){/*{{{*/
+ 
+ 	extrude   =false;
+ 	memcpy(altmode,"clampToGround",(strlen("clampToGround")+1)*sizeof(char));
+@@ -28,8 +27,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_Point::~KML_Point(){{{*/
+-KML_Point::~KML_Point(){
++KML_Point::~KML_Point(){/*{{{*/
+ 
+ 	;
+ 
+@@ -37,8 +35,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_Point::Echo {{{*/
+-void  KML_Point::Echo(){
++void  KML_Point::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -52,8 +49,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Point::DeepEcho {{{*/
+-void  KML_Point::DeepEcho(){
++void  KML_Point::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -62,8 +58,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Point::DeepEcho {{{*/
+-void  KML_Point::DeepEcho(const char* indent){
++void  KML_Point::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -77,8 +72,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Point::Write {{{*/
+-void  KML_Point::Write(FILE* filout,const char* indent){
++void  KML_Point::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	fprintf(filout,"%s<Point",indent);
+ 	WriteAttrib(filout," ");
+@@ -97,8 +91,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Point::Read {{{*/
+-void  KML_Point::Read(FILE* fid,char* kstr){
++void  KML_Point::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	double*      pcoords=&coords[0];
+ 	char*        kstri;
+@@ -145,8 +138,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Point::WriteExp {{{*/
+-void  KML_Point::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
++void  KML_Point::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){/*{{{*/
+ 
+ 	int     i;
+ 	double  lat,lon,x,y;
+Index: ../trunk-jpl/src/c/kml/KML_LinearRing.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_LinearRing.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_LinearRing.cpp	(revision 18063)
+@@ -16,8 +16,7 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_LinearRing::KML_LinearRing(){{{*/
+-KML_LinearRing::KML_LinearRing(){
++KML_LinearRing::KML_LinearRing(){/*{{{*/
+ 
+ 	extrude   =false;
+ 	tessellate=false;
+@@ -28,8 +27,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_LinearRing::~KML_LinearRing(){{{*/
+-KML_LinearRing::~KML_LinearRing(){
++KML_LinearRing::~KML_LinearRing(){/*{{{*/
+ 
+ 	if (coords) xDelete<double>(coords);
+ 
+@@ -40,8 +38,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_LinearRing::Echo {{{*/
+-void  KML_LinearRing::Echo(){
++void  KML_LinearRing::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -56,8 +53,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_LinearRing::DeepEcho {{{*/
+-void  KML_LinearRing::DeepEcho(){
++void  KML_LinearRing::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -66,8 +62,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_LinearRing::DeepEcho {{{*/
+-void  KML_LinearRing::DeepEcho(const char* indent){
++void  KML_LinearRing::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	int   i;
+ 	bool  flag=true;
+@@ -85,8 +80,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_LinearRing::Write {{{*/
+-void  KML_LinearRing::Write(FILE* filout,const char* indent){
++void  KML_LinearRing::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	int   i;
+ 
+@@ -113,8 +107,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_LinearRing::Read {{{*/
+-void  KML_LinearRing::Read(FILE* fid,char* kstr){
++void  KML_LinearRing::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	char  *kstri = NULL;
+ 	int    ncom  = 0;
+@@ -159,8 +152,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_LinearRing::WriteExp {{{*/
+-void  KML_LinearRing::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
++void  KML_LinearRing::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){/*{{{*/
+ 
+ 	int     i;
+ 	double  *lat,*lon,*x,*y;
+Index: ../trunk-jpl/src/c/kml/KML_Feature.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_Feature.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_Feature.cpp	(revision 18063)
+@@ -26,8 +26,7 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_Feature::KML_Feature(){{{*/
+-KML_Feature::KML_Feature(){
++KML_Feature::KML_Feature(){/*{{{*/
+ 
+ 	memcpy(name,"",(strlen("")+1)*sizeof(char));
+ 
+@@ -40,8 +39,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_Feature::~KML_Feature(){{{*/
+-KML_Feature::~KML_Feature(){
++KML_Feature::~KML_Feature(){/*{{{*/
+ 
+ 	if (style) {
+ 		delete style;
+@@ -52,8 +50,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_Feature::Echo {{{*/
+-void  KML_Feature::Echo(){
++void  KML_Feature::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -70,8 +67,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Feature::DeepEcho {{{*/
+-void  KML_Feature::DeepEcho(){
++void  KML_Feature::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -80,8 +76,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Feature::DeepEcho {{{*/
+-void  KML_Feature::DeepEcho(const char* indent){
++void  KML_Feature::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	int   i;
+ 	char  indent2[81];
+@@ -113,8 +108,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Feature::Write {{{*/
+-void  KML_Feature::Write(FILE* filout,const char* indent){
++void  KML_Feature::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	int   i;
+ 	char  indent2[81];
+@@ -144,8 +138,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Feature::Read {{{*/
+-void  KML_Feature::Read(FILE* fid,char* kstr){
++void  KML_Feature::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	KML_Object*  kobj;
+ 
+Index: ../trunk-jpl/src/c/kml/KMLFileReadUtils.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KMLFileReadUtils.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KMLFileReadUtils.cpp	(revision 18063)
+@@ -15,8 +15,7 @@
+ #include "../shared/shared.h"
+ /*}}}*/
+ 
+-/*FUNCTION  KMLFileToken(FILE* fid,int* pncom=NULL,char*** ppcom=NULL) {{{*/
+-char* KMLFileToken(FILE* fid,
++char* KMLFileToken(FILE* fid,/*{{{*/
+ 				   int* pncom=NULL,char*** ppcom=NULL){
+ 
+ /*  get the next token (tag or field) in the file  */
+@@ -143,8 +142,7 @@
+ 	return(buffer);
+ }
+ /*}}}*/
+-/*FUNCTION  KMLFileTokenComment(FILE* fid) {{{*/
+-char* KMLFileTokenComment(FILE* fid){
++char* KMLFileTokenComment(FILE* fid){/*{{{*/
+ 
+ /*  check for comment in the file and read it  */
+ 
+@@ -207,8 +205,7 @@
+ 	return(buffer);
+ }
+ /*}}}*/
+-/*FUNCTION  KMLFileTokenBuffer {{{*/
+-void KMLFileTokenBuffer(char** pbuffer,int* pibuf,int* pbuflen,
++void KMLFileTokenBuffer(char** pbuffer,int* pibuf,int* pbuflen,/*{{{*/
+ 						int c,
+ 						int bufblk){
+ 
+@@ -236,16 +233,14 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION  KMLFileTagName {{{*/
+-char* KMLFileTagName(char* pname,
++char* KMLFileTagName(char* pname,/*{{{*/
+ 					 char* ktag){
+ 
+ 	return(KMLFileTagName(pname,NULL,0,
+ 						  ktag));
+ }
+ /*}}}*/
+-/*FUNCTION  KMLFileTagName {{{*/
+-char* KMLFileTagName(char* pname,int *m,int maxlen,
++char* KMLFileTagName(char* pname,int *m,int maxlen,/*{{{*/
+ 					 char* ktag){
+ 
+ /*  for the given tag buffer, read and store the name  */
+@@ -289,8 +284,7 @@
+ 	return(pname);
+ }
+ /*}}}*/
+-/*FUNCTION  KMLFileTagAttrib {{{*/
+-int KMLFileTagAttrib(KML_Object* kobj,
++int KMLFileTagAttrib(KML_Object* kobj,/*{{{*/
+ 					 char* ktag){
+ 
+ /*  for the given tag buffer, read and store the attributes  */
+@@ -338,8 +332,7 @@
+ 	return(isolo);
+ }
+ /*}}}*/
+-/*FUNCTION  KMLFileTokenParse {{{*/
+-int KMLFileTokenParse(int* pival,
++int KMLFileTokenParse(int* pival,/*{{{*/
+ 					  char* ktag,
+ 					  FILE* fid){
+ 
+@@ -374,8 +367,7 @@
+ 	return(0);
+ }
+ /*}}}*/
+-/*FUNCTION  KMLFileTokenParse {{{*/
+-int KMLFileTokenParse(bool* pbval, char* ktag, FILE* fid){
++int KMLFileTokenParse(bool* pbval, char* ktag, FILE* fid){/*{{{*/
+ 
+ 	int     ival;
+ 	char*   kstr;
+@@ -409,8 +401,7 @@
+ 	return(0);
+ }
+ /*}}}*/
+-/*FUNCTION  KMLFileTokenParse {{{*/
+-char* KMLFileTokenParse(char* pstr,
++char* KMLFileTokenParse(char* pstr,/*{{{*/
+ 						char* ktag,
+ 						FILE* fid){
+ 
+@@ -419,8 +410,7 @@
+ 							 fid));
+ }
+ /*}}}*/
+-/*FUNCTION  KMLFileTokenParse {{{*/
+-char* KMLFileTokenParse(char* pstr,int *m,int maxlen,
++char* KMLFileTokenParse(char* pstr,int *m,int maxlen,/*{{{*/
+ 						char* ktag,
+ 						FILE* fid){
+ 
+@@ -471,8 +461,7 @@
+ 	return(pstr);
+ }
+ /*}}}*/
+-/*FUNCTION  KMLFileTokenParse {{{*/
+-int KMLFileTokenParse(float* pfval,
++int KMLFileTokenParse(float* pfval,/*{{{*/
+ 					  char* ktag,
+ 					  FILE* fid){
+ 
+@@ -506,8 +495,7 @@
+ 	return(0);
+ }
+ /*}}}*/
+-/*FUNCTION  KMLFileTokenParse {{{*/
+-int KMLFileTokenParse(double* pdval,
++int KMLFileTokenParse(double* pdval,/*{{{*/
+ 					  char* ktag,
+ 					  FILE* fid){
+ 
+@@ -541,8 +529,7 @@
+ 	return(0);
+ }
+ /*}}}*/
+-/*FUNCTION  KMLFileTokenParse {{{*/
+-int KMLFileTokenParse(double **pdval,int* m,int maxlen,
++int KMLFileTokenParse(double **pdval,int* m,int maxlen,/*{{{*/
+ 					  char* ktag,
+ 					  FILE* fid){
+ 
+@@ -609,8 +596,7 @@
+ 	return(0);
+ }
+ /*}}}*/
+-/*FUNCTION  KMLFileTokenParse {{{*/
+-int KMLFileTokenParse(double **pdval,int* m,int n,int maxlen,
++int KMLFileTokenParse(double **pdval,int* m,int n,int maxlen,/*{{{*/
+ 					  char* ktag,
+ 					  FILE* fid){
+ 
+@@ -681,8 +667,7 @@
+ 	return(0);
+ }
+ /*}}}*/
+-/*FUNCTION  KMLFileTagSkip {{{*/
+-int KMLFileTagSkip(char* ktag, FILE* fid){
++int KMLFileTagSkip(char* ktag, FILE* fid){/*{{{*/
+ 
+ 	char*   kstr;
+ 
+Index: ../trunk-jpl/src/c/kml/KML_StyleSelector.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_StyleSelector.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_StyleSelector.cpp	(revision 18063)
+@@ -16,15 +16,13 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_StyleSelector::KML_StyleSelector(){{{*/
+-KML_StyleSelector::KML_StyleSelector(){
++KML_StyleSelector::KML_StyleSelector(){/*{{{*/
+ 
+ 	;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_StyleSelector::~KML_StyleSelector(){{{*/
+-KML_StyleSelector::~KML_StyleSelector(){
++KML_StyleSelector::~KML_StyleSelector(){/*{{{*/
+ 
+ 	;
+ 
+@@ -32,16 +30,14 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_StyleSelector::Echo {{{*/
+-void  KML_StyleSelector::Echo(){
++void  KML_StyleSelector::Echo(){/*{{{*/
+ 
+ 	KML_Object::Echo();
+ 
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_StyleSelector::DeepEcho {{{*/
+-void  KML_StyleSelector::DeepEcho(){
++void  KML_StyleSelector::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -50,24 +46,21 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_StyleSelector::DeepEcho {{{*/
+-void  KML_StyleSelector::DeepEcho(const char* indent){
++void  KML_StyleSelector::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	KML_Object::DeepEcho(indent);
+ 
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_StyleSelector::Write {{{*/
+-void  KML_StyleSelector::Write(FILE* filout,const char* indent){
++void  KML_StyleSelector::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	KML_Object::Write(filout,indent);
+ 
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_StyleSelector::Read {{{*/
+-void  KML_StyleSelector::Read(FILE* fid,char* kstr){
++void  KML_StyleSelector::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ /*  process field within opening and closing tags  */
+ 
+Index: ../trunk-jpl/src/c/kml/KML_LatLonBox.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_LatLonBox.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_LatLonBox.cpp	(revision 18063)
+@@ -16,8 +16,7 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_LatLonBox::KML_LatLonBox(){{{*/
+-KML_LatLonBox::KML_LatLonBox(){
++KML_LatLonBox::KML_LatLonBox(){/*{{{*/
+ 
+ 	north     = 0.;
+ 	south     = 0.;
+@@ -27,8 +26,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_LatLonBox::~KML_LatLonBox(){{{*/
+-KML_LatLonBox::~KML_LatLonBox(){
++KML_LatLonBox::~KML_LatLonBox(){/*{{{*/
+ 
+ 	;
+ 
+@@ -36,8 +34,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_LatLonBox::Echo {{{*/
+-void  KML_LatLonBox::Echo(){
++void  KML_LatLonBox::Echo(){/*{{{*/
+ 
+ 	_printf_("KML_LatLonBox:\n");
+ 	KML_Object::Echo();
+@@ -49,8 +46,7 @@
+ 	_printf_("      rotation: " << rotation << "\n");
+ }
+ /*}}}*/
+-/*FUNCTION KML_LatLonBox::DeepEcho {{{*/
+-void  KML_LatLonBox::DeepEcho(){
++void  KML_LatLonBox::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -59,8 +55,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_LatLonBox::DeepEcho {{{*/
+-void  KML_LatLonBox::DeepEcho(const char* indent){
++void  KML_LatLonBox::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	_printf_(indent << "KML_LatLonBox:\n");
+ 	KML_Object::DeepEcho(indent);
+@@ -72,8 +67,7 @@
+ 	_printf_("      rotation: " << rotation << "\n");
+ }
+ /*}}}*/
+-/*FUNCTION KML_LatLonBox::Write {{{*/
+-void  KML_LatLonBox::Write(FILE* filout,const char* indent){
++void  KML_LatLonBox::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	fprintf(filout,"%s<LatLonBox",indent);
+ 	WriteAttrib(filout," ");
+@@ -93,8 +87,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_LatLonBox::Read {{{*/
+-void  KML_LatLonBox::Read(FILE* fid,char* kstr){
++void  KML_LatLonBox::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	char*        kstri;
+ 	int          ncom=0;
+Index: ../trunk-jpl/src/c/kml/KML_Attribute.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_Attribute.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_Attribute.cpp	(revision 18063)
+@@ -15,16 +15,14 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_Attribute::KML_Attribute(){{{*/
+-KML_Attribute::KML_Attribute(){
++KML_Attribute::KML_Attribute(){/*{{{*/
+ 
+ 	name      =NULL;
+ 	value     =NULL;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_Attribute::~KML_Attribute(){{{*/
+-KML_Attribute::~KML_Attribute(){
++KML_Attribute::~KML_Attribute(){/*{{{*/
+ 
+ 	if (name      ) xDelete<char>(name);
+ 	if (value     ) xDelete<char>(value);
+@@ -33,8 +31,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_Attribute::Echo {{{*/
+-void  KML_Attribute::Echo(){
++void  KML_Attribute::Echo(){/*{{{*/
+ 
+ 	int   i;
+ 	bool  flag=true;
+@@ -47,8 +44,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Attribute::DeepEcho {{{*/
+-void  KML_Attribute::DeepEcho(){
++void  KML_Attribute::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -57,8 +53,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Attribute::DeepEcho {{{*/
+-void  KML_Attribute::DeepEcho(const char* indent){
++void  KML_Attribute::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	int   i;
+ 	bool  flag=true;
+@@ -71,8 +66,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Attribute::Write {{{*/
+-void  KML_Attribute::Write(FILE* filout,const char* indent){
++void  KML_Attribute::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ //  attributes always written in keyword line of kml_object
+ 
+@@ -81,8 +75,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Attribute::Read {{{*/
+-void  KML_Attribute::Read(FILE* fid,char* kstr){
++void  KML_Attribute::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ //  attributes always read in keyword line of kml_object
+ 
+@@ -91,8 +84,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Attribute::Alloc {{{*/
+-void  KML_Attribute::Alloc(const char* namei,const char* valuei){
++void  KML_Attribute::Alloc(const char* namei,const char* valuei){/*{{{*/
+ 
+ 	name =xNew<char>(strlen(namei )+1);
+ 	memcpy(name,namei,(strlen(namei)+1)*sizeof(char));
+@@ -103,16 +95,14 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Attribute::Add {{{*/
+-void  KML_Attribute::Add(DataSet* attrib){
++void  KML_Attribute::Add(DataSet* attrib){/*{{{*/
+ 
+ 	attrib->AddObject((Object*)this);
+ 
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Attribute::Get {{{*/
+-void  KML_Attribute::Get(char** pvalueo,char* deflt){
++void  KML_Attribute::Get(char** pvalueo,char* deflt){/*{{{*/
+ 
+ 	if (!value || !strlen(value)) {
+ 		*pvalueo=xNew<char>(strlen(deflt)+1);
+Index: ../trunk-jpl/src/c/kml/KML_PolyStyle.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_PolyStyle.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_PolyStyle.cpp	(revision 18063)
+@@ -18,16 +18,14 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_PolyStyle::KML_PolyStyle(){{{*/
+-KML_PolyStyle::KML_PolyStyle(){
++KML_PolyStyle::KML_PolyStyle(){/*{{{*/
+ 
+ 	fill      =true;
+ 	outline   =true;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_PolyStyle::~KML_PolyStyle(){{{*/
+-KML_PolyStyle::~KML_PolyStyle(){
++KML_PolyStyle::~KML_PolyStyle(){/*{{{*/
+ 
+ 	;
+ 
+@@ -35,8 +33,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_PolyStyle::Echo {{{*/
+-void  KML_PolyStyle::Echo(){
++void  KML_PolyStyle::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -49,8 +46,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_PolyStyle::DeepEcho {{{*/
+-void  KML_PolyStyle::DeepEcho(){
++void  KML_PolyStyle::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -59,8 +55,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_PolyStyle::DeepEcho {{{*/
+-void  KML_PolyStyle::DeepEcho(const char* indent){
++void  KML_PolyStyle::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -73,8 +68,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_PolyStyle::Write {{{*/
+-void  KML_PolyStyle::Write(FILE* filout,const char* indent){
++void  KML_PolyStyle::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	fprintf(filout,"%s<PolyStyle",indent);
+ 	WriteAttrib(filout," ");
+@@ -91,8 +85,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_PolyStyle::Read {{{*/
+-void  KML_PolyStyle::Read(FILE* fid,char* kstr){
++void  KML_PolyStyle::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	char*        kstri;
+ 	int          ncom=0;
+Index: ../trunk-jpl/src/c/kml/KML_Object.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_Object.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_Object.cpp	(revision 18063)
+@@ -31,8 +31,7 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_Object::KML_Object(){{{*/
+-KML_Object::KML_Object(){
++KML_Object::KML_Object(){/*{{{*/
+ 
+ 	attrib    =new DataSet;
+ 	commnt    =new DataSet;
+@@ -40,8 +39,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_Object::~KML_Object(){{{*/
+-KML_Object::~KML_Object(){
++KML_Object::~KML_Object(){/*{{{*/
+ 
+ 	if (attrib) {
+ 		delete attrib;
+@@ -60,8 +58,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_Object::Echo {{{*/
+-void  KML_Object::Echo(){
++void  KML_Object::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -72,8 +69,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Object::DeepEcho {{{*/
+-void  KML_Object::DeepEcho(){
++void  KML_Object::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -82,8 +78,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Object::DeepEcho {{{*/
+-void  KML_Object::DeepEcho(const char* indent){
++void  KML_Object::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	int   i;
+ 	char  indent2[81];
+@@ -124,8 +119,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Object::Write {{{*/
+-void  KML_Object::Write(FILE* filout,const char* indent){
++void  KML_Object::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	int   i;
+ 	char  indent2[81];
+@@ -146,8 +140,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Object::Read {{{*/
+-void  KML_Object::Read(FILE* fid,char* kstr){
++void  KML_Object::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	KML_Object*  kobj;
+ 
+@@ -274,16 +267,14 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Object::WriteExp {{{*/
+-void  KML_Object::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
++void  KML_Object::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){/*{{{*/
+ 
+ 	;
+ 
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Object::AddAttrib {{{*/
+-void  KML_Object::AddAttrib(const char* name,const char* value){
++void  KML_Object::AddAttrib(const char* name,const char* value){/*{{{*/
+ 
+ 	KML_Attribute* katt=NULL;
+ 
+@@ -294,8 +285,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Object::WriteAttrib {{{*/
+-void  KML_Object::WriteAttrib(FILE* filout,const char* indent){
++void  KML_Object::WriteAttrib(FILE* filout,const char* indent){/*{{{*/
+ 
+ //  attributes always written in keyword line of kml_object
+ 
+@@ -308,8 +298,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Object::AddCommnt {{{*/
+-void  KML_Object::AddCommnt(int ncom,char** pcom){
++void  KML_Object::AddCommnt(int ncom,char** pcom){/*{{{*/
+ 
+ 	int   i;
+ 	KML_Comment* kcom=NULL;
+@@ -323,8 +312,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Object::AddCommnt {{{*/
+-void  KML_Object::AddCommnt(char* value){
++void  KML_Object::AddCommnt(char* value){/*{{{*/
+ 
+ 	KML_Comment* kcom=NULL;
+ 
+@@ -335,8 +323,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Object::WriteCommnt {{{*/
+-void  KML_Object::WriteCommnt(FILE* filout,const char* indent){
++void  KML_Object::WriteCommnt(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	int   i;
+ 
+Index: ../trunk-jpl/src/c/kml/KML_SubStyle.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_SubStyle.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_SubStyle.cpp	(revision 18063)
+@@ -16,15 +16,13 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_SubStyle::KML_SubStyle(){{{*/
+-KML_SubStyle::KML_SubStyle(){
++KML_SubStyle::KML_SubStyle(){/*{{{*/
+ 
+ 	;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_SubStyle::~KML_SubStyle(){{{*/
+-KML_SubStyle::~KML_SubStyle(){
++KML_SubStyle::~KML_SubStyle(){/*{{{*/
+ 
+ 	;
+ 
+@@ -32,16 +30,14 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_SubStyle::Echo {{{*/
+-void  KML_SubStyle::Echo(){
++void  KML_SubStyle::Echo(){/*{{{*/
+ 
+ 	KML_Object::Echo();
+ 
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_SubStyle::DeepEcho {{{*/
+-void  KML_SubStyle::DeepEcho(){
++void  KML_SubStyle::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -50,24 +46,21 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_SubStyle::DeepEcho {{{*/
+-void  KML_SubStyle::DeepEcho(const char* indent){
++void  KML_SubStyle::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	KML_Object::DeepEcho(indent);
+ 
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_SubStyle::Write {{{*/
+-void  KML_SubStyle::Write(FILE* filout,const char* indent){
++void  KML_SubStyle::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	KML_Object::Write(filout,indent);
+ 
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_SubStyle::Read {{{*/
+-void  KML_SubStyle::Read(FILE* fid,char* kstr){
++void  KML_SubStyle::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ /*  process field within opening and closing tags  */
+ 
+Index: ../trunk-jpl/src/c/kml/KML_LineString.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_LineString.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_LineString.cpp	(revision 18063)
+@@ -16,8 +16,7 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_LineString::KML_LineString(){{{*/
+-KML_LineString::KML_LineString(){
++KML_LineString::KML_LineString(){/*{{{*/
+ 
+ 	extrude   =false;
+ 	tessellate=false;
+@@ -28,8 +27,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_LineString::~KML_LineString(){{{*/
+-KML_LineString::~KML_LineString(){
++KML_LineString::~KML_LineString(){/*{{{*/
+ 
+ 	if (coords) xDelete<double>(coords);
+ 
+@@ -40,8 +38,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_LineString::Echo {{{*/
+-void  KML_LineString::Echo(){
++void  KML_LineString::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -56,8 +53,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_LineString::DeepEcho {{{*/
+-void  KML_LineString::DeepEcho(){
++void  KML_LineString::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -66,8 +62,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_LineString::DeepEcho {{{*/
+-void  KML_LineString::DeepEcho(const char* indent){
++void  KML_LineString::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	int   i;
+ 	bool  flag=true;
+@@ -85,8 +80,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_LineString::Write {{{*/
+-void  KML_LineString::Write(FILE* filout,const char* indent){
++void  KML_LineString::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	int   i;
+ 
+@@ -113,8 +107,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_LineString::Read {{{*/
+-void  KML_LineString::Read(FILE* fid,char* kstr){
++void  KML_LineString::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	char*        kstri;
+ 	int          ncom=0;
+@@ -170,8 +163,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_LineString::WriteExp {{{*/
+-void  KML_LineString::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
++void  KML_LineString::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){/*{{{*/
+ 
+ 	int     i;
+ 	double  *lat,*lon,*x,*y;
+Index: ../trunk-jpl/src/c/kml/KML_Overlay.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_Overlay.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_Overlay.cpp	(revision 18063)
+@@ -17,8 +17,7 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_Overlay::KML_Overlay(){{{*/
+-KML_Overlay::KML_Overlay(){
++KML_Overlay::KML_Overlay(){/*{{{*/
+ 
+ 	strcpy(color     ,"ffffffff");
+ 	memcpy(color,"ffffffff",(strlen("ffffffff")+1)*sizeof(char));
+@@ -28,8 +27,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_Overlay::~KML_Overlay(){{{*/
+-KML_Overlay::~KML_Overlay(){
++KML_Overlay::~KML_Overlay(){/*{{{*/
+ 
+ 	if (icon) {
+ 		delete icon;
+@@ -40,8 +38,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_Overlay::Echo {{{*/
+-void  KML_Overlay::Echo(){
++void  KML_Overlay::Echo(){/*{{{*/
+ 
+ 	KML_Feature::Echo();
+ 	_printf0_("         color: \"" << color << "\"\n");
+@@ -49,8 +46,7 @@
+ 	_printf0_("          icon: " << icon << "\n");
+ }
+ /*}}}*/
+-/*FUNCTION KML_Overlay::DeepEcho {{{*/
+-void  KML_Overlay::DeepEcho(){
++void  KML_Overlay::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -59,8 +55,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Overlay::DeepEcho {{{*/
+-void  KML_Overlay::DeepEcho(const char* indent){
++void  KML_Overlay::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	char  indent2[81];
+ 	KML_Feature::DeepEcho(indent);
+@@ -76,8 +71,7 @@
+ 		_printf0_(indent << "          icon: " << icon << "\n");
+ }
+ /*}}}*/
+-/*FUNCTION KML_Overlay::Write {{{*/
+-void  KML_Overlay::Write(FILE* filout,const char* indent){
++void  KML_Overlay::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	char  indent2[81];
+ 
+@@ -96,8 +90,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Overlay::Read {{{*/
+-void  KML_Overlay::Read(FILE* fid,char* kstr){
++void  KML_Overlay::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ /*  process field within opening and closing tags  */
+ 
+Index: ../trunk-jpl/src/c/kml/KML_Container.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_Container.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_Container.cpp	(revision 18063)
+@@ -20,15 +20,13 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_Container::KML_Container(){{{*/
+-KML_Container::KML_Container(){
++KML_Container::KML_Container(){/*{{{*/
+ 
+ 	feature   =new DataSet;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_Container::~KML_Container(){{{*/
+-KML_Container::~KML_Container(){
++KML_Container::~KML_Container(){/*{{{*/
+ 
+ 	if (feature) {
+ 		delete feature;
+@@ -39,8 +37,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_Container::Echo {{{*/
+-void  KML_Container::Echo(){
++void  KML_Container::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -51,8 +48,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Container::DeepEcho {{{*/
+-void  KML_Container::DeepEcho(){
++void  KML_Container::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -61,8 +57,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Container::DeepEcho {{{*/
+-void  KML_Container::DeepEcho(const char* indent){
++void  KML_Container::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	int   i;
+ 	char  indent2[81];
+@@ -87,8 +82,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Container::Write {{{*/
+-void  KML_Container::Write(FILE* filout,const char* indent){
++void  KML_Container::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	int   i;
+ 	char  indent2[81];
+@@ -107,8 +101,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Container::Read {{{*/
+-void  KML_Container::Read(FILE* fid,char* kstr){
++void  KML_Container::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	KML_Object*  kobj;
+ 
+@@ -153,8 +146,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Container::WriteExp {{{*/
+-void  KML_Container::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
++void  KML_Container::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){/*{{{*/
+ 
+ 	int   i;
+ 
+Index: ../trunk-jpl/src/c/kml/KML_Polygon.cpp
+===================================================================
+--- ../trunk-jpl/src/c/kml/KML_Polygon.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/kml/KML_Polygon.cpp	(revision 18063)
+@@ -17,8 +17,7 @@
+ /*}}}*/
+ 
+ /*Constructors/destructor/copy*/
+-/*FUNCTION KML_Polygon::KML_Polygon(){{{*/
+-KML_Polygon::KML_Polygon(){
++KML_Polygon::KML_Polygon(){/*{{{*/
+ 
+ 	extrude   =false;
+ 	tessellate=false;
+@@ -29,8 +28,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION KML_Polygon::~KML_Polygon(){{{*/
+-KML_Polygon::~KML_Polygon(){
++KML_Polygon::~KML_Polygon(){/*{{{*/
+ 
+ 	if (inner) {
+ 		delete inner;
+@@ -46,8 +44,7 @@
+ /*}}}*/
+ 
+ /*Other*/
+-/*FUNCTION KML_Polygon::Echo {{{*/
+-void  KML_Polygon::Echo(){
++void  KML_Polygon::Echo(){/*{{{*/
+ 
+ 	bool  flag=true;
+ 
+@@ -63,8 +60,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Polygon::DeepEcho {{{*/
+-void  KML_Polygon::DeepEcho(){
++void  KML_Polygon::DeepEcho(){/*{{{*/
+ 
+ 	char  indent[81]="";
+ 
+@@ -73,8 +69,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Polygon::DeepEcho {{{*/
+-void  KML_Polygon::DeepEcho(const char* indent){
++void  KML_Polygon::DeepEcho(const char* indent){/*{{{*/
+ 
+ 	int   i;
+ 	char  indent2[81];
+@@ -111,8 +106,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Polygon::Write {{{*/
+-void  KML_Polygon::Write(FILE* filout,const char* indent){
++void  KML_Polygon::Write(FILE* filout,const char* indent){/*{{{*/
+ 
+ 	int   i;
+ 	char  indent4[81];
+@@ -151,8 +145,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Polygon::Read {{{*/
+-void  KML_Polygon::Read(FILE* fid,char* kstr){
++void  KML_Polygon::Read(FILE* fid,char* kstr){/*{{{*/
+ 
+ 	char*        kstri;
+ 	char*        kstrj;
+@@ -258,8 +251,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION KML_Polygon::WriteExp {{{*/
+-void  KML_Polygon::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){
++void  KML_Polygon::WriteExp(FILE* fid,const char* nstr,int sgn,double cm,double sp){/*{{{*/
+ 
+ 	int   i;
+ 	char  nstr2[81];
+Index: ../trunk-jpl/src/c/shared/Numerics/Synchronize.sh
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/Synchronize.sh	(revision 18062)
++++ ../trunk-jpl/src/c/shared/Numerics/Synchronize.sh	(revision 18063)
+@@ -115,16 +115,14 @@
+ 
+ /*Verbosity Setup*/
+ static int verbositylevel=-1;
+-/*FUNCTION SetVerbosityLevel {{{*/
+-void SetVerbosityLevel(int level){
++void SetVerbosityLevel(int level){/*{{{*/
+ 
+ 	if(level<0) _error_("vebosity level should be a positive integer (user provided " << level << ")");
+ 
+ 	verbositylevel = level;
+ 
+ }/*}}}*/
+-/*FUNCTION GetVerbosityLevel {{{*/
+-int  GetVerbosityLevel(void){
++int  GetVerbosityLevel(void){/*{{{*/
+ 	_assert_(verbositylevel>=0);
+ 	return verbositylevel;
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp	(revision 18063)
+@@ -8,8 +8,7 @@
+ #include "../Numerics/constants.h"
+ 
+ /*General Gauss points*/
+-/*FUNCTION GaussLegendreLinear {{{*/
+-void GaussLegendreLinear( IssmPDouble** pxgaus, IssmPDouble** pxwgt, int ngaus){
++void GaussLegendreLinear( IssmPDouble** pxgaus, IssmPDouble** pxwgt, int ngaus){/*{{{*/
+ 	/* Gauss-Legendre quadrature points.
+ 
+ 		The recurrence coefficients for Legendre polynomials on (-1,1)
+@@ -92,8 +91,7 @@
+ 		xDelete<IssmPDouble>(alpha);
+ 	}
+ }/*}}}*/
+-/*FUNCTION GaussLegendreTria{{{*/
+-void GaussLegendreTria( int* pngaus, IssmDouble** pl1, IssmDouble** pl2, IssmDouble** pl3, IssmDouble** pwgt, int iord ) {
++void GaussLegendreTria( int* pngaus, IssmDouble** pl1, IssmDouble** pl2, IssmDouble** pl3, IssmDouble** pwgt, int iord ) {/*{{{*/
+ 	/*Gauss quadrature points for the triangle.
+ 
+ 	  Higher-order points from D.A. Dunavant, "High Degree Efficient
+@@ -1209,8 +1207,7 @@
+ 
+ 	return;
+ }/*}}}*/
+-/*FUNCTION GaussLegendreTetra{{{*/
+-void GaussLegendreTetra( int* pngaus, IssmDouble** pl1, IssmDouble** pl2, IssmDouble** pl3, IssmDouble** pl4, IssmDouble** pwgt, int iord ) {
++void GaussLegendreTetra( int* pngaus, IssmDouble** pl1, IssmDouble** pl2, IssmDouble** pl3, IssmDouble** pl4, IssmDouble** pwgt, int iord ) {/*{{{*/
+ 	/* Gauss quadrature points for the tetrahedron.
+ 
+ 		p=2-3 points from Y. Jinyun, "Symmetric Gaussian Quadrature
+@@ -1472,8 +1469,7 @@
+ 		xDelete<IssmPDouble>(xgaus);
+ 	}
+ }/*}}}*/
+-/*FUNCTION GaussLobatto{{{*/
+-void GaussLobatto( IssmPDouble** pxgaus, IssmPDouble** pxwgt, int ngaus ) {
++void GaussLobatto( IssmPDouble** pxgaus, IssmPDouble** pxwgt, int ngaus ) {/*{{{*/
+ 	/*Gauss-Lobatto quadrature points.
+ 
+ 	  The recurrence coefficients for Legendre polynomials on (-1,1)
+@@ -1574,8 +1570,7 @@
+ 	}
+ 
+ }/*}}}*/
+-/*FUNCTION GaussRecur{{{*/
+-void GaussRecur( IssmPDouble* zero, IssmPDouble* weight, int n, IssmPDouble* alpha, IssmPDouble* beta ) {
++void GaussRecur( IssmPDouble* zero, IssmPDouble* weight, int n, IssmPDouble* alpha, IssmPDouble* beta ) {/*{{{*/
+ 	/*Gauss quadrature points from recursion coefficients.
+ 	 *
+ 	 *The routine uses the algorithm from the ORTHPOL routine GAUSS, which
+@@ -1697,16 +1692,14 @@
+ }/*}}}*/
+ 
+ /*Element Gauss points TO BE REMOVED*/
+-/*FUNCTION gaussQuad{{{*/
+-void gaussQuad( IssmPDouble** pxgaus, IssmPDouble** pxwgt, IssmPDouble** pegaus, IssmPDouble** pewgt, int nigaus, int njgaus ) {
++void gaussQuad( IssmPDouble** pxgaus, IssmPDouble** pxwgt, IssmPDouble** pegaus, IssmPDouble** pewgt, int nigaus, int njgaus ) {/*{{{*/
+ 	/*Gauss quadrature points for the quadrilaterial.*/
+ 
+ 	/*get the gauss points using the product of two line rules  */
+ 	GaussLegendreLinear(pxgaus, pxwgt, nigaus);
+ 	GaussLegendreLinear(pegaus, pewgt, njgaus);
+ }/*}}}*/
+-/*FUNCTION gaussHexa{{{*/
+-void gaussHexa( IssmPDouble** pxgaus, IssmPDouble** pxwgt, IssmPDouble** pegaus, IssmPDouble** pewgt, IssmPDouble** pzgaus, IssmPDouble ** pzwgt, int nigaus, int njgaus, int nkgaus ) {
++void gaussHexa( IssmPDouble** pxgaus, IssmPDouble** pxwgt, IssmPDouble** pegaus, IssmPDouble** pewgt, IssmPDouble** pzgaus, IssmPDouble ** pzwgt, int nigaus, int njgaus, int nkgaus ) {/*{{{*/
+ 	/*Gauss quadrature points for the hexahedron.*/
+ 
+ 	/*  get the gauss points using the product of three line rules  */
+Index: ../trunk-jpl/src/c/shared/Numerics/Verbosity.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/Verbosity.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/shared/Numerics/Verbosity.cpp	(revision 18063)
+@@ -30,16 +30,14 @@
+ 
+ /*Verbosity Setup*/
+ static int verbositylevel=-1;
+-/*FUNCTION SetVerbosityLevel {{{*/
+-void SetVerbosityLevel(int level){
++void SetVerbosityLevel(int level){/*{{{*/
+ 
+ 	if(level<0) _error_("vebosity level should be a positive integer (user provided " << level << ")");
+ 
+ 	verbositylevel = level;
+ 
+ }/*}}}*/
+-/*FUNCTION GetVerbosityLevel {{{*/
+-int  GetVerbosityLevel(void){
++int  GetVerbosityLevel(void){/*{{{*/
+ 	_assert_(verbositylevel>=0);
+ 	return verbositylevel;
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 18063)
+@@ -14,8 +14,7 @@
+ #include "../MemOps/MemOps.h"
+ /*}}}*/
+ 
+-/*FUNCTION TripleMultiply {{{*/
+-int TripleMultiply(IssmDouble* a, int nrowa, int ncola, int itrna, IssmDouble* b, int nrowb, int ncolb, int itrnb, IssmDouble* c, int nrowc, int ncolc, int itrnc, IssmDouble* d, int iaddd){
++int TripleMultiply(IssmDouble* a, int nrowa, int ncola, int itrna, IssmDouble* b, int nrowb, int ncolb, int itrnb, IssmDouble* c, int nrowc, int ncolc, int itrnc, IssmDouble* d, int iaddd){/*{{{*/
+ 	/*TripleMultiply    Perform triple matrix product a*b*c+d.*/
+ 
+ 	int         idima,idimb,idimc,idimd;
+@@ -76,8 +75,7 @@
+ 
+ 	return 1;
+ }/*}}}*/
+-/*FUNCTION MatrixMuliply {{{*/
+-int MatrixMultiply(IssmDouble* a, int nrowa, int ncola, int itrna, IssmDouble* b, int nrowb, int ncolb, int itrnb, IssmDouble* c, int iaddc ){
++int MatrixMultiply(IssmDouble* a, int nrowa, int ncola, int itrna, IssmDouble* b, int nrowb, int ncolb, int itrnb, IssmDouble* c, int iaddc ){/*{{{*/
+ 	/*MatrixMultiply    Perform matrix multiplication a*b+c.*/
+ 	int noerr=1;
+ 	int i,j,k,ipta,iptb,iptc;
+@@ -138,8 +136,7 @@
+ 
+ 	return noerr;
+ }/*}}}*/
+-/*FUNCTION MatrixInverse {{{*/
+-int MatrixInverse( IssmDouble* a, int ndim, int nrow, IssmDouble* b, int nvec, IssmDouble* pdet ){
++int MatrixInverse( IssmDouble* a, int ndim, int nrow, IssmDouble* b, int nvec, IssmDouble* pdet ){/*{{{*/
+ 	/* MatrixInverse    Perform matrix inversion and linear equation solution.
+ 
+ 		This function uses Gaussian elimination on the original matrix
+@@ -311,16 +308,14 @@
+ 	xDelete<int>(pindx);
+ 	return noerr;
+ }/*}}}*/
+-/*FUNCTION Matrix2x2Determinant(IssmDouble* Adet,IssmDouble* A) {{{*/
+-void Matrix2x2Determinant(IssmDouble* Adet,IssmDouble* A){
++void Matrix2x2Determinant(IssmDouble* Adet,IssmDouble* A){/*{{{*/
+ 	/*Compute determinant of a 2x2 matrix*/
+ 
+ 	/*det = a*d - c*b*/
+ 	*Adet= A[0]*A[3]-A[2]*A[1];
+ }
+ /*}}}*/
+-/*FUNCTION Matrix2x2Invert(IssmDouble* Ainv,IssmDouble* A) {{{*/
+-void Matrix2x2Invert(IssmDouble* Ainv,IssmDouble* A){
++void Matrix2x2Invert(IssmDouble* Ainv,IssmDouble* A){/*{{{*/
+ 
+ 	/*Intermediaries*/
+ 	IssmDouble det;
+@@ -336,16 +331,14 @@
+ 	Ainv[3]=   A[0]/det; /* =  a/det */
+ 
+ }/*}}}*/
+-/*FUNCTION Matrix3x3Determinant(IssmDouble* Adet,IssmDouble* A) {{{*/
+-void Matrix3x3Determinant(IssmDouble* Adet,IssmDouble* A){
++void Matrix3x3Determinant(IssmDouble* Adet,IssmDouble* A){/*{{{*/
+ 	/*Compute determinant of a 3x3 matrix*/
+ 
+ 	/*det = a*(e*i-f*h)-b*(d*i-f*g)+c*(d*h-e*g)*/
+ 	*Adet= A[0]*A[4]*A[8]-A[0]*A[5]*A[7]-A[3]*A[1]*A[8]+A[3]*A[2]*A[7]+A[6]*A[1]*A[5]-A[6]*A[2]*A[4];
+ }
+ /*}}}*/
+-/*FUNCTION Matrix3x3Invert(IssmDouble* Ainv,IssmDouble* A) {{{*/
+-void Matrix3x3Invert(IssmDouble* Ainv,IssmDouble* A){
++void Matrix3x3Invert(IssmDouble* Ainv,IssmDouble* A){/*{{{*/
+ 
+ 	/*Intermediaries*/
+ 	IssmDouble det;
+@@ -366,8 +359,7 @@
+ 	Ainv[8]=(A[0]*A[4]-A[1]*A[3])/det; /* = (a*e-b*d)/det */
+ 
+ }/*}}}*/
+-/*FUNCTION Matrix3x3Solve(IssmDouble* X,IssmDouble* A,IssmDouble* B) {{{*/
+-void Matrix3x3Solve(IssmDouble* X,IssmDouble* A,IssmDouble* B){
++void Matrix3x3Solve(IssmDouble* X,IssmDouble* A,IssmDouble* B){/*{{{*/
+ 
+ 	IssmDouble Ainv[3][3];
+ 
+@@ -375,7 +367,6 @@
+ 	for(int i=0;i<3;i++) X[i]=Ainv[i][0]*B[0] + Ainv[i][1]*B[1] + Ainv[i][2]*B[2];
+ 
+ }/*}}}*/
+-/*FUNCTION Matrix4x4Solve(IssmDouble* X,IssmDouble* A,IssmDouble *B) {{{*/
+-void Matrix4x4Solve(IssmDouble* X,IssmDouble* A,IssmDouble *B){
++void Matrix4x4Solve(IssmDouble* X,IssmDouble* A,IssmDouble *B){/*{{{*/
+ 	_error_("STOP");
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp	(revision 18063)
+@@ -9,8 +9,7 @@
+ #include "../MemOps/MemOps.h"
+ 
+ #define RIFTPENALTYPAIRSWIDTH 8
+-/*FUNCTION IsGridOnRift{{{*/
+-int IsGridOnRift(int* riftsegments, int nriftsegs, int node){
++int IsGridOnRift(int* riftsegments, int nriftsegs, int node){/*{{{*/
+ 
+ 	/*Does this node belong to 4 elements, or just 2? If it belongs to 4 elements, it is inside a rift, 
+ 	 *if it belongs to 2 elements, it is on the tip of a rift, or it has already been split across the rift (see below).*/
+@@ -32,8 +31,7 @@
+ 		return 0;
+ 	}
+ }/*}}}*/
+-/*FUNCTION GridElementsList{{{*/
+-int GridElementsList(int** pGridElements, int* pNumGridElements,int node,int* index,int nel){
++int GridElementsList(int** pGridElements, int* pNumGridElements,int node,int* index,int nel){/*{{{*/
+ 
+ 	/*From a node, recover all the elements that are connected to it: */
+ 	int i,j;
+@@ -86,8 +84,7 @@
+ 	*pNumGridElements=NumGridElements;
+ 	return noerr;
+ }/*}}}*/
+-/*FUNCTION IsNeighbor{{{*/
+-int IsNeighbor(int el1,int el2,int* index){
++int IsNeighbor(int el1,int el2,int* index){/*{{{*/
+ 	/*From a triangulation held in index, figure out if elements 1 and 2 have two nodes in common: */
+ 	int i,j;
+ 	int count=0;
+@@ -103,8 +100,7 @@
+ 		return 0;
+ 	}
+ }/*}}}*/
+-/*FUNCTION IsOnRift{{{*/
+-int IsOnRift(int el,int nriftsegs,int* riftsegments){
++int IsOnRift(int el,int nriftsegs,int* riftsegments){/*{{{*/
+ 	/*From a list of elements segments, figure out if el belongs to it: */
+ 	int i;
+ 	for (i=0;i<nriftsegs;i++){
+@@ -114,8 +110,7 @@
+ 	}
+ 	return 0;
+ }/*}}}*/
+-/*FUNCTION RiftSegmentsFromSegments{{{*/
+-void RiftSegmentsFromSegments(int* pnriftsegs, int** priftsegments, int nel,int* index,int nsegs,int* segments){
++void RiftSegmentsFromSegments(int* pnriftsegs, int** priftsegments, int nel,int* index,int nsegs,int* segments){/*{{{*/
+ 
+ 	int i,counter;
+ 	int el,el2;
+@@ -180,8 +175,7 @@
+ 	*priftsegments=riftsegments;
+ 	*pnriftsegs=nriftsegs;
+ }/*}}}*/
+-/*FUNCTION DetermineGridElementListOnOneSideOfRift{{{*/
+-int DetermineGridElementListOnOneSideOfRift(int* pNumGridElementListOnOneSideOfRift, int** pGridElementListOnOneSideOfRift, int segmentnumber, int nriftsegs, int* riftsegments, int node,int* index,int nel){
++int DetermineGridElementListOnOneSideOfRift(int* pNumGridElementListOnOneSideOfRift, int** pGridElementListOnOneSideOfRift, int segmentnumber, int nriftsegs, int* riftsegments, int node,int* index,int nel){/*{{{*/
+ 
+ 	int noerr=1;
+ 	int k,l,counter;
+@@ -244,8 +238,7 @@
+ 	*pGridElementListOnOneSideOfRift=GridElementListOnOneSideOfRift;
+ 	return noerr;
+ }/*}}}*/
+-/*FUNCTION UpdateSegments{{{*/
+-int UpdateSegments(int** psegments,int** psegmentmarkerlist, int* pnsegs,int* index, double* x,double* y,int* riftsegments,int nriftsegs,int nods,int nel){
++int UpdateSegments(int** psegments,int** psegmentmarkerlist, int* pnsegs,int* index, double* x,double* y,int* riftsegments,int nriftsegs,int nods,int nel){/*{{{*/
+ 
+ 	int noerr=1;
+ 	int i,j,k;
+@@ -343,8 +336,7 @@
+ 
+ 	return noerr;
+ }/*}}}*/
+-/*FUNCTION FindElement{{{*/
+-int FindElement(int A,int B,int* index,int nel){
++int FindElement(int A,int B,int* index,int nel){/*{{{*/
+ 
+ 	int el=-1;
+ 	for (int n=0;n<nel;n++){
+@@ -355,8 +347,7 @@
+ 	}
+ 	return el;
+ }/*}}}*/
+-/*FUNCTION SplitRiftSegments{{{*/
+-int SplitRiftSegments(int** psegments,int** psegmentmarkerlist, int* pnumsegs, int* pnumrifts,int** priftsnumsegs,int*** priftssegments,int numrifts,int nods,int nel){
++int SplitRiftSegments(int** psegments,int** psegmentmarkerlist, int* pnumsegs, int* pnumrifts,int** priftsnumsegs,int*** priftssegments,int numrifts,int nods,int nel){/*{{{*/
+ 
+ 	/*Using segment markers, wring out the rift segments from the segments. Rift markers are 
+ 	 *of the form 2+i where i=0 to number of rifts */
+@@ -442,8 +433,7 @@
+ 	*priftsnumsegs=riftsnumsegs;
+ 	return noerr;
+ }/*}}}*/
+-/*FUNCTION PairRiftElements{{{*/
+-int PairRiftElements(int** priftsnumpairs,int*** priftspairs,int numrifts,int* riftsnumsegments,int** riftssegments,double* x,double* y){
++int PairRiftElements(int** priftsnumpairs,int*** priftspairs,int numrifts,int* riftsnumsegments,int** riftssegments,double* x,double* y){/*{{{*/
+ 
+ 	int noerr=1;
+ 	int i,j,k;
+@@ -489,8 +479,7 @@
+ 	*priftspairs=riftspairs;
+ 	return noerr;
+ }/*}}}*/
+-/*FUNCTION IsRiftPresent{{{*/
+-int IsRiftPresent(int* priftflag,int* pnumrifts,int* segmentmarkerlist,int nsegs){
++int IsRiftPresent(int* priftflag,int* pnumrifts,int* segmentmarkerlist,int nsegs){/*{{{*/
+ 
+ 	int i;
+ 	int noerr=1;
+@@ -516,8 +505,7 @@
+ 	*pnumrifts=numrifts;
+ 	return noerr;
+ }/*}}}*/
+-/*FUNCTION OrderRifts{{{*/
+-int OrderRifts(int** priftstips,int** riftssegments,int** riftspairs,int numrifts,int* riftsnumsegments,double* x,double* y,int nods,int nels){
++int OrderRifts(int** priftstips,int** riftssegments,int** riftspairs,int numrifts,int* riftsnumsegments,double* x,double* y,int nods,int nels){/*{{{*/
+ 
+ 	int noerr=1;
+ 	int i,j,k,counter;
+@@ -671,8 +659,7 @@
+ 	*priftstips=riftstips;
+ 	return noerr;
+ }/*}}}*/
+-/*FUNCTION PenaltyPairs{{{*/
+-int PenaltyPairs(double*** priftspenaltypairs,int** priftsnumpenaltypairs,int numrifts,int** riftssegments,
++int PenaltyPairs(double*** priftspenaltypairs,int** priftsnumpenaltypairs,int numrifts,int** riftssegments,/*{{{*/
+ 		int* riftsnumsegs,int** riftspairs,int* riftstips,double* x,double* y){
+ 
+ 	int noerr=1;
+Index: ../trunk-jpl/src/c/shared/Elements/DrainageFunctionWaterfraction.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Elements/DrainageFunctionWaterfraction.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/shared/Elements/DrainageFunctionWaterfraction.cpp	(revision 18063)
+@@ -6,7 +6,6 @@
+ #include "../Numerics/types.h"
+ #include "../Exceptions/exceptions.h"
+ 
+-/*FUNCTION IssmDouble DrainageFunctionWaterfraction()*/
+ IssmDouble DrainageFunctionWaterfraction(IssmDouble waterfraction, IssmDouble dt=0.){
+ 	/* DrainageFunctionWaterfraction returns how much of the waterfraction is drained per year */
+ 	_assert_(waterfraction>=0.);
+Index: ../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp	(revision 18063)
+@@ -55,8 +55,7 @@
+ 	xDelete<IssmDouble>(phi_ungrounding);
+ }
+ 
+-/*FUNCTION ContactFSLevelset{{{*/
+-IssmDouble*    ContactFSLevelset(Elements* elements,Vertices* vertices){ 
++IssmDouble*    ContactFSLevelset(Elements* elements,Vertices* vertices){ /*{{{*/
+ 
+ 	Vector<IssmDouble>* vertexgrounded = NULL;
+ 	Vector<IssmDouble>* vertexfloating = NULL;
+@@ -107,8 +106,7 @@
+ 	return phi;
+ }
+ /*}}}*/
+-/*FUNCTION PotentialUngrounding {{{*/
+-IssmDouble*    PotentialUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters){ 
++IssmDouble*    PotentialUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters){ /*{{{*/
+ 
+ 	int                 i,numberofvertices;
+ 	IssmDouble*         vertices_potentially_ungrounding      = NULL;
+@@ -134,8 +132,7 @@
+ 	return vertices_potentially_ungrounding;
+ }
+ /*}}}*/
+-/*FUNCTION PropagateFloatingiceToGroundedNeighbors {{{*/
+-IssmDouble*    PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,IssmDouble* vertices_potentially_ungrounding){ 
++IssmDouble*    PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,IssmDouble* vertices_potentially_ungrounding){ /*{{{*/
+ 	int                 i,analysis_type;
+ 	int                 nflipped,local_nflipped;
+ 	IssmDouble*         phi                                  = NULL;
+Index: ../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 18063)
+@@ -10,8 +10,7 @@
+ #ifdef _HAVE_GSL_
+ #include <gsl/gsl_linalg.h>
+ #endif
+-/*FUNCTION Krigingx{{{*/
+-int Krigingx(double** ppredictions,double **perror,double* obs_x, double* obs_y, double* obs_list, int obs_length,double* x_interp,double* y_interp,int n_interp,Options* options){
++int   Krigingx(double** ppredictions,double **perror,double* obs_x, double* obs_y, double* obs_list, int obs_length,double* x_interp,double* y_interp,int n_interp,Options* options){/*{{{*/
+ 
+ 	/*output*/
+ 	double *predictions = NULL;
+@@ -188,8 +187,7 @@
+ 	*perror       = error;
+ 	return 1;
+ }/*}}}*/
+-/*FUNCTION Krigingxt{{{*/
+-void* Krigingxt(void* vpthread_handle){
++void* Krigingxt(void* vpthread_handle){/*{{{*/
+ 
+ 	/*gate variables :*/
+ 	KrigingxThreadStruct *gate        = NULL;
+@@ -235,8 +233,7 @@
+ 
+ 	return NULL;
+ }/*}}}*/
+-/*FUNCTION NearestNeighbort{{{*/
+-void* NearestNeighbort(void* vpthread_handle){
++void* NearestNeighbort(void* vpthread_handle){/*{{{*/
+ 
+ 	/*gate variables :*/
+ 	KrigingxThreadStruct *gate        = NULL;
+@@ -281,8 +278,7 @@
+ 
+ 	return NULL;
+ }/*}}}*/
+-/*FUNCTION idwt{{{*/
+-void* idwt(void* vpthread_handle){
++void* idwt(void* vpthread_handle){/*{{{*/
+ 
+ 	/*gate variables :*/
+ 	KrigingxThreadStruct *gate        = NULL;
+@@ -327,8 +323,7 @@
+ 	}
+ 	return NULL;
+ }/*}}}*/
+-/*FUNCTION v4t{{{*/
+-void* v4t(void* vpthread_handle){
++void* v4t(void* vpthread_handle){/*{{{*/
+ 
+ 	/*gate variables :*/
+ 	KrigingxThreadStruct *gate        = NULL;
+@@ -372,8 +367,7 @@
+ 	}
+ 	return NULL;
+ }/*}}}*/
+-/*FUNCTION Distancest{{{*/
+-void* Distancest(void* vpthread_handle){
++void* Distancest(void* vpthread_handle){/*{{{*/
+ 
+ 	/*gate variables :*/
+ 	KrigingxThreadStruct *gate        = NULL;
+Index: ../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 18063)
+@@ -8,8 +8,7 @@
+ #include "../../classes/classes.h"
+ #include "../../shared/io/io.h"
+ 
+-/*FUNCTION pKrigingx{{{*/
+-int pKrigingx(double** ppredictions,double **perror,double* obs_x, double* obs_y, double* obs_list, int obs_length,double* x_interp,double* y_interp,int n_interp,Options* options){
++int pKrigingx(double** ppredictions,double **perror,double* obs_x, double* obs_y, double* obs_list, int obs_length,double* x_interp,double* y_interp,int n_interp,Options* options){/*{{{*/
+ 
+ #ifdef _HAVE_MPI_
+ 	int num_procs;
+Index: ../trunk-jpl/src/c/toolkits/objects/Vector.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/objects/Vector.h	(revision 18062)
++++ ../trunk-jpl/src/c/toolkits/objects/Vector.h	(revision 18063)
+@@ -127,8 +127,7 @@
+ 		/*}}}*/
+ 
+ 		/*Vector specific routines*/
+-		/*FUNCTION Echo{{{*/
+-		void Echo(void){_assert_(this);
++		void Echo(void){_assert_(this);/*{{{*/
+ 
+ 			if(type==PetscVecType){
+ 				#ifdef _HAVE_PETSC_
+@@ -139,8 +138,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Assemble{{{*/
+-		void Assemble(void){_assert_(this);
++		void Assemble(void){_assert_(this);/*{{{*/
+ 
+ 			if(type==PetscVecType){
+ 				#ifdef _HAVE_PETSC_
+@@ -151,8 +149,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION SetValues{{{*/
+-		void SetValues(int ssize, int* list, doubletype* values, InsMode mode){ _assert_(this);
++		void SetValues(int ssize, int* list, doubletype* values, InsMode mode){ _assert_(this);/*{{{*/
+ 			if(type==PetscVecType){
+ 				#ifdef _HAVE_PETSC_
+ 				this->pvector->SetValues(ssize,list,values,mode);
+@@ -162,8 +159,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION SetValue{{{*/
+-		void SetValue(int dof, doubletype value, InsMode mode){_assert_(this);
++		void SetValue(int dof, doubletype value, InsMode mode){_assert_(this);/*{{{*/
+ 
+ 			if(type==PetscVecType){
+ 				#ifdef _HAVE_PETSC_
+@@ -174,8 +170,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION GetValue{{{*/
+-		void GetValue(doubletype* pvalue,int dof){_assert_(this);
++		void GetValue(doubletype* pvalue,int dof){_assert_(this);/*{{{*/
+ 
+ 			if(type==PetscVecType){
+ 				#ifdef _HAVE_PETSC_
+@@ -186,8 +181,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION GetSize{{{*/
+-		void GetSize(int* pM){_assert_(this);
++		void GetSize(int* pM){_assert_(this);/*{{{*/
+ 
+ 			if(type==PetscVecType){
+ 				#ifdef _HAVE_PETSC_
+@@ -198,8 +192,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IsEmpty{{{*/
+-		bool IsEmpty(void){
++		bool IsEmpty(void){/*{{{*/
+ 			int M;
+ 
+ 			_assert_(this);
+@@ -211,8 +204,7 @@
+ 				return false;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION GetLocalSize{{{*/
+-		void GetLocalSize(int* pM){_assert_(this);
++		void GetLocalSize(int* pM){_assert_(this);/*{{{*/
+ 
+ 			if(type==PetscVecType){
+ 				#ifdef _HAVE_PETSC_
+@@ -223,8 +215,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Duplicate{{{*/
+-		Vector<doubletype>* Duplicate(void){_assert_(this);
++		Vector<doubletype>* Duplicate(void){_assert_(this);/*{{{*/
+ 
+ 			Vector<doubletype>* output=NULL;
+ 
+@@ -241,8 +232,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Set{{{*/
+-		void Set(doubletype value){_assert_(this);
++		void Set(doubletype value){_assert_(this);/*{{{*/
+ 
+ 			if(type==PetscVecType){
+ 				#ifdef _HAVE_PETSC_
+@@ -253,8 +243,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION AXPY{{{*/
+-		void AXPY(Vector* X, doubletype a){_assert_(this);
++		void AXPY(Vector* X, doubletype a){_assert_(this);/*{{{*/
+ 
+ 			if(type==PetscVecType){
+ 				#ifdef _HAVE_PETSC_
+@@ -265,8 +254,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION AYPX{{{*/
+-		void AYPX(Vector* X, doubletype a){_assert_(this);
++		void AYPX(Vector* X, doubletype a){_assert_(this);/*{{{*/
+ 
+ 			if(type==PetscVecType){
+ 				#ifdef _HAVE_PETSC_
+@@ -276,8 +264,7 @@
+ 			else this->ivector->AYPX(X->ivector,a);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION ToMPISerial{{{*/
+-		doubletype* ToMPISerial(void){
++		doubletype* ToMPISerial(void){/*{{{*/
+ 
+ 			doubletype* vec_serial=NULL;
+ 
+@@ -293,8 +280,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Copy{{{*/
+-		void Copy(Vector* to){_assert_(this);
++		void Copy(Vector* to){_assert_(this);/*{{{*/
+ 
+ 			if(type==PetscVecType){
+ 				#ifdef _HAVE_PETSC_
+@@ -304,8 +290,7 @@
+ 			else this->ivector->Copy(to->ivector);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Max{{{*/
+-		doubletype Max(void){_assert_(this);
++		doubletype Max(void){_assert_(this);/*{{{*/
+ 
+ 			doubletype max=0;
+ 
+@@ -318,8 +303,7 @@
+ 			return max;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Norm{{{*/
+-		doubletype Norm(NormMode norm_type){_assert_(this);
++		doubletype Norm(NormMode norm_type){_assert_(this);/*{{{*/
+ 
+ 			doubletype norm=0;
+ 
+@@ -332,8 +316,7 @@
+ 			return norm;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Scale{{{*/
+-		void Scale(doubletype scale_factor){_assert_(this);
++		void Scale(doubletype scale_factor){_assert_(this);/*{{{*/
+ 
+ 			if(type==PetscVecType){
+ 				#ifdef _HAVE_PETSC_
+@@ -343,8 +326,7 @@
+ 			else this->ivector->Scale(scale_factor);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Dot{{{*/
+-		doubletype Dot(Vector* vector){_assert_(this);
++		doubletype Dot(Vector* vector){_assert_(this);/*{{{*/
+ 
+ 			doubletype dot;
+ 
+@@ -357,8 +339,7 @@
+ 			return dot;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION PointwiseDivide{{{*/
+-		void PointwiseDivide(Vector* x,Vector* y){_assert_(this);
++		void PointwiseDivide(Vector* x,Vector* y){_assert_(this);/*{{{*/
+ 
+ 			if(type==PetscVecType){
+ 				#ifdef _HAVE_PETSC_
+Index: ../trunk-jpl/src/c/toolkits/objects/Matrix.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/objects/Matrix.h	(revision 18062)
++++ ../trunk-jpl/src/c/toolkits/objects/Matrix.h	(revision 18063)
+@@ -35,13 +35,11 @@
+ 		IssmMat<doubletype>   *imatrix;
+ 
+ 		/*Matrix constructors, destructors*/
+-		/*FUNCTION Matrix(){{{*/
+-		Matrix(){
++		Matrix(){/*{{{*/
+ 			InitCheckAndSetType();
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Matrix(int M,int N){{{*/
+-		Matrix(int M,int N){
++		Matrix(int M,int N){/*{{{*/
+ 
+ 			InitCheckAndSetType();
+ 
+@@ -56,8 +54,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Matrix(int m,int n,int M,int N,int* d_nnz,int* o_nnz){{{*/
+-		Matrix(int m,int n,int M,int N,int* d_nnz,int* o_nnz){
++		Matrix(int m,int n,int M,int N,int* d_nnz,int* o_nnz){/*{{{*/
+ 
+ 			InitCheckAndSetType();
+ 
+@@ -72,8 +69,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Matrix(int M,int N,IssmDouble sparsity){{{*/
+-		Matrix(int M,int N,double sparsity){
++		Matrix(int M,int N,double sparsity){/*{{{*/
+ 
+ 			InitCheckAndSetType();
+ 
+@@ -87,8 +83,7 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity){{{*/
+-		Matrix(IssmPDouble* serial_mat,int M,int N,IssmPDouble sparsity){
++		Matrix(IssmPDouble* serial_mat,int M,int N,IssmPDouble sparsity){/*{{{*/
+ 
+ 			InitCheckAndSetType();
+ 
+@@ -103,8 +98,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Matrix(int M,int N,int connectivity,int numberofdofspernode){{{*/
+-		Matrix(int M,int N,int connectivity,int numberofdofspernode){
++		Matrix(int M,int N,int connectivity,int numberofdofspernode){/*{{{*/
+ 
+ 			InitCheckAndSetType();
+ 
+@@ -119,8 +113,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION ~Matrix(){{{*/
+-		~Matrix(){
++		~Matrix(){/*{{{*/
+ 
+ 			if(type==PetscMatType){
+ 				#ifdef _HAVE_PETSC_
+@@ -131,8 +124,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION InitCheckAndSetType(){{{*/
+-		void InitCheckAndSetType(void){
++		void InitCheckAndSetType(void){/*{{{*/
+ 
+ 			char* toolkittype=NULL;
+ 
+@@ -164,8 +156,7 @@
+ 		/*}}}*/
+ 
+ 		/*Matrix specific routines:*/
+-		/*FUNCTION Echo{{{*/
+-		void Echo(void){
++		void Echo(void){/*{{{*/
+ 			_assert_(this);
+ 
+ 			if(type==PetscMatType){
+@@ -179,8 +170,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION AllocationInfo{{{*/
+-		void AllocationInfo(void){
++		void AllocationInfo(void){/*{{{*/
+ 			_assert_(this);
+ 			if(type==PetscMatType){
+ 				#ifdef _HAVE_PETSC_
+@@ -192,8 +182,7 @@
+ 				_error_("not supported yet");
+ 			}
+ 		}/*}}}*/
+-		/*FUNCTION Assemble{{{*/
+-		void Assemble(void){
++		void Assemble(void){/*{{{*/
+ 
+ 			if(type==PetscMatType){
+ 				#ifdef _HAVE_PETSC_
+@@ -205,8 +194,7 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Norm{{{*/
+-		IssmDouble Norm(NormMode norm_type){
++		IssmDouble Norm(NormMode norm_type){/*{{{*/
+ 
+ 			IssmDouble norm=0;
+ 
+@@ -222,8 +210,7 @@
+ 			return norm;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION GetSize{{{*/
+-		void GetSize(int* pM,int* pN){
++		void GetSize(int* pM,int* pN){/*{{{*/
+ 
+ 			if(type==PetscMatType){
+ 				#ifdef _HAVE_PETSC_
+@@ -236,8 +223,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION GetLocalSize{{{*/
+-		void GetLocalSize(int* pM,int* pN){
++		void GetLocalSize(int* pM,int* pN){/*{{{*/
+ 
+ 			if(type==PetscMatType){
+ 				#ifdef _HAVE_PETSC_
+@@ -250,8 +236,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION MatMult{{{*/
+-		void MatMult(Vector<doubletype>* X,Vector<doubletype>* AX){
++		void MatMult(Vector<doubletype>* X,Vector<doubletype>* AX){/*{{{*/
+ 
+ 			if(type==PetscMatType){
+ 				#ifdef _HAVE_PETSC_
+@@ -264,8 +249,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Duplicate{{{*/
+-		Matrix<doubletype>* Duplicate(void){
++		Matrix<doubletype>* Duplicate(void){/*{{{*/
+ 
+ 			Matrix<doubletype>* output=new Matrix<doubletype>();
+ 
+@@ -281,8 +265,7 @@
+ 			return output;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION ToSerial{{{*/
+-		doubletype* ToSerial(void){
++		doubletype* ToSerial(void){/*{{{*/
+ 
+ 			doubletype* output=NULL;
+ 
+@@ -298,8 +281,7 @@
+ 			return output;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION SetValues{{{*/
+-		void SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode){
++		void SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode){/*{{{*/
+ 
+ 			if(type==PetscMatType){
+ 				#ifdef _HAVE_PETSC_
+@@ -311,8 +293,7 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Convert{{{*/
+-		void Convert(MatrixType newtype){
++		void Convert(MatrixType newtype){/*{{{*/
+ 
+ 			if(type==PetscMatType){
+ 				#ifdef _HAVE_PETSC_
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h	(revision 18062)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h	(revision 18063)
+@@ -44,8 +44,7 @@
+ 		SparseRow<doubletype>** matrix;  /*here, doubletype is either IssmDouble or IssmPDouble*/
+ 		DataSet*    buckets;  /*here, we store buckets of values that we will Assemble into a global matrix.*/
+ 		/*IssmMpiSparseMat constructors, destructors*/
+-		/*FUNCTION IssmMpiSparseMat(){{{*/
+-		IssmMpiSparseMat(){
++		IssmMpiSparseMat(){/*{{{*/
+ 			this->M=0;
+ 			this->N=0;
+ 			this->m=0;
+@@ -53,19 +52,16 @@
+ 			this->buckets=new DataSet();
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmMpiSparseMat(int M,int N){{{*/
+-		IssmMpiSparseMat(int Min,int Nin){
++		IssmMpiSparseMat(int Min,int Nin){/*{{{*/
+ 			this->Init(Min,Nin);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmMpiSparseMat(int M,int N, doubletype sparsity){{{*/
+-		IssmMpiSparseMat(int pM,int pN, doubletype sparsity){
++		IssmMpiSparseMat(int pM,int pN, doubletype sparsity){/*{{{*/
+ 			/*no sparsity involved here, the sparsity pattern is resolve during the assemble phase: */
+ 			this->Init(pM,pN);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmMpiSparseMat(int m,int n,int M,int N,int* d_nnz,int* o_nnz){{{*/
+-		IssmMpiSparseMat(int min,int nin,int Min,int Nin,int* d_nnz,int* o_nnz){
++		IssmMpiSparseMat(int min,int nin,int Min,int Nin,int* d_nnz,int* o_nnz){/*{{{*/
+ 
+ 			int i;
+ 
+@@ -88,14 +84,12 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmMpiSparseMat(int M,int N, int connectivity, int numberofdofspernode){{{*/
+-		IssmMpiSparseMat(int pM,int pN, int connectivity,int numberofdofspernode){
++		IssmMpiSparseMat(int pM,int pN, int connectivity,int numberofdofspernode){/*{{{*/
+ 			/*this is not needed, sparsity pattern is resolved at assemble phase: */
+ 			this->Init(pM,pN);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmMpiSparseMat::Init(int Min,int Nin){{{*/
+-		void Init(int Min,int Nin){
++		void Init(int Min,int Nin){/*{{{*/
+ 			
+ 			int i;
+ 
+@@ -119,8 +113,7 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION ~IssmMpiSparseMat(){{{*/
+-		~IssmMpiSparseMat(){
++		~IssmMpiSparseMat(){/*{{{*/
+ 			int i;
+ 
+ 			if(m*N){
+@@ -137,8 +130,7 @@
+ 		/*}}}*/
+ 
+ 		/*IssmMpiSparseMat specific routines */
+-		/*FUNCTION Echo{{{*/
+-		void Echo(void){
++		void Echo(void){/*{{{*/
+ 
+ 			/*Do a synchronized dump across all the rows: */
+ 			int my_rank=IssmComm::GetRank();
+@@ -156,8 +148,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Assemble{{{*/
+-		void Assemble(){
++		void Assemble(){/*{{{*/
+ 
+ 			int           i,j;
+ 
+@@ -368,8 +359,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Norm{{{*/
+-		doubletype Norm(NormMode mode){
++		doubletype Norm(NormMode mode){/*{{{*/
+ 
+ 			doubletype norm,local_norm;
+ 			doubletype absolute;
+@@ -401,20 +391,17 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION GetSize{{{*/
+-		void GetSize(int* pM,int* pN){
++		void GetSize(int* pM,int* pN){/*{{{*/
+ 			*pM=M;
+ 			*pN=N;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION GetLocalSize{{{*/
+-		void GetLocalSize(int* pM,int* pN){
++		void GetLocalSize(int* pM,int* pN){/*{{{*/
+ 			*pM=m;
+ 			*pN=N;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION MatMult{{{*/
+-		void MatMult(IssmAbsVec<doubletype>* Xin,IssmAbsVec<doubletype>* AXin){
++		void MatMult(IssmAbsVec<doubletype>* Xin,IssmAbsVec<doubletype>* AXin){/*{{{*/
+ 
+ 			/*A check on the types: */
+ 			if(IssmVecTypeFromToolkitOptions()!=MpiEnum)_error_("MatMult operation only possible with 'mpi' vectors");
+@@ -436,20 +423,17 @@
+ 			xDelete<doubletype>(X_serial);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Duplicate{{{*/
+-		IssmMpiSparseMat<doubletype>* Duplicate(void){
++		IssmMpiSparseMat<doubletype>* Duplicate(void){/*{{{*/
+ 
+ 			_error_("not supported yet!");
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION ToSerial{{{*/
+-		doubletype* ToSerial(void){
++		doubletype* ToSerial(void){/*{{{*/
+ 			_error_("not supported yet!");
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION SetValues{{{*/
+-		void SetValues(int min,int* idxm,int nin,int* idxn,doubletype* values,InsMode mode){
++		void SetValues(int min,int* idxm,int nin,int* idxn,doubletype* values,InsMode mode){/*{{{*/
+ 
+ 			/*we need to store all the values we collect here in order to Assemble later. 
+ 			 * Indeed, the values we are collecting here most of the time will not belong 
+@@ -460,13 +444,11 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Convert{{{*/
+-		void Convert(MatrixType type){
++		void Convert(MatrixType type){/*{{{*/
+ 			_error_("not supported yet!");
+ 		}
+ 		/*}}}*/		
+-		/*FUNCTION BucketsBuildScatterBuffers{{{*/
+-		void BucketsBuildScatterBuffers(int** pnumvalues_forcpu,int** prow_indices_forcpu,int** pcol_indices_forcpu,doubletype** pvalues_forcpu,int** pmodes_forcpu,DataSet** bucketsforcpu,int num_procs){
++		void BucketsBuildScatterBuffers(int** pnumvalues_forcpu,int** prow_indices_forcpu,int** pcol_indices_forcpu,doubletype** pvalues_forcpu,int** pmodes_forcpu,DataSet** bucketsforcpu,int num_procs){/*{{{*/
+ 
+ 			/*intermediary: */
+ 			int         i,j;
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmMpiDenseMat.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmMpiDenseMat.h	(revision 18062)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmMpiDenseMat.h	(revision 18063)
+@@ -44,8 +44,7 @@
+ 		DataSet*    buckets;  /*here, we store buckets of values that we will Assemble into a global matrix.*/
+ 
+ 		/*IssmMpiDenseMat constructors, destructors*/
+-		/*FUNCTION IssmMpiDenseMat(){{{*/
+-		IssmMpiDenseMat(){
++		IssmMpiDenseMat(){/*{{{*/
+ 			this->M=0;
+ 			this->N=0;
+ 			this->m=0;
+@@ -53,19 +52,16 @@
+ 			this->buckets=new DataSet();
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmMpiDenseMat(int M,int N){{{*/
+-		IssmMpiDenseMat(int Min,int Nin){
++		IssmMpiDenseMat(int Min,int Nin){/*{{{*/
+ 			this->Init(Min,Nin);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmMpiDenseMat(int M,int N, doubletype sparsity){{{*/
+-		IssmMpiDenseMat(int pM,int pN, doubletype sparsity){
++		IssmMpiDenseMat(int pM,int pN, doubletype sparsity){/*{{{*/
+ 			/*no sparsity involved here, we are fully dense, so just use the previous constructor: */
+ 			this->Init(pM,pN);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmMpiDenseMat(int m,int n,int M,int N,int* d_nnz,int* o_nnz){{{*/
+-		IssmMpiDenseMat(int min,int nin,int Min,int Nin,int* d_nnz,int* o_nnz){
++		IssmMpiDenseMat(int min,int nin,int Min,int Nin,int* d_nnz,int* o_nnz){/*{{{*/
+ 			/*not needed, we are fully dense!: */
+ 
+ 			this->buckets=new DataSet();
+@@ -81,8 +77,7 @@
+ 			if (m*N)this->matrix=xNewZeroInit<doubletype>(this->m*N);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmMpiDenseMat(doubletype* serial_mat,int M,int N,doubletype sparsity){{{*/
+-		IssmMpiDenseMat(doubletype* serial_mat,int Min,int Nin,doubletype sparsity){
++		IssmMpiDenseMat(doubletype* serial_mat,int Min,int Nin,doubletype sparsity){/*{{{*/
+ 
+ 			/*Here, we assume that the serial_mat is local to the local cpu, and that it has 
+ 			 * the correct size (m rows by N colums), n determined by DetermineLocalSize: */
+@@ -98,14 +93,12 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmMpiDenseMat(int M,int N, int connectivity, int numberofdofspernode){{{*/
+-		IssmMpiDenseMat(int pM,int pN, int connectivity,int numberofdofspernode){
++		IssmMpiDenseMat(int pM,int pN, int connectivity,int numberofdofspernode){/*{{{*/
+ 			/*not needed, we are fully dense!: */
+ 			this->Init(pM,pN);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION ~IssmMpiDenseMat(){{{*/
+-		~IssmMpiDenseMat(){
++		~IssmMpiDenseMat(){/*{{{*/
+ 			xDelete<doubletype>(this->matrix);
+ 			M=0;
+ 			N=0;
+@@ -113,8 +106,7 @@
+ 			delete this->buckets;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmMpiDenseMat::Init(int Min,int Nin){{{*/
+-		void Init(int Min,int Nin){
++		void Init(int Min,int Nin){/*{{{*/
+ 
+ 			this->buckets=new DataSet();
+ 
+@@ -133,8 +125,7 @@
+ 		/*}}}*/
+ 
+ 		/*IssmMpiDenseMat specific routines */
+-		/*FUNCTION Echo{{{*/
+-		void Echo(void){
++		void Echo(void){/*{{{*/
+ 
+ 			int my_rank;
+ 			int i,j,k;
+@@ -157,8 +148,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Assemble{{{*/
+-		void Assemble(){
++		void Assemble(){/*{{{*/
+ 
+ 			int           i,j;
+ 
+@@ -312,8 +302,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Norm{{{*/
+-		doubletype Norm(NormMode mode){
++		doubletype Norm(NormMode mode){/*{{{*/
+ 
+ 			doubletype norm,local_norm;
+ 			doubletype absolute;
+@@ -351,20 +340,17 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION GetSize{{{*/
+-		void GetSize(int* pM,int* pN){
++		void GetSize(int* pM,int* pN){/*{{{*/
+ 			*pM=M;
+ 			*pN=N;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION GetLocalSize{{{*/
+-		void GetLocalSize(int* pM,int* pN){
++		void GetLocalSize(int* pM,int* pN){/*{{{*/
+ 			*pM=m;
+ 			*pN=N;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION MatMult{{{*/
+-		void MatMult(IssmAbsVec<doubletype>* Xin,IssmAbsVec<doubletype>* AXin){
++		void MatMult(IssmAbsVec<doubletype>* Xin,IssmAbsVec<doubletype>* AXin){/*{{{*/
+ 
+ 			int         i,j;
+ 			doubletype *X_serial  = NULL;
+@@ -391,21 +377,18 @@
+ 			xDelete<doubletype>(X_serial);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Duplicate{{{*/
+-		IssmMpiDenseMat<doubletype>* Duplicate(void){
++		IssmMpiDenseMat<doubletype>* Duplicate(void){/*{{{*/
+ 
+ 			IssmMpiDenseMat<doubletype>* dup=new IssmMpiDenseMat<doubletype>(this->matrix,this->M,this->N,0);
+ 			return dup;
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION ToSerial{{{*/
+-		doubletype* ToSerial(void){
++		doubletype* ToSerial(void){/*{{{*/
+ 			_error_("not supported yet!");
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION SetValues{{{*/
+-		void SetValues(int min,int* idxm,int nin,int* idxn,doubletype* values,InsMode mode){
++		void SetValues(int min,int* idxm,int nin,int* idxn,doubletype* values,InsMode mode){/*{{{*/
+ 
+ 			/*we need to store all the values we collect here in order to Assemble later. 
+ 			 * Indeed, the values we are collecting here most of the time will not belong 
+@@ -416,13 +399,11 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Convert{{{*/
+-		void Convert(MatrixType type){
++		void Convert(MatrixType type){/*{{{*/
+ 			_error_("not supported yet!");
+ 		}
+ 		/*}}}*/		
+-		/*FUNCTION BucketsBuildScatterBuffers{{{*/
+-		void BucketsBuildScatterBuffers(int** pnumvalues_forcpu,int** prow_indices_forcpu,int** pcol_indices_forcpu,doubletype** pvalues_forcpu,int** pmodes_forcpu,DataSet** bucketsforcpu,int num_procs){
++		void BucketsBuildScatterBuffers(int** pnumvalues_forcpu,int** prow_indices_forcpu,int** pcol_indices_forcpu,doubletype** pvalues_forcpu,int** pmodes_forcpu,DataSet** bucketsforcpu,int num_procs){/*{{{*/
+ 
+ 			/*intermediary: */
+ 			int         i,j;
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h	(revision 18062)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h	(revision 18063)
+@@ -41,8 +41,7 @@
+ 		DataSet*    buckets;  /*here, we store buckets of values that we will Assemble into a global vector.*/
+ 
+ 		/*IssmMpiVec constructors, destructors*/
+-		/*FUNCTION IssmMpiVec(){{{*/
+-		IssmMpiVec(){
++		IssmMpiVec(){/*{{{*/
+ 
+ 			this->M=0;
+ 			this->m=0;
+@@ -50,23 +49,19 @@
+ 			this->buckets=new DataSet();
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmMpiVec(int M){{{*/
+-		IssmMpiVec(int Min){
++		IssmMpiVec(int Min){/*{{{*/
+ 			this->Init(Min,false);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmMpiVec(int m,int M){{{*/
+-		IssmMpiVec(int min, int Min){
++		IssmMpiVec(int min, int Min){/*{{{*/
+ 			this->Init(min,true);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmMpiVec(int M,bool fromlocalsize){{{*/
+-		IssmMpiVec(int Min, bool fromlocalsize){
++		IssmMpiVec(int Min, bool fromlocalsize){/*{{{*/
+ 			this->Init(Min,fromlocalsize);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmMpiVec(doubletype* serial_vec,int M){{{*/
+-		IssmMpiVec(doubletype* buffer,int Min){
++		IssmMpiVec(doubletype* buffer,int Min){/*{{{*/
+ 
+ 			this->Init(Min,false);
+ 
+@@ -76,8 +71,7 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmMpiVec(doubletype* serial_vec,int M,int m){{{*/
+-		IssmMpiVec(doubletype* buffer,int Min,int min){
++		IssmMpiVec(doubletype* buffer,int Min,int min){/*{{{*/
+ 
+ 			this->vector=NULL;
+ 			this->buckets=new DataSet();
+@@ -90,8 +84,7 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmMpiVec::Init(int Min,bool fromlocalsize){{{*/
+-		void Init(int Min,bool fromlocalsize){
++		void Init(int Min,bool fromlocalsize){/*{{{*/
+ 
+ 			this->buckets=new DataSet();
+ 
+@@ -111,8 +104,7 @@
+ 			if (m)this->vector=xNewZeroInit<doubletype>(this->m);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION ~IssmMpiVec(){{{*/
+-		~IssmMpiVec(){
++		~IssmMpiVec(){/*{{{*/
+ 			xDelete<doubletype>(this->vector);
+ 			this->M=0;
+ 			this->m=0;
+@@ -121,8 +113,7 @@
+ 		/*}}}*/
+ 
+ 		/*IssmMpiVec specific routines*/
+-		/*FUNCTION Echo{{{*/
+-		void Echo(void){
++		void Echo(void){/*{{{*/
+ 
+ 			int i,j;
+ 
+@@ -139,8 +130,7 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Assemble{{{*/
+-		void Assemble(){
++		void Assemble(){/*{{{*/
+ 
+ 			int           i,j;
+ 
+@@ -284,8 +274,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION SetValues{{{*/
+-		void SetValues(int ssize, int* list, doubletype* values, InsMode mode){
++		void SetValues(int ssize, int* list, doubletype* values, InsMode mode){/*{{{*/
+ 
+ 			/*we need to store all the values we collect here in order to Assemble later. 
+ 			 * Indeed, the values we are collecting here most of the time will not belong 
+@@ -296,8 +285,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION SetValue{{{*/
+-		void SetValue(int dof, doubletype value, InsMode mode){
++		void SetValue(int dof, doubletype value, InsMode mode){/*{{{*/
+ 
+ 			/*we need to store the value we collect here in order to Assemble later. 
+ 			 * Indeed, the value we are collecting here most of the time will not belong 
+@@ -307,42 +295,36 @@
+ 			buckets->AddObject(new Bucket<doubletype>(1,&dof,&value, mode));
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION GetValue{{{*/
+-		void GetValue(doubletype* pvalue,int dof){
++		void GetValue(doubletype* pvalue,int dof){/*{{{*/
+ 			_error_("Get value on a MpiVec vector not implemented yet!");
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION GetSize{{{*/
+-		void GetSize(int* pM){
++		void GetSize(int* pM){/*{{{*/
+ 
+ 			*pM=this->M;
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION GetLocalSize{{{*/
+-		void GetLocalSize(int* pM){
++		void GetLocalSize(int* pM){/*{{{*/
+ 
+ 			*pM=this->m;
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Duplicate{{{*/
+-		IssmMpiVec<doubletype>* Duplicate(void){
++		IssmMpiVec<doubletype>* Duplicate(void){/*{{{*/
+ 
+ 			return new IssmMpiVec<doubletype>(this->vector,this->M,this->m);
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Set{{{*/
+-		void Set(doubletype value){
++		void Set(doubletype value){/*{{{*/
+ 
+ 			int i;
+ 			for(i=0;i<this->m;i++)this->vector[i]=value;
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION AXPY{{{*/
+-		void AXPY(IssmAbsVec<doubletype>* Xin, doubletype a){
++		void AXPY(IssmAbsVec<doubletype>* Xin, doubletype a){/*{{{*/
+ 
+ 			int i;
+ 
+@@ -356,8 +338,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION AYPX{{{*/
+-		void AYPX(IssmAbsVec<doubletype>* Xin, doubletype a){
++		void AYPX(IssmAbsVec<doubletype>* Xin, doubletype a){/*{{{*/
+ 			int i;
+ 
+ 			/*Assume X is of the correct type, and downcast: */
+@@ -370,8 +351,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION ToMPISerial{{{*/
+-		doubletype* ToMPISerial(void){
++		doubletype* ToMPISerial(void){/*{{{*/
+ 
+ 			/*communicator info: */
+ 			ISSM_MPI_Comm comm;
+@@ -415,8 +395,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Copy{{{*/
+-		void Copy(IssmAbsVec<doubletype>* toin){
++		void Copy(IssmAbsVec<doubletype>* toin){/*{{{*/
+ 
+ 			int i;
+ 
+@@ -430,8 +409,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Norm{{{*/
+-		doubletype Norm(NormMode mode){
++		doubletype Norm(NormMode mode){/*{{{*/
+ 
+ 			doubletype local_norm;
+ 			doubletype norm;
+@@ -458,16 +436,14 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Scale{{{*/
+-		void Scale(doubletype scale_factor){
++		void Scale(doubletype scale_factor){/*{{{*/
+ 
+ 			int i;
+ 			for(i=0;i<this->M;i++)this->vector[i]=scale_factor*this->vector[i];
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Dot{{{*/
+-		doubletype Dot(IssmAbsVec<doubletype>* inputin){
++		doubletype Dot(IssmAbsVec<doubletype>* inputin){/*{{{*/
+ 
+ 			int i;
+ 			doubletype local_dot=0;
+@@ -487,8 +463,7 @@
+ 			return dot;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION PointwiseDivide{{{*/
+-		void PointwiseDivide(IssmAbsVec<doubletype>* xin,IssmAbsVec<doubletype>* yin){
++		void PointwiseDivide(IssmAbsVec<doubletype>* xin,IssmAbsVec<doubletype>* yin){/*{{{*/
+ 
+ 			int i;
+ 
+@@ -503,8 +478,7 @@
+ 			for(i=0;i<this->m;i++)this->vector[i]=x->vector[i]/y->vector[i];
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION BucketsBuildScatterBuffers{{{*/
+-		void BucketsBuildScatterBuffers(int** pnumvalues_forcpu,int** prow_indices_forcpu,doubletype** pvalues_forcpu,int** pmodes_forcpu,DataSet** bucketsforcpu,int num_procs){
++		void BucketsBuildScatterBuffers(int** pnumvalues_forcpu,int** prow_indices_forcpu,doubletype** pvalues_forcpu,int** pmodes_forcpu,DataSet** bucketsforcpu,int num_procs){/*{{{*/
+ 
+ 			/*intermediary: */
+ 			int         i,j;
+Index: ../trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h	(revision 18062)
++++ ../trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h	(revision 18063)
+@@ -36,39 +36,34 @@
+ 		int M;
+ 
+ 		/*IssmSeqVec constructors, destructors*/
+-		/*FUNCTION IssmSeqVec(){{{*/
+-		IssmSeqVec(){
++		IssmSeqVec(){/*{{{*/
+ 
+ 			this->M=0;
+ 			this->vector=NULL;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmSeqVec(int M){{{*/
+-		IssmSeqVec(int pM){
++		IssmSeqVec(int pM){/*{{{*/
+ 
+ 			this->M=pM;
+ 			this->vector=NULL;
+ 			if(this->M) this->vector=xNewZeroInit<doubletype>(pM);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmSeqVec(int m,int M){{{*/
+-		IssmSeqVec(int pm,int pM){
++		IssmSeqVec(int pm,int pM){/*{{{*/
+ 
+ 			this->M=pM;
+ 			this->vector=NULL;
+ 			if(this->M) this->vector=xNewZeroInit<doubletype>(pM);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmSeqVec(int M,bool fromlocalsize){{{*/
+-		IssmSeqVec(int pM,bool fromlocalsize){
++		IssmSeqVec(int pM,bool fromlocalsize){/*{{{*/
+ 
+ 			this->M=pM;
+ 			this->vector=NULL;
+ 			if(this->M) this->vector=xNewZeroInit<doubletype>(pM);
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmSeqVec(doubletype* serial_vec,int M){{{*/
+-		IssmSeqVec(doubletype* buffer,int pM){
++		IssmSeqVec(doubletype* buffer,int pM){/*{{{*/
+ 
+ 			this->M=pM;
+ 			this->vector=NULL;
+@@ -78,16 +73,14 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION ~IssmSeqVec(){{{*/
+-		~IssmSeqVec(){
++		~IssmSeqVec(){/*{{{*/
+ 			if(this->M)xDelete<doubletype>(this->vector);
+ 			M=0;
+ 		}
+ 		/*}}}*/
+ 
+ 		/*IssmSeqVec specific routines*/
+-		/*FUNCTION Echo{{{*/
+-		void Echo(void){
++		void Echo(void){/*{{{*/
+ 
+ 			int i;
+ 			_printf_("IssmSeqVec size " << this->M << "\n");
+@@ -96,15 +89,13 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Assemble{{{*/
+-		void Assemble(void){
++		void Assemble(void){/*{{{*/
+ 
+ 			/*do nothing*/
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION SetValues{{{*/
+-		void SetValues(int ssize, int* list, doubletype* values, InsMode mode){
++		void SetValues(int ssize, int* list, doubletype* values, InsMode mode){/*{{{*/
+ 
+ 			int i;
+ 			switch(mode){
+@@ -121,8 +112,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION SetValue{{{*/
+-		void SetValue(int dof, doubletype value, InsMode mode){
++		void SetValue(int dof, doubletype value, InsMode mode){/*{{{*/
+ 
+ 			switch(mode){
+ 				case ADD_VAL:
+@@ -137,44 +127,38 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION GetValue{{{*/
+-		void GetValue(doubletype* pvalue,int dof){
++		void GetValue(doubletype* pvalue,int dof){/*{{{*/
+ 
+ 			*pvalue=this->vector[dof];
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION GetSize{{{*/
+-		void GetSize(int* pM){
++		void GetSize(int* pM){/*{{{*/
+ 
+ 			*pM=this->M;
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION GetLocalSize{{{*/
+-		void GetLocalSize(int* pM){
++		void GetLocalSize(int* pM){/*{{{*/
+ 
+ 			*pM=this->M;
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Duplicate{{{*/
+-		IssmSeqVec<doubletype>* Duplicate(void){
++		IssmSeqVec<doubletype>* Duplicate(void){/*{{{*/
+ 
+ 			return new IssmSeqVec<doubletype>(this->vector,this->M);
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Set{{{*/
+-		void Set(doubletype value){
++		void Set(doubletype value){/*{{{*/
+ 
+ 			int i;
+ 			for(i=0;i<this->M;i++)this->vector[i]=value;
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION AXPY{{{*/
+-		void AXPY(IssmAbsVec<doubletype>* Xin, doubletype a){
++		void AXPY(IssmAbsVec<doubletype>* Xin, doubletype a){/*{{{*/
+ 
+ 			int i;
+ 
+@@ -188,8 +172,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION AYPX{{{*/
+-		void AYPX(IssmAbsVec<doubletype>* Xin, doubletype a){
++		void AYPX(IssmAbsVec<doubletype>* Xin, doubletype a){/*{{{*/
+ 
+ 			int i;
+ 
+@@ -203,8 +186,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION ToMPISerial{{{*/
+-		doubletype* ToMPISerial(void){
++		doubletype* ToMPISerial(void){/*{{{*/
+ 
+ 			doubletype* buffer=NULL;
+ 
+@@ -216,8 +198,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Copy{{{*/
+-		void Copy(IssmAbsVec<doubletype>* toin){
++		void Copy(IssmAbsVec<doubletype>* toin){/*{{{*/
+ 
+ 			int i;
+ 
+@@ -231,8 +212,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Norm{{{*/
+-		doubletype Norm(NormMode mode){
++		doubletype Norm(NormMode mode){/*{{{*/
+ 
+ 			doubletype norm;
+ 			int i;
+@@ -254,16 +234,14 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Scale{{{*/
+-		void Scale(doubletype scale_factor){
++		void Scale(doubletype scale_factor){/*{{{*/
+ 
+ 			int i;
+ 			for(i=0;i<this->M;i++)this->vector[i]=scale_factor*this->vector[i];
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Dot{{{*/
+-		doubletype Dot(IssmAbsVec<doubletype>* inputin){
++		doubletype Dot(IssmAbsVec<doubletype>* inputin){/*{{{*/
+ 
+ 			int i;
+ 
+@@ -278,8 +256,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION PointwiseDivide{{{*/
+-		void PointwiseDivide(IssmAbsVec<doubletype>* xin,IssmAbsVec<doubletype>* yin){
++		void PointwiseDivide(IssmAbsVec<doubletype>* xin,IssmAbsVec<doubletype>* yin){/*{{{*/
+ 
+ 			int i;
+ 
+Index: ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 18063)
+@@ -18,8 +18,7 @@
+ /*}}}*/
+ 
+ /*PetscMat constructors and destructor*/
+-/*FUNCTION PetscMat::PetscMat(){{{*/
+-PetscMat::PetscMat(){
++PetscMat::PetscMat(){/*{{{*/
+ 	this->matrix=NULL;
+ 	#ifdef _HAVE_ADOLC_
+ 	this->amatrix=NULL;
+@@ -27,20 +26,17 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscMat::PetscMat(int M,int N){{{*/
+-PetscMat::PetscMat(int M,int N){
++PetscMat::PetscMat(int M,int N){/*{{{*/
+ 
+ 	this->matrix=NewMat(M,N,IssmComm::GetComm());
+ }
+ /*}}}*/
+-/*FUNCTION PetscMat::PetscMat(int M,int N, IssmDouble sparsity){{{*/
+-PetscMat::PetscMat(int M,int N, IssmDouble sparsity){
++PetscMat::PetscMat(int M,int N, IssmDouble sparsity){/*{{{*/
+ 
+ 	this->matrix=NewMat(M,N,sparsity,IssmComm::GetComm());
+ }
+ /*}}}*/
+-/*FUNCTION PetscMat::PetscMat(int m,int n,int M,int N,int* d_nnz,int* o_nnz){{{*/
+-PetscMat::PetscMat(int m,int n,int M,int N,int* d_nnz,int* o_nnz){
++PetscMat::PetscMat(int m,int n,int M,int N,int* d_nnz,int* o_nnz){/*{{{*/
+ 
+ 	MatCreate(IssmComm::GetComm(),&this->matrix);
+ 	MatSetSizes(this->matrix,m,n,M,N);
+@@ -50,8 +46,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscMat::PetscMat(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity){{{*/
+-PetscMat::PetscMat(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity){
++PetscMat::PetscMat(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity){/*{{{*/
+ 
+ 	int     i;
+ 	int* idxm=NULL;
+@@ -73,22 +68,19 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscMat::PetscMat(int M,int N, int connectivity, int numberofdofspernode){{{*/
+-PetscMat::PetscMat(int M,int N, int connectivity,int numberofdofspernode){
++PetscMat::PetscMat(int M,int N, int connectivity,int numberofdofspernode){/*{{{*/
+ 
+ 	this->matrix=NewMat(M,N,connectivity,numberofdofspernode,IssmComm::GetComm());
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscMat::~PetscMat(){{{*/
+-PetscMat::~PetscMat(){
++PetscMat::~PetscMat(){/*{{{*/
+ 	MatFree(&this->matrix);
+ }
+ /*}}}*/
+ 
+ /*PetscMat specific routines: */
+-/*FUNCTION PetscMat::AllocationInfo{{{*/
+-void PetscMat::AllocationInfo(void){
++void PetscMat::AllocationInfo(void){/*{{{*/
+ 
+ 	MatInfo info;
+ 	MatGetInfo(this->matrix,MAT_GLOBAL_SUM,&info);
+@@ -102,14 +94,12 @@
+ 	_printf0_("========================================================================================\n");
+ }
+ /*}}}*/
+-/*FUNCTION PetscMat::Echo{{{*/
+-void PetscMat::Echo(void){
++void PetscMat::Echo(void){/*{{{*/
+ 
+ 	MatView(this->matrix,PETSC_VIEWER_STDOUT_WORLD);
+ }
+ /*}}}*/
+-/*FUNCTION PetscMat::Assemble{{{*/
+-void PetscMat::Assemble(void){
++void PetscMat::Assemble(void){/*{{{*/
+ 
+ 	_assert_(this->matrix);
+ 	MatAssemblyBegin(this->matrix,MAT_FINAL_ASSEMBLY);
+@@ -117,8 +107,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscMat::Norm{{{*/
+-IssmDouble PetscMat::Norm(NormMode mode){
++IssmDouble PetscMat::Norm(NormMode mode){/*{{{*/
+ 
+ 	IssmDouble norm=0;
+ 	_assert_(this->matrix);
+@@ -128,23 +117,20 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscMat::GetSize{{{*/
+-void PetscMat::GetSize(int* pM,int* pN){
++void PetscMat::GetSize(int* pM,int* pN){/*{{{*/
+ 
+ 	_assert_(this->matrix);
+ 	MatGetSize(this->matrix,pM,pN);
+ }
+ /*}}}*/
+-/*FUNCTION PetscMat::GetLocalSize{{{*/
+-void PetscMat::GetLocalSize(int* pM,int* pN){
++void PetscMat::GetLocalSize(int* pM,int* pN){/*{{{*/
+ 
+ 	_assert_(this->matrix);
+ 	MatGetLocalSize(this->matrix,pM,pN);
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscMat::MatMult{{{*/
+-void PetscMat::MatMult(PetscVec* X,PetscVec* AX){
++void PetscMat::MatMult(PetscVec* X,PetscVec* AX){/*{{{*/
+ 
+ 	_assert_(this->matrix);
+ 	_assert_(X->vector);
+@@ -152,8 +138,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscMat::Duplicate{{{*/
+-PetscMat* PetscMat::Duplicate(void){
++PetscMat* PetscMat::Duplicate(void){/*{{{*/
+ 
+ 	PetscMat* output=new PetscMat();
+ 	_assert_(this->matrix);
+@@ -163,8 +148,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscMat::ToSerial{{{*/
+-IssmDouble* PetscMat::ToSerial(void){
++IssmDouble* PetscMat::ToSerial(void){/*{{{*/
+ 
+ 	 IssmDouble* output=NULL;
+ 
+@@ -173,8 +157,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscMat::SetValues{{{*/
+-void PetscMat::SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode){
++void PetscMat::SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode){/*{{{*/
+ 
+ 	PetscErrorCode ierr;
+ 	ierr = MatSetValues(this->matrix,m,idxm,n,idxn,values,ISSMToPetscInsertMode(mode));
+@@ -182,8 +165,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscMat::Convert{{{*/
+-void PetscMat::Convert(MatrixType type){
++void PetscMat::Convert(MatrixType type){/*{{{*/
+ 
+ 	MatConvert(this->matrix,ISSMToPetscMatrixType(type),MAT_REUSE_MATRIX,&this->matrix);
+ 
+Index: ../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp	(revision 18063)
+@@ -18,23 +18,20 @@
+ /*}}}*/
+ 
+ /*PetscVec constructors and destructor*/
+-/*FUNCTION PetscVec::PetscVec(){{{*/
+-PetscVec::PetscVec(){
++PetscVec::PetscVec(){/*{{{*/
+ 	this->vector=NULL;
+ 	#ifdef _HAVE_ADOLC_
+ 	this->avector=NULL;
+ 	#endif
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::PetscVec(int M,bool fromlocalsize){{{*/
+-PetscVec::PetscVec(int M,bool fromlocalsize){
++PetscVec::PetscVec(int M,bool fromlocalsize){/*{{{*/
+ 
+ 	this->vector=NewVec(M,IssmComm::GetComm(),fromlocalsize);
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::PetscVec(int m,int M){{{*/
+-PetscVec::PetscVec(int m,int M){
++PetscVec::PetscVec(int m,int M){/*{{{*/
+ 
+ 	VecCreate(IssmComm::GetComm(),&this->vector);
+ 	VecSetSizes(this->vector,m,M);
+@@ -43,8 +40,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::PetscVec(Vec petsc_vec){{{*/
+-PetscVec::PetscVec(Vec petsc_vec){
++PetscVec::PetscVec(Vec petsc_vec){/*{{{*/
+ 
+ 	if(petsc_vec==NULL){
+ 		this->vector=NewVec(0,IssmComm::GetComm());
+@@ -57,8 +53,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::PetscVec(IssmDouble* serial_vec,int M){{{*/
+-PetscVec::PetscVec(IssmDouble* serial_vec,int M){
++PetscVec::PetscVec(IssmDouble* serial_vec,int M){/*{{{*/
+ 
+ 	int* idxm=NULL;
+ 	if(M)idxm=xNew<int>(M);
+@@ -72,22 +67,19 @@
+ 	xDelete<int>(idxm);
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::~PetscVec(){{{*/
+-PetscVec::~PetscVec(){
++PetscVec::~PetscVec(){/*{{{*/
+     VecFree(&this->vector);
+ }
+ /*}}}*/
+ 
+ /*PetscVec specific routines: */
+-/*FUNCTION PetscVec::Echo{{{*/
+-void PetscVec::Echo(void){
++void PetscVec::Echo(void){/*{{{*/
+ 
+ 	_assert_(this->vector);
+ 	VecView(this->vector,PETSC_VIEWER_STDOUT_WORLD);
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::Assemble{{{*/
+-void PetscVec::Assemble(void){
++void PetscVec::Assemble(void){/*{{{*/
+ 
+ 	_assert_(this->vector);
+ 	VecAssemblyBegin(this->vector); 
+@@ -95,48 +87,42 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::SetValues{{{*/
+-void PetscVec::SetValues(int ssize, int* list, IssmDouble* values, InsMode mode){
++void PetscVec::SetValues(int ssize, int* list, IssmDouble* values, InsMode mode){/*{{{*/
+ 
+ 	_assert_(this->vector);
+ 	VecSetValues(this->vector,ssize,list,values,ISSMToPetscInsertMode(mode));
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::SetValue{{{*/
+-void PetscVec::SetValue(int dof, IssmDouble value, InsMode mode){
++void PetscVec::SetValue(int dof, IssmDouble value, InsMode mode){/*{{{*/
+ 
+ 	_assert_(this->vector);
+ 	VecSetValues(this->vector,1,&dof,&value,ISSMToPetscInsertMode(mode));
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::GetValue{{{*/
+-void PetscVec::GetValue(IssmDouble* pvalue,int dof){
++void PetscVec::GetValue(IssmDouble* pvalue,int dof){/*{{{*/
+ 
+ 	_assert_(this->vector);
+ 	VecGetValues(this->vector,1,&dof,pvalue);
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::GetSize{{{*/
+-void PetscVec::GetSize(int* pM){
++void PetscVec::GetSize(int* pM){/*{{{*/
+ 
+ 	_assert_(this->vector);
+ 	VecGetSize(this->vector,pM);
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::GetLocalSize{{{*/
+-void PetscVec::GetLocalSize(int* pM){
++void PetscVec::GetLocalSize(int* pM){/*{{{*/
+ 
+ 	_assert_(this->vector);
+ 	VecGetLocalSize(this->vector,pM);
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::Duplicate{{{*/
+-PetscVec* PetscVec::Duplicate(void){
++PetscVec* PetscVec::Duplicate(void){/*{{{*/
+ 
+ 	_assert_(this->vector);
+ 	Vec vec_output=NULL;
+@@ -147,32 +133,28 @@
+ 	return output;
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::Set{{{*/
+-void PetscVec::Set(IssmDouble value){
++void PetscVec::Set(IssmDouble value){/*{{{*/
+ 
+ 	_assert_(this->vector);
+ 	VecSet(this->vector,value);
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::AXPY{{{*/
+-void PetscVec::AXPY(PetscVec* X, IssmDouble a){
++void PetscVec::AXPY(PetscVec* X, IssmDouble a){/*{{{*/
+ 
+ 	_assert_(this->vector);
+ 	VecAXPY(this->vector,a,X->vector);
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::AYPX{{{*/
+-void PetscVec::AYPX(PetscVec* X, IssmDouble a){
++void PetscVec::AYPX(PetscVec* X, IssmDouble a){/*{{{*/
+ 
+ 	_assert_(this->vector);
+ 	VecAYPX(this->vector,a,X->vector);
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::ToMPISerial{{{*/
+-IssmDouble* PetscVec::ToMPISerial(void){
++IssmDouble* PetscVec::ToMPISerial(void){/*{{{*/
+ 
+ 	IssmDouble* vec_serial=NULL;
+ 	VecToMPISerial(&vec_serial, this->vector,IssmComm::GetComm());
+@@ -180,15 +162,13 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::Copy{{{*/
+-void PetscVec::Copy(PetscVec* to){
++void PetscVec::Copy(PetscVec* to){/*{{{*/
+ 
+ 	if(this->vector) VecCopy(this->vector,to->vector);
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::Max{{{*/
+-IssmDouble PetscVec::Max(void){
++IssmDouble PetscVec::Max(void){/*{{{*/
+ 
+ 	_assert_(this->vector);
+ 
+@@ -198,8 +178,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::Norm{{{*/
+-IssmDouble PetscVec::Norm(NormMode mode){
++IssmDouble PetscVec::Norm(NormMode mode){/*{{{*/
+ 
+ 	IssmDouble norm=0;
+ 	_assert_(this->vector);
+@@ -208,16 +187,14 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::Scale{{{*/
+-void PetscVec::Scale(IssmDouble scale_factor){
++void PetscVec::Scale(IssmDouble scale_factor){/*{{{*/
+ 
+ 	_assert_(this->vector);
+ 	VecScale(this->vector,scale_factor); 
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::Dot{{{*/
+-IssmDouble PetscVec::Dot(PetscVec* input){
++IssmDouble PetscVec::Dot(PetscVec* input){/*{{{*/
+ 
+ 	IssmDouble dot;
+ 	_assert_(this->vector);
+@@ -226,8 +203,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PetscVec::PointwiseDivide{{{*/
+-void PetscVec::PointwiseDivide(PetscVec* x,PetscVec* y){
++void PetscVec::PointwiseDivide(PetscVec* x,PetscVec* y){/*{{{*/
+ 
+ 	_assert_(this->vector);
+ 	VecPointwiseDivide(this->vector,x->vector,y->vector);
+Index: ../trunk-jpl/src/c/classes/Vertex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Vertex.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/classes/Vertex.cpp	(revision 18063)
+@@ -15,13 +15,11 @@
+ /*}}}*/
+ 
+ /*Vertex constructors and destructor:*/
+-/*FUNCTION Vertex::Vertex() {{{*/
+-Vertex::Vertex(){
++Vertex::Vertex(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Vertex::Vertex(int vertex_id, int vertex_sid,int i, IoModel* iomodel) {{{*/
+-Vertex::Vertex(int vertex_id, int vertex_sid,int i, IoModel* iomodel){
++Vertex::Vertex(int vertex_id, int vertex_sid,int i, IoModel* iomodel){/*{{{*/
+ 
+ 	this->id           = vertex_id;
+ 	this->sid          = vertex_sid;
+@@ -48,15 +46,13 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Vertex::~Vertex() {{{*/
+-Vertex::~Vertex(){
++Vertex::~Vertex(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION Vertex::Echo{{{*/
+-void Vertex::Echo(void){
++void Vertex::Echo(void){/*{{{*/
+ 
+ 	_printf_("Vertex:\n");
+ 	_printf_("   id: " << id << "\n");
+@@ -72,23 +68,19 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Vertex::DeepEcho{{{*/
+-void Vertex::DeepEcho(void){
++void Vertex::DeepEcho(void){/*{{{*/
+ 	this->Echo();
+ }
+ /*}}}*/
+-/*FUNCTION Vertex::Id{{{*/
+-int    Vertex::Id(void){ return id; }
++int Vertex::Id(void){ return id; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION Vertex::ObjectEnum{{{*/
+-int Vertex::ObjectEnum(void){
++int Vertex::ObjectEnum(void){/*{{{*/
+ 
+ 	return VertexEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Vertex::copy {{{*/
+-Object* Vertex::copy() {
++Object* Vertex::copy() {/*{{{*/
+ 
+ 	return new Vertex(*this); 
+ 
+@@ -96,32 +88,25 @@
+ /*}}}*/
+ 
+ /*Vertex management: */
+-/*FUNCTION Vertex::Connectivity{{{*/
+-int    Vertex::Connectivity(void){return connectivity;}
++int        Vertex::Connectivity(void){return connectivity;}/*{{{*/
+ /*}}}*/
+-/*FUNCTION Vertex::GetX {{{*/
+-IssmDouble Vertex::GetX(){
++IssmDouble Vertex::GetX(){/*{{{*/
+ 	return this->x;
+ }
+ /*}}}*/
+-/*FUNCTION Vertex::GetY {{{*/
+-IssmDouble Vertex::GetY(){
++IssmDouble Vertex::GetY(){/*{{{*/
+ 	return this->y;
+ }
+ /*}}}*/
+-/*FUNCTION Vertex::GetZ {{{*/
+-IssmDouble Vertex::GetZ(){
++IssmDouble Vertex::GetZ(){/*{{{*/
+ 	return this->z;
+ }
+ /*}}}*/
+-/*FUNCTION Vertex::Sid{{{*/
+-int    Vertex::Sid(void){ return sid; }
++int        Vertex::Sid(void){ return sid; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION Vertex::Pid{{{*/
+-int    Vertex::Pid(void){ return pid; }
++int        Vertex::Pid(void){ return pid; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION Vertex::UpdatePosition {{{*/
+-void  Vertex::UpdatePosition(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz,Parameters* parameters,IssmDouble* surface,IssmDouble* bed){
++void       Vertex::UpdatePosition(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz,Parameters* parameters,IssmDouble* surface,IssmDouble* bed){/*{{{*/
+ 
+ 	IssmDouble oldy,newy,vely;
+ 	IssmDouble oldz,newz,velz;
+@@ -154,8 +139,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Vertex::DistributePids{{{*/
+-void  Vertex::DistributePids(int* ppidcount){
++void       Vertex::DistributePids(int* ppidcount){/*{{{*/
+ 
+ 	/*retrieve current pid*/
+ 	int pidcount=*ppidcount;
+@@ -171,8 +155,7 @@
+ 	*ppidcount=pidcount;
+ }
+ /*}}}*/
+-/*FUNCTION Vertex::OffsetPids{{{*/
+-void  Vertex::OffsetPids(int pidcount){
++void       Vertex::OffsetPids(int pidcount){/*{{{*/
+ 
+ 	/*This vertex is a clone, don't offset the pids*/
+ 	if(this->clone) return;
+@@ -181,8 +164,7 @@
+ 	this->pid+=pidcount;
+ }
+ /*}}}*/
+-/*FUNCTION Vertex::ShowTruePids{{{*/
+-void  Vertex::ShowTruePids(int* truepids){
++void       Vertex::ShowTruePids(int* truepids){/*{{{*/
+ 
+ 	/*Are we a clone? : */
+ 	if(this->clone)return;
+@@ -191,8 +173,7 @@
+ 	truepids[this->sid]=this->pid;
+ }
+ /*}}}*/
+-/*FUNCTION Vertex::UpdateClonePids{{{*/
+-void  Vertex::UpdateClonePids(int* alltruepids){
++void       Vertex::UpdateClonePids(int* alltruepids){/*{{{*/
+ 
+ 	/*If we are not a clone, don't update, we already have pids: */
+ 	if(!this->clone)return;
+@@ -202,8 +183,7 @@
+ 	this->pid=alltruepids[this->sid];
+ }
+ /*}}}*/
+-/*FUNCTION Vertex::SetClone {{{*/
+-void  Vertex::SetClone(int* minranks){
++void       Vertex::SetClone(int* minranks){/*{{{*/
+ 
+ 	int my_rank;
+ 
+@@ -221,8 +201,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Vertex::ToXYZ {{{*/
+-void  Vertex::ToXYZ(Matrix<IssmDouble>* matrix){
++void       Vertex::ToXYZ(Matrix<IssmDouble>* matrix){/*{{{*/
+ 
+ 	IssmDouble xyz[3];
+ 	int        indices[3];
+@@ -239,8 +218,7 @@
+ 	matrix->SetValues(1,&sid,3,&indices[0],&xyz[0],INS_VAL);
+ }
+ /*}}}*/
+-/*FUNCTION Vertex::VertexCoordinates {{{*/
+-void  Vertex::VertexCoordinates(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz){
++void       Vertex::VertexCoordinates(Vector<IssmDouble>* vx,Vector<IssmDouble>* vy,Vector<IssmDouble>* vz){/*{{{*/
+ 
+ 	if (this->clone==true) return;
+ 
+Index: ../trunk-jpl/src/c/classes/Profiler.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Profiler.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/classes/Profiler.cpp	(revision 18063)
+@@ -16,15 +16,13 @@
+ /*}}}*/
+ 
+ /*Profiler constructors and destructors:*/
+-/*FUNCTION Profiler::Profiler() default constructor {{{*/
+-Profiler::Profiler(){
++Profiler::Profiler(){/*{{{*/
+ 		 this->time=new Parameters();
+ 		 this->flops=new Parameters();
+ 		 this->memory=new Parameters();
+ }
+ /*}}}*/
+-/*FUNCTION Profiler::~Profiler(){{{*/
+-Profiler::~Profiler(){
++Profiler::~Profiler(){/*{{{*/
+ 	delete time;
+ 	delete flops;
+ 	delete memory;
+@@ -32,8 +30,7 @@
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION Profiler::Echo{{{*/
+-void Profiler::Echo(void){
++void Profiler::Echo(void){/*{{{*/
+ 
+ 	_printf_("Profiler:\n");
+ 	_printf_("   time tags: \n");
+@@ -41,8 +38,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Profiler::DeepEcho{{{*/
+-void Profiler::DeepEcho(void){
++void Profiler::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_("Profiler:\n");
+ 	_printf_("   time tags: \n");
+@@ -50,11 +46,9 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Profiler::Id{{{*/
+-int    Profiler::Id(void){ return -1; }
++int    Profiler::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION Profiler::ObjectEnum{{{*/
+-int Profiler::ObjectEnum(void){
++int Profiler::ObjectEnum(void){/*{{{*/
+ 
+ 	return ProfilerEnum;
+ 
+@@ -62,8 +56,7 @@
+ /*}}}*/
+ 
+ /*Profiler routines:*/
+-/*FUNCTION Profiler::Tag {{{*/
+-void  Profiler::Tag(int tagenum,bool dontmpisync){
++void  Profiler::Tag(int tagenum,bool dontmpisync){/*{{{*/
+ 
+ 	IssmDouble t;
+ 	IssmDouble f;
+@@ -97,8 +90,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Profiler::DeltaTime {{{*/
+-IssmDouble  Profiler::DeltaTime(int inittag, int finaltag){
++IssmDouble  Profiler::DeltaTime(int inittag, int finaltag){/*{{{*/
+ 
+ 	IssmDouble init, final;
+ 	this->time->FindParam(&init,inittag);
+@@ -111,8 +103,7 @@
+ 	#endif
+ }
+ /*}}}*/
+-/*FUNCTION Profiler::DeltaFlops {{{*/
+-IssmDouble  Profiler::DeltaFlops(int inittag, int finaltag){
++IssmDouble  Profiler::DeltaFlops(int inittag, int finaltag){/*{{{*/
+ 
+ 	IssmDouble init, final;
+ 	this->flops->FindParam(&init,inittag);
+@@ -121,8 +112,7 @@
+ 	return final-init;
+ }
+ /*}}}*/
+-/*FUNCTION Profiler::DeltaTimeModHour {{{*/
+-int Profiler::DeltaTimeModHour(int inittag, int finishtag){
++int Profiler::DeltaTimeModHour(int inittag, int finishtag){/*{{{*/
+ 
+ 	IssmDouble init, finish;
+ 	this->time->FindParam(&init,inittag);
+@@ -136,8 +126,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Profiler::DeltaTimeModMin {{{*/
+-int Profiler::DeltaTimeModMin(int inittag, int finishtag){
++int Profiler::DeltaTimeModMin(int inittag, int finishtag){/*{{{*/
+ 
+ 	IssmDouble init, finish;
+ 	this->time->FindParam(&init,inittag);
+@@ -150,8 +139,7 @@
+ 	#endif
+ }
+ /*}}}*/
+-/*FUNCTION Profiler::DeltaTimeModSec {{{*/
+-int Profiler::DeltaTimeModSec(int inittag, int finishtag){
++int Profiler::DeltaTimeModSec(int inittag, int finishtag){/*{{{*/
+ 
+ 	IssmDouble init, finish;
+ 	this->time->FindParam(&init,inittag);
+@@ -164,8 +152,7 @@
+ 	#endif
+ }
+ /*}}}*/
+-/*FUNCTION Profiler::Memory {{{*/
+-IssmDouble  Profiler::Memory(int tag){
++IssmDouble  Profiler::Memory(int tag){/*{{{*/
+ 
+ 	IssmDouble m;
+ 	this->memory->FindParam(&m,tag);
+Index: ../trunk-jpl/src/c/classes/matrix/ElementVector.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/classes/matrix/ElementVector.cpp	(revision 18063)
+@@ -17,8 +17,7 @@
+ /*}}}*/
+ 
+ /*ElementVector constructors and destructor*/
+-/*FUNCTION ElementVector::ElementVector(){{{*/
+-ElementVector::ElementVector(){
++ElementVector::ElementVector(){/*{{{*/
+ 
+ 	this->nrows=0;
+ 	this->values=NULL;
+@@ -28,8 +27,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION ElementVector::ElementVector(ElementVector* pe1, ElementVector* pe2){{{*/
+-ElementVector::ElementVector(ElementVector* pe1, ElementVector* pe2){
++ElementVector::ElementVector(ElementVector* pe1, ElementVector* pe2){/*{{{*/
+ 
+ 	/*intermediaries*/
+ 	int i,j,counter;
+@@ -113,8 +111,7 @@
+ 	xDelete<int>(P);
+ }
+ /*}}}*/
+-/*FUNCTION ElementVector::ElementVector(ElementVector* pe1, ElementVector* pe2,ElementVector* pe3){{{*/
+-ElementVector::ElementVector(ElementVector* pe1, ElementVector* pe2,ElementVector* pe3){
++ElementVector::ElementVector(ElementVector* pe1, ElementVector* pe2,ElementVector* pe3){/*{{{*/
+ 
+ 	/*Concatenate all matrices*/
+ 	ElementVector* pe12 =new ElementVector(pe1,pe2);
+@@ -128,8 +125,7 @@
+ 	delete pe123;
+ }
+ /*}}}*/
+-/*FUNCTION ElementVector::ElementVector(Node** nodes,int numnodes,Parameters* parameters,int approximation){{{*/
+-ElementVector::ElementVector(Node** nodes,int numnodes,Parameters* parameters,int approximation){
++ElementVector::ElementVector(Node** nodes,int numnodes,Parameters* parameters,int approximation){/*{{{*/
+ 
+ 	/*get Vector size and properties*/
+ 	this->nrows=GetNumberOfDofs(nodes,numnodes,GsetEnum,approximation);
+@@ -146,8 +142,7 @@
+ 	this->fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
+ }
+ /*}}}*/
+-/*FUNCTION ElementVector::~ElementVector(){{{*/
+-ElementVector::~ElementVector(){
++ElementVector::~ElementVector(){/*{{{*/
+ 
+ 	xDelete<IssmDouble>(this->values);
+ 	xDelete<int>(this->gglobaldoflist);
+@@ -157,8 +152,7 @@
+ /*}}}*/
+ 
+ /*ElementVector specific routines: */
+-/*FUNCTION ElementVector::AddToGlobal(Vector<IssmDouble>* pf){{{*/
+-void ElementVector::AddToGlobal(Vector<IssmDouble>* pf){
++void ElementVector::AddToGlobal(Vector<IssmDouble>* pf){/*{{{*/
+ 
+ 	int i;
+ 	IssmDouble* localvalues=NULL;
+@@ -181,8 +175,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION ElementVector::InsertIntoGlobal(Vector<IssmDouble>* pf){{{*/
+-void ElementVector::InsertIntoGlobal(Vector<IssmDouble>* pf){
++void ElementVector::InsertIntoGlobal(Vector<IssmDouble>* pf){/*{{{*/
+ 
+ 	int i;
+ 	IssmDouble* localvalues=NULL;
+@@ -202,8 +195,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION ElementVector::CheckConsistency{{{*/
+-void ElementVector::CheckConsistency(void){
++void ElementVector::CheckConsistency(void){/*{{{*/
+ 	/*Check element matrix values, only in debugging mode*/
+ #ifdef _ISSM_DEBUG_ 
+ 	for (int i=0;i<this->nrows;i++){
+@@ -213,8 +205,7 @@
+ #endif
+ }
+ /*}}}*/
+-/*FUNCTION ElementVector::Echo{{{*/
+-void ElementVector::Echo(void){
++void ElementVector::Echo(void){/*{{{*/
+ 
+ 	int i;
+ 
+@@ -238,8 +229,7 @@
+ 	_printf_(" \n");
+ }
+ /*}}}*/
+-/*FUNCTION ElementVector::Init{{{*/
+-void ElementVector::Init(ElementVector* pe){
++void ElementVector::Init(ElementVector* pe){/*{{{*/
+ 
+ 	_assert_(pe);
+ 
+@@ -264,8 +254,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION ElementVector::SetValue{{{*/
+-void ElementVector::SetValue(IssmDouble scalar){
++void ElementVector::SetValue(IssmDouble scalar){/*{{{*/
+ 
+ 	int i;
+ 
+@@ -273,8 +262,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION ElementVector::StaticCondensation{{{*/
+-void ElementVector::StaticCondensation(ElementMatrix* Ke,int bsize,int* bindices){
++void ElementVector::StaticCondensation(ElementMatrix* Ke,int bsize,int* bindices){/*{{{*/
+ 	/* 
+ 	 * | Kii  Kib | | Ui |    |Fi|
+ 	 * | Kbi  Kbb | | Ub |  = |Fb|
+Index: ../trunk-jpl/src/c/classes/Segment.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Segment.h	(revision 18062)
++++ ../trunk-jpl/src/c/classes/Segment.h	(revision 18063)
+@@ -22,8 +22,7 @@
+ 		doubletype y2;
+ 
+ 		/*Segment constructors, destructors :*/
+-		/*FUNCTION Segment() default constructor {{{*/
+-		Segment(){
++		Segment(){/*{{{*/
+ 			this->eid = UNDEF;
+ 			this->x1  = UNDEF;
+ 			this->y1  = UNDEF;
+@@ -31,8 +30,7 @@
+ 			this->y2  = UNDEF;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Segment(int eid, doubletype x1,doubletype y1,doubletype x2, doubletype y2){{{*/
+-		Segment(int segment_eid, doubletype segment_x1,doubletype segment_y1,doubletype segment_x2, doubletype segment_y2){
++		Segment(int segment_eid, doubletype segment_x1,doubletype segment_y1,doubletype segment_x2, doubletype segment_y2){/*{{{*/
+ 
+ 			this->eid = segment_eid;
+ 			this->x1  = segment_x1;
+@@ -42,14 +40,12 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION ~Segment(){{{*/
+-		~Segment(){
++		~Segment(){/*{{{*/
+ 		}
+ 		/*}}}*/
+ 
+ 		/*Object virtual functions definitions:*/
+-		/*FUNCTION Echo{{{*/
+-		void Echo(void){
++		void Echo(void){/*{{{*/
+ 
+ 			_printf_("Segment:\n");
+ 			_printf_("   eid: " << eid << "\n");
+@@ -58,23 +54,19 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION DeepEcho{{{*/
+-		void DeepEcho(void){
++		void DeepEcho(void){/*{{{*/
+ 			this->Echo();
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Id{{{*/
+-		int    Id(void){ return eid; }
++		int    Id(void){ return eid; }/*{{{*/
+ 		/*}}}*/
+-		/*FUNCTION ObjectEnum{{{*/
+-		int ObjectEnum(void){
++		int ObjectEnum(void){/*{{{*/
+ 
+ 			return SegmentEnum;
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION copy {{{*/
+-		Object* copy() {
++		Object* copy() {/*{{{*/
+ 			return new Segment(this->eid,this->x1,this->y1,this->x2,this->y2);
+ 		}
+ 		/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Nodes.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Nodes.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/classes/Nodes.cpp	(revision 18063)
+@@ -18,21 +18,18 @@
+ /*}}}*/
+ 
+ /*Object constructors and destructor*/
+-/*FUNCTION Nodes::Nodes(){{{*/
+-Nodes::Nodes(){
++Nodes::Nodes(){/*{{{*/
+ 	enum_type=NodesEnum;
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Nodes::~Nodes(){{{*/
+-Nodes::~Nodes(){
++Nodes::~Nodes(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Numerics*/
+-/*FUNCTION Nodes::DistributeDofs{{{*/
+-void  Nodes::DistributeDofs(int analysis_type,int setenum){
++void  Nodes::DistributeDofs(int analysis_type,int setenum){/*{{{*/
+ 
+ 	int  i;
+ 	int  dofcount=0;
+@@ -121,8 +118,7 @@
+ 	xDelete<int>(alltruedofs);
+ }
+ /*}}}*/
+-/*FUNCTION Nodes::FlagClones{{{*/
+-void  Nodes::FlagClones(int analysis_type){
++void  Nodes::FlagClones(int analysis_type){/*{{{*/
+ 
+ 	int i;
+ 	int num_procs;
+@@ -167,8 +163,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Nodes::MaxNumDofs{{{*/
+-int   Nodes::MaxNumDofs(int analysis_type,int setenum){
++int   Nodes::MaxNumDofs(int analysis_type,int setenum){/*{{{*/
+ 
+ 	int max=0;
+ 	int allmax,numdofs;
+@@ -193,8 +188,7 @@
+ 	return max;
+ }
+ /*}}}*/
+-/*FUNCTION Nodes::MaximymId{{{*/
+-int Nodes::MaximumId(){
++int   Nodes::MaximumId(){/*{{{*/
+ 
+ 	int max=-1;
+ 	int id,allmax;
+@@ -224,8 +218,7 @@
+ 	return max;
+ }
+ /*}}}*/
+-/*FUNCTION Nodes::NumberOfDofs{{{*/
+-int   Nodes::NumberOfDofs(int analysis_type,int setenum){
++int   Nodes::NumberOfDofs(int analysis_type,int setenum){/*{{{*/
+ 
+ 	int   allnumdofs;
+ 
+@@ -237,8 +230,7 @@
+ 	return allnumdofs;
+ }
+ /*}}}*/
+-/*FUNCTION Nodes::NumberOfDofsLocal{{{*/
+-int   Nodes::NumberOfDofsLocal(int analysis_type,int setenum){
++int   Nodes::NumberOfDofsLocal(int analysis_type,int setenum){/*{{{*/
+ 
+ 	int   numdofs=0;
+ 
+@@ -260,8 +252,7 @@
+ 	return numdofs;
+ }
+ /*}}}*/
+-/*FUNCTION Nodes::NumberOfNodes(){{{*/
+-int Nodes::NumberOfNodes(void){
++int   Nodes::NumberOfNodes(void){/*{{{*/
+ 
+ 	/*Careful! only use once all clones have been setup for all nodes!: */
+ 
+@@ -282,8 +273,7 @@
+ 	return allnumnodes;
+ }
+ /*}}}*/
+-/*FUNCTION Nodes::NumberOfNodes(analysis){{{*/
+-int Nodes::NumberOfNodes(int analysis_type){
++int   Nodes::NumberOfNodes(int analysis_type){/*{{{*/
+ 
+ 	int i;
+ 
+@@ -314,8 +304,7 @@
+ 	return max_sid;
+ }
+ /*}}}*/
+-/*FUNCTION Nodes::Ranks{{{*/
+-void   Nodes::Ranks(int* ranks,int analysis_type){
++void  Nodes::Ranks(int* ranks,int analysis_type){/*{{{*/
+ 
+ 	int my_rank;
+ 	int sid;
+@@ -337,8 +326,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Nodes::RequiresDofReindexing{{{*/
+-bool Nodes::RequiresDofReindexing(int analysis_type){
++bool Nodes::RequiresDofReindexing(int analysis_type){/*{{{*/
+ 
+ 	int flag = 0;
+ 	int allflag;
+Index: ../trunk-jpl/src/c/classes/Vertices.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Vertices.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/classes/Vertices.cpp	(revision 18063)
+@@ -23,21 +23,18 @@
+ /*}}}*/
+ 
+ /*Object constructors and destructor*/
+-/*FUNCTION Vertices::Vertices(){{{*/
+-Vertices::Vertices(){
++Vertices::Vertices(){/*{{{*/
+ 	enum_type=VerticesEnum;
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Vertices::~Vertices(){{{*/
+-Vertices::~Vertices(){
++Vertices::~Vertices(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Numerics management*/
+-/*FUNCTION Vertices::DistributePids{{{*/
+-void  Vertices::DistributePids(int numberofobjects){
++void  Vertices::DistributePids(int numberofobjects){/*{{{*/
+ 
+ 	int num_procs;
+ 	int my_rank;
+@@ -101,8 +98,7 @@
+ 	xDelete<int>(alltruepids);
+ }
+ /*}}}*/
+-/*FUNCTION Vertices::FlagClones{{{*/
+-void  Vertices::FlagClones(int numberofobjects){
++void  Vertices::FlagClones(int numberofobjects){/*{{{*/
+ 
+ 	int i;
+ 	int num_procs;
+@@ -141,8 +137,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Vertices::NumberOfVertices{{{*/
+-int Vertices::NumberOfVertices(void){
++int Vertices::NumberOfVertices(void){/*{{{*/
+ 
+ 	int i,sid;
+ 	int max_sid=0;
+@@ -165,8 +160,7 @@
+ 	return max_sid;
+ }
+ /*}}}*/
+-/*FUNCTION Vertices::Ranks{{{*/
+-void   Vertices::Ranks(int* ranks){
++void   Vertices::Ranks(int* ranks){/*{{{*/
+ 
+ 	int my_rank;
+ 	int        sid;
+@@ -183,8 +177,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Vertices::ToXYZ{{{*/
+-IssmDouble* Vertices::ToXYZ(void){
++IssmDouble* Vertices::ToXYZ(void){/*{{{*/
+ 
+ 	/*intermediary: */
+ 	int i;
+Index: ../trunk-jpl/src/c/datastructures/DataSet.cpp
+===================================================================
+--- ../trunk-jpl/src/c/datastructures/DataSet.cpp	(revision 18062)
++++ ../trunk-jpl/src/c/datastructures/DataSet.cpp	(revision 18063)
+@@ -23,8 +23,7 @@
+ /*}}}*/
+ 
+ /*Constructors/Destructors*/
+-/*FUNCTION DataSet::DataSet(){{{*/
+-DataSet::DataSet(){
++DataSet::DataSet(){/*{{{*/
+ 
+ 	sorted=0;
+ 	sorted_ids=NULL;
+@@ -32,8 +31,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DataSet::DataSet(int dataset_enum){{{*/
+-DataSet::DataSet(int dataset_enum){
++DataSet::DataSet(int dataset_enum){/*{{{*/
+ 	enum_type=dataset_enum;
+ 
+ 	sorted=0;
+@@ -42,8 +40,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DataSet::Copy{{{*/
+-DataSet*   DataSet::Copy(void){
++DataSet*   DataSet::Copy(void){/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Object* object_copy=NULL;
+@@ -71,8 +68,7 @@
+ 	return copy;
+ }
+ /*}}}*/
+-/*FUNCTION DataSet::~DataSet{{{*/
+-DataSet::~DataSet(){
++DataSet::~DataSet(){/*{{{*/
+ 	clear();
+ 	xDelete<int>(sorted_ids);
+ 	xDelete<int>(id_offsets);
+@@ -80,8 +76,7 @@
+ /*}}}*/
+ 
+ /*Specific methods*/
+-/*FUNCTION DataSet::AddObject{{{*/
+-int  DataSet::AddObject(Object* object){
++int  DataSet::AddObject(Object* object){/*{{{*/
+ 
+ 	_assert_(this);
+ 	objects.push_back(object);
+@@ -89,8 +84,7 @@
+ 	return 1;
+ }
+ /*}}}*/
+-/*FUNCTION DataSet::clear{{{*/
+-void  DataSet::clear(){
++void  DataSet::clear(){/*{{{*/
+ 
+ /*  use reverse_iterator for efficiency in matlab memory manager
+ 	(keeping old code in case it needs to revert back)  */
+@@ -107,8 +101,7 @@
+ 	objects.clear();
+ }
+ /*}}}*/
+-/*FUNCTION DataSet::DeleteObject{{{*/
+-int  DataSet::DeleteObject(Object* object){
++int  DataSet::DeleteObject(Object* object){/*{{{*/
+ 
+ 	vector<Object*>::iterator iterator;
+ 
+@@ -122,8 +115,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DataSet::DeepEcho{{{*/
+-void DataSet::DeepEcho(){
++void DataSet::DeepEcho(){/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 
+@@ -139,8 +131,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION DataSet::Echo{{{*/
+-void DataSet::Echo(){
++void DataSet::Echo(){/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 
+@@ -157,20 +148,17 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION DataSet::GetEnum(){{{*/
+-int  DataSet::GetEnum(){
++int  DataSet::GetEnum(){/*{{{*/
+ 	return enum_type;
+ }
+ /*}}}*/
+-/*FUNCTION DataSet::GetEnum(int offset){{{*/
+-int   DataSet::GetEnum(int offset){
++int   DataSet::GetEnum(int offset){/*{{{*/
+ 
+ 	return objects[offset]->ObjectEnum();
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DataSet::GetObjectByOffset{{{*/
+-Object* DataSet::GetObjectByOffset(int offset){
++Object* DataSet::GetObjectByOffset(int offset){/*{{{*/
+ 
+ 	/*Check index in debugging mode*/
+ 	_assert_(this!=NULL);
+@@ -181,8 +169,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DataSet::GetObjectById{{{*/
+-Object* DataSet::GetObjectById(int* poffset,int eid){
++Object* DataSet::GetObjectById(int* poffset,int eid){/*{{{*/
+ 
+ 	int id_offset;
+ 	int offset;
+@@ -205,8 +192,7 @@
+ 	return objects[offset];
+ }
+ /*}}}*/
+-/*FUNCTION DataSet::Presort{{{*/
+-void DataSet::Presort(){
++void DataSet::Presort(){/*{{{*/
+ 
+ 	/*vector of objects is already sorted, just allocate the sorted ids and their
+ 	 * offsets:*/
+@@ -231,15 +217,13 @@
+ 	sorted=1;
+ }
+ /*}}}*/
+-/*FUNCTION DataSet::Size{{{*/
+-int  DataSet::Size(void){
++int  DataSet::Size(void){/*{{{*/
+ 	_assert_(this!=NULL);
+ 
+ 	return objects.size();
+ }
+ /*}}}*/
+-/*FUNCTION DataSet::Sort{{{*/
+-void DataSet::Sort(){
++void DataSet::Sort(){/*{{{*/
+ 
+ 	/*Only sort if we are not already sorted: */
+ 	if(!sorted){
Index: /issm/oecreview/Archive/17984-18295/ISSM-18063-18064.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18063-18064.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18063-18064.diff	(revision 18296)
@@ -0,0 +1,12877 @@
+Index: ../trunk-jpl/src/c/bamg/ListofIntersectionTriangles.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/ListofIntersectionTriangles.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/ListofIntersectionTriangles.cpp	(revision 18064)
+@@ -10,29 +10,25 @@
+ namespace bamg {
+ 
+ 	/*Constructors Destructors*/
+-	/*FUNCTION ListofIntersectionTriangles::ListofIntersectionTriangles{{{*/
+-	ListofIntersectionTriangles::ListofIntersectionTriangles(int n,int m)
++	ListofIntersectionTriangles::ListofIntersectionTriangles(int n,int m)/*{{{*/
+ 	  : MaxSize(n), Size(0), len(-1),state(-1),lIntTria(new IntersectionTriangles[n]) ,
+ 	  NbSeg(0), MaxNbSeg(m), lSegsI(new SegInterpolation[m]){
+ 	  }
+ 	/*}}}*/
+-	/*FUNCTION ListofIntersectionTriangles::~ListofIntersectionTriangles{{{*/
+-	ListofIntersectionTriangles::~ListofIntersectionTriangles(){
++	ListofIntersectionTriangles::~ListofIntersectionTriangles(){/*{{{*/
+ 		if (lIntTria) delete [] lIntTria,lIntTria=0;
+ 		if (lSegsI) delete [] lSegsI,lSegsI=0;
+ 	} 
+ 	/*}}}*/
+ 
+ 	/*Methods*/
+-	/*FUNCTION ListofIntersectionTriangles::Init{{{*/
+-	void ListofIntersectionTriangles::Init(void){
++	void ListofIntersectionTriangles::Init(void){/*{{{*/
+ 		state=0;
+ 		len=0;
+ 		Size=0;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION ListofIntersectionTriangles::Length{{{*/
+-	double  ListofIntersectionTriangles::Length(){
++	double  ListofIntersectionTriangles::Length(){/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Length)*/
+ 
+ 		// computation of the length
+@@ -78,8 +74,7 @@
+ 		return s;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION ListofIntersectionTriangles::NewItem(Triangle * tt,double d0,double d1,double d2) {{{*/
+-	int  ListofIntersectionTriangles::NewItem(Triangle * tt,double d0,double d1,double d2) { 
++	int  ListofIntersectionTriangles::NewItem(Triangle * tt,double d0,double d1,double d2) { /*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/NewItem)*/
+ 
+ 		int n;
+@@ -106,8 +101,7 @@
+ 		return n;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION ListofIntersectionTriangles::NewItem(R2 A,const Metric & mm){{{*/
+-	int ListofIntersectionTriangles::NewItem(R2 A,const Metric & mm) {
++	int ListofIntersectionTriangles::NewItem(R2 A,const Metric & mm) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/NewItem)*/
+ 
+ 		int n;
+@@ -122,8 +116,7 @@
+ 		return  n; 
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION ListofIntersectionTriangles::NewPoints{{{*/
+-	long ListofIntersectionTriangles::NewPoints(BamgVertex* vertices,long &nbv,long maxnbv){
++	long ListofIntersectionTriangles::NewPoints(BamgVertex* vertices,long &nbv,long maxnbv){/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/NewPoints)*/
+ 
+ 		//If length<1.5, do nothing
+@@ -179,8 +172,7 @@
+ 		return nbv-nbvold;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION ListofIntersectionTriangles::ReShape{{{*/
+-	void ListofIntersectionTriangles::ReShape(){ 
++	void ListofIntersectionTriangles::ReShape(){ /*{{{*/
+ 
+ 		int newsize = MaxSize*2;
+ 		IntersectionTriangles* nw = new IntersectionTriangles[newsize];
+@@ -195,8 +187,7 @@
+ 		lIntTria = nw; // copy pointer
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION ListofIntersectionTriangles::SplitEdge{{{*/
+-	void ListofIntersectionTriangles::SplitEdge(const Mesh & Bh, const R2 &A,const R2  &B,int nbegin) {
++	void ListofIntersectionTriangles::SplitEdge(const Mesh & Bh, const R2 &A,const R2  &B,int nbegin) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/ListofIntersectionTriangles)*/
+ 
+ 		Triangle *tbegin, *t;
+Index: ../trunk-jpl/src/c/bamg/Triangle.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/Triangle.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/Triangle.cpp	(revision 18064)
+@@ -10,13 +10,11 @@
+ namespace bamg {
+ 
+ 	/*Constructors/Destructors*/
+-	/*FUNCTION Triangle(){{{*/
+-	Triangle::Triangle(void){
++	Triangle::Triangle(void){/*{{{*/
+ 
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Triangle(Mesh *Th,long i,long j,long k) {{{*/
+-	Triangle::Triangle(Mesh *Th,long i,long j,long k) {
++	Triangle::Triangle(Mesh *Th,long i,long j,long k) {/*{{{*/
+ 		BamgVertex *v=Th->vertices;
+ 		long nbv = Th->nbv;
+ 		if (i<0 || j<0 || k<0){
+@@ -33,8 +31,7 @@
+ 		det=0;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Triangle(BamgVertex *v0,BamgVertex *v1,BamgVertex *v2) {{{*/
+-	Triangle::Triangle(BamgVertex *v0,BamgVertex *v1,BamgVertex *v2){
++	Triangle::Triangle(BamgVertex *v0,BamgVertex *v1,BamgVertex *v2){/*{{{*/
+ 		vertices[0]=v0;
+ 		vertices[1]=v1;
+ 		vertices[2]=v2;
+@@ -48,12 +45,10 @@
+ 	/*}}}*/
+ 
+ 	/*Methods*/
+-	/*FUNCTION Triangle::Adj{{{*/
+-	AdjacentTriangle Triangle::Adj(int i)  const {
++	AdjacentTriangle Triangle::Adj(int i)  const {/*{{{*/
+ 		return AdjacentTriangle(adj[i],AdjEdgeIndex[i]&3);
+ 	};/*}}}*/
+-	/*FUNCTION Triangle::Length{{{*/
+-	double Triangle::Length() const{
++	double Triangle::Length() const{/*{{{*/
+ 
+ 		double l;
+ 
+@@ -74,8 +69,7 @@
+ 
+ 		return l;
+ 	};/*}}}*/
+-	/*FUNCTION Triangle::Echo {{{*/
+-	void Triangle::Echo(void){
++	void Triangle::Echo(void){/*{{{*/
+ 
+ 		int i;
+ 
+@@ -105,25 +99,20 @@
+ 		return;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Triangle::GetAllflag{{{*/
+-	int    Triangle::GetAllflag(int a){
++	int    Triangle::GetAllflag(int a){/*{{{*/
+ 		return AdjEdgeIndex[a] & 1020;
+ 	}/*}}}*/
+-	/*FUNCTION Triangle::Hidden{{{*/
+-	int    Triangle::Hidden(int a)const {
++	int    Triangle::Hidden(int a)const {/*{{{*/
+ 		return AdjEdgeIndex[a]&16;
+ 	} /*}}}*/
+-	/*FUNCTION Triangle::Locked{{{*/
+-	int    Triangle::Locked(int a)const {
++	int    Triangle::Locked(int a)const {/*{{{*/
+ 		return AdjEdgeIndex[a]&4;
+ 	} /*}}}*/
+-	/*FUNCTION Triangle::NuEdgeTriangleAdj{{{*/
+-	short  Triangle::NuEdgeTriangleAdj(int i) const {
++	short  Triangle::NuEdgeTriangleAdj(int i) const {/*{{{*/
+ 		/*Number of the  adjacent edge in adj tria (make sure it is between 0 and 2*/
+ 		return AdjEdgeIndex[i&3]&3;
+ 	}/*}}}*/
+-	/*FUNCTION Triangle::Optim{{{*/
+-	long  Triangle::Optim(short i,int koption) {
++	long  Triangle::Optim(short i,int koption) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Optim)*/
+ 
+ 		// turn around (positive direction)
+@@ -155,8 +144,7 @@
+ 		return NbSwap;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Triangle::Quadrangle {{{*/
+-	Triangle* Triangle::Quadrangle(BamgVertex * & v0,BamgVertex * & v1,BamgVertex * & v2,BamgVertex * & v3) const{
++	Triangle* Triangle::Quadrangle(BamgVertex * & v0,BamgVertex * & v1,BamgVertex * & v2,BamgVertex * & v3) const{/*{{{*/
+ 		// return the other triangle of the quad if a quad or 0 if not a quat
+ 		Triangle * t =0;
+ 		if (link) {
+@@ -176,8 +164,7 @@
+ 		return t;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Triangle::QualityQuad {{{*/
+-	double   Triangle::QualityQuad(int a,int option) const{
++	double   Triangle::QualityQuad(int a,int option) const{/*{{{*/
+ 		double q;
+ 		if (!link || AdjEdgeIndex[a] &4)
+ 		 q=  -1;
+@@ -199,22 +186,19 @@
+ 		return  q;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Triangle::Renumbering(Triangle *tb,Triangle *te, long *renu){{{*/
+-	void  Triangle::Renumbering(Triangle *tb,Triangle *te, long *renu){
++	void  Triangle::Renumbering(Triangle *tb,Triangle *te, long *renu){/*{{{*/
+ 
+ 		if (link  >=tb && link  <te) link  = tb + renu[link -tb];
+ 		if (adj[0] >=tb && adj[0] <te) adj[0] = tb + renu[adj[0]-tb];
+ 		if (adj[1] >=tb && adj[1] <te) adj[1] = tb + renu[adj[1]-tb];
+ 		if (adj[2] >=tb && adj[2] <te) adj[2] = tb + renu[adj[2]-tb];    
+ 	}/*}}}*/
+-	/*FUNCTION Triangle::Renumbering(BamgVertex *vb,BamgVertex *ve, long *renu){{{*/
+-	void Triangle::Renumbering(BamgVertex *vb,BamgVertex *ve, long *renu){
++	void Triangle::Renumbering(BamgVertex *vb,BamgVertex *ve, long *renu){/*{{{*/
+ 		if (vertices[0] >=vb && vertices[0] <ve) vertices[0] = vb + renu[vertices[0]-vb];
+ 		if (vertices[1] >=vb && vertices[1] <ve) vertices[1] = vb + renu[vertices[1]-vb];
+ 		if (vertices[2] >=vb && vertices[2] <ve) vertices[2] = vb + renu[vertices[2]-vb];    
+ 	}/*}}}*/
+-	/*FUNCTION Triangle::Set {{{*/
+-	void Triangle::Set(const Triangle & rec,const Mesh & Th ,Mesh & ThNew){ 
++	void Triangle::Set(const Triangle & rec,const Mesh & Th ,Mesh & ThNew){ /*{{{*/
+ 		*this = rec;
+ 		if ( vertices[0] ) vertices[0] = ThNew.vertices +  Th.GetId(vertices[0]);
+ 		if ( vertices[1] ) vertices[1] = ThNew.vertices +  Th.GetId(vertices[1]);
+@@ -226,8 +210,7 @@
+ 		 link = ThNew.triangles + Th.GetId(link);
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Triangle::SetAdjAdj{{{*/
+-	void Triangle::SetAdjAdj(short a){
++	void Triangle::SetAdjAdj(short a){/*{{{*/
+ 		// Copy all the mark 
+ 		a &= 3;
+ 		Triangle *tt=adj[a];
+@@ -238,8 +221,7 @@
+ 			tt->AdjEdgeIndex[aatt]=a + (AdjEdgeIndex[a] & 60 ) ;
+ 		}
+ 	}/*}}}*/
+-	/*FUNCTION Triangle::SetAdj2{{{*/
+-	void Triangle::SetAdj2(short a,Triangle *t,short aat){
++	void Triangle::SetAdj2(short a,Triangle *t,short aat){/*{{{*/
+ 		/*For current triangle:
+ 		 * - a is the index of the edge were the adjency is set (in [0 2])
+ 		 * - t is the adjacent triangle
+@@ -251,8 +233,7 @@
+ 			t->AdjEdgeIndex[aat]=a;
+ 		}
+ 	}/*}}}*/
+-	/*FUNCTION Triangle::SetHidden{{{*/
+-	void Triangle::SetHidden(int a){
++	void Triangle::SetHidden(int a){/*{{{*/
+ 		//Get Adjacent Triangle number a
+ 		Triangle* t = adj[a];
+ 		//if it exist
+@@ -260,33 +241,28 @@
+ 		if(t) t->AdjEdgeIndex[AdjEdgeIndex[a] & 3] |=16;
+ 		AdjEdgeIndex[a] |= 16;
+ 	}/*}}}*/
+-	/*FUNCTION Triangle::SetLocked{{{*/
+-	void Triangle::SetLocked(int a){
++	void Triangle::SetLocked(int a){/*{{{*/
+ 		//mark the edge as on Boundary
+ 		Triangle * t = adj[a];
+ 		t->AdjEdgeIndex[AdjEdgeIndex[a] & 3] |=4;
+ 		AdjEdgeIndex[a] |= 4;
+ 	}/*}}}*/
+-	/*FUNCTION Triangle::SetMarkUnSwap{{{*/
+-	void Triangle::SetMarkUnSwap(int a){
++	void Triangle::SetMarkUnSwap(int a){/*{{{*/
+ 		Triangle * t = adj[a];
+ 		t->AdjEdgeIndex[AdjEdgeIndex[a] & 3] |=8;
+ 		AdjEdgeIndex[a] |=8 ;
+ 	}/*}}}*/
+-	/*FUNCTION Triangle::SetSingleVertexToTriangleConnectivity{{{*/
+-	void Triangle::SetSingleVertexToTriangleConnectivity() { 
++	void Triangle::SetSingleVertexToTriangleConnectivity() { /*{{{*/
+ 		if (vertices[0]) (vertices[0]->t=this,vertices[0]->IndexInTriangle=0);
+ 		if (vertices[1]) (vertices[1]->t=this,vertices[1]->IndexInTriangle=1);
+ 		if (vertices[2]) (vertices[2]->t=this,vertices[2]->IndexInTriangle=2);
+ 	}/*}}}*/
+-	/*FUNCTION Triangle::SetUnMarkUnSwap{{{*/
+-	void Triangle::SetUnMarkUnSwap(int a){ 
++	void Triangle::SetUnMarkUnSwap(int a){ /*{{{*/
+ 		Triangle * t = adj[a];
+ 		t->AdjEdgeIndex[AdjEdgeIndex[a] & 3] &=55; // 23 + 32 
+ 		AdjEdgeIndex[a] &=55 ;
+ 	}/*}}}*/
+-	/*FUNCTION Triangle::swap{{{*/
+-	int Triangle::swap(short a,int koption){
++	int Triangle::swap(short a,int koption){/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/swap)*/
+ 
+ 		if(a/4 !=0) return 0;// arete lock or MarkUnSwap
+@@ -399,8 +375,7 @@
+ 		return OnSwap;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Triangle::TriangleAdj{{{*/
+-	Triangle* Triangle::TriangleAdj(int i) const {
++	Triangle* Triangle::TriangleAdj(int i) const {/*{{{*/
+ 		return adj[i&3];
+ 	}/*}}}*/
+ 
+Index: ../trunk-jpl/src/c/bamg/VertexOnVertex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/VertexOnVertex.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/VertexOnVertex.cpp	(revision 18064)
+@@ -9,25 +9,21 @@
+ namespace bamg {
+ 
+ 	/*Constructors/Destructors*/
+-	/*FUNCTION VertexOnVertex::VertexOnVertex(){{{*/
+-	VertexOnVertex::VertexOnVertex() {
++	VertexOnVertex::VertexOnVertex() {/*{{{*/
+ 		v=NULL;
+ 		bv=NULL;
+ 	};/*}}}*/
+-	/*FUNCTION VertexOnVertex::VertexOnVertex(BamgVertex * w,BamgVertex *bw){{{*/
+-	VertexOnVertex::VertexOnVertex(BamgVertex * w,BamgVertex *bw) :v(w),bv(bw){
++	VertexOnVertex::VertexOnVertex(BamgVertex * w,BamgVertex *bw) :v(w),bv(bw){/*{{{*/
+ 
+ 	}/*}}}*/
+ 
+ 	/*Methods*/
+-	/*FUNCTION VertexOnVertex::Set{{{*/
+-	void VertexOnVertex::Set(const Mesh &Th ,long i,Mesh &ThNew) { 
++	void VertexOnVertex::Set(const Mesh &Th ,long i,Mesh &ThNew) { /*{{{*/
+ 		*this = Th.VertexOnBThVertex[i];  
+ 		v     = ThNew.vertices + Th.GetId(v);
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION VertexOnVertex::SetOnBTh{{{*/
+-	void VertexOnVertex::SetOnBTh(){
++	void VertexOnVertex::SetOnBTh(){/*{{{*/
+ 		v->BackgroundVertexHook=bv;v->IndexInTriangle=IsVertexOnVertex;
+ 	}/*}}}*/
+ 
+Index: ../trunk-jpl/src/c/bamg/BamgOpts.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/BamgOpts.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/BamgOpts.cpp	(revision 18064)
+@@ -2,8 +2,7 @@
+ #include "../shared/shared.h"
+ 
+ /*Constructors/Destructors*/
+-/*FUNCTION BamgOpts::BamgOpts() {{{*/
+-BamgOpts::BamgOpts(){
++BamgOpts::BamgOpts(){/*{{{*/
+ 
+ 	this->anisomax=0;
+ 	this->cutoff=0;
+@@ -38,8 +37,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION BamgOpts::~BamgOpts() {{{*/
+-BamgOpts::~BamgOpts(){
++BamgOpts::~BamgOpts(){/*{{{*/
+ 
+ 	xDelete<double>(this->hminVertices);
+ 	xDelete<double>(this->hmaxVertices);
+@@ -52,8 +50,7 @@
+ /*}}}*/
+ 
+ /*Methods*/
+-/*FUNCTION BamgOpts::Check{{{*/
+-void BamgOpts::Check(void){
++void BamgOpts::Check(void){/*{{{*/
+ 
+ 	int i;
+ 
+Index: ../trunk-jpl/src/c/bamg/BamgGeom.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/BamgGeom.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/BamgGeom.cpp	(revision 18064)
+@@ -2,8 +2,7 @@
+ #include "../shared/shared.h"
+ 
+ /*Constructors/Destructors*/
+-/*FUNCTION BamgGeom::BamgGeom(){{{*/
+-BamgGeom::BamgGeom(){
++BamgGeom::BamgGeom(){/*{{{*/
+ 
+ 	this->VerticesSize[0]=0,          this->VerticesSize[1]=0;          this->Vertices=NULL;
+ 	this->EdgesSize[0]=0,             this->EdgesSize[1]=0;             this->Edges=NULL;
+@@ -16,8 +15,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION BamgGeom::~BamgGeom(){{{*/
+-BamgGeom::~BamgGeom(){
++BamgGeom::~BamgGeom(){/*{{{*/
+ 
+ 	xDelete<double>(this->Vertices);
+ 	xDelete<double>(this->Edges);
+Index: ../trunk-jpl/src/c/bamg/CrackedEdge.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/CrackedEdge.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/CrackedEdge.cpp	(revision 18064)
+@@ -8,8 +8,7 @@
+ namespace bamg {
+ 
+ 	/*Constructors/Destructors*/
+-	/*FUNCTION CrackedEdge() {{{*/
+-	CrackedEdge::CrackedEdge() {
++	CrackedEdge::CrackedEdge() {/*{{{*/
+ 		a=NULL;
+ 		b=NULL;
+ 		E=NULL;
+Index: ../trunk-jpl/src/c/bamg/SubDomain.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/SubDomain.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/SubDomain.cpp	(revision 18064)
+@@ -11,8 +11,7 @@
+ 	/*Constructors/Destructors*/
+ 
+ 	/*Methods*/
+-	/*FUNCTION SubDomain::Set {{{*/
+-	void SubDomain::Set(const Mesh & Th ,long i,Mesh & ThNew){
++	void SubDomain::Set(const Mesh & Th ,long i,Mesh & ThNew){/*{{{*/
+ 		*this = Th.subdomains[i];
+ 		if( head-Th.triangles<0 || head-Th.triangles>=Th.nbt){
+ 			_error_("head-Th.triangles<0 || head-Th.triangles>=Th.nbt");
+Index: ../trunk-jpl/src/c/bamg/Metric.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/Metric.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/Metric.cpp	(revision 18064)
+@@ -12,16 +12,13 @@
+ 	SaveMetricInterpole  LastMetricInterpole;
+ 
+ 	/*Constructor/Destructor*/
+-	/*FUNCTION Metric::Metric(double a){{{*/
+-	Metric::Metric(double a): a11(1/(a*a)),a21(0),a22(1/(a*a)){
++	Metric::Metric(double a): a11(1/(a*a)),a21(0),a22(1/(a*a)){/*{{{*/
+ 
+ 	}/*}}}*/
+-	/*FUNCTION Metric::Metric(double a,double b,double c){{{*/
+-	Metric::Metric(double a,double b,double c) :a11(a),a21(b),a22(c){
++	Metric::Metric(double a,double b,double c) :a11(a),a21(b),a22(c){/*{{{*/
+ 
+ 	}/*}}}*/
+-	/*FUNCTION Metric::Metric(const double  a[3],const  Metric& m0, const  Metric& m1,const  Metric&  m2 ){{{*/ 
+-	Metric::Metric(const double  a[3],const  Metric& m0, const  Metric& m1,const  Metric& m2 ){
++	Metric::Metric(const double  a[3],const  Metric& m0, const  Metric& m1,const  Metric& m2 ){/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/Metric)*/
+ 
+ 		Metric mab(a[0]*m0.a11 + a[1]*m1.a11 + a[2]*m2.a11,
+@@ -41,8 +38,7 @@
+ 		*this = vab;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Metric::Metric(double  a,const  Metric& ma, double  b,const  Metric& mb){{{*/
+-	Metric::Metric(double  a,const  Metric& ma, double  b,const  Metric& mb) { 
++	Metric::Metric(double  a,const  Metric& ma, double  b,const  Metric& mb) { /*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/EigenMetric)*/
+ 
+ 		/*Compute metric (linear combination of ma and mb)*/
+@@ -63,12 +59,10 @@
+ 	/*}}}*/
+ 
+ 	/*Methods*/
+-	/*FUNCTION Metric::det{{{*/
+-	double Metric::det() const {
++	double Metric::det() const {/*{{{*/
+ 		return a11*a22-a21*a21;
+ 	}  /*}}}*/
+-	/*FUNCTION Metric::Echo {{{*/
+-	void Metric::Echo(void){
++	void Metric::Echo(void){/*{{{*/
+ 
+ 		_printf_("Metric:\n");
+ 		_printf_("   [a11 a21 a22]: [" << a11 << " " << a21 << " " << a22 << "]\n");
+@@ -76,8 +70,7 @@
+ 		return;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Metric::IntersectWith{{{*/
+-	int Metric::IntersectWith(const Metric& M2) {
++	int Metric::IntersectWith(const Metric& M2) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/IntersectWith)*/
+ 
+ 		/*Get a new metric from an existing metric (M1=this)
+@@ -129,14 +122,12 @@
+ 		return change;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Metric::mul{{{*/
+-	R2     Metric::mul(const R2 x)const {
++	R2     Metric::mul(const R2 x)const {/*{{{*/
+ 		return R2(a11*x.x+a21*x.y,a21*x.x+a22*x.y);
+ 	}/*}}}*/
+ 
+ 	/*Intermediary*/
+-	/*FUNCTION LengthInterpole{{{*/
+-	double LengthInterpole(const Metric& Ma,const  Metric& Mb, R2 AB) {
++	double LengthInterpole(const Metric& Ma,const  Metric& Mb, R2 AB) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/LengthInterpole)*/
+ 
+ 		double k=1./2.;
+@@ -203,8 +194,7 @@
+ 		return l;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION SimultaneousMatrixReduction{{{*/
+-	void SimultaneousMatrixReduction( Metric M1,  Metric M2, D2xD2 &V) {
++	void SimultaneousMatrixReduction( Metric M1,  Metric M2, D2xD2 &V) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/ReductionSimultanee)*/
+ 
+ 		/*In this routine we must return a matrix V that is composed of the 
+@@ -306,8 +296,7 @@
+ 		}
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION abscisseInterpole{{{*/
+-	double abscisseInterpole(const Metric& Ma,const  Metric& Mb, R2 AB,double s,int optim) { 
++	double abscisseInterpole(const Metric& Ma,const  Metric& Mb, R2 AB,double s,int optim) { /*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/abscisseInterpole)*/
+ 
+ 		if(!optim)  LengthInterpole(Ma,Mb,AB);
+Index: ../trunk-jpl/src/c/bamg/BamgMesh.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/BamgMesh.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/BamgMesh.cpp	(revision 18064)
+@@ -2,8 +2,7 @@
+ #include "../shared/shared.h"
+ 
+ /*Constructors/Destructors*/
+-/*FUNCTION BamgMesh::BamgMesh(){{{*/
+-BamgMesh::BamgMesh(){
++BamgMesh::BamgMesh(){/*{{{*/
+ 
+ 	this->VerticesSize[0]=0,                  this->VerticesSize[1]=0;                 this->Vertices=NULL;
+ 	this->EdgesSize[0]=0,                     this->EdgesSize[1]=0;                    this->Edges=NULL;
+@@ -27,8 +26,7 @@
+ 	this->NodalElementConnectivitySize[0]=0,  this->NodalElementConnectivitySize[1]=0; this->NodalElementConnectivity=NULL;
+ }
+ /*}}}*/
+-/*FUNCTION BamgMesh::~BamgMesh(){{{*/
+-BamgMesh::~BamgMesh(){
++BamgMesh::~BamgMesh(){/*{{{*/
+ 
+ 	xDelete<double>(this->Vertices);
+ 	xDelete<double>(this->Edges);
+Index: ../trunk-jpl/src/c/bamg/Curve.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/Curve.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/Curve.cpp	(revision 18064)
+@@ -9,8 +9,7 @@
+ namespace bamg {
+ 
+ 	/*Constructors/Destructors*/
+-	/*FUNCTION Curve::Curve(){{{*/
+-	Curve::Curve(){
++	Curve::Curve(){/*{{{*/
+ 		FirstEdge=NULL;
+ 		LastEdge=NULL;
+ 		FirstVertexIndex=0;
+@@ -19,8 +18,7 @@
+ 	/*}}}*/
+ 
+ 	/*Methods*/
+-	/*FUNCTION Curve::Set {{{*/
+-	void Curve::Set(const Curve & rec,const Geometry & Gh ,Geometry & GhNew){
++	void Curve::Set(const Curve & rec,const Geometry & Gh ,Geometry & GhNew){/*{{{*/
+ 		*this = rec;
+ 		FirstEdge = GhNew.edges + Gh.GetId(FirstEdge);    
+ 		LastEdge = GhNew.edges + Gh.GetId(LastEdge); 
+Index: ../trunk-jpl/src/c/bamg/GeomVertex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/GeomVertex.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/GeomVertex.cpp	(revision 18064)
+@@ -12,24 +12,20 @@
+ 	//See header file
+ 
+ 	/*Methods*/
+-	/*FUNCTION GeomVertex::Corner {{{*/
+-	int  GeomVertex::Corner() const {
++	int  GeomVertex::Corner() const {/*{{{*/
+ 		return type & 4;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION GeomVertex::Required {{{*/
+-	int  GeomVertex::Required()const {
++	int  GeomVertex::Required()const {/*{{{*/
+ 		// a corner is required
+ 		return type & 6;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION GeomVertex::SetCorner {{{*/
+-	void GeomVertex::SetCorner(){
++	void GeomVertex::SetCorner(){/*{{{*/
+ 		type |= 4;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION GeomVertex::SetRequired {{{*/
+-	void GeomVertex::SetRequired(){
++	void GeomVertex::SetRequired(){/*{{{*/
+ 		type |= 2;
+ 	}
+ 	/*}}}*/
+Index: ../trunk-jpl/src/c/bamg/GeomSubDomain.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/GeomSubDomain.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/GeomSubDomain.cpp	(revision 18064)
+@@ -11,8 +11,7 @@
+ 	/*Constructors/Destructors*/
+ 
+ 	/*Methods*/
+-	/*FUNCTION GeomSubDomain::Set {{{*/
+-	void GeomSubDomain::Set(const GeomSubDomain & rec,const Geometry & Gh ,const Geometry & GhNew){
++	void GeomSubDomain::Set(const GeomSubDomain & rec,const Geometry & Gh ,const Geometry & GhNew){/*{{{*/
+ 		*this = rec;
+ 		edge = Gh.GetId(edge) + GhNew.edges;
+ 	}/*}}}*/
+Index: ../trunk-jpl/src/c/bamg/Geometry.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/Geometry.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/Geometry.cpp	(revision 18064)
+@@ -11,20 +11,17 @@
+ 	static const  Direction NoDirOfSearch=Direction();
+ 
+ 	/*Constructors/Destructors*/
+-	/*FUNCTION Geometry::Geometry(){{{*/
+-	Geometry::Geometry(){
++	Geometry::Geometry(){/*{{{*/
+ 		Init();
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Geometry::Geometry(BamgGeom* bamggeom, BamgOpts* bamgopts){{{*/
+-	Geometry::Geometry(BamgGeom* bamggeom, BamgOpts* bamgopts){
++	Geometry::Geometry(BamgGeom* bamggeom, BamgOpts* bamgopts){/*{{{*/
+ 		Init();
+ 		ReadGeometry(bamggeom,bamgopts);
+ 		PostRead();
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Geometry::Geometry(const Geometry & Gh) (COPY operator){{{*/
+-	Geometry::Geometry(const Geometry & Gh) {
++	Geometry::Geometry(const Geometry & Gh) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/Geometry)*/
+ 
+ 		long i;
+@@ -43,8 +40,7 @@
+ 		 subdomains[i].Set(Gh.subdomains[i],Gh,*this);
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Geometry::~Geometry(){{{*/
+-	Geometry::~Geometry() {
++	Geometry::~Geometry() {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/~Geometry)*/
+ 		if(NbRef>0){   _printf_("Trying to delete geometry and NbRef>0, probably due to an error"); return;}
+ 		if(vertices)   delete [] vertices;  vertices=0;
+@@ -57,8 +53,7 @@
+ 	/*}}}*/
+ 
+ 	/*IO*/
+-	/*FUNCTION Geometry::ReadGeometry{{{*/
+-	void Geometry::ReadGeometry(BamgGeom* bamggeom,BamgOpts* bamgopts){
++	void Geometry::ReadGeometry(BamgGeom* bamggeom,BamgOpts* bamgopts){/*{{{*/
+ 
+ 		int verbose;
+ 		nbcurves=0;
+@@ -276,8 +271,7 @@
+ 		}
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Geometry::WriteGeometry{{{*/
+-	void Geometry::WriteGeometry(BamgGeom* bamggeom, BamgOpts* bamgopts){
++	void Geometry::WriteGeometry(BamgGeom* bamggeom, BamgOpts* bamgopts){/*{{{*/
+ 
+ 		int verbose;
+ 		int nbreq=0;
+@@ -393,8 +387,7 @@
+ 	/*}}}*/
+ 
+ 	/*Methods*/
+-	/*FUNCTION Geometry::Echo {{{*/
+-	void Geometry::Echo(void){
++	void Geometry::Echo(void){/*{{{*/
+ 
+ 		_printf_("Geometry:\n");
+ 		_printf_("   nbv  (number of vertices) : " << nbv << "\n");
+@@ -414,8 +407,7 @@
+ 		return;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Geometry::Init{{{*/
+-	void Geometry::Init(void){
++	void Geometry::Init(void){/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/EmptyGeometry)*/
+ 
+ 		NbRef=0;
+@@ -431,39 +423,31 @@
+ 		MaxCornerAngle = 10*Pi/180; //default is 10 degres
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Geometry::MinimalHmin{{{*/
+-	double Geometry::MinimalHmin() {
++	double Geometry::MinimalHmin() {/*{{{*/
+ 		/* coeffIcoor = (2^30-1)/D
+ 		 * We cannot go beyond hmin = D/2^30 because of the quadtree
+ 		 * hmin is therefore approximately 2/coeffIcoor */
+ 		return 2.0/coefIcoor;
+ 	}/*}}}*/
+-	/*FUNCTION Geometry::MaximalHmax{{{*/
+-	double Geometry::MaximalHmax() {
++	double Geometry::MaximalHmax() {/*{{{*/
+ 		return Max(pmax.x-pmin.x,pmax.y-pmin.y);
+ 	}/*}}}*/
+-	/*FUNCTION Geometry::GetId(const GeomVertex &t){{{*/
+-	long Geometry::GetId(const GeomVertex & t) const  {
++	long Geometry::GetId(const GeomVertex & t) const  {/*{{{*/
+ 		return &t - vertices;
+ 	}/*}}}*/
+-	/*FUNCTION Geometry::GetId(const GeomVertex * t){{{*/
+-	long Geometry::GetId(const GeomVertex * t) const  {
++	long Geometry::GetId(const GeomVertex * t) const  {/*{{{*/
+ 		return t - vertices;
+ 	}/*}}}*/
+-	/*FUNCTION Geometry::GetId(const GeomEdge & t){{{*/
+-	long Geometry::GetId(const GeomEdge & t) const  {
++	long Geometry::GetId(const GeomEdge & t) const  {/*{{{*/
+ 		return &t - edges;
+ 	}/*}}}*/
+-	/*FUNCTION Geometry::GetId(const GeomEdge * t){{{*/
+-	long Geometry::GetId(const GeomEdge * t) const  {
++	long Geometry::GetId(const GeomEdge * t) const  {/*{{{*/
+ 		return t - edges;
+ 	}/*}}}*/
+-	/*FUNCTION Geometry::GetId(const Curve * c){{{*/
+-	long Geometry::GetId(const Curve * c) const  {
++	long Geometry::GetId(const Curve * c) const  {/*{{{*/
+ 		return c - curves;
+ 	}/*}}}*/
+-	/*FUNCTION Geometry::PostRead{{{*/
+-	void Geometry::PostRead(){
++	void Geometry::PostRead(){/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/AfterRead)*/
+ 
+ 		long          i          ,j,k;
+@@ -784,8 +768,7 @@
+ 
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Geometry::ProjectOnCurve {{{*/
+-	GeomEdge* Geometry::ProjectOnCurve(const Edge &e,double s,BamgVertex &V,VertexOnGeom &GV) const {
++	GeomEdge* Geometry::ProjectOnCurve(const Edge &e,double s,BamgVertex &V,VertexOnGeom &GV) const {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/ProjectOnCurve)*/
+ 		/*Add a vertex on an existing geometrical edge according to the metrics of the two vertices constituting the edge*/
+ 
+@@ -917,8 +900,7 @@
+ 		return on;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Geometry::R2ToI2{{{*/
+-	I2 Geometry::R2ToI2(const R2 & P) const {
++	I2 Geometry::R2ToI2(const R2 & P) const {/*{{{*/
+ 		/*coefIcoor is the coefficient used for integer coordinates:
+ 		 *                       (x-pmin.x)
+ 		 * Icoor x = (2^30 -1) ------------ 
+@@ -930,8 +912,7 @@
+ 		 */
+ 		return  I2( (Icoor1) (coefIcoor*(P.x-pmin.x)) ,(Icoor1) (coefIcoor*(P.y-pmin.y)) );
+ 	}/*}}}*/
+-	/*FUNCTION Geometry::UnMarkEdges{{{*/
+-	void Geometry::UnMarkEdges() {
++	void Geometry::UnMarkEdges() {/*{{{*/
+ 		for (int i=0;i<nbe;i++) edges[i].SetUnMark();
+ 	}/*}}}*/
+ } 
+Index: ../trunk-jpl/src/c/bamg/VertexOnEdge.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/VertexOnEdge.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/VertexOnEdge.cpp	(revision 18064)
+@@ -9,14 +9,12 @@
+ namespace bamg {
+ 
+ 	/*Methods*/
+-	/*FUNCTION VertexOnEdge::Set {{{*/
+-	void VertexOnEdge::Set(const Mesh & Th ,long i,Mesh & ThNew){
++	void VertexOnEdge::Set(const Mesh & Th ,long i,Mesh & ThNew){/*{{{*/
+ 		*this = Th.VertexOnBThEdge[i];  
+ 		v = ThNew.vertices + Th.GetId(v);
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION VertexOnEdge::SetOnBTh{{{*/
+-	void VertexOnEdge::SetOnBTh(){
++	void VertexOnEdge::SetOnBTh(){/*{{{*/
+ 		v->BackgroundEdgeHook=this;
+ 		v->IndexInTriangle=IsVertexOnEdge;  
+ 	}
+Index: ../trunk-jpl/src/c/bamg/AdjacentTriangle.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/AdjacentTriangle.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/AdjacentTriangle.cpp	(revision 18064)
+@@ -12,44 +12,36 @@
+ 	//See header file
+ 
+ 	/*Methods*/
+-	/*FUNCTION AdjacentTriangle::Locked {{{*/
+-	int  AdjacentTriangle::Locked() const {
++	int  AdjacentTriangle::Locked() const {/*{{{*/
+ 		return t->AdjEdgeIndex[a] & 4;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION AdjacentTriangle::GetAllFlag_UnSwap {{{*/
+-	int  AdjacentTriangle::GetAllFlag_UnSwap() const {
++	int  AdjacentTriangle::GetAllFlag_UnSwap() const {/*{{{*/
+ 		// take all flag except MarkUnSwap
+ 		return t->AdjEdgeIndex[a] & 1012;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION AdjacentTriangle::SetLock {{{*/
+-	void AdjacentTriangle::SetLock(){
++	void AdjacentTriangle::SetLock(){/*{{{*/
+ 		t->SetLocked(a);
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION AdjacentTriangle::Adj {{{*/
+-	AdjacentTriangle AdjacentTriangle::Adj() const {
++	AdjacentTriangle AdjacentTriangle::Adj() const {/*{{{*/
+ 		return  t->Adj(a);
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION AdjacentTriangle::EdgeVertex {{{*/
+-	BamgVertex* AdjacentTriangle::EdgeVertex(const int & i) const {
++	BamgVertex* AdjacentTriangle::EdgeVertex(const int & i) const {/*{{{*/
+ 		return t->vertices[VerticesOfTriangularEdge[a][i]];
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION AdjacentTriangle::det {{{*/
+-	Icoor2 & AdjacentTriangle::det() const {
++	Icoor2 & AdjacentTriangle::det() const {/*{{{*/
+ 		return t->det;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION AdjacentTriangle::swap {{{*/
+-	int AdjacentTriangle::swap(){
++	int AdjacentTriangle::swap(){/*{{{*/
+ 		return  t->swap(a);
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION AdjacentTriangle::SetAdj2 {{{*/
+-	void AdjacentTriangle::SetAdj2(const AdjacentTriangle & ta, int l  ){
++	void AdjacentTriangle::SetAdj2(const AdjacentTriangle & ta, int l  ){/*{{{*/
+ 		//set Adjacent Triangle of a triangle
+ 		if(t) {
+ 			t->adj[a]=ta.t;
+Index: ../trunk-jpl/src/c/bamg/BamgQuadtree.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/BamgQuadtree.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/BamgQuadtree.cpp	(revision 18064)
+@@ -97,8 +97,7 @@
+ 	 }}}*/
+ 
+ 	/*Constructors/Destructors*/
+-	/*FUNCTION BamgQuadtree::BamgQuadtree(){{{*/
+-	BamgQuadtree::BamgQuadtree(){
++	BamgQuadtree::BamgQuadtree(){/*{{{*/
+ 
+ 		/*Number of boxes and vertices*/
+ 		NbBamgQuadtreeBox=0;
+@@ -112,8 +111,7 @@
+ 
+ 		}
+ 	/*}}}*/
+-	/*FUNCTION BamgQuadtree::BamgQuadtree(Mesh * t,long nbv){{{*/
+-	BamgQuadtree::BamgQuadtree(Mesh * t,long nbv){ 
++	BamgQuadtree::BamgQuadtree(Mesh * t,long nbv){ /*{{{*/
+ 
+ 		/*Number of boxes and vertices*/
+ 		NbBamgQuadtreeBox=0;
+@@ -134,16 +132,14 @@
+ 
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION BamgQuadtree::~BamgQuadtree(){{{*/
+-	BamgQuadtree::~BamgQuadtree() {
++	BamgQuadtree::~BamgQuadtree() {/*{{{*/
+ 		delete boxcontainer;
+ 		root=NULL;
+ 	}
+ 	/*}}}*/
+ 
+ 	/*Methods*/
+-	/*FUNCTION BamgQuadtree::Add{{{*/
+-	void  BamgQuadtree::Add(BamgVertex &w){
++	void  BamgQuadtree::Add(BamgVertex &w){/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, BamgQuadtree.cpp/Add)*/
+ 		BamgQuadtreeBox** pb=NULL;
+ 		BamgQuadtreeBox*  b=NULL;
+@@ -231,8 +227,7 @@
+ 		NbVertices++;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION BamgQuadtree::NearestVertex{{{*/
+-	BamgVertex*  BamgQuadtree::NearestVertex(Icoor1 i,Icoor1 j) {
++	BamgVertex*  BamgQuadtree::NearestVertex(Icoor1 i,Icoor1 j) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, BamgQuadtree.cpp/NearestVertex)*/
+ 
+ 		/*Intermediaries*/
+@@ -390,8 +385,7 @@
+ 
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION BamgQuadtree::NewBamgQuadtreeBox {{{*/
+-	BamgQuadtree::BamgQuadtreeBox* BamgQuadtree::NewBamgQuadtreeBox(void){
++	BamgQuadtree::BamgQuadtreeBox* BamgQuadtree::NewBamgQuadtreeBox(void){/*{{{*/
+ 
+ 		/*Output*/
+ 		BamgQuadtreeBox* newbox=NULL;
+@@ -413,8 +407,7 @@
+ 		/*currentbox now points toward next quadtree box*/
+ 		return newbox;
+ 	}/*}}}*/
+-	/*FUNCTION BamgQuadtree::ToClose {{{*/
+-	BamgVertex*   BamgQuadtree::ToClose(BamgVertex & v,double seuil,Icoor1 hx,Icoor1 hy){
++	BamgVertex*   BamgQuadtree::ToClose(BamgVertex & v,double seuil,Icoor1 hx,Icoor1 hy){/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, BamgQuadtree.cpp/ToClose)*/
+ 
+ 		const Icoor1 i=v.i.x;
+Index: ../trunk-jpl/src/c/bamg/BamgVertex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/BamgVertex.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/BamgVertex.cpp	(revision 18064)
+@@ -10,10 +10,8 @@
+ namespace bamg {
+ 
+ 	/*Methods*/
+-	/*FUNCTION BamgVertex::Echo {{{*/
++	void BamgVertex::Echo(void){/*{{{*/
+ 
+-	void BamgVertex::Echo(void){
+-
+ 		_printf_("Vertex:\n");
+ 		_printf_("  integer   coordinates i.x: " << i.x << ", i.y: " << i.y << "\n");
+ 		_printf_("  Euclidean coordinates r.x: " << r.x << ", r.y: " << r.y << "\n");
+@@ -23,13 +21,11 @@
+ 		return;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION BamgVertex::GetReferenceNumber{{{*/
+-	int  BamgVertex::GetReferenceNumber() const { 
++	int  BamgVertex::GetReferenceNumber() const { /*{{{*/
+ 		return ReferenceNumber;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION BamgVertex::MetricFromHessian{{{*/
+-	void BamgVertex::MetricFromHessian(const double Hxx,const double Hyx, const double Hyy,const double smin,const double smax,const double s,double err,BamgOpts* bamgopts){
++	void BamgVertex::MetricFromHessian(const double Hxx,const double Hyx, const double Hyy,const double smin,const double smax,const double s,double err,BamgOpts* bamgopts){/*{{{*/
+ 		/*Compute Metric from Hessian*/
+ 
+ 		/*get options*/
+@@ -107,8 +103,7 @@
+ 
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION BamgVertex::Optim {{{*/
+-	long BamgVertex::Optim(int i,int koption){ 
++	long BamgVertex::Optim(int i,int koption){ /*{{{*/
+ 		long ret=0;
+ 		if ( t && (IndexInTriangle >= 0 ) && (IndexInTriangle <3) ){
+ 			ret = t->Optim(IndexInTriangle,koption);
+@@ -120,8 +115,7 @@
+ 		return ret;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION BamgVertex::Smoothing{{{*/
+-	double  BamgVertex::Smoothing(Mesh &Th,const Mesh &BTh,Triangle* &tstart ,double omega){
++	double  BamgVertex::Smoothing(Mesh &Th,const Mesh &BTh,Triangle* &tstart ,double omega){/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Smoothing)*/
+ 
+ 		BamgVertex* s=this;
+@@ -226,8 +220,7 @@
+ 	/*}}}*/
+ 
+ 	/*Intermediary*/
+-	/*FUNCTION QuadQuality{{{*/
+-	double QuadQuality(const BamgVertex & a,const BamgVertex &b,const BamgVertex &c,const BamgVertex &d) {
++	double QuadQuality(const BamgVertex & a,const BamgVertex &b,const BamgVertex &c,const BamgVertex &d) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshQuad.cpp/QuadQuality)*/
+ 
+ 		// calcul de 4 angles --
+Index: ../trunk-jpl/src/c/bamg/Edge.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/Edge.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/Edge.cpp	(revision 18064)
+@@ -13,8 +13,7 @@
+ 	/*Constructors/Destructors*/
+ 
+ 	/*Methods*/
+-	/*FUNCTION Edge::Set {{{*/
+-	void Edge::Set(const Mesh & Th ,long i,Mesh & ThNew){ 
++	void Edge::Set(const Mesh & Th ,long i,Mesh & ThNew){ /*{{{*/
+ 		*this = Th.edges[i];
+ 		v[0] = ThNew.vertices + Th.GetId(v[0]);    
+ 		v[1] = ThNew.vertices + Th.GetId(v[1]);
+@@ -24,8 +23,7 @@
+ 		if (adj[1]) adj[1] =   ThNew.edges +   Th.GetId(adj[1]);
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Edge::Echo {{{*/
+-	void Edge::Echo(void){ 
++	void Edge::Echo(void){ /*{{{*/
+ 		_printf_("Edge:\n");
+ 		_printf_("   pointers towards two vertices: " << v[0] << " " << v[1] << "\n");
+ 		_printf_("   ReferenceNumber = " << ReferenceNumber << "\n");
+@@ -33,16 +31,14 @@
+ 		_printf_("   two adjacent edges on the same curve: " << adj[0] << " " << adj[1] << "\n");
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Edge::Renumbering{{{*/
+-	void Edge::Renumbering(BamgVertex *vb,BamgVertex *ve, long *renu){
++	void Edge::Renumbering(BamgVertex *vb,BamgVertex *ve, long *renu){/*{{{*/
+ 
+ 		if (v[0] >=vb && v[0] <ve) v[0] = vb + renu[v[0]-vb];
+ 		if (v[1] >=vb && v[1] <ve) v[1] = vb + renu[v[1]-vb];
+ 
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Edge::Intersection{{{*/
+-	int Edge::Intersection(const  Edge & e){ 
++	int Edge::Intersection(const  Edge & e){ /*{{{*/
+ 
+ 		/*some shecks*/
+ 		if (!(adj[0]==&e || adj[1]==&e)){ _error_("Intersection bug"); }
+Index: ../trunk-jpl/src/c/bamg/SetOfE4.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/SetOfE4.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/SetOfE4.cpp	(revision 18064)
+@@ -4,8 +4,7 @@
+ namespace bamg {
+ 
+ 	/*Constructor*/
+-	/*FUNCTION  SetOfEdges4::SetOfEdges4(long mmx,long nnx){{{*/
+-	SetOfEdges4::SetOfEdges4(long mmx,long nnx){
++	SetOfEdges4::SetOfEdges4(long mmx,long nnx){/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, SetOfEdges4.cpp/SetOfEdges4)*/
+ 
+ 		/*Intermediary*/
+@@ -25,8 +24,7 @@
+ 	/*}}}*/
+ 
+ 	/*Methods*/ 
+-	/*FUNCTION  SetOfEdges4::add{{{*/
+-	long SetOfEdges4::add(long ii,long jj) {
++	long SetOfEdges4::add(long ii,long jj) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, SetOfEdges4.cpp/add)*/
+ 
+ 		/*Intermediary*/
+@@ -60,8 +58,7 @@
+ 		return NbOfEdges ++;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION  SetOfEdges4::find {{{*/
+-	long SetOfEdges4::find(long ii,long jj) { 
++	long SetOfEdges4::find(long ii,long jj) { /*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, SetOfEdges4.cpp/find)*/
+ 
+ 		/*Intermediary*/
+@@ -87,28 +84,23 @@
+ 		return -1;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION  SetOfEdges4::i{{{*/
+-	long SetOfEdges4::i(long k){
++	long SetOfEdges4::i(long k){/*{{{*/
+ 		return Edges[k].i;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION  SetOfEdges4::j{{{*/
+-	long SetOfEdges4::j(long k){
++	long SetOfEdges4::j(long k){/*{{{*/
+ 		return Edges[k].j;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION  SetOfEdges4::nb{{{*/
+-	long SetOfEdges4::nb(){
++	long SetOfEdges4::nb(){/*{{{*/
+ 		return NbOfEdges;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION  SetOfEdges4::SortAndAdd{{{*/
+-	long SetOfEdges4::SortAndAdd (long ii,long jj) {
++	long SetOfEdges4::SortAndAdd (long ii,long jj) {/*{{{*/
+ 		return ii <=jj ? add (ii,jj)  : add (jj,ii) ;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION  SetOfEdges4::SortAndFind{{{*/
+-	long SetOfEdges4::SortAndFind (long ii,long jj) {
++	long SetOfEdges4::SortAndFind (long ii,long jj) {/*{{{*/
+ 		return ii <=jj ? find (ii,jj)  : find (jj,ii) ;
+ 	}
+ 	/*}}}*/
+Index: ../trunk-jpl/src/c/bamg/GeomEdge.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/GeomEdge.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/GeomEdge.cpp	(revision 18064)
+@@ -14,12 +14,10 @@
+ 	/*Constructor/Destructor*/
+ 
+ 	/*Methods*/
+-	/*FUNCTION GeomEdge::Cracked{{{*/
+-	int    GeomEdge::Cracked() const  {
++	int    GeomEdge::Cracked() const  {/*{{{*/
+ 		return type &1;  
+ 	}/*}}}*/
+-	/*FUNCTION GeomEdge::F{{{*/
+-	R2 GeomEdge::F(double theta) const{
++	R2 GeomEdge::F(double theta) const{/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/F)*/
+ 		// parametrization of the curve edge
+ 
+@@ -61,12 +59,10 @@
+ 		return A*ca + B*cb + tg[0]*cta + tg[1]*ctb;
+ 	  }
+ 	/*}}}*/
+-	/*FUNCTION GeomEdge::Mark{{{*/
+-	int    GeomEdge::Mark()    const  {
++	int    GeomEdge::Mark()    const  {/*{{{*/
+ 		return type &16; 
+ 	}/*}}}*/
+-	/*FUNCTION GeomEdge::R1tg{{{*/
+-	double GeomEdge::R1tg(double theta,R2 & t) const{
++	double GeomEdge::R1tg(double theta,R2 & t) const{/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/R1tg)*/
+ 		// 1/R of radius of cuvature
+ 
+@@ -137,12 +133,10 @@
+ 		else return 0;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION GeomEdge::Required{{{*/
+-	int    GeomEdge::Required()       {
++	int    GeomEdge::Required()       {/*{{{*/
+ 		return type &64; 
+ 	}/*}}}*/
+-	/*FUNCTION GeomEdge::Set {{{*/
+-	void GeomEdge::Set(const GeomEdge & rec,const Geometry & Gh ,Geometry & GhNew){ 
++	void GeomEdge::Set(const GeomEdge & rec,const Geometry & Gh ,Geometry & GhNew){ /*{{{*/
+ 		*this = rec;
+ 		v[0] = GhNew.vertices + Gh.GetId(v[0]);    
+ 		v[1] = GhNew.vertices + Gh.GetId(v[1]); 
+@@ -150,36 +144,28 @@
+ 		if (Adj[1]) Adj[1] =  GhNew.edges + Gh.GetId(Adj[1]);     
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION GeomEdge::SetCracked{{{*/
+-	void   GeomEdge::SetCracked()     { 
++	void   GeomEdge::SetCracked()     { /*{{{*/
+ 		type |= 1;/*=>1st digit to 1*/
+ 	}/*}}}*/
+-	/*FUNCTION GeomEdge::SetTgA{{{*/
+-	void   GeomEdge::SetTgA()         { 
++	void   GeomEdge::SetTgA()         { /*{{{*/
+ 		type |=4; /*=>2d digit to 1*/
+ 	}/*}}}*/
+-	/*FUNCTION GeomEdge::SetTgB{{{*/
+-	void   GeomEdge::SetTgB()         { 
++	void   GeomEdge::SetTgB()         { /*{{{*/
+ 		type |=8; /*=> 3d digit to 1*/
+ 	}/*}}}*/
+-	/*FUNCTION GeomEdge::SetMark{{{*/
+-	void   GeomEdge::SetMark()        { 
++	void   GeomEdge::SetMark()        { /*{{{*/
+ 		type |=16;/*=> 4th digiy to 1*/
+ 	}/*}}}*/
+-	/*FUNCTION GeomEdge::SetUnMark{{{*/
+-	void   GeomEdge::SetUnMark()      { 
++	void   GeomEdge::SetUnMark()      { /*{{{*/
+ 		type &= 1007 /* 1023-16 = 000111110111 => 4th digit to 0*/;
+ 	}/*}}}*/
+-	/*FUNCTION GeomEdge::SetRequired{{{*/
+-	void   GeomEdge::SetRequired()    { 
++	void   GeomEdge::SetRequired()    { /*{{{*/
+ 		type |= 64;/*=>6th digit to 1*/ 
+ 	}/*}}}*/
+-	/*FUNCTION GeomEdge::TgA{{{*/
+-	int    GeomEdge::TgA()     const  {
++	int    GeomEdge::TgA()     const  {/*{{{*/
+ 		return type &4;  
+ 	}/*}}}*/
+-	/*FUNCTION GeomEdge::TgB{{{*/
+-	int    GeomEdge::TgB()     const  {
++	int    GeomEdge::TgB()     const  {/*{{{*/
+ 		return type &8;  
+ 	}/*}}}*/
+ }
+Index: ../trunk-jpl/src/c/bamg/Direction.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/Direction.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/Direction.cpp	(revision 18064)
+@@ -8,13 +8,11 @@
+ namespace bamg {
+ 
+ 	/*Constructors/Destructors*/
+-	/*FUNCTION Direction() {{{*/
+-	Direction::Direction():
++	Direction::Direction():/*{{{*/
+ 		dir(MaxICoor){
+ 
+ 	}/*}}}*/
+-	/*FUNCTION Direction(Icoor1 i,Icoor1 j) {{{*/
+-	Direction::Direction(Icoor1 i,Icoor1 j) {
++	Direction::Direction(Icoor1 i,Icoor1 j) {/*{{{*/
+ 		Icoor2 n2 = 2*(Abs(i)+Abs(j));  
+ 		Icoor2 r  = MaxICoor* (Icoor2) i;
+ 		Icoor1 r1 = (Icoor1) (2*(r/ n2)); // odd number 
+@@ -22,8 +20,7 @@
+ 	}/*}}}*/
+ 
+ 	/*Methods*/
+-	/*FUNCTION Direction::direction{{{*/
+-	int Direction::direction(Icoor1 i,Icoor1 j) {
++	int Direction::direction(Icoor1 i,Icoor1 j) {/*{{{*/
+ 		int r =1; 
+ 		if (dir!= MaxICoor) {
+ 			Icoor2 x(dir/2),y1(MaxICoor/2-Abs(x)),y((dir%2)?-y1:y1);
+Index: ../trunk-jpl/src/c/bamg/VertexOnGeom.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/VertexOnGeom.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/VertexOnGeom.cpp	(revision 18064)
+@@ -10,22 +10,19 @@
+ namespace bamg {
+ 
+ 	/*Constructors/Destructors*/
+-	/*FUNCTION VertexOnGeom::VertexOnGeom(){{{*/
+-	VertexOnGeom::VertexOnGeom(){
++	VertexOnGeom::VertexOnGeom(){/*{{{*/
+ 		meshvertex=NULL;
+ 		curvilincoord=0;
+ 		gv=0;
+ 	} 
+ 	/*}}}*/
+-	/*FUNCTION VertexOnGeom::VertexOnGeom(BamgVertex & m,GeomVertex &g){{{*/
+-	VertexOnGeom::VertexOnGeom(BamgVertex & m,GeomVertex &g){
++	VertexOnGeom::VertexOnGeom(BamgVertex & m,GeomVertex &g){/*{{{*/
+ 		meshvertex=&m;
+ 		curvilincoord=-1;
+ 		gv=&g;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION VertexOnGeom::VertexOnGeom(BamgVertex & m,GeomEdge &g,double s){{{*/
+-	VertexOnGeom::VertexOnGeom(BamgVertex & m,GeomEdge &g,double s){
++	VertexOnGeom::VertexOnGeom(BamgVertex & m,GeomEdge &g,double s){/*{{{*/
+ 		meshvertex=&m;
+ 		curvilincoord=s;
+ 		ge=&g;
+@@ -33,8 +30,7 @@
+ 	/*}}}*/
+ 
+ 	/*Methods*/
+-	/*FUNCTION VertexOnGeom::Set {{{*/
+-	void VertexOnGeom::Set(const VertexOnGeom & rec,const Mesh & Th ,Mesh & ThNew){
++	void VertexOnGeom::Set(const VertexOnGeom & rec,const Mesh & Th ,Mesh & ThNew){/*{{{*/
+ 		*this = rec;  
+ 		meshvertex = ThNew.vertices + Th.GetId(meshvertex);
+ 		if(gv){
+@@ -46,23 +42,19 @@
+ 
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION VertexOnGeom::OnGeomVertex{{{*/
+-	int VertexOnGeom::OnGeomVertex()const{
++	int VertexOnGeom::OnGeomVertex()const{/*{{{*/
+ 		return this? curvilincoord <0 :0;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION VertexOnGeom::OnGeomEdge{{{*/
+-	int VertexOnGeom::OnGeomEdge() const{
++	int VertexOnGeom::OnGeomEdge() const{/*{{{*/
+ 		return this? curvilincoord >=0 :0;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION VertexOnGeom::IsRequiredVertex{{{*/
+-	int VertexOnGeom::IsRequiredVertex() {
++	int VertexOnGeom::IsRequiredVertex() {/*{{{*/
+ 		return this? ((curvilincoord<0 ? (gv?gv->Required():0):0 )) : 0;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION VertexOnGeom::SetOn{{{*/
+-	void VertexOnGeom::SetOn(){
++	void VertexOnGeom::SetOn(){/*{{{*/
+ 		meshvertex->GeomEdgeHook=this;
+ 		meshvertex->IndexInTriangle=IsVertexOnGeom;
+ 	}
+Index: ../trunk-jpl/src/c/bamg/EigenMetric.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/EigenMetric.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/EigenMetric.cpp	(revision 18064)
+@@ -9,8 +9,7 @@
+ namespace bamg {
+ 
+ 	/*Constructor*/
+-	/*FUNCTION EigenMetric::EigenMetric(const Metric M){{{*/
+-	EigenMetric::EigenMetric(const Metric& M){
++	EigenMetric::EigenMetric(const Metric& M){/*{{{*/
+ 		/*From a metric (a11,a21,a22), get eigen values lambda1 and lambda2 and one eigen vector v*/
+ 
+ 		/*Intermediaries*/
+@@ -88,22 +87,18 @@
+ 
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION EigenMetric::EigenMetric(double r1,double r2,const D2 vp1){{{*/
+-	EigenMetric::EigenMetric(double r1,double r2,const D2& vp1): lambda1(r1),lambda2(r2),v(vp1){
++	EigenMetric::EigenMetric(double r1,double r2,const D2& vp1): lambda1(r1),lambda2(r2),v(vp1){/*{{{*/
+ 
+ 	}/*}}}*/
+ 
+ 	/*Methods*/
+-	/*FUNCTION EigenMetric::Abs{{{*/
+-	void   EigenMetric::Abs(){
++	void   EigenMetric::Abs(){/*{{{*/
+ 		lambda1=bamg::Abs(lambda1),lambda2=bamg::Abs(lambda2);
+ 	}/*}}}*/
+-	/*FUNCTION EigenMetric::Aniso2{{{*/
+-	double EigenMetric::Aniso2() const  { 
++	double EigenMetric::Aniso2() const  { /*{{{*/
+ 		return lmax()/lmin();
+ 	}/*}}}*/
+-	/*FUNCTION EigenMetric::Echo {{{*/
+-	void EigenMetric::Echo(void){
++	void EigenMetric::Echo(void){/*{{{*/
+ 
+ 		_printf_("EigenMetric:\n");
+ 		_printf_("   lambda1: " << lambda1 << "\n");
+@@ -114,42 +109,33 @@
+ 		return;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION EigenMetric::hmin{{{*/
+-	double EigenMetric::hmin() const {
++	double EigenMetric::hmin() const {/*{{{*/
+ 		return sqrt(1/bamg::Max3(lambda1,lambda2,1e-30));
+ 	}/*}}}*/
+-	/*FUNCTION EigenMetric::hmax{{{*/
+-	double EigenMetric::hmax() const {
++	double EigenMetric::hmax() const {/*{{{*/
+ 		return sqrt(1/bamg::Max(bamg::Min(lambda1,lambda2),1e-30));
+ 	}/*}}}*/
+-	/*FUNCTION EigenMetric::lmax{{{*/
+-	double EigenMetric::lmax() const {
++	double EigenMetric::lmax() const {/*{{{*/
+ 		return bamg::Max3(lambda1,lambda2,1e-30);
+ 	}/*}}}*/
+-	/*FUNCTION EigenMetric::lmin{{{*/
+-	double EigenMetric::lmin() const {
++	double EigenMetric::lmin() const {/*{{{*/
+ 		return bamg::Max(bamg::Min(lambda1,lambda2),1e-30);
+ 	}/*}}}*/
+-	/*FUNCTION EigenMetric::Min{{{*/
+-	void   EigenMetric::Min(double a) { 
++	void   EigenMetric::Min(double a) { /*{{{*/
+ 		lambda1=bamg::Min(a,lambda1); lambda2=bamg::Min(a,lambda2) ;
+ 	}/*}}}*/
+-	/*FUNCTION EigenMetric::Max{{{*/
+-	void   EigenMetric::Max(double a) { 
++	void   EigenMetric::Max(double a) { /*{{{*/
+ 		//change eigen values
+ 		lambda1=bamg::Max(a,lambda1); lambda2=bamg::Max(a,lambda2) ;
+ 	}/*}}}*/
+-	/*FUNCTION EigenMetric::Minh{{{*/
+-	void   EigenMetric::Minh(double h) {
++	void   EigenMetric::Minh(double h) {/*{{{*/
+ 		Min(1.0/(h*h));
+ 	}/*}}}*/
+-	/*FUNCTION EigenMetric::Maxh{{{*/
+-	void   EigenMetric::Maxh(double h) {
++	void   EigenMetric::Maxh(double h) {/*{{{*/
+ 		//Call Max function
+ 		Max(1.0/(h*h));
+ 	}/*}}}*/
+-	/*FUNCTION EigenMetric::pow{{{*/
+-	void   EigenMetric::pow(double p){
++	void   EigenMetric::pow(double p){/*{{{*/
+ 		lambda1=::pow(lambda1,p);lambda2=::pow(lambda2,p);
+ 	}/*}}}*/
+ 
+Index: ../trunk-jpl/src/c/bamg/Mesh.cpp
+===================================================================
+--- ../trunk-jpl/src/c/bamg/Mesh.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/bamg/Mesh.cpp	(revision 18064)
+@@ -12,8 +12,7 @@
+ 	static const  Direction NoDirOfSearch=Direction();
+ 
+ 	/*Constructors/Destructors*/
+-	/*FUNCTION Mesh::Mesh(BamgGeom* bamggeom,BamgMesh* bamgmesh, BamgOpts* bamgopts){{{*/
+-	Mesh::Mesh(BamgGeom* bamggeom,BamgMesh* bamgmesh, BamgOpts* bamgopts):Gh(*(new Geometry())),BTh(*this){ 
++	Mesh::Mesh(BamgGeom* bamggeom,BamgMesh* bamgmesh, BamgOpts* bamgopts):Gh(*(new Geometry())),BTh(*this){ /*{{{*/
+ 
+ 		/*Initialize fields*/
+ 		Init(0);
+@@ -42,8 +41,7 @@
+ 		ReconstructExistingMesh();
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::Mesh(int* index,double* x,double* y,int nods,int nels){{{*/
+-	Mesh::Mesh(int* index,double* x,double* y,int nods,int nels):Gh(*(new Geometry())),BTh(*this){
++	Mesh::Mesh(int* index,double* x,double* y,int nods,int nels):Gh(*(new Geometry())),BTh(*this){/*{{{*/
+ 
+ 		Init(0);
+ 		ReadMesh(index,x,y,nods,nels);
+@@ -51,13 +49,11 @@
+ 		ReconstructExistingMesh();
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::Mesh(double* x,double* y,int nods){{{*/
+-	Mesh::Mesh(double* x,double* y,int nods):Gh(*(new Geometry())),BTh(*this){
++	Mesh::Mesh(double* x,double* y,int nods):Gh(*(new Geometry())),BTh(*this){/*{{{*/
+ 		Triangulate(x,y,nods);
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::Mesh(const Mesh & Tho,const int *flag ,const int *bb){{{*/
+-	Mesh::Mesh(const Mesh & Tho,const int *flag ,const int *bb,BamgOpts* bamgopts) : Gh(*(new Geometry())), BTh(*this) {
++	Mesh::Mesh(const Mesh & Tho,const int *flag ,const int *bb,BamgOpts* bamgopts) : Gh(*(new Geometry())), BTh(*this) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Triangles)*/
+ 
+ 		  int i,k,itadj;
+@@ -155,8 +151,7 @@
+ 		  _assert_(subdomains[0].head && subdomains[0].head->link); 
+ 	  }
+ 	/*}}}*/
+-	/*FUNCTION Mesh::Mesh(Mesh & Th,Geometry * pGh,Mesh * pBth,long maxnbv_in) COPY{{{*/
+-	Mesh::Mesh(Mesh & Th,Geometry * pGh,Mesh * pBth,long maxnbv_in)
++	Mesh::Mesh(Mesh & Th,Geometry * pGh,Mesh * pBth,long maxnbv_in)/*{{{*/
+ 	  : Gh(*(pGh?pGh:&Th.Gh)), BTh(*(pBth?pBth:this)) {
+ 		  /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Triangles)*/
+ 		  Gh.NbRef++;
+@@ -218,20 +213,17 @@
+ 
+ 	  }
+ 	/*}}}*/
+-	/*FUNCTION Mesh::Mesh(long maxnbv,Mesh & BT,BamgOpts* bamgopts,int keepBackVertices){{{*/
+-	Mesh::Mesh(long imaxnbv,Mesh & BT,BamgOpts* bamgopts,int keepBackVertices) :Gh(BT.Gh),BTh(BT) {
++	Mesh::Mesh(long imaxnbv,Mesh & BT,BamgOpts* bamgopts,int keepBackVertices) :Gh(BT.Gh),BTh(BT) {/*{{{*/
+ 		this->Init(imaxnbv);
+ 		TriangulateFromGeom1(bamgopts,keepBackVertices);
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::Mesh(long maxnbv,Geometry & G,BamgOpts* bamgopts){{{*/
+-	Mesh::Mesh(long imaxnbv,Geometry & G,BamgOpts* bamgopts):Gh(G),BTh(*this){
++	Mesh::Mesh(long imaxnbv,Geometry & G,BamgOpts* bamgopts):Gh(G),BTh(*this){/*{{{*/
+ 		Init(imaxnbv);
+ 		TriangulateFromGeom0(bamgopts);
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::~Mesh(){{{*/
+-	Mesh::~Mesh() {
++	Mesh::~Mesh() {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Triangles)*/
+ 
+ 		//if (vertices)             delete [] vertices;
+@@ -258,8 +250,7 @@
+ 	/*}}}*/
+ 
+ 	/*IO*/
+-	/*FUNCTION Mesh::ReadMesh(int* index,double* x,double* y,int nods,int nels){{{*/
+-	void Mesh::ReadMesh(int* index,double* x,double* y,int nods,int nels){
++	void Mesh::ReadMesh(int* index,double* x,double* y,int nods,int nels){/*{{{*/
+ 
+ 		long i1,i2,i3;
+ 		long i;
+@@ -321,8 +312,7 @@
+ 		xDelete<bool>(nodeflags);
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::ReadMesh(BamgMesh* bamgmesh, BamgOpts* bamgopts){{{*/
+-	void Mesh::ReadMesh(BamgMesh* bamgmesh, BamgOpts* bamgopts){
++	void Mesh::ReadMesh(BamgMesh* bamgmesh, BamgOpts* bamgopts){/*{{{*/
+ 
+ 		int    verbose;
+ 		double Hmin = HUGE_VAL;    // the infinie value
+@@ -524,8 +514,7 @@
+ 
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::WriteMesh {{{*/
+-	void Mesh::WriteMesh(BamgMesh* bamgmesh,BamgOpts* bamgopts){
++	void Mesh::WriteMesh(BamgMesh* bamgmesh,BamgOpts* bamgopts){/*{{{*/
+ 
+ 		/*Intermediary*/
+ 		int i,j,k,num,i1,i2;
+@@ -951,8 +940,7 @@
+ 		delete [] numt;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::ReadMetric{{{*/
+-	void Mesh::ReadMetric(const BamgOpts* bamgopts) {
++	void Mesh::ReadMetric(const BamgOpts* bamgopts) {/*{{{*/
+ 
+ 		/*Intermediary*/
+ 		int  i,j;
+@@ -989,8 +977,7 @@
+ 		}
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::WriteMetric{{{*/
+-	void Mesh::WriteMetric(BamgOpts* bamgopts) {
++	void Mesh::WriteMetric(BamgOpts* bamgopts) {/*{{{*/
+ 		int i;
+ 		xDelete<double>(bamgopts->metric);
+ 		bamgopts->metric=xNew<double>(3*nbv);
+@@ -1001,8 +988,7 @@
+ 		}
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::WriteIndex{{{*/
+-	void Mesh::WriteIndex(int** pindex,int* pnels){
++	void Mesh::WriteIndex(int** pindex,int* pnels){/*{{{*/
+ 
+ 		/*Intermediary*/
+ 		int i,k;
+@@ -1041,8 +1027,7 @@
+ 	/*}}}*/
+ 
+ 	/*Methods*/
+-	/*FUNCTION Mesh::AddGeometryMetric{{{*/
+-	void Mesh::AddGeometryMetric(BamgOpts* bamgopts){
++	void Mesh::AddGeometryMetric(BamgOpts* bamgopts){/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/IntersectGeomMetric)*/
+ 
+ 		/*Get options*/
+@@ -1093,8 +1078,7 @@
+ 		// the problem is for the vertex on vertex 
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::AddMetric{{{*/
+-	void Mesh::AddMetric(BamgOpts* bamgopts){
++	void Mesh::AddMetric(BamgOpts* bamgopts){/*{{{*/
+ 		//  Hessiantype = 0 =>  H is computed using double L2 projection
+ 		//  Hessiantype = 1 =>  H is computed with green formula
+ 
+@@ -1112,8 +1096,7 @@
+ 		}
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::AddVertex{{{*/
+-	void Mesh::AddVertex( BamgVertex &s,Triangle* t, Icoor2* det3) {
++	void Mesh::AddVertex( BamgVertex &s,Triangle* t, Icoor2* det3) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Add)*/
+ 		// -------------------------------
+ 		//             s2
+@@ -1248,8 +1231,7 @@
+ 		}
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::BoundAnisotropy{{{*/
+-	void  Mesh::BoundAnisotropy(double anisomax,double hminaniso) {
++	void  Mesh::BoundAnisotropy(double anisomax,double hminaniso) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/BoundAnisotropy)*/
+ 
+ 		long int verbose=0;
+@@ -1288,8 +1270,7 @@
+ 		}
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::BuildGeometryFromMesh{{{*/
+-	void Mesh::BuildGeometryFromMesh(BamgOpts* bamgopts){
++	void Mesh::BuildGeometryFromMesh(BamgOpts* bamgopts){/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/ConsGeometry)*/
+ 
+ 		/*Reconstruct Geometry from Mesh*/
+@@ -1738,8 +1719,7 @@
+ 
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::BuildMetric0 (double L2 projection){{{*/
+-	void Mesh::BuildMetric0(BamgOpts* bamgopts){
++	void Mesh::BuildMetric0(BamgOpts* bamgopts){/*{{{*/
+ 
+ 		/*Options*/
+ 		double* s=NULL;
+@@ -1943,8 +1923,7 @@
+ 		delete [] dydy_vertex;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::BuildMetric1 (Green formula){{{*/
+-	void Mesh::BuildMetric1(BamgOpts* bamgopts){
++	void Mesh::BuildMetric1(BamgOpts* bamgopts){/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/IntersectConsMetric)*/
+ 
+ 		/*Options*/
+@@ -2236,8 +2215,7 @@
+ 
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::CrackMesh{{{*/
+-	void Mesh::CrackMesh(BamgOpts* bamgopts) {
++	void Mesh::CrackMesh(BamgOpts* bamgopts) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/CrackMesh)*/
+ 
+ 		/*Intermediary*/
+@@ -2384,8 +2362,7 @@
+ 
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::Echo{{{*/
+-	void Mesh::Echo(void) {
++	void Mesh::Echo(void) {/*{{{*/
+ 
+ 		int i;
+ 
+@@ -2408,51 +2385,49 @@
+ 
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::ForceBoundary{{{*/
+-		void Mesh::ForceBoundary() {
+-			/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/ForceBoundary)*/
++	void Mesh::ForceBoundary() {/*{{{*/
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/ForceBoundary)*/
+ 
+-			long int verbose=2;
+-			int k=0;
+-			int nbfe=0,nbswp=0,Nbswap=0;
++		long int verbose=2;
++		int k=0;
++		int nbfe=0,nbswp=0,Nbswap=0;
+ 
+-			//display
+-			if (verbose > 2) _printf_("   ForceBoundary  nb of edge: " << nbe << "\n");
++		//display
++		if (verbose > 2) _printf_("   ForceBoundary  nb of edge: " << nbe << "\n");
+ 
+-			//check that there is no triangle with 0 determinant
+-			for (int t = 0; t < nbt; t++){
+-				if (!triangles[t].det) k++;
+-			}
+-			if (k!=0) {
+-				_error_("there is " << k << " triangles of mes = 0");
+-			}
++		//check that there is no triangle with 0 determinant
++		for (int t = 0; t < nbt; t++){
++			if (!triangles[t].det) k++;
++		}
++		if (k!=0) {
++			_error_("there is " << k << " triangles of mes = 0");
++		}
+ 
+-			//Force Edges
+-			AdjacentTriangle ta(0,0);
+-			for (int i = 0; i < nbe; i++){
++		//Force Edges
++		AdjacentTriangle ta(0,0);
++		for (int i = 0; i < nbe; i++){
+ 
+-				//Force edge i
+-				nbswp =  ForceEdge(edges[i][0],edges[i][1],ta);
+-				if (nbswp<0) k++;
+-				else Nbswap += nbswp;
++			//Force edge i
++			nbswp =  ForceEdge(edges[i][0],edges[i][1],ta);
++			if (nbswp<0) k++;
++			else Nbswap += nbswp;
+ 
+-				if (nbswp) nbfe++;
+-				if ( nbswp < 0 && k < 5){
+-					_error_("Missing Edge " << i << ", v0=" << GetId(edges[i][0]) << ",v1=" << GetId(edges[i][1]));
+-				}
++			if (nbswp) nbfe++;
++			if ( nbswp < 0 && k < 5){
++				_error_("Missing Edge " << i << ", v0=" << GetId(edges[i][0]) << ",v1=" << GetId(edges[i][1]));
+ 			}
++		}
+ 
+-			if (k!=0) {
+-				_error_("There are " << k << " lost edges, the boundary might be crossing");
+-			}
+-			for (int j=0;j<nbv;j++){
+-				Nbswap +=  vertices[j].Optim(1,0);
+-			}
+-			if (verbose > 3) _printf_("      number of inforced edge = " << nbfe << ", number of swap= " << Nbswap << "\n"); 
++		if (k!=0) {
++			_error_("There are " << k << " lost edges, the boundary might be crossing");
+ 		}
++		for (int j=0;j<nbv;j++){
++			Nbswap +=  vertices[j].Optim(1,0);
++		}
++		if (verbose > 3) _printf_("      number of inforced edge = " << nbfe << ", number of swap= " << Nbswap << "\n"); 
++	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::FindSubDomain{{{*/
+-	void Mesh::FindSubDomain(int OutSide) {
++	void Mesh::FindSubDomain(int OutSide) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/FindSubDomain)*/
+ 
+ 		long int verbose=0;
+@@ -2694,38 +2669,31 @@
+ 			 if(!triangles[it].link)  nbtout++;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::GetId(const Triangle & t) const{{{*/
+-	long Mesh::GetId(const Triangle & t) const  { 
++	long Mesh::GetId(const Triangle & t) const  { /*{{{*/
+ 		return &t - triangles;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::GetId(const Triangle * t) const{{{*/
+-	long Mesh::GetId(const Triangle * t) const  { 
++	long Mesh::GetId(const Triangle * t) const  { /*{{{*/
+ 		return t - triangles;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::GetId(const BamgVertex & t) const{{{*/
+-	long Mesh::GetId(const BamgVertex & t) const  { 
++	long Mesh::GetId(const BamgVertex & t) const  { /*{{{*/
+ 		return &t - vertices;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::GetId(const BamgVertex * t) const{{{*/
+-	long Mesh::GetId(const BamgVertex * t) const  { 
++	long Mesh::GetId(const BamgVertex * t) const  { /*{{{*/
+ 		return t - vertices;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::GetId(const Edge & t) const{{{*/
+-	long Mesh::GetId(const Edge & t) const  { 
++	long Mesh::GetId(const Edge & t) const  { /*{{{*/
+ 		return &t - edges;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::GetId(const Edge * t) const{{{*/
+-	long Mesh::GetId(const Edge * t) const  { 
++	long Mesh::GetId(const Edge * t) const  { /*{{{*/
+ 		return t - edges;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::Init{{{*/
+-	void Mesh::Init(long maxnbv_in) {
++	void Mesh::Init(long maxnbv_in) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/PreInit)*/
+ 
+ 		/* initialize random seed: */
+@@ -2773,8 +2741,7 @@
+ 		} 
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::Insert{{{*/
+-	void Mesh::Insert(bool random) {
++	void Mesh::Insert(bool random) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/Insert)*/
+ 
+ 		/*Insert points in the existing Geometry*/
+@@ -2906,8 +2873,7 @@
+ 		}
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::InsertNewPoints{{{*/
+-	long Mesh::InsertNewPoints(long nbvold,long & NbTSwap,bool random) {
++	long Mesh::InsertNewPoints(long nbvold,long & NbTSwap,bool random) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/InsertNewPoints)*/
+ 
+ 		long int verbose=0;
+@@ -2984,8 +2950,7 @@
+ 		return nbv-nbvold;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::MakeGeomEdgeToEdge{{{*/
+-	Edge** Mesh::MakeGeomEdgeToEdge() {
++	Edge** Mesh::MakeGeomEdgeToEdge() {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/MakeGeomEdgeToEdge)*/
+ 
+ 		if (!Gh.nbe){
+@@ -3027,8 +2992,7 @@
+ 		return e;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::MakeQuadrangles{{{*/
+-	void Mesh::MakeQuadrangles(double costheta){
++	void Mesh::MakeQuadrangles(double costheta){/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/MakeQuadrangles)*/
+ 
+ 		long int verbose=0;
+@@ -3069,19 +3033,16 @@
+ 			delete [] qq;
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::MakeBamgQuadtree{{{*/
+-	void Mesh::MakeBamgQuadtree() {  
++	void Mesh::MakeBamgQuadtree() {  /*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/MakeBamgQuadtree)*/
+ 		if(!quadtree) quadtree = new BamgQuadtree(this);
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::MaxinalHmax{{{*/
+-	double Mesh::MaximalHmax() {
++	double Mesh::MaximalHmax() {/*{{{*/
+ 		return Max(pmax.x-pmin.x,pmax.y-pmin.y);
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::MaxSubDivision{{{*/
+-	void  Mesh::MaxSubDivision(double maxsubdiv) {
++	void  Mesh::MaxSubDivision(double maxsubdiv) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/MaxSubDivision)*/
+ 
+ 		long int verbose=0;
+@@ -3134,8 +3095,7 @@
+ 		}
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::MetricAt{{{*/
+-	Metric Mesh::MetricAt(const R2 & A) const { 
++	Metric Mesh::MetricAt(const R2 & A) const { /*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/MetricAt)*/
+ 
+ 		I2 a = R2ToI2(A);
+@@ -3155,19 +3115,16 @@
+ 		}
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::MininalHmin{{{*/
+-	double Mesh::MinimalHmin() {
++	double Mesh::MinimalHmin() {/*{{{*/
+ 		return 2.0/coefIcoor;
+ 	}
+ 	/*}}}*/
+-/*FUNCTION Mesh::NearestVertex{{{*/
+-BamgVertex* Mesh::NearestVertex(Icoor1 i,Icoor1 j) {
+-	/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/NearestVertex)*/
+-	return  quadtree->NearestVertex(i,j); 
+-} 
+-/*}}}*/
+-	/*FUNCTION Mesh::NewPoints{{{*/
+-	void  Mesh::NewPoints(Mesh & Bh,BamgOpts* bamgopts,int KeepVertices){
++	BamgVertex* Mesh::NearestVertex(Icoor1 i,Icoor1 j) {/*{{{*/
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/NearestVertex)*/
++		return  quadtree->NearestVertex(i,j); 
++	} 
++	/*}}}*/
++	void  Mesh::NewPoints(Mesh & Bh,BamgOpts* bamgopts,int KeepVertices){/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/NewPoints)*/
+ 
+ 		int i,j,k;
+@@ -3248,8 +3205,8 @@
+ 
+ 					lIntTria.SplitEdge(Bh,A,B);
+ 					lIntTria.NewPoints(vertices,nbv,maxnbv);
+-				  } // end loop for each edge 
+-			  }// for triangle   
++				} // end loop for each edge 
++			}// for triangle   
+ 
+ 			if (!InsertNewPoints(nbvold,NbTSwap,bamgopts->random)) break;
+ 			for (i=nbtold;i<nbt;i++) first_np_or_next_t[i]=iter;
+@@ -3280,8 +3237,7 @@
+ 		long NbSwapf =0;
+ 		for(i=0;i<nbv;i++) NbSwapf += vertices[i].Optim(0);
+ 	}/*}}}*/
+-	/*FUNCTION Mesh::ProjectOnCurve{{{*/
+-	GeomEdge*   Mesh::ProjectOnCurve( Edge & BhAB, BamgVertex &  vA, BamgVertex & vB,
++	GeomEdge*   Mesh::ProjectOnCurve( Edge & BhAB, BamgVertex &  vA, BamgVertex & vB,/*{{{*/
+ 				double theta,BamgVertex & R,VertexOnEdge &  BR,VertexOnGeom & GR) {
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshQuad.cpp/ProjectOnCurve)*/
+ 
+@@ -3342,7 +3298,7 @@
+ 		  } 
+ 		else{ // do the search by walking 
+ 			_error_("case not supported yet");
+-		  }
++		}
+ 
+ 		// find the direction of walking with direction of edge and pA,PB;
+ 		R2 AB=B-A;
+@@ -3380,8 +3336,8 @@
+ 					_assert_(thetab>=0 && thetab<=1);
+ 					BR = VertexOnEdge(&R,eee,thetab);
+ 					return  Gh.ProjectOnCurve(*eee,thetab,R,GR);
+-				  }
+-			  }
++				}
++			}
+ 			// we find the end 
+ 			if (v1 != pvB){
+ 				if (( void*) v1 == pB)
+@@ -3401,323 +3357,321 @@
+ 					BR = VertexOnEdge(&R,eee,thetab);
+ 					return  Gh.ProjectOnCurve(*eee,thetab,R,GR);
+ 				  }
+-			  }
++			}
+ 			abscisse = lg*theta;
+ 
+-		  }
++		}
+ 		_error_("Big bug...");
+ 		return 0; // just for the compiler 
+ 	}                  
+ 	/*}}}*/
+-/*FUNCTION Mesh::ReconstructExistingMesh{{{*/
+-void Mesh::ReconstructExistingMesh(){
+-	/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/FillHoleInMesh)*/
++	void Mesh::ReconstructExistingMesh(){/*{{{*/
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/FillHoleInMesh)*/
+ 
+-	/*This routine reconstruct an existing mesh to make it CONVEX:
+-	 * -all the holes are filled
+-	 * -concave boundaries are filled
+-	 * A convex mesh is required for a lot of operations. This is why every mesh
+-	 * goes through this process.
+-	 * This routine also generates mesh properties such as adjencies,...
+-	 */
++		/*This routine reconstruct an existing mesh to make it CONVEX:
++		 * -all the holes are filled
++		 * -concave boundaries are filled
++		 * A convex mesh is required for a lot of operations. This is why every mesh
++		 * goes through this process.
++		 * This routine also generates mesh properties such as adjencies,...
++		 */
+ 
+-	/*Intermediary*/
+-	int verbose=0;
++		/*Intermediary*/
++		int verbose=0;
+ 
+-	// generation of the integer coordinate
++		// generation of the integer coordinate
+ 
+-	// find extrema coordinates of vertices pmin,pmax
+-	long i;
+-	if(verbose>2) _printf_("      Reconstruct mesh of " << nbv << " vertices\n"); 
++		// find extrema coordinates of vertices pmin,pmax
++		long i;
++		if(verbose>2) _printf_("      Reconstruct mesh of " << nbv << " vertices\n"); 
+ 
+-	//initialize orderedvertices
+-	_assert_(orderedvertices);
+-	for (i=0;i<nbv;i++) orderedvertices[i]=0;
++		//initialize orderedvertices
++		_assert_(orderedvertices);
++		for (i=0;i<nbv;i++) orderedvertices[i]=0;
+ 
+-	//Initialize nbsubdomains
+-	nbsubdomains =0;
++		//Initialize nbsubdomains
++		nbsubdomains =0;
+ 
+-	/* generation of triangles adjacency*/
++		/* generation of triangles adjacency*/
+ 
+-	//First add existing edges
+-	long kk =0;
+-	SetOfEdges4* edge4= new SetOfEdges4(nbt*3,nbv);
+-	for (i=0;i<nbe;i++){
+-		kk=kk+(i==edge4->SortAndAdd(GetId(edges[i][0]),GetId(edges[i][1])));
+-	}
+-	if (kk != nbe){ 
+-		_error_("There are " << kk-nbe << " double edges in the mesh");
+-	}
++		//First add existing edges
++		long kk =0;
++		SetOfEdges4* edge4= new SetOfEdges4(nbt*3,nbv);
++		for (i=0;i<nbe;i++){
++			kk=kk+(i==edge4->SortAndAdd(GetId(edges[i][0]),GetId(edges[i][1])));
++		}
++		if (kk != nbe){ 
++			_error_("There are " << kk-nbe << " double edges in the mesh");
++		}
+ 
+-	//Add edges of all triangles in existing mesh
+-	long* st = new long[nbt*3];
+-	for (i=0;i<nbt*3;i++) st[i]=-1;
+-	for (i=0;i<nbt;i++){
+-		for (int j=0;j<3;j++){
++		//Add edges of all triangles in existing mesh
++		long* st = new long[nbt*3];
++		for (i=0;i<nbt*3;i++) st[i]=-1;
++		for (i=0;i<nbt;i++){
++			for (int j=0;j<3;j++){
+ 
+-			//Add current triangle edge to edge4
+-			long k =edge4->SortAndAdd(GetId(triangles[i][VerticesOfTriangularEdge[j][0]]),GetId(triangles[i][VerticesOfTriangularEdge[j][1]]));
++				//Add current triangle edge to edge4
++				long k =edge4->SortAndAdd(GetId(triangles[i][VerticesOfTriangularEdge[j][0]]),GetId(triangles[i][VerticesOfTriangularEdge[j][1]]));
+ 
+-			long invisible=triangles[i].Hidden(j);
++				long invisible=triangles[i].Hidden(j);
+ 
+-			//If the edge has not been added to st, add it
+-			if(st[k]==-1) st[k]=3*i+j;
++				//If the edge has not been added to st, add it
++				if(st[k]==-1) st[k]=3*i+j;
+ 
+-			//If the edge already exists, add adjacency
+-			else if(st[k]>=0) {
+-				_assert_(!triangles[i].TriangleAdj(j));
+-				_assert_(!triangles[st[k]/3].TriangleAdj((int) (st[k]%3)));
++				//If the edge already exists, add adjacency
++				else if(st[k]>=0) {
++					_assert_(!triangles[i].TriangleAdj(j));
++					_assert_(!triangles[st[k]/3].TriangleAdj((int) (st[k]%3)));
+ 
+-				triangles[i].SetAdj2(j,triangles+st[k]/3,(int)(st[k]%3));
+-				if (invisible) triangles[i].SetHidden(j);
+-				if (k<nbe)     triangles[i].SetLocked(j);
++					triangles[i].SetAdj2(j,triangles+st[k]/3,(int)(st[k]%3));
++					if (invisible) triangles[i].SetHidden(j);
++					if (k<nbe)     triangles[i].SetLocked(j);
+ 
+-				//Make st[k] negative so that it will throw an error message if it is found again
+-				st[k]=-2-st[k]; 
+-			}
++					//Make st[k] negative so that it will throw an error message if it is found again
++					st[k]=-2-st[k]; 
++				}
+ 
+-			//An edge belongs to 2 triangles
+-			else {
+-				_error_("The edge (" << GetId(triangles[i][VerticesOfTriangularEdge[j][0]]) << " , " << GetId(triangles[i][VerticesOfTriangularEdge[j][1]]) << ") belongs to more than 2 triangles");
++				//An edge belongs to 2 triangles
++				else {
++					_error_("The edge (" << GetId(triangles[i][VerticesOfTriangularEdge[j][0]]) << " , " << GetId(triangles[i][VerticesOfTriangularEdge[j][1]]) << ") belongs to more than 2 triangles");
++				}
+ 			}
+ 		}
+-	}
+ 
+-	//Display info if required
+-	if(verbose>5) {
+-		_printf_("         info of Mesh:\n");
+-		_printf_("            - number of vertices    = " << nbv << " \n"); 
+-		_printf_("            - number of triangles   = " << nbt << " \n"); 
+-		_printf_("            - number of given edges = " << nbe << " \n"); 
+-		_printf_("            - number of all edges   = " << edge4->nb() << "\n"); 
+-		_printf_("            - Euler number 1 - nb of holes = " << nbt-edge4->nb()+nbv << "\n"); 
+-	}
++		//Display info if required
++		if(verbose>5) {
++			_printf_("         info of Mesh:\n");
++			_printf_("            - number of vertices    = " << nbv << " \n"); 
++			_printf_("            - number of triangles   = " << nbt << " \n"); 
++			_printf_("            - number of given edges = " << nbe << " \n"); 
++			_printf_("            - number of all edges   = " << edge4->nb() << "\n"); 
++			_printf_("            - Euler number 1 - nb of holes = " << nbt-edge4->nb()+nbv << "\n"); 
++		}
+ 
+-	//check the consistency of edge[].adj and the geometrical required vertex
+-	long k=0;
+-	for (i=0;i<edge4->nb();i++){
+-		if (st[i]>=0){ // edge alone 
+-			if (i<nbe){
+-				long i0=edge4->i(i);
+-				orderedvertices[i0] = vertices+i0;
+-				long i1=edge4->j(i);
+-				orderedvertices[i1] = vertices+i1;
+-			}
+-			else {
+-				k=k+1;
+-				if (k<10) {
+-					//print only 10 edges
+-					_printf_("Lost boundary edges " << i << " : " << edge4->i(i) << " " << edge4->j(i) << "\n");
++		//check the consistency of edge[].adj and the geometrical required vertex
++		long k=0;
++		for (i=0;i<edge4->nb();i++){
++			if (st[i]>=0){ // edge alone 
++				if (i<nbe){
++					long i0=edge4->i(i);
++					orderedvertices[i0] = vertices+i0;
++					long i1=edge4->j(i);
++					orderedvertices[i1] = vertices+i1;
+ 				}
+-				else if (k==10){
+-					_printf_("Other lost boundary edges not shown...\n");
++				else {
++					k=k+1;
++					if (k<10) {
++						//print only 10 edges
++						_printf_("Lost boundary edges " << i << " : " << edge4->i(i) << " " << edge4->j(i) << "\n");
++					}
++					else if (k==10){
++						_printf_("Other lost boundary edges not shown...\n");
++					}
+ 				}
+ 			}
+ 		}
+-	}
+-	if(k) {
+-		_error_(k << " boundary edges (from the geometry) are not defined as mesh edges");
+-	}
++		if(k) {
++			_error_(k << " boundary edges (from the geometry) are not defined as mesh edges");
++		}
+ 
+-	/* mesh generation with boundary points*/
+-	long nbvb=0;
+-	for (i=0;i<nbv;i++){ 
+-		vertices[i].t=0;
+-		vertices[i].IndexInTriangle=0;
+-		if (orderedvertices[i]) orderedvertices[nbvb++]=orderedvertices[i];
+-	}
++		/* mesh generation with boundary points*/
++		long nbvb=0;
++		for (i=0;i<nbv;i++){ 
++			vertices[i].t=0;
++			vertices[i].IndexInTriangle=0;
++			if (orderedvertices[i]) orderedvertices[nbvb++]=orderedvertices[i];
++		}
+ 
+-	Triangle* savetriangles=triangles;
+-	long savenbt=nbt;
+-	long savemaxnbt=maxnbt;
+-	SubDomain* savesubdomains=subdomains;
+-	subdomains=0;
++		Triangle* savetriangles=triangles;
++		long savenbt=nbt;
++		long savemaxnbt=maxnbt;
++		SubDomain* savesubdomains=subdomains;
++		subdomains=0;
+ 
+-	long  Nbtriafillhole=2*nbvb;
+-	Triangle* triafillhole=new Triangle[Nbtriafillhole];
+-	triangles = triafillhole;
++		long  Nbtriafillhole=2*nbvb;
++		Triangle* triafillhole=new Triangle[Nbtriafillhole];
++		triangles = triafillhole;
+ 
+-	nbt=2;
+-	maxnbt= Nbtriafillhole;
++		nbt=2;
++		maxnbt= Nbtriafillhole;
+ 
+-	//Find a vertex that is not aligned with vertices 0 and 1
+-	for (i=2;det(orderedvertices[0]->i,orderedvertices[1]->i,orderedvertices[i]->i)==0;) 
+-	 if  (++i>=nbvb) {
+-		 _error_("ReconstructExistingMesh: All the vertices are aligned");
+-	 }
+-	//Move this vertex (i) to the 2d position in orderedvertices
+-	Exchange(orderedvertices[2], orderedvertices[i]);
++		//Find a vertex that is not aligned with vertices 0 and 1
++		for (i=2;det(orderedvertices[0]->i,orderedvertices[1]->i,orderedvertices[i]->i)==0;) 
++		 if  (++i>=nbvb) {
++			 _error_("ReconstructExistingMesh: All the vertices are aligned");
++		 }
++		//Move this vertex (i) to the 2d position in orderedvertices
++		Exchange(orderedvertices[2], orderedvertices[i]);
+ 
+-	/*Reconstruct mesh beginning with 2 triangles*/
+-	BamgVertex *  v0=orderedvertices[0], *v1=orderedvertices[1];
++		/*Reconstruct mesh beginning with 2 triangles*/
++		BamgVertex *  v0=orderedvertices[0], *v1=orderedvertices[1];
+ 
+-	triangles[0](0) = NULL; // Infinite vertex
+-	triangles[0](1) = v0;
+-	triangles[0](2) = v1;
++		triangles[0](0) = NULL; // Infinite vertex
++		triangles[0](1) = v0;
++		triangles[0](2) = v1;
+ 
+-	triangles[1](0) = NULL;// Infinite vertex
+-	triangles[1](2) = v0;
+-	triangles[1](1) = v1;
+-	const int e0 = OppositeEdge[0];
+-	const int e1 = NextEdge[e0];
+-	const int e2 = PreviousEdge[e0];
+-	triangles[0].SetAdj2(e0, &triangles[1] ,e0);
+-	triangles[0].SetAdj2(e1, &triangles[1] ,e2);
+-	triangles[0].SetAdj2(e2, &triangles[1] ,e1);
++		triangles[1](0) = NULL;// Infinite vertex
++		triangles[1](2) = v0;
++		triangles[1](1) = v1;
++		const int e0 = OppositeEdge[0];
++		const int e1 = NextEdge[e0];
++		const int e2 = PreviousEdge[e0];
++		triangles[0].SetAdj2(e0, &triangles[1] ,e0);
++		triangles[0].SetAdj2(e1, &triangles[1] ,e2);
++		triangles[0].SetAdj2(e2, &triangles[1] ,e1);
+ 
+-	triangles[0].det = -1;  // boundary triangles
+-	triangles[1].det = -1;  // boundary triangles
++		triangles[0].det = -1;  // boundary triangles
++		triangles[1].det = -1;  // boundary triangles
+ 
+-	triangles[0].SetSingleVertexToTriangleConnectivity();
+-	triangles[1].SetSingleVertexToTriangleConnectivity();
++		triangles[0].SetSingleVertexToTriangleConnectivity();
++		triangles[1].SetSingleVertexToTriangleConnectivity();
+ 
+-	triangles[0].link=&triangles[1];
+-	triangles[1].link=&triangles[0];
++		triangles[0].link=&triangles[1];
++		triangles[1].link=&triangles[0];
+ 
+-	if (!quadtree) delete quadtree; //ReInitialise;
+-	quadtree = new BamgQuadtree(this,0);
+-	quadtree->Add(*v0);
+-	quadtree->Add(*v1);
++		if (!quadtree) delete quadtree; //ReInitialise;
++		quadtree = new BamgQuadtree(this,0);
++		quadtree->Add(*v0);
++		quadtree->Add(*v1);
+ 
+-	// vertices are added one by one
+-	long NbSwap=0;
+-	for (int icount=2; icount<nbvb; icount++) {
+-		BamgVertex *vi  = orderedvertices[icount];
+-		Icoor2 det3[3];
+-		Triangle *tcvi = TriangleFindFromCoord(vi->i,det3);
+-		quadtree->Add(*vi); 
+-		AddVertex(*vi,tcvi,det3);
+-		NbSwap += vi->Optim(1,1);
+-	}
++		// vertices are added one by one
++		long NbSwap=0;
++		for (int icount=2; icount<nbvb; icount++) {
++			BamgVertex *vi  = orderedvertices[icount];
++			Icoor2 det3[3];
++			Triangle *tcvi = TriangleFindFromCoord(vi->i,det3);
++			quadtree->Add(*vi); 
++			AddVertex(*vi,tcvi,det3);
++			NbSwap += vi->Optim(1,1);
++		}
+ 
+-	//enforce the boundary 
+-	AdjacentTriangle ta(0,0);
+-	long nbloss = 0,knbe=0;
+-	for ( i = 0; i < nbe; i++){
+-		if (st[i] >=0){ //edge alone => on border
+-			BamgVertex &a=edges[i][0], &b=edges[i][1];
+-			if (a.t && b.t){
+-				knbe++;
+-				if (ForceEdge(a,b,ta)<0) nbloss++;
++		//enforce the boundary 
++		AdjacentTriangle ta(0,0);
++		long nbloss = 0,knbe=0;
++		for ( i = 0; i < nbe; i++){
++			if (st[i] >=0){ //edge alone => on border
++				BamgVertex &a=edges[i][0], &b=edges[i][1];
++				if (a.t && b.t){
++					knbe++;
++					if (ForceEdge(a,b,ta)<0) nbloss++;
++				}
+ 			}
+ 		}
+-	}
+-	if(nbloss) {
+-		_error_("we lost " << nbloss << " existing edges other " << knbe);
+-	}
++		if(nbloss) {
++			_error_("we lost " << nbloss << " existing edges other " << knbe);
++		}
+ 
+-	FindSubDomain(1);
+-	// remove all the hole 
+-	// remove all the good sub domain
+-	long krm =0;
+-	for (i=0;i<nbt;i++){
+-		if (triangles[i].link){ // remove triangles
+-			krm++;
+-			for (int j=0;j<3;j++){
+-				AdjacentTriangle ta =  triangles[i].Adj(j);
+-				Triangle &tta = *(Triangle*)ta;
+-				//if edge between remove and not remove 
+-				if(! tta.link){ 
+-					// change the link of ta;
+-					int ja = ta;
+-					BamgVertex *v0= ta.EdgeVertex(0);
+-					BamgVertex *v1= ta.EdgeVertex(1);
+-					long k =edge4->SortAndAdd(v0?GetId(v0):nbv,v1? GetId(v1):nbv);
++		FindSubDomain(1);
++		// remove all the hole 
++		// remove all the good sub domain
++		long krm =0;
++		for (i=0;i<nbt;i++){
++			if (triangles[i].link){ // remove triangles
++				krm++;
++				for (int j=0;j<3;j++){
++					AdjacentTriangle ta =  triangles[i].Adj(j);
++					Triangle &tta = *(Triangle*)ta;
++					//if edge between remove and not remove 
++					if(! tta.link){ 
++						// change the link of ta;
++						int ja = ta;
++						BamgVertex *v0= ta.EdgeVertex(0);
++						BamgVertex *v1= ta.EdgeVertex(1);
++						long k =edge4->SortAndAdd(v0?GetId(v0):nbv,v1? GetId(v1):nbv);
+ 
+-					_assert_(st[k]>=0);
+-					tta.SetAdj2(ja,savetriangles + st[k] / 3,(int) (st[k]%3));
+-					ta.SetLock();
+-					st[k]=-2-st[k]; 
++						_assert_(st[k]>=0);
++						tta.SetAdj2(ja,savetriangles + st[k] / 3,(int) (st[k]%3));
++						ta.SetLock();
++						st[k]=-2-st[k]; 
++					}
+ 				}
+ 			}
+ 		}
+-	}
+-	long NbTfillHoll =0;
+-	for (i=0;i<nbt;i++){
+-		if (triangles[i].link) {
+-			triangles[i]=Triangle((BamgVertex *) NULL,(BamgVertex *) NULL,(BamgVertex *) NULL);
+-			triangles[i].color=-1;
++		long NbTfillHoll =0;
++		for (i=0;i<nbt;i++){
++			if (triangles[i].link) {
++				triangles[i]=Triangle((BamgVertex *) NULL,(BamgVertex *) NULL,(BamgVertex *) NULL);
++				triangles[i].color=-1;
++			}
++			else{
++				triangles[i].color= savenbt+ NbTfillHoll++;
++			}
+ 		}
+-		else{
+-			triangles[i].color= savenbt+ NbTfillHoll++;
+-		}
+-	}
+-	_assert_(savenbt+NbTfillHoll<=savemaxnbt);
++		_assert_(savenbt+NbTfillHoll<=savemaxnbt);
+ 
+-	// copy of the outside triangles in saveMesh 
+-	for (i=0;i<nbt;i++){
+-		if(triangles[i].color>=0) {
+-			savetriangles[savenbt]=triangles[i];
+-			savetriangles[savenbt].link=0;
+-			savenbt++;
++		// copy of the outside triangles in saveMesh 
++		for (i=0;i<nbt;i++){
++			if(triangles[i].color>=0) {
++				savetriangles[savenbt]=triangles[i];
++				savetriangles[savenbt].link=0;
++				savenbt++;
++			}
+ 		}
+-	}
+-	// gestion of the adj
+-	k =0;
+-	Triangle * tmax = triangles + nbt;
+-	for (i=0;i<savenbt;i++) { 
+-		Triangle & ti = savetriangles[i];
+-		for (int j=0;j<3;j++){
+-			Triangle * ta = ti.TriangleAdj(j);
+-			int aa = ti.NuEdgeTriangleAdj(j);
+-			int lck = ti.Locked(j);
+-			if (!ta) k++; // bug 
+-			else if ( ta >= triangles && ta < tmax){
+-				ta= savetriangles + ta->color;
+-				ti.SetAdj2(j,ta,aa);
+-				if(lck) ti.SetLocked(j);
++		// gestion of the adj
++		k =0;
++		Triangle * tmax = triangles + nbt;
++		for (i=0;i<savenbt;i++) { 
++			Triangle & ti = savetriangles[i];
++			for (int j=0;j<3;j++){
++				Triangle * ta = ti.TriangleAdj(j);
++				int aa = ti.NuEdgeTriangleAdj(j);
++				int lck = ti.Locked(j);
++				if (!ta) k++; // bug 
++				else if ( ta >= triangles && ta < tmax){
++					ta= savetriangles + ta->color;
++					ti.SetAdj2(j,ta,aa);
++					if(lck) ti.SetLocked(j);
++				}
+ 			}
+ 		}
+-	}
+ 
+-	// restore triangles;
+-	nbt=savenbt;
+-	maxnbt=savemaxnbt;
+-	delete [] triangles;
+-	delete [] subdomains;
+-	triangles = savetriangles;
+-	subdomains = savesubdomains;
+-	if (k) {
+-		_error_("number of triangles edges alone = " << k);
+-	}
+-	FindSubDomain();
++		// restore triangles;
++		nbt=savenbt;
++		maxnbt=savemaxnbt;
++		delete [] triangles;
++		delete [] subdomains;
++		triangles = savetriangles;
++		subdomains = savesubdomains;
++		if (k) {
++			_error_("number of triangles edges alone = " << k);
++		}
++		FindSubDomain();
+ 
+-	delete edge4;
+-	delete [] st;
+-	for (i=0;i<nbv;i++) quadtree->Add(vertices[i]);
++		delete edge4;
++		delete [] st;
++		for (i=0;i<nbv;i++) quadtree->Add(vertices[i]);
+ 
+-	SetVertexFieldOn();
++		SetVertexFieldOn();
+ 
+-	/*Check requirements consistency*/
+-	for (i=0;i<nbe;i++){
+- 	/*If the current mesh edge is on Geometry*/
+-		if(edges[i].GeomEdgeHook){
+-			for(int j=0;j<2;j++){
+-				/*Go through the edges adjacent to current edge (if on the same curve)*/
+-				if (!edges[i].adj[j]){
+-					/*The edge is on Geometry and does not have 2 adjacent edges... (not on a closed curve)*/
+-					/*Check that the 2 vertices are on geometry AND required*/
+-					if(!edges[i][j].GeomEdgeHook->IsRequiredVertex()){
+-						_printf_("ReconstructExistingMesh error message: problem with the edge number " << i+1 << ": [" << GetId(edges[i][0])+1 << " " << GetId(edges[i][1])+1 << "]\n");
+-						_printf_("This edge is on geometrical edge number " << Gh.GetId(edges[i].GeomEdgeHook)+1 << "\n");
+-						if (edges[i][j].GeomEdgeHook->OnGeomVertex())
+-						 _printf_("the vertex number " << GetId(edges[i][j])+1 << " of this edge is a geometric BamgVertex number " << Gh.GetId(edges[i][j].GeomEdgeHook->gv)+1 << "\n");
+-						else if (edges[i][j].GeomEdgeHook->OnGeomEdge())
+-						 _printf_("the vertex number " << GetId(edges[i][j])+1 << " of this edge is a geometric Edge number " << Gh.GetId(edges[i][j].GeomEdgeHook->ge)+1 << "\n");
+-						else
+-						 _printf_("Its pointer is " << edges[i][j].GeomEdgeHook << "\n");
++		/*Check requirements consistency*/
++		for (i=0;i<nbe;i++){
++			/*If the current mesh edge is on Geometry*/
++			if(edges[i].GeomEdgeHook){
++				for(int j=0;j<2;j++){
++					/*Go through the edges adjacent to current edge (if on the same curve)*/
++					if (!edges[i].adj[j]){
++						/*The edge is on Geometry and does not have 2 adjacent edges... (not on a closed curve)*/
++						/*Check that the 2 vertices are on geometry AND required*/
++						if(!edges[i][j].GeomEdgeHook->IsRequiredVertex()){
++							_printf_("ReconstructExistingMesh error message: problem with the edge number " << i+1 << ": [" << GetId(edges[i][0])+1 << " " << GetId(edges[i][1])+1 << "]\n");
++							_printf_("This edge is on geometrical edge number " << Gh.GetId(edges[i].GeomEdgeHook)+1 << "\n");
++							if (edges[i][j].GeomEdgeHook->OnGeomVertex())
++							 _printf_("the vertex number " << GetId(edges[i][j])+1 << " of this edge is a geometric BamgVertex number " << Gh.GetId(edges[i][j].GeomEdgeHook->gv)+1 << "\n");
++							else if (edges[i][j].GeomEdgeHook->OnGeomEdge())
++							 _printf_("the vertex number " << GetId(edges[i][j])+1 << " of this edge is a geometric Edge number " << Gh.GetId(edges[i][j].GeomEdgeHook->ge)+1 << "\n");
++							else
++							 _printf_("Its pointer is " << edges[i][j].GeomEdgeHook << "\n");
+ 
+-						_printf_("This edge is on geometry and has no adjacent edge (open curve) and one of the tip is not required\n");
+-						_error_("See above (might be cryptic...)");
++							_printf_("This edge is on geometry and has no adjacent edge (open curve) and one of the tip is not required\n");
++							_error_("See above (might be cryptic...)");
++						}
+ 					}
+ 				}
+ 			}
+ 		}
+ 	}
+-}
+-/*}}}*/
+-	/*FUNCTION Mesh::TrianglesRenumberBySubDomain{{{*/
+-	void Mesh::TrianglesRenumberBySubDomain(bool justcompress){
++	/*}}}*/
++	void Mesh::TrianglesRenumberBySubDomain(bool justcompress){/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/ReNumberingTheTriangleBySubDomain)*/
+ 
+ 		long *renu= new long[nbt];
+@@ -3784,439 +3738,428 @@
+ 
+ 	}
+ 	/*}}}*/
+-/*FUNCTION Mesh::SetIntCoor{{{*/
+-void Mesh::SetIntCoor(const char * strfrom) {
+-	/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/SetIntCoor)*/
++	void Mesh::SetIntCoor(const char * strfrom) {/*{{{*/
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/SetIntCoor)*/
+ 
+-	/*Set integer coordinate for existing vertices*/
++		/*Set integer coordinate for existing vertices*/
+ 
+-	//Get extrema coordinates of the existing vertices
+-	pmin =  vertices[0].r;
+-	pmax =  vertices[0].r;
+-	long i;
+-	for (i=0;i<nbv;i++) {
+-		pmin.x = Min(pmin.x,vertices[i].r.x);
+-		pmin.y = Min(pmin.y,vertices[i].r.y);
+-		pmax.x = Max(pmax.x,vertices[i].r.x);
+-		pmax.y = Max(pmax.y,vertices[i].r.y);
+-	}
+-	R2 DD = (pmax-pmin)*0.05;
+-	pmin = pmin-DD;
+-	pmax = pmax+DD; 
++		//Get extrema coordinates of the existing vertices
++		pmin =  vertices[0].r;
++		pmax =  vertices[0].r;
++		long i;
++		for (i=0;i<nbv;i++) {
++			pmin.x = Min(pmin.x,vertices[i].r.x);
++			pmin.y = Min(pmin.y,vertices[i].r.y);
++			pmax.x = Max(pmax.x,vertices[i].r.x);
++			pmax.y = Max(pmax.y,vertices[i].r.y);
++		}
++		R2 DD = (pmax-pmin)*0.05;
++		pmin = pmin-DD;
++		pmax = pmax+DD; 
+ 
+-	//Compute coefIcoor
+-	coefIcoor= (MaxICoor)/(Max(pmax.x-pmin.x,pmax.y-pmin.y));
+-	if (coefIcoor<=0){
+-		_error_("coefIcoor should be positive, a problem in the geometry is likely");
+-	}
++		//Compute coefIcoor
++		coefIcoor= (MaxICoor)/(Max(pmax.x-pmin.x,pmax.y-pmin.y));
++		if (coefIcoor<=0){
++			_error_("coefIcoor should be positive, a problem in the geometry is likely");
++		}
+ 
+-	// generation of integer coord  
+-	for (i=0;i<nbv;i++) {
+-		vertices[i].i = R2ToI2(vertices[i].r);    
+-	}
++		// generation of integer coord  
++		for (i=0;i<nbv;i++) {
++			vertices[i].i = R2ToI2(vertices[i].r);    
++		}
+ 
+-	// computation of the det 
+-	int number_of_errors=0;
+-	for (i=0;i<nbt;i++) {
+-		BamgVertex & v0 = triangles[i][0];
+-		BamgVertex & v1 = triangles[i][1];
+-		BamgVertex & v2 = triangles[i][2];
++		// computation of the det 
++		int number_of_errors=0;
++		for (i=0;i<nbt;i++) {
++			BamgVertex & v0 = triangles[i][0];
++			BamgVertex & v1 = triangles[i][1];
++			BamgVertex & v2 = triangles[i][2];
+ 
+-		//If this is not a boundary triangle
+-		if ( &v0 && &v1 &&  &v2 ){
++			//If this is not a boundary triangle
++			if ( &v0 && &v1 &&  &v2 ){
+ 
+-			/*Compute determinant*/
+-			triangles[i].det= det(v0,v1,v2);
++				/*Compute determinant*/
++				triangles[i].det= det(v0,v1,v2);
+ 
+-			/*Check that determinant is positive*/
+-			if (triangles[i].det <=0){
++				/*Check that determinant is positive*/
++				if (triangles[i].det <=0){
+ 
+-				/*increase number_of_errors and print error only for the first 20 triangles*/
+-				number_of_errors++;
+-				if (number_of_errors<20){
+-					_printf_("Area of Triangle " << i+1 << " < 0 (det=" << triangles[i].det << ")\n");
++					/*increase number_of_errors and print error only for the first 20 triangles*/
++					number_of_errors++;
++					if (number_of_errors<20){
++						_printf_("Area of Triangle " << i+1 << " < 0 (det=" << triangles[i].det << ")\n");
++					}
+ 				}
+ 			}
++
++			//else, set as -1
++			else triangles[i].det=-1;
+ 		}
+ 
+-		//else, set as -1
+-		else triangles[i].det=-1;
++		if (number_of_errors) _error_("Fatal error: some triangles have negative areas, see above");
+ 	}
++	/*}}}*/
++	void Mesh::SmoothingVertex(int nbiter,double omega ) { /*{{{*/
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/SmoothingVertex)*/
+ 
+-	if (number_of_errors) _error_("Fatal error: some triangles have negative areas, see above");
+-}
+-/*}}}*/
+-/*FUNCTION Mesh::SmoothingVertex{{{*/
+-void Mesh::SmoothingVertex(int nbiter,double omega ) { 
+-	/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/SmoothingVertex)*/
+-
+-	long int verbose=0;
+-	//  if quatree exist remove it end reconstruct
+-	if (quadtree) delete quadtree;
+-	quadtree=0;
+-	CreateSingleVertexToTriangleConnectivity();
+-	Triangle vide; // a triangle to mark the boundary vertex
+-	Triangle   ** tstart= new Triangle* [nbv];
+-	long i,j,k;
+-	//   attention si Background == Triangle alors on ne peut pas utiliser la rechech rapide 
+-	if ( this == & BTh)
+-	 for ( i=0;i<nbv;i++)
+-	  tstart[i]=vertices[i].t;     
+-	else 
+-	 for ( i=0;i<nbv;i++)
+-	  tstart[i]=0;
+-	for ( j=0;j<NbVerticesOnGeomVertex;j++ ) 
+-	 tstart[ GetId(VerticesOnGeomVertex[j].meshvertex)]=&vide;
+-	for ( k=0;k<NbVerticesOnGeomEdge;k++ ) 
+-	 tstart[ GetId(VerticesOnGeomEdge[k].meshvertex)]=&vide;
+-	if(verbose>2) _printf_("   SmoothingVertex: nb Iteration = " << nbiter << ", Omega=" << omega << "\n");
+-	for (k=0;k<nbiter;k++)
+-	  {
+-		long i,NbSwap =0;
+-		double delta =0;
+-		for ( i=0;i<nbv;i++)
+-		 if (tstart[i] != &vide) // not a boundary vertex 
+-		  delta=Max(delta,vertices[i].Smoothing(*this,BTh,tstart[i],omega));
+-		if (!nbq)
++		long int verbose=0;
++		//  if quatree exist remove it end reconstruct
++		if (quadtree) delete quadtree;
++		quadtree=0;
++		CreateSingleVertexToTriangleConnectivity();
++		Triangle vide; // a triangle to mark the boundary vertex
++		Triangle   ** tstart= new Triangle* [nbv];
++		long i,j,k;
++		//   attention si Background == Triangle alors on ne peut pas utiliser la rechech rapide 
++		if ( this == & BTh)
+ 		 for ( i=0;i<nbv;i++)
+-		  if (tstart[i] != &vide) // not a boundary vertex 
+-			NbSwap += vertices[i].Optim(1);
+-		if (verbose>3) _printf_("      move max = " << pow(delta,0.5) << ", iteration = " << k << ", nb of swap = " << NbSwap << "\n");
+-	  }
++		  tstart[i]=vertices[i].t;     
++		else 
++		 for ( i=0;i<nbv;i++)
++		  tstart[i]=0;
++		for ( j=0;j<NbVerticesOnGeomVertex;j++ ) 
++		 tstart[ GetId(VerticesOnGeomVertex[j].meshvertex)]=&vide;
++		for ( k=0;k<NbVerticesOnGeomEdge;k++ ) 
++		 tstart[ GetId(VerticesOnGeomEdge[k].meshvertex)]=&vide;
++		if(verbose>2) _printf_("   SmoothingVertex: nb Iteration = " << nbiter << ", Omega=" << omega << "\n");
++		for (k=0;k<nbiter;k++)
++		  {
++			long i,NbSwap =0;
++			double delta =0;
++			for ( i=0;i<nbv;i++)
++			 if (tstart[i] != &vide) // not a boundary vertex 
++			  delta=Max(delta,vertices[i].Smoothing(*this,BTh,tstart[i],omega));
++			if (!nbq)
++			 for ( i=0;i<nbv;i++)
++			  if (tstart[i] != &vide) // not a boundary vertex 
++				NbSwap += vertices[i].Optim(1);
++			if (verbose>3) _printf_("      move max = " << pow(delta,0.5) << ", iteration = " << k << ", nb of swap = " << NbSwap << "\n");
++		  }
+ 
+-	delete [] tstart;
+-	if (quadtree) quadtree= new BamgQuadtree(this);
+-}
+-/*}}}*/
+-/*FUNCTION Mesh::SmoothMetric{{{*/
+-void Mesh::SmoothMetric(double raisonmax) { 
+-	/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/SmoothMetric)*/
++		delete [] tstart;
++		if (quadtree) quadtree= new BamgQuadtree(this);
++	}
++	/*}}}*/
++	void Mesh::SmoothMetric(double raisonmax) { /*{{{*/
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Metric.cpp/SmoothMetric)*/
+ 
+-	long int verbose=0;
++		long int verbose=0;
+ 
+-	if(raisonmax<1.1) return;
+-	if(verbose > 1) _printf_("   Mesh::SmoothMetric raisonmax = " << raisonmax << "\n");
+-	CreateSingleVertexToTriangleConnectivity();
+-	long i,j,kch,kk,ip;
+-	long *first_np_or_next_t0 = new long[nbv];
+-	long *first_np_or_next_t1 = new long[nbv];
+-	long Head0 =0,Head1=-1;
+-	double logseuil= log(raisonmax);
++		if(raisonmax<1.1) return;
++		if(verbose > 1) _printf_("   Mesh::SmoothMetric raisonmax = " << raisonmax << "\n");
++		CreateSingleVertexToTriangleConnectivity();
++		long i,j,kch,kk,ip;
++		long *first_np_or_next_t0 = new long[nbv];
++		long *first_np_or_next_t1 = new long[nbv];
++		long Head0 =0,Head1=-1;
++		double logseuil= log(raisonmax);
+ 
+-	for(i=0;i<nbv-1;i++)
+-	 first_np_or_next_t0[i]=i+1; 
+-	first_np_or_next_t0[nbv-1]=-1;// end;
+-	for(i=0;i<nbv;i++)
+-	 first_np_or_next_t1[i]=-1;
+-	kk=0;
+-	while(Head0>=0&& kk++<100){
+-		kch=0;
+-		for(i=Head0;i>=0;i=first_np_or_next_t0[ip=i],first_np_or_next_t0[ip]=-1) {
+-			//  pour tous les triangles autour du sommet s
+-			Triangle* t= vertices[i].t;
+-			if (!t){
+-				_error_("!t");
+-			}
+-			BamgVertex & vi = vertices[i];
+-			AdjacentTriangle ta(t,EdgesVertexTriangle[vertices[i].IndexInTriangle][0]);
+-			BamgVertex *pvj0 = ta.EdgeVertex(0);
+-			while (1) {
+-				ta=Previous(Adj(ta));
+-				if (vertices+i != ta.EdgeVertex(1)){
+-					_error_("vertices+i != ta.EdgeVertex(1)");
++		for(i=0;i<nbv-1;i++)
++		 first_np_or_next_t0[i]=i+1; 
++		first_np_or_next_t0[nbv-1]=-1;// end;
++		for(i=0;i<nbv;i++)
++		 first_np_or_next_t1[i]=-1;
++		kk=0;
++		while(Head0>=0&& kk++<100){
++			kch=0;
++			for(i=Head0;i>=0;i=first_np_or_next_t0[ip=i],first_np_or_next_t0[ip]=-1) {
++				//  pour tous les triangles autour du sommet s
++				Triangle* t= vertices[i].t;
++				if (!t){
++					_error_("!t");
+ 				}
+-				BamgVertex & vj = *(ta.EdgeVertex(0));
+-				if ( &vj ) {
+-					j= &vj-vertices;
+-					if (j<0 || j >= nbv){
+-						_error_("j<0 || j >= nbv");
++				BamgVertex & vi = vertices[i];
++				AdjacentTriangle ta(t,EdgesVertexTriangle[vertices[i].IndexInTriangle][0]);
++				BamgVertex *pvj0 = ta.EdgeVertex(0);
++				while (1) {
++					ta=Previous(Adj(ta));
++					if (vertices+i != ta.EdgeVertex(1)){
++						_error_("vertices+i != ta.EdgeVertex(1)");
+ 					}
+-					R2 Aij = (R2) vj - (R2) vi;
+-					double ll =  Norme2(Aij);
+-					if (0) {  
+-						double hi = ll/vi.m(Aij);
+-						double hj = ll/vj.m(Aij);
+-						if(hi < hj)
++					BamgVertex & vj = *(ta.EdgeVertex(0));
++					if ( &vj ) {
++						j= &vj-vertices;
++						if (j<0 || j >= nbv){
++							_error_("j<0 || j >= nbv");
++						}
++						R2 Aij = (R2) vj - (R2) vi;
++						double ll =  Norme2(Aij);
++						if (0) {  
++							double hi = ll/vi.m(Aij);
++							double hj = ll/vj.m(Aij);
++							if(hi < hj)
++							  {
++								double dh=(hj-hi)/ll;
++								if (dh>logseuil) {
++									vj.m.IntersectWith(vi.m/(1 +logseuil*ll/hi));
++									if(first_np_or_next_t1[j]<0)
++									 kch++,first_np_or_next_t1[j]=Head1,Head1=j;
++								}
++							  }
++						} 
++						else
+ 						  {
+-							double dh=(hj-hi)/ll;
+-							if (dh>logseuil) {
+-								vj.m.IntersectWith(vi.m/(1 +logseuil*ll/hi));
+-								if(first_np_or_next_t1[j]<0)
+-								 kch++,first_np_or_next_t1[j]=Head1,Head1=j;
+-							}
++							double li = vi.m(Aij);
++							if( vj.m.IntersectWith(vi.m/(1 +logseuil*li)) )
++							 if(first_np_or_next_t1[j]<0) // if the metrix change 
++							  kch++,first_np_or_next_t1[j]=Head1,Head1=j;
+ 						  }
+-					} 
+-					else
+-					  {
+-						double li = vi.m(Aij);
+-						if( vj.m.IntersectWith(vi.m/(1 +logseuil*li)) )
+-						 if(first_np_or_next_t1[j]<0) // if the metrix change 
+-						  kch++,first_np_or_next_t1[j]=Head1,Head1=j;
+-					  }
++					}
++					if  ( &vj ==  pvj0 ) break;
+ 				}
+-				if  ( &vj ==  pvj0 ) break;
+ 			}
++			Head0 = Head1;
++			Head1 = -1;
++			Exchange(first_np_or_next_t0,first_np_or_next_t1);
+ 		}
+-		Head0 = Head1;
+-		Head1 = -1;
+-		Exchange(first_np_or_next_t0,first_np_or_next_t1);
++		if(verbose>2) _printf_("      number of iterations = " << kch << "\n"); 
++		delete [] first_np_or_next_t0;
++		delete [] first_np_or_next_t1;
+ 	}
+-	if(verbose>2) _printf_("      number of iterations = " << kch << "\n"); 
+-	delete [] first_np_or_next_t0;
+-	delete [] first_np_or_next_t1;
+-}
+-/*}}}*/
+-/*FUNCTION Mesh::SplitInternalEdgeWithBorderVertices{{{*/
+-long  Mesh::SplitInternalEdgeWithBorderVertices(){
+-	/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/SplitInternalEdgeWithBorderVertices)*/
++	/*}}}*/
++	long  Mesh::SplitInternalEdgeWithBorderVertices(){/*{{{*/
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/SplitInternalEdgeWithBorderVertices)*/
+ 
+-	long NbSplitEdge=0;
+-	SetVertexFieldOn();  
+-	long it;
+-	long nbvold=nbv;
+-	long int verbose=2;
+-	for (it=0;it<nbt;it++){
+-		Triangle &t=triangles[it];
+-		if (t.link)
+-		 for (int j=0;j<3;j++)
+-		  if(!t.Locked(j) && !t.Hidden(j)){
+-			  Triangle &tt = *t.TriangleAdj(j);
+-			  if ( &tt && tt.link && it < GetId(tt)) 
+-				 { // an internal edge 
+-				  BamgVertex &v0 = t[VerticesOfTriangularEdge[j][0]];
+-				  BamgVertex &v1 = t[VerticesOfTriangularEdge[j][1]];
+-				  if (v0.GeomEdgeHook && v1.GeomEdgeHook){
+-					  R2 P= ((R2) v0 + (R2) v1)*0.5;
+-					  if ( nbv<maxnbv) {
+-						  vertices[nbv].r = P;
+-						  vertices[nbv++].m = Metric(0.5,v0.m,0.5,v1.m);
+-						  vertices[nbv].ReferenceNumber=0;
+-						  vertices[nbv].DirOfSearch = NoDirOfSearch ;
++		long NbSplitEdge=0;
++		SetVertexFieldOn();  
++		long it;
++		long nbvold=nbv;
++		long int verbose=2;
++		for (it=0;it<nbt;it++){
++			Triangle &t=triangles[it];
++			if (t.link)
++			 for (int j=0;j<3;j++)
++			  if(!t.Locked(j) && !t.Hidden(j)){
++				  Triangle &tt = *t.TriangleAdj(j);
++				  if ( &tt && tt.link && it < GetId(tt)) 
++					 { // an internal edge 
++					  BamgVertex &v0 = t[VerticesOfTriangularEdge[j][0]];
++					  BamgVertex &v1 = t[VerticesOfTriangularEdge[j][1]];
++					  if (v0.GeomEdgeHook && v1.GeomEdgeHook){
++						  R2 P= ((R2) v0 + (R2) v1)*0.5;
++						  if ( nbv<maxnbv) {
++							  vertices[nbv].r = P;
++							  vertices[nbv++].m = Metric(0.5,v0.m,0.5,v1.m);
++							  vertices[nbv].ReferenceNumber=0;
++							  vertices[nbv].DirOfSearch = NoDirOfSearch ;
++						  }
++						  NbSplitEdge++;
+ 					  }
+-					  NbSplitEdge++;
+-				  }
+-				 }
+-		  }
+-	}
+-	CreateSingleVertexToTriangleConnectivity();    
+-	if (nbvold!=nbv){
+-		long  iv = nbvold;
+-		long NbSwap = 0;
+-		Icoor2 det3[3];  
+-		for (int i=nbvold;i<nbv;i++) {// for all the new point
+-			BamgVertex & vi = vertices[i];
+-			vi.i = R2ToI2(vi.r);
+-			vi.r = I2ToR2(vi.i);
++					 }
++			  }
++		}
++		CreateSingleVertexToTriangleConnectivity();    
++		if (nbvold!=nbv){
++			long  iv = nbvold;
++			long NbSwap = 0;
++			Icoor2 det3[3];  
++			for (int i=nbvold;i<nbv;i++) {// for all the new point
++				BamgVertex & vi = vertices[i];
++				vi.i = R2ToI2(vi.r);
++				vi.r = I2ToR2(vi.i);
+ 
+-			// a good new point 
+-			vi.ReferenceNumber=0; 
+-			vi.DirOfSearch =NoDirOfSearch;
+-			Triangle *tcvi = TriangleFindFromCoord(vi.i,det3);
+-			if (tcvi && !tcvi->link) {
+-				_printf_("problem inserting point in SplitInternalEdgeWithBorderVertices (tcvj && !tcvj->link)\n");
+-			}
++				// a good new point 
++				vi.ReferenceNumber=0; 
++				vi.DirOfSearch =NoDirOfSearch;
++				Triangle *tcvi = TriangleFindFromCoord(vi.i,det3);
++				if (tcvi && !tcvi->link) {
++					_printf_("problem inserting point in SplitInternalEdgeWithBorderVertices (tcvj && !tcvj->link)\n");
++				}
+ 
+-			quadtree->Add(vi);
+-			if (!tcvi || tcvi->det<0){// internal
+-				_error_("!tcvi || tcvi->det < 0");
++				quadtree->Add(vi);
++				if (!tcvi || tcvi->det<0){// internal
++					_error_("!tcvi || tcvi->det < 0");
++				}
++				AddVertex(vi,tcvi,det3);
++				NbSwap += vi.Optim(1);          
++				iv++;
+ 			}
+-			AddVertex(vi,tcvi,det3);
+-			NbSwap += vi.Optim(1);          
+-			iv++;
++			if (verbose>3) {
++				_printf_("   number of points: " << iv << "\n");
++				_printf_("   number of swap to  split internal edges with border vertices: " << NbSwap << "\n");
++				nbv = iv;
++			}
+ 		}
+-		if (verbose>3) {
+-			_printf_("   number of points: " << iv << "\n");
+-			_printf_("   number of swap to  split internal edges with border vertices: " << NbSwap << "\n");
+-			nbv = iv;
+-		}
++		if (NbSplitEdge>nbv-nbvold) _printf_("WARNING: not enough vertices  to split all internal edges, we lost " << NbSplitEdge - ( nbv-nbvold) << " edges...\n");
++		if (verbose>2) _printf_("SplitInternalEdgeWithBorderVertices: Number of splited edge " << NbSplitEdge << "\n");
++
++		return  NbSplitEdge;
+ 	}
+-	if (NbSplitEdge>nbv-nbvold) _printf_("WARNING: not enough vertices  to split all internal edges, we lost " << NbSplitEdge - ( nbv-nbvold) << " edges...\n");
+-	if (verbose>2) _printf_("SplitInternalEdgeWithBorderVertices: Number of splited edge " << NbSplitEdge << "\n");
++	/*}}}*/
++	I2 Mesh::R2ToI2(const R2 & P) const {/*{{{*/
++		return  I2( (Icoor1) (coefIcoor*(P.x-pmin.x)),(Icoor1) (coefIcoor*(P.y-pmin.y)) );
++	}
++	/*}}}*/
++	R2 Mesh::I2ToR2(const I2 & P) const {/*{{{*/
++		return  R2( (double) P.x/coefIcoor+pmin.x, (double) P.y/coefIcoor+pmin.y);
++	}
++	/*}}}*/
++	Triangle * Mesh::TriangleFindFromCoord(const I2 & B,Icoor2 det3[3], Triangle *tstart) const {/*{{{*/
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/FindTriangleContening)*/
+ 
+-	return  NbSplitEdge;
+-}
+-/*}}}*/
+-/*FUNCTION Mesh::ToI2{{{*/
+-I2 Mesh::R2ToI2(const R2 & P) const {
+-	return  I2( (Icoor1) (coefIcoor*(P.x-pmin.x)),(Icoor1) (coefIcoor*(P.y-pmin.y)) );
+-}
+-/*}}}*/
+-/*FUNCTION Mesh::ToR2{{{*/
+-R2 Mesh::I2ToR2(const I2 & P) const {
+-	return  R2( (double) P.x/coefIcoor+pmin.x, (double) P.y/coefIcoor+pmin.y);
+-}
+-/*}}}*/
+-/*FUNCTION Mesh::TriangleFindFromCoord{{{*/
+-Triangle * Mesh::TriangleFindFromCoord(const I2 & B,Icoor2 det3[3], Triangle *tstart) const {
+-	/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/FindTriangleContening)*/
++		Triangle * t=0;	
++		int j,jp,jn,jj;
++		int counter;
+ 
+-	Triangle * t=0;	
+-	int j,jp,jn,jj;
+-	int counter;
++		/*Get starting triangle. Take tsart if provided*/
++		if (tstart) t=tstart;
+ 
+-	/*Get starting triangle. Take tsart if provided*/
+-	if (tstart) t=tstart;
++		/*Else find the closest Triangle using the quadtree*/
++		else {
+ 
+-	/*Else find the closest Triangle using the quadtree*/
+-	else {
++			/*Check that the quadtree does exist*/
++			if (!quadtree) _error_("no starting triangle provided and no quadtree available");
+ 
+-		/*Check that the quadtree does exist*/
+-		if (!quadtree) _error_("no starting triangle provided and no quadtree available");
++			/*Call NearestVertex*/
++			BamgVertex *a = quadtree->NearestVertex(B.x,B.y) ;
+ 
+-		/*Call NearestVertex*/
+-		BamgVertex *a = quadtree->NearestVertex(B.x,B.y) ;
++			/*Check output (Vertex a)*/
++			if (!a)    _error_("problem while trying to find nearest vertex from a given point. No output found");
++			if (!a->t) _error_("no triangle is associated to vertex number " << GetId(a)+1 << " (orphan?)");
++			_assert_(a>=vertices && a<vertices+nbv);
+ 
+-		/*Check output (Vertex a)*/
+-		if (!a)    _error_("problem while trying to find nearest vertex from a given point. No output found");
+-		if (!a->t) _error_("no triangle is associated to vertex number " << GetId(a)+1 << " (orphan?)");
+-		_assert_(a>=vertices && a<vertices+nbv);
++			/*Get starting triangle*/
++			t = a->t;
++			_assert_(t>=triangles && t<triangles+nbt);
++		}
+ 
+-		/*Get starting triangle*/
+-		t = a->t;
+-		_assert_(t>=triangles && t<triangles+nbt);
+-	}
++		Icoor2  detop ;
+ 
+-	Icoor2  detop ;
++		/*initialize number of test triangle*/
++		counter=0; 
+ 
+-	/*initialize number of test triangle*/
+-	counter=0; 
++		/*The initial triangle might be outside*/
++		while (t->det < 0){ 
+ 
+-	/*The initial triangle might be outside*/
+-	while (t->det < 0){ 
++			/*Get a real vertex from this triangle (k0)*/
++			int k0=(*t)(0)?(((*t)(1)?((*t)(2)?-1:2):1)):0;
++			_assert_(k0>=0);// k0 the NULL vertex
++			int k1=NextVertex[k0],k2=PreviousVertex[k0];
++			det3[k0]=det(B,(*t)[k1],(*t)[k2]);
++			det3[k1]=det3[k2]=-1;     
++			if (det3[k0] > 0) // outside B 
++			 return t; 
++			t = t->TriangleAdj(OppositeEdge[k0]);
++			counter++;
++			_assert_(counter<2);
++		}
+ 
+-		/*Get a real vertex from this triangle (k0)*/
+-		int k0=(*t)(0)?(((*t)(1)?((*t)(2)?-1:2):1)):0;
+-		_assert_(k0>=0);// k0 the NULL vertex
+-		int k1=NextVertex[k0],k2=PreviousVertex[k0];
+-		det3[k0]=det(B,(*t)[k1],(*t)[k2]);
+-		det3[k1]=det3[k2]=-1;     
+-		if (det3[k0] > 0) // outside B 
+-		 return t; 
+-		t = t->TriangleAdj(OppositeEdge[k0]);
+-		counter++;
+-		_assert_(counter<2);
+-	}
++		jj=0;
++		detop = det(*(*t)(VerticesOfTriangularEdge[jj][0]),*(*t)(VerticesOfTriangularEdge[jj][1]),B);
+ 
+-	jj=0;
+-	detop = det(*(*t)(VerticesOfTriangularEdge[jj][0]),*(*t)(VerticesOfTriangularEdge[jj][1]),B);
++		while(t->det>0){
+ 
+-	while(t->det>0){
++			/*Increase counter*/
++			if (++counter>=10000) _error_("Maximum number of iteration reached (threshold = " << counter << ").");
+ 
+-		/*Increase counter*/
+-		if (++counter>=10000) _error_("Maximum number of iteration reached (threshold = " << counter << ").");
++			j= OppositeVertex[jj];
++			det3[j] = detop;  //det(*b,*s1,*s2);
++			jn = NextVertex[j];
++			jp = PreviousVertex[j];
++			det3[jp]= det(*(*t)(j),*(*t)(jn),B);
++			det3[jn] = t->det-det3[j] -det3[jp];
+ 
+-		j= OppositeVertex[jj];
+-		det3[j] = detop;  //det(*b,*s1,*s2);
+-		jn = NextVertex[j];
+-		jp = PreviousVertex[j];
+-		det3[jp]= det(*(*t)(j),*(*t)(jn),B);
+-		det3[jn] = t->det-det3[j] -det3[jp];
++			// count the number k of  det3 <0
++			int k=0,ii[3];
++			if (det3[0] < 0 ) ii[k++]=0; 
++			if (det3[1] < 0 ) ii[k++]=1;
++			if (det3[2] < 0 ) ii[k++]=2;
++			// 0 => ok
++			// 1 => go in way 1
++			// 2 => two way go in way 1 or 2 randomly
+ 
+-		// count the number k of  det3 <0
+-		int k=0,ii[3];
+-		if (det3[0] < 0 ) ii[k++]=0; 
+-		if (det3[1] < 0 ) ii[k++]=1;
+-		if (det3[2] < 0 ) ii[k++]=2;
+-		// 0 => ok
+-		// 1 => go in way 1
+-		// 2 => two way go in way 1 or 2 randomly
++			if (k==0) break;
++			if (k==2 && BinaryRand()) Exchange(ii[0],ii[1]);
++			_assert_(k<3);
++			AdjacentTriangle t1 = t->Adj(jj=ii[0]);
++			if ((t1.det() < 0 ) && (k == 2))
++			 t1 = t->Adj(jj=ii[1]);
++			t=t1;
++			j=t1;// for optimisation we now the -det[OppositeVertex[j]];
++			detop = -det3[OppositeVertex[jj]];
++			jj = j;
++		}
+ 
+-		if (k==0) break;
+-		if (k==2 && BinaryRand()) Exchange(ii[0],ii[1]);
+-		_assert_(k<3);
+-		AdjacentTriangle t1 = t->Adj(jj=ii[0]);
+-		if ((t1.det() < 0 ) && (k == 2))
+-		 t1 = t->Adj(jj=ii[1]);
+-		t=t1;
+-		j=t1;// for optimisation we now the -det[OppositeVertex[j]];
+-		detop = -det3[OppositeVertex[jj]];
+-		jj = j;
++		if (t->det<0) // outside triangle 
++		 det3[0]=det3[1]=det3[2]=-1,det3[OppositeVertex[jj]]=detop;
++		return t;
+ 	}
++	/*}}}*/
++	void Mesh::TriangleIntNumbering(long* renumbering){/*{{{*/
+ 
+-	if (t->det<0) // outside triangle 
+-	 det3[0]=det3[1]=det3[2]=-1,det3[OppositeVertex[jj]]=detop;
+-	return t;
+-}
+-/*}}}*/
+-/*FUNCTION Mesh::TriangleIntNumbering{{{*/
+-void Mesh::TriangleIntNumbering(long* renumbering){
+-
+-	long num=0;
+-	for (int i=0;i<nbt;i++){
+-		if (triangles[i].det>0) renumbering[i]=num++;
+-		else renumbering[i]=-1;
++		long num=0;
++		for (int i=0;i<nbt;i++){
++			if (triangles[i].det>0) renumbering[i]=num++;
++			else renumbering[i]=-1;
++		}
++		return;   
+ 	}
+-	return;   
+-}
+-/*}}}*/
+-/*FUNCTION Mesh::TriangleReferenceList{{{*/
+-long  Mesh::TriangleReferenceList(long* reft) const {
+-	/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/ConsRefTriangle)*/
++	/*}}}*/
++	long  Mesh::TriangleReferenceList(long* reft) const {/*{{{*/
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/ConsRefTriangle)*/
+ 
+-	Triangle *t0,*t;
+-	long k=0, num;   
++		Triangle *t0,*t;
++		long k=0, num;   
+ 
+-	//initialize all triangles as -1 (outside)
+-	for (int it=0;it<nbt;it++) reft[it]=-1;
++		//initialize all triangles as -1 (outside)
++		for (int it=0;it<nbt;it++) reft[it]=-1;
+ 
+-	//loop over all subdomains
+-	for (int i=0;i<nbsubdomains;i++){ 
++		//loop over all subdomains
++		for (int i=0;i<nbsubdomains;i++){ 
+ 
+-		//first triangle of the subdomain i
+-		t=t0=subdomains[i].head;
++			//first triangle of the subdomain i
++			t=t0=subdomains[i].head;
+ 
+-		//check that the subdomain is not empty
+-		if (!t0){ _error_("At least one subdomain is empty");}
++			//check that the subdomain is not empty
++			if (!t0){ _error_("At least one subdomain is empty");}
+ 
+-		//loop
+-		do{
+-			k++;
++			//loop
++			do{
++				k++;
+ 
+-			//get current triangle number
+-			num = GetId(t);
++				//get current triangle number
++				num = GetId(t);
+ 
+-			//check that num is in [0 nbt[
+-			_assert_(num>=0 && num<nbt);
++				//check that num is in [0 nbt[
++				_assert_(num>=0 && num<nbt);
+ 
+-			//reft of this triangle is the subdomain number
+-			reft[num]=i;
++				//reft of this triangle is the subdomain number
++				reft[num]=i;
+ 
+-		} while (t0 != (t=t->link));
+-		//stop when all triangles of subdomains have been tagged
++			} while (t0 != (t=t->link));
++			//stop when all triangles of subdomains have been tagged
+ 
++		}
++		return k;   
+ 	}
+-	return k;   
+-}
+-/*}}}*/
+-/*FUNCTION Mesh::Triangulate{{{*/
+-void Mesh::Triangulate(double* x,double* y,int nods){
++	/*}}}*/
++	void Mesh::Triangulate(double* x,double* y,int nods){/*{{{*/
+ 
+-	int verbose=0;
+-	int i;
+-	Metric M1(1);
++		int verbose=0;
++		int i;
++		Metric M1(1);
+ 
+-	/*Initialize mesh*/
+-	Init(nods);//this resets nbv to 0
+-	nbv=nods;
++		/*Initialize mesh*/
++		Init(nods);//this resets nbv to 0
++		nbv=nods;
+ 
+-	//Vertices
+-	if(verbose) _printf_("Reading vertices (" << nbv << ")\n");
+-	for(i=0;i<nbv;i++){
+-		vertices[i].r.x=x[i];
+-		vertices[i].r.y=y[i];
+-		vertices[i].ReferenceNumber=1;
+-		vertices[i].DirOfSearch =NoDirOfSearch;
+-		vertices[i].m=M1;
+-		vertices[i].color=0;
++		//Vertices
++		if(verbose) _printf_("Reading vertices (" << nbv << ")\n");
++		for(i=0;i<nbv;i++){
++			vertices[i].r.x=x[i];
++			vertices[i].r.y=y[i];
++			vertices[i].ReferenceNumber=1;
++			vertices[i].DirOfSearch =NoDirOfSearch;
++			vertices[i].m=M1;
++			vertices[i].color=0;
++		}
++		maxnbt=2*maxnbv-2; // for filling The Holes and quadrilaterals 
++
++		/*Insert Vertices*/
++		Insert(true);
+ 	}
+-	maxnbt=2*maxnbv-2; // for filling The Holes and quadrilaterals 
+-
+-	/*Insert Vertices*/
+-	Insert(true);
+-}
+-/*}}}*/
+-	/*FUNCTION Mesh::TriangulateFromGeom0{{{*/
+-	void Mesh::TriangulateFromGeom0(BamgOpts* bamgopts){
++	/*}}}*/
++	void Mesh::TriangulateFromGeom0(BamgOpts* bamgopts){/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/GeomToTriangles0)*/
+ 		/*Generate mesh from geometry*/
+ 
+@@ -4530,8 +4473,7 @@
+ 		if (verbose>4) _printf_("      -- current number of vertices = " << nbv << "\n");
+ 	}
+ 	/*}}}*/
+-	/*FUNCTION Mesh::TriangulateFromGeom1{{{*/
+-	void Mesh::TriangulateFromGeom1(BamgOpts* bamgopts,int KeepVertices){ 
++	void Mesh::TriangulateFromGeom1(BamgOpts* bamgopts,int KeepVertices){ /*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/GeomToTriangles1)*/
+ 
+ 		/*Get options*/
+@@ -4565,11 +4507,11 @@
+ 		int* bcurve = new int[Gh.nbcurves]; // 
+ 
+ 		/* There are 2 ways to make the loop 
+-		* 1) on the geometry 
+-		* 2) on the background mesh
+-		*  if you do the loop on geometry, we don't have the pointeur on background,
+-		*  and if you do the loop in background we have the pointeur on geometry
+-		* so do the walk on  background */
++		 * 1) on the geometry 
++		 * 2) on the background mesh
++		 *  if you do the loop on geometry, we don't have the pointeur on background,
++		 *  and if you do the loop in background we have the pointeur on geometry
++		 * so do the walk on  background */
+ 
+ 		NbVerticesOnGeomVertex=0;
+ 		NbVerticesOnGeomEdge=0;
+@@ -4860,8 +4802,7 @@
+ 	/*}}}*/
+ 
+ 	/*Intermediary*/
+-	/*FUNCTION CloseBoundaryEdge{{{*/
+-	AdjacentTriangle CloseBoundaryEdge(I2 A,Triangle *t, double &a,double &b) {
++	AdjacentTriangle CloseBoundaryEdge(I2 A,Triangle *t, double &a,double &b) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/CloseBoundaryEdge)*/
+ 
+ 		int k=(*t)(0) ?  ((  (*t)(1) ? ( (*t)(2) ? -1 : 2) : 1  )) : 0;
+@@ -4897,132 +4838,129 @@
+ 							a= IJ_AJ/IJ2;
+ 							b= IJ_IA/IJ2;
+ 							return edge;
+-		  } 
++		} 
+ 	}
+ 	/*}}}*/
+-/*FUNCTION ForceEdge{{{*/
+-int ForceEdge(BamgVertex &a, BamgVertex & b,AdjacentTriangle & taret)  { 
+-	/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/ForceEdge)*/
++	int ForceEdge(BamgVertex &a, BamgVertex & b,AdjacentTriangle & taret)  { /*{{{*/
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/ForceEdge)*/
+ 
+-	int NbSwap =0;
+-	if (!a.t || !b.t){ // the 2 vertex is in a mesh
+-		_error_("!a.t || !b.t");
+-	}
+-	int k=0;
+-	taret=AdjacentTriangle(0,0); // erreur 
++		int NbSwap =0;
++		if (!a.t || !b.t){ // the 2 vertex is in a mesh
++			_error_("!a.t || !b.t");
++		}
++		int k=0;
++		taret=AdjacentTriangle(0,0); // erreur 
+ 
+-	AdjacentTriangle tta(a.t,EdgesVertexTriangle[a.IndexInTriangle][0]);
+-	BamgVertex   *v1, *v2 = tta.EdgeVertex(0),*vbegin =v2;
+-	// we turn around a in the  direct direction  
++		AdjacentTriangle tta(a.t,EdgesVertexTriangle[a.IndexInTriangle][0]);
++		BamgVertex   *v1, *v2 = tta.EdgeVertex(0),*vbegin =v2;
++		// we turn around a in the  direct direction  
+ 
+-	Icoor2 det2 = v2 ? det(*v2,a,b): -1 , det1;
+-	if(v2) // normal case 
+-	 det2 = det(*v2,a,b);
+-	else { // no chance infini vertex try the next
+-		tta= Previous(Adj(tta));
+-		v2 = tta.EdgeVertex(0);
+-		vbegin =v2;
+-		if (!v2){
+-			_error_("!v2");
++		Icoor2 det2 = v2 ? det(*v2,a,b): -1 , det1;
++		if(v2) // normal case 
++		 det2 = det(*v2,a,b);
++		else { // no chance infini vertex try the next
++			tta= Previous(Adj(tta));
++			v2 = tta.EdgeVertex(0);
++			vbegin =v2;
++			if (!v2){
++				_error_("!v2");
++			}
++			det2 = det(*v2,a,b);
+ 		}
+-		det2 = det(*v2,a,b);
+-	}
+ 
+-	while (v2 != &b) {
+-		AdjacentTriangle tc = Previous(Adj(tta));    
+-		v1 = v2; 
+-		v2 = tc.EdgeVertex(0);
+-		det1 = det2;
+-		det2 =  v2 ? det(*v2,a,b): det2; 
++		while (v2 != &b) {
++			AdjacentTriangle tc = Previous(Adj(tta));    
++			v1 = v2; 
++			v2 = tc.EdgeVertex(0);
++			det1 = det2;
++			det2 =  v2 ? det(*v2,a,b): det2; 
+ 
+-		if((det1 < 0) && (det2 >0)) { 
+-			// try to force the edge 
+-			BamgVertex * va = &a, *vb = &b;
+-			tc = Previous(tc);
+-			if (!v1 || !v2){
+-				_error_("!v1 || !v2");
++			if((det1 < 0) && (det2 >0)) { 
++				// try to force the edge 
++				BamgVertex * va = &a, *vb = &b;
++				tc = Previous(tc);
++				if (!v1 || !v2){
++					_error_("!v1 || !v2");
++				}
++				Icoor2 detss = 0,l=0;
++				while ((SwapForForcingEdge(  va,  vb, tc, detss, det1,det2,NbSwap)))
++				 if(l++ > 10000000) {
++					 _error_("Loop in forcing Egde, nb de swap=" << NbSwap << ", nb of try swap (" << l << ") too big");
++				 }
++				BamgVertex *aa = tc.EdgeVertex(0), *bb = tc.EdgeVertex(1);
++				if (((aa == &a ) && (bb == &b)) ||((bb ==  &a ) && (aa == &b))){
++					tc.SetLock();
++					a.Optim(1,0);
++					b.Optim(1,0);
++					taret = tc;
++					return NbSwap;
++				}
++				else 
++				  {
++					taret = tc;
++					return -2; // error  boundary is crossing
++				  }
+ 			}
+-			Icoor2 detss = 0,l=0;
+-			while ((SwapForForcingEdge(  va,  vb, tc, detss, det1,det2,NbSwap)))
+-			 if(l++ > 10000000) {
+-				 _error_("Loop in forcing Egde, nb de swap=" << NbSwap << ", nb of try swap (" << l << ") too big");
+-			 }
+-			BamgVertex *aa = tc.EdgeVertex(0), *bb = tc.EdgeVertex(1);
+-			if (((aa == &a ) && (bb == &b)) ||((bb ==  &a ) && (aa == &b))){
+-				tc.SetLock();
+-				a.Optim(1,0);
+-				b.Optim(1,0);
+-				taret = tc;
+-				return NbSwap;
++			tta = tc;
++			k++;
++			if (k>=2000){
++				_error_("k>=2000");
+ 			}
+-			else 
+-			  {
+-				taret = tc;
+-				return -2; // error  boundary is crossing
+-			  }
++			if ( vbegin == v2 ) return -1;// error 
+ 		}
+-		tta = tc;
+-		k++;
+-		if (k>=2000){
+-			_error_("k>=2000");
+-		}
+-		if ( vbegin == v2 ) return -1;// error 
++
++		tta.SetLock();
++		taret=tta;
++		a.Optim(1,0);
++		b.Optim(1,0);
++		return NbSwap; 
+ 	}
++	/*}}}*/
++	void  swap(Triangle *t1,short a1, Triangle *t2,short a2, BamgVertex *s1,BamgVertex *s2,Icoor2 det1,Icoor2 det2){ /*{{{*/
++		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/swap)*/
++		// --------------------------------------------------------------
++		// short a2=aa[a];// les 2 numero de l arete dans les 2 triangles
++		//                               
++		//               sb                     sb    
++		//             / | \                   /   \                      !
++		//         as1/  |  \                 /a2   \                     !
++		//           /   |   \               /    t2 \                    !
++		//       s1 /t1  | t2 \s2  -->   s1 /___as2___\s2                 !
++		//          \  a1|a2  /             \   as1   /  
++		//           \   |   /               \ t1    /   
++		//            \  |  / as2             \   a1/    
++		//             \ | /                   \   /     
++		//              sa                       sa   
++		//  -------------------------------------------------------------
++		int as1 = NextEdge[a1];
++		int as2 = NextEdge[a2];
++		int ap1 = PreviousEdge[a1];
++		int ap2 = PreviousEdge[a2];
++		(*t1)(VerticesOfTriangularEdge[a1][1]) = s2 ; // avant sb
++		(*t2)(VerticesOfTriangularEdge[a2][1]) = s1  ; // avant sa
++		// mise a jour des 2 adjacences externes 
++		AdjacentTriangle taas1 = t1->Adj(as1),
++							  taas2 = t2->Adj(as2),
++							  tas1(t1,as1), tas2(t2,as2),
++							  ta1(t1,a1),ta2(t2,a2);
++		// externe haut gauche
++		taas1.SetAdj2(ta2, taas1.GetAllFlag_UnSwap());
++		// externe bas droite
++		taas2.SetAdj2(ta1, taas2.GetAllFlag_UnSwap());
++		// remove the Mark  UnMarkSwap 
++		t1->SetUnMarkUnSwap(ap1);
++		t2->SetUnMarkUnSwap(ap2);
++		// interne 
++		tas1.SetAdj2(tas2);
+ 
+-	tta.SetLock();
+-	taret=tta;
+-	a.Optim(1,0);
+-	b.Optim(1,0);
+-	return NbSwap; 
+-}
+-/*}}}*/
+-/*FUNCTION swap{{{*/
+-void  swap(Triangle *t1,short a1, Triangle *t2,short a2, BamgVertex *s1,BamgVertex *s2,Icoor2 det1,Icoor2 det2){ 
+-	/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/swap)*/
+-	// --------------------------------------------------------------
+-	// short a2=aa[a];// les 2 numero de l arete dans les 2 triangles
+-	//                               
+-	//               sb                     sb    
+-	//             / | \                   /   \                      !
+-	//         as1/  |  \                 /a2   \                     !
+-	//           /   |   \               /    t2 \                    !
+-	//       s1 /t1  | t2 \s2  -->   s1 /___as2___\s2                 !
+-	//          \  a1|a2  /             \   as1   /  
+-	//           \   |   /               \ t1    /   
+-	//            \  |  / as2             \   a1/    
+-	//             \ | /                   \   /     
+-	//              sa                       sa   
+-	//  -------------------------------------------------------------
+-	int as1 = NextEdge[a1];
+-	int as2 = NextEdge[a2];
+-	int ap1 = PreviousEdge[a1];
+-	int ap2 = PreviousEdge[a2];
+-	(*t1)(VerticesOfTriangularEdge[a1][1]) = s2 ; // avant sb
+-	(*t2)(VerticesOfTriangularEdge[a2][1]) = s1  ; // avant sa
+-	// mise a jour des 2 adjacences externes 
+-	AdjacentTriangle taas1 = t1->Adj(as1),
+-						  taas2 = t2->Adj(as2),
+-						  tas1(t1,as1), tas2(t2,as2),
+-						  ta1(t1,a1),ta2(t2,a2);
+-	// externe haut gauche
+-	taas1.SetAdj2(ta2, taas1.GetAllFlag_UnSwap());
+-	// externe bas droite
+-	taas2.SetAdj2(ta1, taas2.GetAllFlag_UnSwap());
+-	// remove the Mark  UnMarkSwap 
+-	t1->SetUnMarkUnSwap(ap1);
+-	t2->SetUnMarkUnSwap(ap2);
+-	// interne 
+-	tas1.SetAdj2(tas2);
++		t1->det = det1;
++		t2->det = det2;
+ 
+-	t1->det = det1;
+-	t2->det = det2;
+-
+-	t1->SetSingleVertexToTriangleConnectivity();
+-	t2->SetSingleVertexToTriangleConnectivity();
+-} // end swap 
+-/*}}}*/
+-	/*FUNCTION SwapForForcingEdge{{{*/
+-	int SwapForForcingEdge(BamgVertex   *  & pva ,BamgVertex  * &   pvb ,AdjacentTriangle & tt1,Icoor2 & dets1, Icoor2 & detsa,Icoor2 & detsb, int & NbSwap) {
++		t1->SetSingleVertexToTriangleConnectivity();
++		t2->SetSingleVertexToTriangleConnectivity();
++	} // end swap 
++	/*}}}*/
++	int SwapForForcingEdge(BamgVertex   *  & pva ,BamgVertex  * &   pvb ,AdjacentTriangle & tt1,Icoor2 & dets1, Icoor2 & detsa,Icoor2 & detsb, int & NbSwap) {/*{{{*/
+ 		/*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/SwapForForcingEdge)*/
+ 		// l'arete ta coupe l'arete pva pvb
+ 		// de cas apres le swap sa coupe toujours
+@@ -5091,23 +5029,22 @@
+ 			detsb=-detsb;
+ 
+ 			if(ToSwap){
+-			 if (dets2 < 0) {// haut
+-				 dets1 = (ToSwap ? dets1 : detsa) ;
+-				 detsa = dets2; 
+-				 tt1 =  Previous(tt2) ;}
+-			 else if(dets2 > 0){// bas 
+-				 dets1 = (ToSwap ? dets1 : detsb) ;
+-				 detsb =  dets2;
+-				 if(!ToSwap) tt1 =  Next(tt2);
+-			 }
+-			 else {// on a fin ???
+-				 tt1 = Next(tt2);
+-				 ret =0;}
++				if (dets2 < 0) {// haut
++					dets1 = (ToSwap ? dets1 : detsa) ;
++					detsa = dets2; 
++					tt1 =  Previous(tt2) ;}
++				else if(dets2 > 0){// bas 
++					dets1 = (ToSwap ? dets1 : detsb) ;
++					detsb =  dets2;
++					if(!ToSwap) tt1 =  Next(tt2);
++				}
++				else {// on a fin ???
++					tt1 = Next(tt2);
++					ret =0;}
+ 			}
+ 
+ 		}
+ 		return ret;
+ 	}
+ 	/*}}}*/
+-
+ }
+Index: ../trunk-jpl/src/c/classes/Contour.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Contour.h	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Contour.h	(revision 18064)
+@@ -23,8 +23,7 @@
+ 		bool        closed;   //is this contour closed?
+ 
+ 		/*Contour constructors, destructors :*/
+-		/*FUNCTION Contour() {{{*/
+-		Contour(){
++		Contour(){/*{{{*/
+ 			this->id     = 0;
+ 			this->nods   = 0;
+ 			this->x      = NULL;
+@@ -32,8 +31,7 @@
+ 			this->closed = false;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Contour(int pid, int nods, doubletype* x, doubletype* y,bool closed) {{{*/
+-		Contour(int pid,int pnods, doubletype* px, doubletype* py,bool pclosed){
++		Contour(int pid,int pnods, doubletype* px, doubletype* py,bool pclosed){/*{{{*/
+ 
+ 			this->id     = pid;
+ 			this->nods   = pnods;
+@@ -46,16 +44,14 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION ~Contour() {{{*/
+-		~Contour(){
++		~Contour(){/*{{{*/
+ 			xDelete<doubletype>(this->x);
+ 			xDelete<doubletype>(this->y);
+ 		}
+ 		/*}}}*/
+ 
+ 		/*Object virtual function resolutoin: */
+-		/*FUNCTION Echo(){{{*/
+-		void Echo(void){
++		void Echo(void){/*{{{*/
+ 			_printf_(" Contour: " << id << "\n");
+ 			_printf_("    nods: " << nods << "\n");
+ 			_printf_("  closed: " << (closed?"true":"false") << "\n");
+@@ -67,23 +63,19 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION DeepEcho(){{{*/
+-		void DeepEcho(void){
++		void DeepEcho(void){/*{{{*/
+ 			this->Echo();
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Id(){{{*/
+-		int Id(void){
++		int Id(void){/*{{{*/
+ 			return id;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION ObjectEnum{{{*/
+-		int ObjectEnum(void){
++		int ObjectEnum(void){/*{{{*/
+ 			return ContourEnum;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION copy {{{*/
+-		Object* copy() {
++		Object* copy() {/*{{{*/
+ 			return new Contour(*this); 
+ 		}
+ 		/*}}}*/
+Index: ../trunk-jpl/src/c/classes/DofIndexing.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/DofIndexing.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/DofIndexing.cpp	(revision 18064)
+@@ -19,8 +19,7 @@
+ #include "../shared/Enum/Enum.h"
+ 
+ /*DofIndexing constructors and destructor*/
+-/*FUNCTION DofIndexing::DofIndexing(){{{*/
+-DofIndexing::DofIndexing(){
++DofIndexing::DofIndexing(){/*{{{*/
+ 
+ 	this->gsize    = UNDEF;
+ 	this->fsize    = UNDEF;
+@@ -37,15 +36,13 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DofIndexing::DofIndexing(int gsize){{{*/
+-DofIndexing::DofIndexing(int in_gsize){
++DofIndexing::DofIndexing(int in_gsize){/*{{{*/
+ 
+ 	this->Init(in_gsize,NULL);
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DofIndexing::DofIndexing(DofIndexing* in)  -> copy{{{*/
+-DofIndexing::DofIndexing(DofIndexing* in){ //copy constructor
++DofIndexing::DofIndexing(DofIndexing* in){ //copy constructor/*{{{*/
+ 
+ 	this->gsize  = in->gsize;
+ 	this->fsize  = in->fsize;
+@@ -82,8 +79,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DofIndexing::~DofIndexing() {{{*/
+-DofIndexing::~DofIndexing(){ //destructor
++DofIndexing::~DofIndexing(){ //destructor/*{{{*/
+ 
+ 	xDelete<bool>(f_set); 
+ 	xDelete<bool>(s_set); 
+@@ -95,8 +91,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DofIndexing::Init{{{*/
+-void DofIndexing::Init(int in_gsize,int* in_doftype){
++void DofIndexing::Init(int in_gsize,int* in_doftype){/*{{{*/
+ 
+ 	this->gsize = in_gsize;
+ 
+@@ -126,8 +121,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION DofIndexing::InitSet{{{*/
+-void DofIndexing::InitSet(int setenum){
++void DofIndexing::InitSet(int setenum){/*{{{*/
+ 
+ 	int i;
+ 	int size=0;
+@@ -161,8 +155,7 @@
+ /*}}}*/
+ 
+ /*Some of the Object functionality: */
+-/*FUNCTION DofIndexing::Echo{{{*/
+-void DofIndexing::Echo(void){
++void DofIndexing::Echo(void){/*{{{*/
+ 
+ 	_printf_("DofIndexing:\n");
+ 	_printf_("   gsize:  " << gsize << "\n");
+@@ -172,8 +165,7 @@
+ 	_printf_("   active: " << active << "\n");
+ }
+ /*}}}*/
+-/*FUNCTION DofIndexing::DeepEcho{{{*/
+-void DofIndexing::DeepEcho(void){
++void DofIndexing::DeepEcho(void){/*{{{*/
+ 
+ 	int i;
+ 
+@@ -223,8 +215,7 @@
+ 	_printf_("\n");
+ }		
+ /*}}}*/
+-/*FUNCTION DofIndexing::Deactivate{{{*/
+-void DofIndexing::Deactivate(void){
++void DofIndexing::Deactivate(void){/*{{{*/
+ 	this->active = false;
+ 
+ 	/*Constrain to 0. at this point*/
+@@ -236,8 +227,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION DofIndexing::Activate{{{*/
+-void DofIndexing::Activate(void){
++void DofIndexing::Activate(void){/*{{{*/
+ 	this->active = true;
+ 
+ 	/*Constrain to 0. at this point*/
+Index: ../trunk-jpl/src/c/classes/Materials/Materials.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Materials.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Materials/Materials.cpp	(revision 18064)
+@@ -18,21 +18,18 @@
+ /*}}}*/
+ 
+ /*Object constructors and destructor*/
+-/*FUNCTION Materials::Materials(){{{*/
+-Materials::Materials(){
++Materials::Materials(){/*{{{*/
+ 	enum_type=MaterialsEnum;
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Materials::~Materials(){{{*/
+-Materials::~Materials(){
++Materials::~Materials(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object management*/
+-/*FUNCTION Materials::Configure{{{*/
+-void Materials::Configure(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters){
++void Materials::Configure(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters){/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Material* material=NULL;
+Index: ../trunk-jpl/src/c/classes/Materials/Matice.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 18064)
+@@ -26,15 +26,13 @@
+ #include "../../shared/shared.h"
+ 
+ /*Matice constructors and destructor*/
+-/*FUNCTION Matice::Matice(){{{*/
+-Matice::Matice(){
++Matice::Matice(){/*{{{*/
+ 	this->helement=NULL;
+ 	this->element=NULL;
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Matice::Matice(int id, int index, IoModel* iomodel, int num_vertices){{{*/
+-Matice::Matice(int matice_mid,int index, IoModel* iomodel){
++Matice::Matice(int matice_mid,int index, IoModel* iomodel){/*{{{*/
+ 
+ 	/*Intermediaries:*/
+ 	int    matice_eid;
+@@ -58,16 +56,14 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Matice::~Matice(){{{*/
+-Matice::~Matice(){
++Matice::~Matice(){/*{{{*/
+ 	delete helement;
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION Matice::Echo {{{*/
+-void Matice::Echo(void){
++void Matice::Echo(void){/*{{{*/
+ 
+ 	_printf_("Matice:\n");
+ 	_printf_("   mid: " << mid << "\n");
+@@ -75,8 +71,7 @@
+ 	helement->Echo();
+ }
+ /*}}}*/
+-/*FUNCTION Matice::DeepEcho {{{*/
+-void Matice::DeepEcho(void){
++void Matice::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_("Matice:\n");
+ 	_printf_("   mid: " << mid << "\n");
+@@ -84,18 +79,15 @@
+ 	helement->Echo();
+ }		
+ /*}}}*/
+-/*FUNCTION Matice::Id {{{*/
+-int    Matice::Id(void){ return mid; }
++int    Matice::Id(void){ return mid; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION Matice::ObjectEnum{{{*/
+-int Matice::ObjectEnum(void){
++int Matice::ObjectEnum(void){/*{{{*/
+ 
+ 	return MaticeEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Matice::copy() {{{*/
+-Object* Matice::copy() {
++Object* Matice::copy() {/*{{{*/
+ 
+ 	/*Output*/
+ 	Matice* matice=NULL;
+@@ -112,8 +104,7 @@
+ 	return matice;
+ }
+ /*}}}*/
+-/*FUNCTION Matice::copy2(Element* element) {{{*/
+-Material* Matice::copy2(Element* element_in) {
++Material* Matice::copy2(Element* element_in) {/*{{{*/
+ 
+ 	/*Output*/
+ 	Matice* matice=NULL;
+@@ -132,8 +123,7 @@
+ /*}}}*/
+ 
+ /*Matice management*/
+-/*FUNCTION Matice::Configure {{{*/
+-void  Matice::Configure(Elements* elementsin){
++void  Matice::Configure(Elements* elementsin){/*{{{*/
+ 
+ 	/*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 
+ 	 * datasets, using internal ids and offsets hidden in hooks: */
+@@ -141,13 +131,11 @@
+ 	this->element  = (Element*)helement->delivers();
+ }
+ /*}}}*/
+-/*FUNCTION Matice::SetCurrentConfiguration {{{*/
+-void  Matice::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
++void  Matice::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Matice::GetA {{{*/
+-IssmDouble Matice::GetA(){
++IssmDouble Matice::GetA(){/*{{{*/
+ 	/*
+ 	 * A = 1/B^n
+ 	 */
+@@ -160,8 +148,7 @@
+ 	return pow(B,-n);
+ }
+ /*}}}*/
+-/*FUNCTION Matice::GetAbar {{{*/
+-IssmDouble Matice::GetAbar(){
++IssmDouble Matice::GetAbar(){/*{{{*/
+ 	/*
+ 	 * A = 1/B^n
+ 	 */
+@@ -174,8 +161,7 @@
+ 	return pow(B,-n);
+ }
+ /*}}}*/
+-/*FUNCTION Matice::GetB {{{*/
+-IssmDouble Matice::GetB(){
++IssmDouble Matice::GetB(){/*{{{*/
+ 
+ 	/*Output*/
+ 	IssmDouble B;
+@@ -184,8 +170,7 @@
+ 	return B;
+ }
+ /*}}}*/
+-/*FUNCTION Matice::GetBbar {{{*/
+-IssmDouble Matice::GetBbar(){
++IssmDouble Matice::GetBbar(){/*{{{*/
+ 
+ 	/*Output*/
+ 	IssmDouble Bbar;
+@@ -194,8 +179,7 @@
+ 	return Bbar;
+ }
+ /*}}}*/
+-/*FUNCTION Matice::GetN {{{*/
+-IssmDouble Matice::GetN(){
++IssmDouble Matice::GetN(){/*{{{*/
+ 
+ 	/*Output*/
+ 	IssmDouble n;
+@@ -204,8 +188,7 @@
+ 	return n;
+ }
+ /*}}}*/
+-/*FUNCTION Matice::GetD {{{*/
+-IssmDouble Matice::GetD(){
++IssmDouble Matice::GetD(){/*{{{*/
+ 
+ 	_assert_(this->isdamaged);
+ 	/*Output*/
+@@ -214,8 +197,7 @@
+ 	return D;
+ }
+ /*}}}*/
+-/*FUNCTION Matice::GetDbar {{{*/
+-IssmDouble Matice::GetDbar(){
++IssmDouble Matice::GetDbar(){/*{{{*/
+ 
+ 	_assert_(this->isdamaged);
+ 	/*Output*/
+@@ -224,14 +206,12 @@
+ 	return Dbar;
+ }
+ /*}}}*/
+-/*FUNCTION Matice::IsDamage() {{{*/
+-bool Matice::IsDamage(){
++bool Matice::IsDamage(){/*{{{*/
+ 
+ 	return this->isdamaged;
+ }
+ /*}}}*/
+-/*FUNCTION Matice::GetViscosity {{{*/
+-void  Matice::GetViscosity(IssmDouble* pviscosity,IssmDouble eps_eff){
++void  Matice::GetViscosity(IssmDouble* pviscosity,IssmDouble eps_eff){/*{{{*/
+ 	/*From a string tensor and a material object, return viscosity, using Glen's flow law.
+ 								(1-D) B
+ 	  viscosity= -------------------------
+@@ -283,8 +263,7 @@
+ 	*pviscosity=viscosity;
+ }
+ /*}}}*/
+-/*FUNCTION Matice::GetViscosity_B {{{*/
+-void  Matice::GetViscosity_B(IssmDouble* pdmudB,IssmDouble eps_eff){
++void  Matice::GetViscosity_B(IssmDouble* pdmudB,IssmDouble eps_eff){/*{{{*/
+ 
+ 	/*output: */
+ 	IssmDouble dmudB;
+@@ -312,8 +291,7 @@
+ 	*pdmudB=dmudB;
+ }
+ /*}}}*/
+-/*FUNCTION Matice::GetViscosity_D {{{*/
+-void  Matice::GetViscosity_D(IssmDouble* pdmudD,IssmDouble eps_eff){
++void  Matice::GetViscosity_D(IssmDouble* pdmudD,IssmDouble eps_eff){/*{{{*/
+ 
+ 	/*output: */
+ 	IssmDouble dmudD;
+@@ -339,8 +317,7 @@
+ 	*pdmudD=dmudD;
+ }
+ /*}}}*/
+-/*FUNCTION Matice::GetViscosityBar {{{*/
+-void  Matice::GetViscosityBar(IssmDouble* pviscosity,IssmDouble eps_eff){
++void  Matice::GetViscosityBar(IssmDouble* pviscosity,IssmDouble eps_eff){/*{{{*/
+ 	/*From a string tensor and a material object, return viscosity, using Glen's flow law.
+ 								(1-D) B
+ 	  viscosity= -------------------------
+@@ -391,8 +368,7 @@
+ 	*pviscosity=viscosity;
+ }
+ /*}}}*/
+-/*FUNCTION Matice::GetViscosityComplement {{{*/
+-void  Matice::GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* epsilon){
++void  Matice::GetViscosityComplement(IssmDouble* pviscosity_complement, IssmDouble* epsilon){/*{{{*/
+ 	/*Return viscosity accounting for steady state power law creep [Thomas and SSA, 1982]: 
+ 	 *
+ 	 *  										                (1-D)
+@@ -450,8 +426,7 @@
+ 	*pviscosity_complement=viscosity_complement;
+ }
+ /*}}}*/
+-/*FUNCTION Matice::GetViscosityDComplement {{{*/
+-void  Matice::GetViscosityDComplement(IssmDouble* pviscosity_complement, IssmDouble* epsilon){
++void  Matice::GetViscosityDComplement(IssmDouble* pviscosity_complement, IssmDouble* epsilon){/*{{{*/
+ 	/*Return viscosity derivative for control method d(mu)/dD: 
+ 	 *
+ 	 *  										               B 
+@@ -506,8 +481,7 @@
+ 	*pviscosity_complement=viscosity_complement;
+ }
+ /*}}}*/
+-/*FUNCTION Matice::GetViscosityDerivativeEpsSquare{{{*/
+-void  Matice::GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* epsilon){
++void  Matice::GetViscosityDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* epsilon){/*{{{*/
+ 
+ 	/*output: */
+ 	IssmDouble mu_prime;
+@@ -540,8 +514,7 @@
+ 	*pmu_prime=mu_prime;
+ }
+ /*}}}*/
+-/*FUNCTION Matice::GetViscosity2dDerivativeEpsSquare{{{*/
+-void  Matice::GetViscosity2dDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* epsilon){
++void  Matice::GetViscosity2dDerivativeEpsSquare(IssmDouble* pmu_prime, IssmDouble* epsilon){/*{{{*/
+ 
+ 	/*output: */
+ 	IssmDouble mu_prime;
+@@ -569,33 +542,27 @@
+ 	*pmu_prime=mu_prime;
+ }
+ /*}}}*/
+-/*FUNCTION Matice::InputUpdateFromVector(IssmDouble* vector, int name, int type) {{{*/
+-void  Matice::InputUpdateFromVector(IssmDouble* vector, int name, int type){
++void  Matice::InputUpdateFromVector(IssmDouble* vector, int name, int type){/*{{{*/
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Matice::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type) {{{*/
+-void  Matice::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
++void  Matice::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*{{{*/
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Matice::InputUpdateFromMatrixDakota(int* vector, int name, int type) {{{*/
+-void  Matice::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols,int name, int type){
++void  Matice::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols,int name, int type){/*{{{*/
+ 	/*Nothing updated yet*/
+ }
+ /*}}}*/
+-/*FUNCTION Matice::InputUpdateFromConstant(IssmDouble constant, int name) {{{*/
+-void  Matice::InputUpdateFromConstant(IssmDouble constant, int name){
++void  Matice::InputUpdateFromConstant(IssmDouble constant, int name){/*{{{*/
+ 	/*Nothing updated yet*/
+ }
+ /*}}}*/
+-/*FUNCTION Matice::InputUpdateFromConstant(int constant, int name) {{{*/
+-void  Matice::InputUpdateFromConstant(int constant, int name){
++void  Matice::InputUpdateFromConstant(int constant, int name){/*{{{*/
+ 	/*Nothing updated yet*/
+ }
+ /*}}}*/
+-/*FUNCTION Matice::InputUpdateFromConstant(bool constant, int name) {{{*/
+-void  Matice::InputUpdateFromConstant(bool constant, int name){
++void  Matice::InputUpdateFromConstant(bool constant, int name){/*{{{*/
+ 	/*Nothing updated yet*/
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Materials/Matpar.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matpar.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Materials/Matpar.cpp	(revision 18064)
+@@ -12,13 +12,11 @@
+ #include "../../shared/shared.h"
+ 
+ /*Matpar constructors and destructor*/
+-/*FUNCTION Matpar::Matpar() {{{*/
+-Matpar::Matpar(){
++Matpar::Matpar(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::Matpar(int matpar_mid,IoModel* iomodel){{{*/
+-Matpar::Matpar(int matpar_mid, IoModel* iomodel){
++Matpar::Matpar(int matpar_mid, IoModel* iomodel){/*{{{*/
+ 
+ 	bool isefficientlayer;
+ 	int  hydrology_model,smb_model;
+@@ -93,15 +91,13 @@
+ 	iomodel->Constant(&this->mantle_density,MaterialsMantleDensityEnum);
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::~Matpar() {{{*/
+-Matpar::~Matpar(){
++Matpar::~Matpar(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION Matpar::Echo {{{*/
+-void Matpar::Echo(void){
++void Matpar::Echo(void){/*{{{*/
+ 
+ 	_printf_("Matpar:\n");
+ 	_printf_("   mid: " << mid << "\n");
+@@ -124,46 +120,38 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::DeepEcho {{{*/
+-void Matpar::DeepEcho(void){
++void Matpar::DeepEcho(void){/*{{{*/
+ 
+ 	this->Echo();
+ }		
+ /*}}}*/
+-/*FUNCTION Matpar::Id {{{*/
+-int    Matpar::Id(void){ return mid; }
++int    Matpar::Id(void){ return mid; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION Matpar::ObjectEnum{{{*/
+-int Matpar::ObjectEnum(void){
++int Matpar::ObjectEnum(void){/*{{{*/
+ 
+ 	return MatparEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::copy {{{*/
+-Object* Matpar::copy() {
++Object* Matpar::copy() {/*{{{*/
+ 	return new Matpar(*this); 
+ }
+ /*}}}*/
+ 
+ /*Update virtual functions definitions:*/
+-/*FUNCTION Matpar::InputUpdateFromVector(IssmDouble* vector, int name, int type) {{{*/
+-void   Matpar::InputUpdateFromVector(IssmDouble* vector, int name, int type){
++void   Matpar::InputUpdateFromVector(IssmDouble* vector, int name, int type){/*{{{*/
+ 	/*Nothing updated yet*/
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type) {{{*/
+-void   Matpar::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
++void   Matpar::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*{{{*/
+ 	/*Nothing updated yet*/
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::InputUpdateFromMatrixDakota(IssmDouble* vector, int name, int type) {{{*/
+-void  Matpar::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols,int name, int type){
++void  Matpar::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols,int name, int type){/*{{{*/
+ 	/*Nothing updated yet*/
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::InputUpdateFromConstant(IssmDouble constant, int name) {{{*/
+-void   Matpar::InputUpdateFromConstant(IssmDouble constant, int name){
++void   Matpar::InputUpdateFromConstant(IssmDouble constant, int name){/*{{{*/
+ 
+ 	switch(name){
+ 		case MaterialsRhoIceEnum:
+@@ -220,27 +208,23 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::InputUpdateFromConstant(int constant, int name) {{{*/
+-void   Matpar::InputUpdateFromConstant(int constant, int name){
++void   Matpar::InputUpdateFromConstant(int constant, int name){/*{{{*/
+ 	/*Nothing updated yet*/
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::InputUpdateFromConstant(bool constant, int name) {{{*/
+-void   Matpar::InputUpdateFromConstant(bool constant, int name){
++void   Matpar::InputUpdateFromConstant(bool constant, int name){/*{{{*/
+ 	/*Nothing updated yet*/
+ }
+ /*}}}*/
+ 
+ /*Matpar management: */
+-/*FUNCTION Matpar::Configure {{{*/
+-void  Matpar::Configure(Elements* elementsin){
++void  Matpar::Configure(Elements* elementsin){/*{{{*/
+ 
+ 	/*nothing done yet!*/
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::Configure {{{*/
+-IssmDouble Matpar::GetMaterialParameter(int enum_in){
++IssmDouble Matpar::GetMaterialParameter(int enum_in){/*{{{*/
+ 
+ 	switch(enum_in){
+ 		case MaterialsRhoIceEnum:                    return this->rho_ice;
+@@ -271,67 +255,55 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::GetBeta {{{*/
+-IssmDouble Matpar::GetBeta(){
++IssmDouble Matpar::GetBeta(){/*{{{*/
+ 	return beta;
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::GetG {{{*/
+-IssmDouble Matpar::GetG(){
++IssmDouble Matpar::GetG(){/*{{{*/
+ 	return g;
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::GetMeltingPoint {{{*/
+-IssmDouble Matpar::GetMeltingPoint(){
++IssmDouble Matpar::GetMeltingPoint(){/*{{{*/
+ 	return meltingpoint;
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::GetRhoIce {{{*/
+-IssmDouble Matpar::GetRhoIce(){
++IssmDouble Matpar::GetRhoIce(){/*{{{*/
+ 
+ 	return rho_ice;
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::GetRhoWater {{{*/
+-IssmDouble Matpar::GetRhoWater(){
++IssmDouble Matpar::GetRhoWater(){/*{{{*/
+ 	return rho_water;
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::GetRhoFreshwater {{{*/
+-IssmDouble Matpar::GetRhoFreshwater(){
++IssmDouble Matpar::GetRhoFreshwater(){/*{{{*/
+ 	return rho_freshwater;
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::GetDesFac {{{*/
+-IssmDouble Matpar::GetDesFac(){
++IssmDouble Matpar::GetDesFac(){/*{{{*/
+ 	return desfac;
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::GetS0p {{{*/
+-IssmDouble Matpar::GetS0p(){
++IssmDouble Matpar::GetS0p(){/*{{{*/
+ 	return s0p;
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::TMeltingPoint {{{*/
+-IssmDouble Matpar::TMeltingPoint(IssmDouble pressure){
++IssmDouble Matpar::TMeltingPoint(IssmDouble pressure){/*{{{*/
+ 	return meltingpoint-beta*pressure;
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::PureIceEnthalpy{{{*/
+-IssmDouble Matpar::PureIceEnthalpy(IssmDouble pressure){
++IssmDouble Matpar::PureIceEnthalpy(IssmDouble pressure){/*{{{*/
+ 	return heatcapacity*(TMeltingPoint(pressure)-referencetemperature);
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::GetEnthalpyDiffusionParameter{{{*/
+-IssmDouble Matpar::GetEnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure){
++IssmDouble Matpar::GetEnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure){/*{{{*/
+ 	if (enthalpy<PureIceEnthalpy(pressure))
+ 		return thermalconductivity/heatcapacity;
+ 	else
+ 		return temperateiceconductivity/heatcapacity;
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::GetEnthalpyDiffusionParameterVolume{{{*/
+-IssmDouble Matpar::GetEnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure){
++IssmDouble Matpar::GetEnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure){/*{{{*/
+ 
+ 	int         iv;
+ 	IssmDouble  lambda;                 // fraction of cold ice
+@@ -377,8 +349,7 @@
+ 	return kappa;
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::EnthalpyToThermal {{{*/
+-void Matpar::EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure){
++void Matpar::EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure){/*{{{*/
+ 
+ 	/*Ouput*/
+ 	IssmDouble temperature,waterfraction;
+@@ -397,8 +368,7 @@
+ 	*ptemperature=temperature;
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::ThermalToEnthalpy {{{*/
+-void Matpar::ThermalToEnthalpy(IssmDouble * penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure){
++void Matpar::ThermalToEnthalpy(IssmDouble * penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure){/*{{{*/
+ 
+ 	/*Ouput*/
+ 	IssmDouble enthalpy;
+@@ -414,23 +384,19 @@
+ 	*penthalpy=enthalpy;
+ }
+ /*}}}*/
+-/*FUNCTION Matpar::GetLithosphereShearModulus {{{*/			 
+-IssmDouble Matpar::GetLithosphereShearModulus(){		 
++IssmDouble Matpar::GetLithosphereShearModulus(){		 /*{{{*/
+ 	return lithosphere_shear_modulus;			 
+ }		 
+ /*}}}*/ 
+-/*FUNCTION Matpar::GetLithosphereDensity {{{*/			 
+-IssmDouble Matpar::GetLithosphereDensity(){		 
++IssmDouble Matpar::GetLithosphereDensity(){		 /*{{{*/
+ 	return lithosphere_density;			 
+ }		 
+ /*}}}*/ 
+-/*FUNCTION Matpar::GetMantleDensity {{{*/			 
+-IssmDouble Matpar::GetMantleDensity(){		 
++IssmDouble Matpar::GetMantleDensity(){		 /*{{{*/
+ 	return mantle_density;			 
+ }		 
+ /*}}}*/ 
+-/*FUNCTION Matpar::GetMantleShearModulus {{{*/			 
+-IssmDouble Matpar::GetMantleShearModulus(){		 
++IssmDouble Matpar::GetMantleShearModulus(){		 /*{{{*/
+ 	return mantle_shear_modulus;			 
+ }		 
+ /*}}}*/ 
+Index: ../trunk-jpl/src/c/classes/Params/IntVecParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/IntVecParam.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Params/IntVecParam.cpp	(revision 18064)
+@@ -15,13 +15,11 @@
+ /*}}}*/
+ 
+ /*IntVecParam constructors and destructor*/
+-/*FUNCTION IntVecParam::IntVecParam(){{{*/
+-IntVecParam::IntVecParam(){
++IntVecParam::IntVecParam(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION IntVecParam::IntVecParam(int enum_type,int* values,int M){{{*/
+-IntVecParam::IntVecParam(int in_enum_type,int* in_values, int in_M){
++IntVecParam::IntVecParam(int in_enum_type,int* in_values, int in_M){/*{{{*/
+ 
+ 	enum_type=in_enum_type;
+ 	M=in_M;
+@@ -33,8 +31,7 @@
+ 	else values=NULL;
+ }
+ /*}}}*/
+-/*FUNCTION IntVecParam::IntVecParam(int enum_type,IssmDouble* values,int M){{{*/
+-IntVecParam::IntVecParam(int in_enum_type,IssmDouble* in_values, int in_M){
++IntVecParam::IntVecParam(int in_enum_type,IssmDouble* in_values, int in_M){/*{{{*/
+ 
+ 	enum_type=in_enum_type;
+ 	M=in_M;
+@@ -46,16 +43,14 @@
+ 	else values=NULL;
+ }
+ /*}}}*/
+-/*FUNCTION IntVecParam::~IntVecParam(){{{*/
+-IntVecParam::~IntVecParam(){
++IntVecParam::~IntVecParam(){/*{{{*/
+ 	xDelete<int>(values);
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION IntVecParam::Echo {{{*/
+-void IntVecParam::Echo(void){
++void IntVecParam::Echo(void){/*{{{*/
+ 
+ 	_printf_("IntVecParam:\n");
+ 	_printf_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
+@@ -63,8 +58,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IntVecParam::DeepEcho{{{*/
+-void IntVecParam::DeepEcho(void){
++void IntVecParam::DeepEcho(void){/*{{{*/
+ 
+ 	int i;
+ 
+@@ -76,18 +70,15 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION IntVecParam::Id{{{*/
+-int    IntVecParam::Id(void){ return -1; }
++int    IntVecParam::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION IntVecParam::ObjectEnum{{{*/
+-int IntVecParam::ObjectEnum(void){
++int IntVecParam::ObjectEnum(void){/*{{{*/
+ 
+ 	return IntVecParamEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IntVecParam::copy{{{*/
+-Object* IntVecParam::copy() {
++Object* IntVecParam::copy() {/*{{{*/
+ 
+ 	return new IntVecParam(this->enum_type,this->values,this->M);
+ 
+@@ -95,8 +86,7 @@
+ /*}}}*/
+ 
+ /*IntVecParam virtual functions definitions: */
+-/*FUNCTION IntVecParam::GetParameterValue{{{*/
+-void  IntVecParam::GetParameterValue(int** pintarray,int* pM){
++void  IntVecParam::GetParameterValue(int** pintarray,int* pM){/*{{{*/
+ 	int* output=NULL;
+ 
+ 	if(M){
+@@ -109,8 +99,7 @@
+ 	*pintarray=output;
+ }
+ /*}}}*/
+-/*FUNCTION IntVecParam::SetValue{{{*/
+-void  IntVecParam::SetValue(int* intarray,int in_M){
++void  IntVecParam::SetValue(int* intarray,int in_M){/*{{{*/
+ 
+ 	/*avoid leak: */
+ 	xDelete<int>(this->values);
+Index: ../trunk-jpl/src/c/classes/Params/BoolParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/BoolParam.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Params/BoolParam.cpp	(revision 18064)
+@@ -15,47 +15,39 @@
+ /*}}}*/
+ 
+ /*BoolParam constructors and destructor*/
+-/*FUNCTION BoolParam::BoolParam(){{{*/
+-BoolParam::BoolParam(){
++BoolParam::BoolParam(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION BoolParam::BoolParam(int enum_type,bool value){{{*/
+-BoolParam::BoolParam(int in_enum_type,bool in_value){
++BoolParam::BoolParam(int in_enum_type,bool in_value){/*{{{*/
+ 
+ 	enum_type=in_enum_type;
+ 	value=in_value;
+ }
+ /*}}}*/
+-/*FUNCTION BoolParam::~BoolParam(){{{*/
+-BoolParam::~BoolParam(){
++BoolParam::~BoolParam(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION BoolParam::Echo {{{*/
+-void BoolParam::Echo(void){
++void BoolParam::Echo(void){/*{{{*/
+ 	this->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION BoolParam::DeepEcho{{{*/
+-void BoolParam::DeepEcho(void){
++void BoolParam::DeepEcho(void){/*{{{*/
+ 	_printf_(setw(22)<<"   BoolParam "<<setw(35)<<left<<EnumToStringx(this->enum_type)<<" "<<(value?"true":"false")<<"\n");
+ }
+ /*}}}*/
+-/*FUNCTION BoolParam::Id{{{*/
+-int    BoolParam::Id(void){ return -1; }
++int    BoolParam::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION BoolParam::ObjectEnum{{{*/
+-int BoolParam::ObjectEnum(void){
++int BoolParam::ObjectEnum(void){/*{{{*/
+ 
+ 	return BoolParamEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION BoolParam::copy{{{*/
+-Object* BoolParam::copy() {
++Object* BoolParam::copy() {/*{{{*/
+ 
+ 	return new BoolParam(this->enum_type,this->value);
+ 
+Index: ../trunk-jpl/src/c/classes/Params/IntMatParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/IntMatParam.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Params/IntMatParam.cpp	(revision 18064)
+@@ -15,13 +15,11 @@
+ /*}}}*/
+ 
+ /*IntMatParam constructors and destructor*/
+-/*FUNCTION IntMatParam::IntMatParam(){{{*/
+-IntMatParam::IntMatParam(){
++IntMatParam::IntMatParam(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION IntMatParam::IntMatParam(int enum_type,IssmIntMat value){{{*/
+-IntMatParam::IntMatParam(int in_enum_type,int* in_value, int in_M,int in_N){
++IntMatParam::IntMatParam(int in_enum_type,int* in_value, int in_M,int in_N){/*{{{*/
+ 
+ 	enum_type=in_enum_type;
+ 	M=in_M;
+@@ -31,16 +29,14 @@
+ 	xMemCpy<int>(value,in_value,M*N);
+ }
+ /*}}}*/
+-/*FUNCTION IntMatParam::~IntMatParam(){{{*/
+-IntMatParam::~IntMatParam(){
++IntMatParam::~IntMatParam(){/*{{{*/
+ 	xDelete<int>(value);
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION IntMatParam::Echo {{{*/
+-void IntMatParam::Echo(void){
++void IntMatParam::Echo(void){/*{{{*/
+ 
+ 	_printf_("IntMatParam:\n");
+ 	_printf_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
+@@ -48,8 +44,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IntMatParam::DeepEcho{{{*/
+-void IntMatParam::DeepEcho(void){
++void IntMatParam::DeepEcho(void){/*{{{*/
+ 
+ 	int i,j;
+ 
+@@ -63,18 +58,15 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION IntMatParam::Id{{{*/
+-int    IntMatParam::Id(void){ return -1; }
++int    IntMatParam::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION IntMatParam::ObjectEnum{{{*/
+-int IntMatParam::ObjectEnum(void){
++int IntMatParam::ObjectEnum(void){/*{{{*/
+ 
+ 	return IntMatParamEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IntMatParam::copy{{{*/
+-Object* IntMatParam::copy() {
++Object* IntMatParam::copy() {/*{{{*/
+ 
+ 	return new IntMatParam(this->enum_type,this->value,this->M,this->N);
+ 
+@@ -82,8 +74,7 @@
+ /*}}}*/
+ 
+ /*IntMatParam virtual functions definitions: */
+-/*FUNCTION IntMatParam::GetParameterValue{{{*/
+-void  IntMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){
++void  IntMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){/*{{{*/
+ 	int* output=NULL;
+ 
+ 	output=xNew<int>(M*N);
+@@ -95,8 +86,7 @@
+ 	*pintarray=output;
+ }
+ /*}}}*/
+-/*FUNCTION IntMatParam::SetValue{{{*/
+-void  IntMatParam::SetValue(int* intarray,int in_M,int in_N){
++void  IntMatParam::SetValue(int* intarray,int in_M,int in_N){/*{{{*/
+ 
+ 	/*avoid leak: */
+ 	xDelete<int>(this->value);
+Index: ../trunk-jpl/src/c/classes/Params/DoubleTransientMatParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/DoubleTransientMatParam.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Params/DoubleTransientMatParam.cpp	(revision 18064)
+@@ -14,7 +14,6 @@
+ #include "shared/shared.h"
+ /*}}}*/
+ 
+-/*FUNCTION DoubleTransientMatParam::DoubleTransientMatParam(int enum_type,IssmDoubleMat value){{{*/
+-DoubleTransientMatParam::DoubleTransientMatParam(int in_enum_type,IssmDouble* in_value, int in_M,int in_N):DoubleMatParam(in_enum_type,in_value,in_M,in_N){
++DoubleTransientMatParam::DoubleTransientMatParam(int in_enum_type,IssmDouble* in_value, int in_M,int in_N):DoubleMatParam(in_enum_type,in_value,in_M,in_N){/*{{{*/
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Params/StringParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/StringParam.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Params/StringParam.cpp	(revision 18064)
+@@ -15,13 +15,11 @@
+ /*}}}*/
+ 
+ /*StringParam constructors and destructor*/
+-/*FUNCTION StringParam::StringParam(){{{*/
+-StringParam::StringParam(){
++StringParam::StringParam(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION StringParam::StringParam(int enum_type,IssmString value){{{*/
+-StringParam::StringParam(int in_enum_type,char* in_value){
++StringParam::StringParam(int in_enum_type,char* in_value){/*{{{*/
+ 
+ 	enum_type=in_enum_type;
+ 	value=xNew<char>(strlen(in_value)+1);
+@@ -29,35 +27,29 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION StringParam::~StringParam(){{{*/
+-StringParam::~StringParam(){
++StringParam::~StringParam(){/*{{{*/
+ 	xDelete<char>(value);
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION StringParam::Echo {{{*/
+-void StringParam::Echo(void){
++void StringParam::Echo(void){/*{{{*/
+ 	this->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION StringParam::DeepEcho{{{*/
+-void StringParam::DeepEcho(void){
++void StringParam::DeepEcho(void){/*{{{*/
+ 	_printf_(setw(22)<<"   StringParam "<<setw(35)<<left<<EnumToStringx(this->enum_type)<<" "<<this->value<<"\n");
+ }
+ /*}}}*/
+-/*FUNCTION StringParam::Id{{{*/
+-int    StringParam::Id(void){ return -1; }
++int    StringParam::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION StringParam::ObjectEnum{{{*/
+-int StringParam::ObjectEnum(void){
++int StringParam::ObjectEnum(void){/*{{{*/
+ 
+ 	return StringParamEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION StringParam::copy{{{*/
+-Object* StringParam::copy() {
++Object* StringParam::copy() {/*{{{*/
+ 
+ 	return new StringParam(this->enum_type,this->value);
+ 
+@@ -65,8 +57,7 @@
+ /*}}}*/
+ 
+ /*StringParam virtual functions definitions: */
+-/*FUNCTION StringParam::GetParameterValue{{{*/
+-void  StringParam::GetParameterValue(char** pstring){
++void  StringParam::GetParameterValue(char** pstring){/*{{{*/
+ 
+ 	char* outstring=NULL;
+ 	int   stringsize;
+@@ -80,8 +71,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION StringParam::SetValue{{{*/
+-void  StringParam::SetValue(char* string){
++void  StringParam::SetValue(char* string){/*{{{*/
+ 
+ 	int   stringsize;
+ 
+Index: ../trunk-jpl/src/c/classes/Params/DoubleVecParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/DoubleVecParam.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Params/DoubleVecParam.cpp	(revision 18064)
+@@ -15,13 +15,11 @@
+ /*}}}*/
+ 
+ /*DoubleVecParam constructors and destructor*/
+-/*FUNCTION DoubleVecParam::DoubleVecParam(){{{*/
+-DoubleVecParam::DoubleVecParam(){
++DoubleVecParam::DoubleVecParam(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION DoubleVecParam::DoubleVecParam(int enum_type,IssmDoubleVec values,int M){{{*/
+-DoubleVecParam::DoubleVecParam(int in_enum_type,IssmDouble* in_values, int in_M){
++DoubleVecParam::DoubleVecParam(int in_enum_type,IssmDouble* in_values, int in_M){/*{{{*/
+ 
+ 	enum_type=in_enum_type;
+ 	M=in_M;
+@@ -30,40 +28,34 @@
+ 	xMemCpy<IssmDouble>(values,in_values,M);
+ }
+ /*}}}*/
+-/*FUNCTION DoubleVecParam::~DoubleVecParam(){{{*/
+-DoubleVecParam::~DoubleVecParam(){
++DoubleVecParam::~DoubleVecParam(){/*{{{*/
+ 	xDelete<IssmDouble>(values);
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION DoubleVecParam::Echo {{{*/
+-void DoubleVecParam::Echo(void){
++void DoubleVecParam::Echo(void){/*{{{*/
+ 
+ 	_printf_(setw(22)<<"   DoubleVecParam "<<setw(35)<<left<<EnumToStringx(this->enum_type)<<" size: "<<this->M<<"\n");
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleVecParam::DeepEcho{{{*/
+-void DoubleVecParam::DeepEcho(void){
++void DoubleVecParam::DeepEcho(void){/*{{{*/
+ 	_printf_(setw(22)<<"   DoubleVecParam "<<setw(35)<<left<<EnumToStringx(this->enum_type)<<" "<<"[");
+ 	for(int i=0;i<this->M;i++) _printf_(" "<< this->values[i]);
+ 	_printf_("\n");
+ }
+ /*}}}*/
+-/*FUNCTION DoubleVecParam::Id{{{*/
+-int    DoubleVecParam::Id(void){ return -1; }
++int    DoubleVecParam::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION DoubleVecParam::ObjectEnum{{{*/
+-int DoubleVecParam::ObjectEnum(void){
++int DoubleVecParam::ObjectEnum(void){/*{{{*/
+ 
+ 	return DoubleVecParamEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleVecParam::copy{{{*/
+-Object* DoubleVecParam::copy() {
++Object* DoubleVecParam::copy() {/*{{{*/
+ 
+ 	return new DoubleVecParam(this->enum_type,this->values,this->M);
+ 
+@@ -71,8 +63,7 @@
+ /*}}}*/
+ 
+ /*DoubleVecParam virtual functions definitions: */
+-/*FUNCTION DoubleVecParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){{{*/
+-void  DoubleVecParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){
++void  DoubleVecParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){/*{{{*/
+ 	IssmDouble* output=NULL;
+ 	int M;
+ 
+@@ -85,8 +76,7 @@
+ 	*pIssmDoublearray=output;
+ }
+ /*}}}*/
+-/*FUNCTION DoubleVecParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){{{*/
+-void  DoubleVecParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){
++void  DoubleVecParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){/*{{{*/
+ 	IssmDouble* output=NULL;
+ 	int M;
+ 	int N;
+@@ -102,13 +92,11 @@
+ 	*pIssmDoublearray=output;
+ }
+ /*}}}*/
+-/*FUNCTION DoubleVecParam::GetParameterValue(int** pintarray,int* pM){{{*/
+-void  DoubleVecParam::GetParameterValue(int** pintarray,int* pM){
++void  DoubleVecParam::GetParameterValue(int** pintarray,int* pM){/*{{{*/
+ 	_error_("DoubleVec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of int");
+ }
+ /*}}}*/
+-/*FUNCTION DoubleVecParam::SetValue{{{*/
+-void  DoubleVecParam::SetValue(IssmDouble* IssmDoublearray,int in_M){
++void  DoubleVecParam::SetValue(IssmDouble* IssmDoublearray,int in_M){/*{{{*/
+ 
+ 	/*avoid leak: */
+ 	xDelete<IssmDouble>(this->values);
+Index: ../trunk-jpl/src/c/classes/Params/DoubleMatParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/DoubleMatParam.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Params/DoubleMatParam.cpp	(revision 18064)
+@@ -15,13 +15,11 @@
+ /*}}}*/
+ 
+ /*DoubleMatParam constructors and destructor*/
+-/*FUNCTION DoubleMatParam::DoubleMatParam(){{{*/
+-DoubleMatParam::DoubleMatParam(){
++DoubleMatParam::DoubleMatParam(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION DoubleMatParam::DoubleMatParam(int enum_type,IssmDoubleMat value){{{*/
+-DoubleMatParam::DoubleMatParam(int in_enum_type,IssmDouble* in_value, int in_M,int in_N){
++DoubleMatParam::DoubleMatParam(int in_enum_type,IssmDouble* in_value, int in_M,int in_N){/*{{{*/
+ 
+ 	enum_type=in_enum_type;
+ 	M=in_M;
+@@ -31,16 +29,14 @@
+ 	xMemCpy<IssmDouble>(value,in_value,M*N);
+ }
+ /*}}}*/
+-/*FUNCTION DoubleMatParam::~DoubleMatParam(){{{*/
+-DoubleMatParam::~DoubleMatParam(){
++DoubleMatParam::~DoubleMatParam(){/*{{{*/
+ 	xDelete<IssmDouble>(value);
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION DoubleMatParam::Echo {{{*/
+-void DoubleMatParam::Echo(void){
++void DoubleMatParam::Echo(void){/*{{{*/
+ 
+ 	_printf_("DoubleMatParam:\n");
+ 	_printf_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
+@@ -48,8 +44,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleMatParam::DeepEcho{{{*/
+-void DoubleMatParam::DeepEcho(void){
++void DoubleMatParam::DeepEcho(void){/*{{{*/
+ 
+ 	int i,j;
+ 
+@@ -63,18 +58,15 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION DoubleMatParam::Id{{{*/
+-int    DoubleMatParam::Id(void){ return -1; }
++int    DoubleMatParam::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION DoubleMatParam::ObjectEnum{{{*/
+-int DoubleMatParam::ObjectEnum(void){
++int DoubleMatParam::ObjectEnum(void){/*{{{*/
+ 
+ 	return DoubleMatParamEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleMatParam::copy{{{*/
+-Object* DoubleMatParam::copy() {
++Object* DoubleMatParam::copy() {/*{{{*/
+ 
+ 	return new DoubleMatParam(this->enum_type,this->value,this->M,this->N);
+ 
+@@ -82,8 +74,7 @@
+ /*}}}*/
+ 
+ /*DoubleMatParam virtual functions definitions: */
+-/*FUNCTION DoubleMatParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){{{*/
+-void  DoubleMatParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){
++void  DoubleMatParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){/*{{{*/
+ 	IssmDouble* output=NULL;
+ 
+ 	output=xNew<IssmDouble>(M*N);
+@@ -95,13 +86,11 @@
+ 	*pIssmDoublearray=output;
+ }
+ /*}}}*/
+-/*FUNCTION DoubleMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){{{*/
+-void  DoubleMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){
++void  DoubleMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){/*{{{*/
+ 	_error_("DoubleMat of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of int");
+ }
+ /*}}}*/
+-/*FUNCTION DoubleMatParam::SetValue{{{*/
+-void  DoubleMatParam::SetValue(IssmDouble* IssmDoublearray,int in_M,int in_N){
++void  DoubleMatParam::SetValue(IssmDouble* IssmDoublearray,int in_M,int in_N){/*{{{*/
+ 
+ 	/*avoid leak: */
+ 	xDelete<IssmDouble>(this->value);
+Index: ../trunk-jpl/src/c/classes/Params/FileParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/FileParam.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Params/FileParam.cpp	(revision 18064)
+@@ -15,48 +15,40 @@
+ /*}}}*/
+ 
+ /*FileParam constructors and destructor*/
+-/*FUNCTION FileParam::FileParam(){{{*/
+-FileParam::FileParam(){
++FileParam::FileParam(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION FileParam::FileParam(int enum_type,FILE *value){{{*/
+-FileParam::FileParam(int in_enum_type,FILE* in_value){
++FileParam::FileParam(int in_enum_type,FILE* in_value){/*{{{*/
+ 
+ 	enum_type=in_enum_type;
+ 	value=in_value;
+ }
+ /*}}}*/
+-/*FUNCTION FileParam::~FileParam(){{{*/
+-FileParam::~FileParam(){
++FileParam::~FileParam(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION FileParam::Echo {{{*/
+-void FileParam::Echo(void){
++void FileParam::Echo(void){/*{{{*/
+ 	this->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION FileParam::DeepEcho{{{*/
+-void FileParam::DeepEcho(void){
++void FileParam::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_(setw(22)<<"   FileParam "<<setw(35)<<left<<EnumToStringx(this->enum_type)<<" "<<this->value<<"\n");
+ }
+ /*}}}*/
+-/*FUNCTION FileParam::Id{{{*/
+-int    FileParam::Id(void){ return -1; }
++int    FileParam::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION FileParam::ObjectEnum{{{*/
+-int FileParam::ObjectEnum(void){
++int FileParam::ObjectEnum(void){/*{{{*/
+ 
+ 	return FileParamEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION FileParam::copy{{{*/
+-Object* FileParam::copy() {
++Object* FileParam::copy() {/*{{{*/
+ 
+ 	return new FileParam(this->enum_type,this->value);
+ 
+Index: ../trunk-jpl/src/c/classes/Params/Parameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/Parameters.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Params/Parameters.cpp	(revision 18064)
+@@ -39,21 +39,18 @@
+ /*}}}*/
+ 
+ /*Object constructors and destructor*/
+-/*FUNCTION Parameters::Parameters(){{{*/
+-Parameters::Parameters(){
++Parameters::Parameters(){/*{{{*/
+ 	enum_type=ParametersEnum;
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::~Parameters(){{{*/
+-Parameters::~Parameters(){
++Parameters::~Parameters(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object management*/
+-/*FUNCTION Parameters::Exist{{{*/
+-bool Parameters::Exist(int enum_type){
++bool Parameters::Exist(int enum_type){/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Param* param=NULL;
+@@ -65,8 +62,7 @@
+ 	return false;
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::FindParam(bool* pbool,int enum_type){{{*/
+-void Parameters::FindParam(bool* pbool,int enum_type){ _assert_(this);
++void Parameters::FindParam(bool* pbool,int enum_type){ _assert_(this);/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Param* param=NULL;
+@@ -82,8 +78,7 @@
+ 	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::FindParam(int* pinteger,int enum_type){{{*/
+-void Parameters::FindParam(int* pinteger,int enum_type){ _assert_(this);
++void Parameters::FindParam(int* pinteger,int enum_type){ _assert_(this);/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Param* param=NULL;
+@@ -99,8 +94,7 @@
+ 	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::FindParam(IssmDouble* pscalar, int enum_type){{{*/
+-void Parameters::FindParam(IssmDouble* pscalar, int enum_type){ _assert_(this);
++void Parameters::FindParam(IssmDouble* pscalar, int enum_type){ _assert_(this);/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Param* param=NULL;
+@@ -116,8 +110,7 @@
+ 	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::FindParam(IssmDouble* pscalar, int enum_type,IssmDouble time){{{*/
+-void Parameters::FindParam(IssmDouble* pscalar, int enum_type,IssmDouble time){ _assert_(this);
++void Parameters::FindParam(IssmDouble* pscalar, int enum_type,IssmDouble time){ _assert_(this);/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Param* param=NULL;
+@@ -133,8 +126,7 @@
+ 	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::FindParam(char** pstring,int enum_type){{{*/
+-void Parameters::FindParam(char** pstring,int enum_type){ _assert_(this);
++void Parameters::FindParam(char** pstring,int enum_type){ _assert_(this);/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Param* param=NULL;
+@@ -151,8 +143,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){{{*/
+-void Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){ _assert_(this);
++void Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){ _assert_(this);/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Param* param=NULL;
+@@ -169,8 +160,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::FindParam(int** pintarray,int* pM,int enum_type){{{*/
+-void Parameters::FindParam(int** pintarray,int* pM, int enum_type){ _assert_(this);
++void Parameters::FindParam(int** pintarray,int* pM, int enum_type){ _assert_(this);/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Param* param=NULL;
+@@ -187,8 +177,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::FindParam(int** pintarray,int* pM,int* pN,int enum_type){{{*/
+-void Parameters::FindParam(int** pintarray,int* pM,int *pN,int enum_type){ _assert_(this);
++void Parameters::FindParam(int** pintarray,int* pM,int *pN,int enum_type){ _assert_(this);/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Param* param=NULL;
+@@ -205,8 +194,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::FindParam(IssmDouble** pIssmDoublearray,int* pM,int enum_type){{{*/
+-void Parameters::FindParam(IssmDouble** pIssmDoublearray,int* pM, int enum_type){ _assert_(this);
++void Parameters::FindParam(IssmDouble** pIssmDoublearray,int* pM, int enum_type){ _assert_(this);/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Param* param=NULL;
+@@ -223,8 +211,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::FindParam(IssmDouble** pIssmDoublearray,int* pM, int* pN,int enum_type){{{*/
+-void Parameters::FindParam(IssmDouble** pIssmDoublearray,int* pM, int* pN,int enum_type){ _assert_(this);
++void Parameters::FindParam(IssmDouble** pIssmDoublearray,int* pM, int* pN,int enum_type){ _assert_(this);/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Param* param=NULL;
+@@ -241,8 +228,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::FindParam(IssmDouble*** parray,int* pM,int** pmdims_array,int** pndims_array,int enum_type){{{*/
+-void Parameters::FindParam(IssmDouble*** parray,int* pM,int** pmdims_array,int** pndims_array,int enum_type){ _assert_(this);
++void Parameters::FindParam(IssmDouble*** parray,int* pM,int** pmdims_array,int** pndims_array,int enum_type){ _assert_(this);/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Param* param=NULL;
+@@ -258,8 +244,7 @@
+ 	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::FindParam(Vector<IssmDouble>** pvec,int enum_type){{{*/
+-void Parameters::FindParam(Vector<IssmDouble>** pvec,int enum_type){ _assert_(this);
++void Parameters::FindParam(Vector<IssmDouble>** pvec,int enum_type){ _assert_(this);/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Param* param=NULL;
+@@ -276,8 +261,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::FindParam(Matrix<IssmDouble>** pmat,int enum_type){{{*/
+-void Parameters::FindParam(Matrix<IssmDouble>** pmat,int enum_type){ _assert_(this);
++void Parameters::FindParam(Matrix<IssmDouble>** pmat,int enum_type){ _assert_(this);/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Param* param=NULL;
+@@ -294,8 +278,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::FindParam(FILE** pfid,int enum_type){{{*/
+-void Parameters::FindParam(FILE** pfid,int enum_type){ _assert_(this);
++void Parameters::FindParam(FILE** pfid,int enum_type){ _assert_(this);/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Param* param=NULL;
+@@ -311,8 +294,7 @@
+ 	_error_("could not find parameter " << EnumToStringx(enum_type));
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::FindParam(DataSet** pdataset,int enum_type){{{*/
+-void Parameters::FindParam(DataSet** pdataset,int enum_type){ 
++void Parameters::FindParam(DataSet** pdataset,int enum_type){ /*{{{*/
+ 	_assert_(this);
+ 
+ 	vector<Object*>::iterator object;
+@@ -330,8 +312,7 @@
+ }
+ /*}}}*/
+ 
+-/*FUNCTION Parameters::SetParam(bool boolean,int enum_type);{{{*/
+-void   Parameters::SetParam(bool boolean,int enum_type){
++void   Parameters::SetParam(bool boolean,int enum_type){/*{{{*/
+ 
+ 	Param* param=NULL;
+ 
+@@ -342,8 +323,7 @@
+ 	else this->AddObject(new BoolParam(enum_type,boolean)); //just add the new parameter.
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::SetParam(int integer,int enum_type);{{{*/
+-void   Parameters::SetParam(int integer,int enum_type){
++void   Parameters::SetParam(int integer,int enum_type){/*{{{*/
+ 
+ 	Param* param=NULL;
+ 
+@@ -354,8 +334,7 @@
+ 	else this->AddObject(new IntParam(enum_type,integer)); //just add the new parameter.
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::SetParam(IssmDouble scalar,int enum_type);{{{*/
+-void   Parameters::SetParam(IssmDouble scalar,int enum_type){
++void   Parameters::SetParam(IssmDouble scalar,int enum_type){/*{{{*/
+ 
+ 	Param* param=NULL;
+ 
+@@ -366,8 +345,7 @@
+ 	else this->AddObject(new DoubleParam(enum_type,scalar)); //just add the new parameter.
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::SetParam(char* string,int enum_type);{{{*/
+-void   Parameters::SetParam(char* string,int enum_type){
++void   Parameters::SetParam(char* string,int enum_type){/*{{{*/
+ 
+ 	Param* param=NULL;
+ 
+@@ -378,8 +356,7 @@
+ 	else this->AddObject(new StringParam(enum_type,string)); //just add the new parameter.
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::SetParam(char** stringarray,int M, int enum_type);{{{*/
+-void   Parameters::SetParam(char** stringarray,int M, int enum_type){
++void   Parameters::SetParam(char** stringarray,int M, int enum_type){/*{{{*/
+ 
+ 	Param* param=NULL;
+ 
+@@ -390,8 +367,7 @@
+ 	else this->AddObject(new StringArrayParam(enum_type,stringarray,M)); //just add the new parameter.
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::SetParam(IssmDouble* IssmDoublearray,int M,int enum_type);{{{*/
+-void   Parameters::SetParam(IssmDouble* IssmDoublearray,int M, int enum_type){
++void   Parameters::SetParam(IssmDouble* IssmDoublearray,int M, int enum_type){/*{{{*/
+ 
+ 	Param* param=NULL;
+ 
+@@ -402,8 +378,7 @@
+ 	else this->AddObject(new DoubleVecParam(enum_type,IssmDoublearray,M)); //just add the new parameter.
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::SetParam(IssmDouble* IssmDoublearray,int M,int N, int enum_type);{{{*/
+-void   Parameters::SetParam(IssmDouble* IssmDoublearray,int M, int N, int enum_type){
++void   Parameters::SetParam(IssmDouble* IssmDoublearray,int M, int N, int enum_type){/*{{{*/
+ 
+ 	Param* param=NULL;
+ 
+@@ -414,8 +389,7 @@
+ 	else this->AddObject(new DoubleMatParam(enum_type,IssmDoublearray,M,N)); //just add the new parameter.
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::SetParam(int* intarray,int M,int enum_type);{{{*/
+-void   Parameters::SetParam(int* intarray,int M, int enum_type){
++void   Parameters::SetParam(int* intarray,int M, int enum_type){/*{{{*/
+ 
+ 	Param* param=NULL;
+ 
+@@ -426,8 +400,7 @@
+ 	else this->AddObject(new IntVecParam(enum_type,intarray,M)); //just add the new parameter.
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::SetParam(int* intarray,int M,int N, int enum_type);{{{*/
+-void   Parameters::SetParam(int* intarray,int M, int N, int enum_type){
++void   Parameters::SetParam(int* intarray,int M, int N, int enum_type){/*{{{*/
+ 
+ 	Param* param=NULL;
+ 
+@@ -438,8 +411,7 @@
+ 	else this->AddObject(new IntMatParam(enum_type,intarray,M,N)); //just add the new parameter.
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::SetParam(Vector<IssmDouble>* vector,int enum_type);{{{*/
+-void   Parameters::SetParam(Vector<IssmDouble>* vector,int enum_type){
++void   Parameters::SetParam(Vector<IssmDouble>* vector,int enum_type){/*{{{*/
+ 
+ 	Param* param=NULL;
+ 
+@@ -450,8 +422,7 @@
+ 	else this->AddObject(new VectorParam(enum_type,vector)); //just add the new parameter.
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::SetParam(Matrix<IssmDouble>* matrix,int enum_type);{{{*/
+-void   Parameters::SetParam(Matrix<IssmDouble>* matrix,int enum_type){
++void   Parameters::SetParam(Matrix<IssmDouble>* matrix,int enum_type){/*{{{*/
+ 
+ 	Param* param=NULL;
+ 
+@@ -462,8 +433,7 @@
+ 	else this->AddObject(new MatrixParam(enum_type,matrix)); //just add the new parameter.
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::SetParam(FILE* fid,int enum_type);{{{*/
+-void   Parameters::SetParam(FILE* fid,int enum_type){
++void   Parameters::SetParam(FILE* fid,int enum_type){/*{{{*/
+ 
+ 	Param* param=NULL;
+ 
+@@ -474,8 +444,7 @@
+ 	else this->AddObject(new FileParam(enum_type,fid)); //just add the new parameter.
+ }
+ /*}}}*/
+-/*FUNCTION Parameters::SetParam(DataSet* dataset, int enum_type);{{{*/
+-void   Parameters::SetParam(DataSet* dataset,int enum_type){
++void   Parameters::SetParam(DataSet* dataset,int enum_type){/*{{{*/
+ 
+ 	Param* param=NULL;
+ 
+@@ -487,8 +456,7 @@
+ }
+ /*}}}*/
+ 
+-/*FUNCTION Parameters::FindParamObject{{{*/
+-Object* Parameters::FindParamObject(int enum_type){
++Object* Parameters::FindParamObject(int enum_type){/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Param* param=NULL;
+Index: ../trunk-jpl/src/c/classes/Params/DataSetParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/DataSetParam.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Params/DataSetParam.cpp	(revision 18064)
+@@ -15,51 +15,43 @@
+ /*}}}*/
+ 
+ /*DataSetParam constructors and destructor*/
+-/*FUNCTION DataSetParam::DataSetParam(){{{*/
+-DataSetParam::DataSetParam(){
++DataSetParam::DataSetParam(){/*{{{*/
+ 	value=NULL;
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION DataSetParam::DataSetParam(int enum_type,DataSet *value){{{*/
+-DataSetParam::DataSetParam(int in_enum_type,DataSet* in_value){
++DataSetParam::DataSetParam(int in_enum_type,DataSet* in_value){/*{{{*/
+ 
+ 	enum_type=in_enum_type;
+ 	value=in_value->Copy();;
+ }
+ /*}}}*/
+-/*FUNCTION DataSetParam::~DataSetParam(){{{*/
+-DataSetParam::~DataSetParam(){
++DataSetParam::~DataSetParam(){/*{{{*/
+ 	delete value;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION DataSetParam::Echo {{{*/
+-void DataSetParam::Echo(void){
++void DataSetParam::Echo(void){/*{{{*/
+ 	this->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION DataSetParam::DeepEcho{{{*/
+-void DataSetParam::DeepEcho(void){
++void DataSetParam::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_(setw(22)<<"   DataSetParam "<<setw(35)<<left<<EnumToStringx(this->enum_type)<<" ----- begin\n");
+ 	this->value->Echo();
+ 	_printf_(setw(22)<<"   DataSetParam "<<setw(35)<<left<<EnumToStringx(this->enum_type)<<" ----- end\n");
+ }
+ /*}}}*/
+-/*FUNCTION DataSetParam::Id{{{*/
+-int    DataSetParam::Id(void){ return -1; }
++int    DataSetParam::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION DataSetParam::ObjectEnum{{{*/
+-int DataSetParam::ObjectEnum(void){
++int DataSetParam::ObjectEnum(void){/*{{{*/
+ 
+ 	return DataSetParamEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DataSetParam::copy{{{*/
+-Object* DataSetParam::copy() {
++Object* DataSetParam::copy() {/*{{{*/
+ 
+ 	return new DataSetParam(this->enum_type,this->value);
+ 
+@@ -67,8 +59,7 @@
+ /*}}}*/
+ 
+ /*DataSetParam virtual functions definitions: */
+-/*FUNCTION DataSetParam::GetParameterValue{{{*/
+-void DataSetParam::GetParameterValue(DataSet** pdataset){
++void DataSetParam::GetParameterValue(DataSet** pdataset){/*{{{*/
+ 	*pdataset=value->Copy();
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Params/IntParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/IntParam.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Params/IntParam.cpp	(revision 18064)
+@@ -15,48 +15,40 @@
+ /*}}}*/
+ 
+ /*IntParam constructors and destructor*/
+-/*FUNCTION IntParam::IntParam(){{{*/
+-IntParam::IntParam(){
++IntParam::IntParam(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION IntParam::IntParam(int enum_type,IssmInt value){{{*/
+-IntParam::IntParam(int in_enum_type,IssmInt in_value){
++IntParam::IntParam(int in_enum_type,IssmInt in_value){/*{{{*/
+ 
+ 	enum_type=in_enum_type;
+ 	value=in_value;
+ }
+ /*}}}*/
+-/*FUNCTION IntParam::~IntParam(){{{*/
+-IntParam::~IntParam(){
++IntParam::~IntParam(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION IntParam::Echo {{{*/
+-void IntParam::Echo(void){
++void IntParam::Echo(void){/*{{{*/
+ 	this->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION IntParam::DeepEcho{{{*/
+-void IntParam::DeepEcho(void){
++void IntParam::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_(setw(22)<<"   IntParam "<<setw(35)<<left<<EnumToStringx(this->enum_type)<<" "<<this->value<<"\n");
+ }
+ /*}}}*/
+-/*FUNCTION IntParam::Id{{{*/
+-int    IntParam::Id(void){ return -1; }
++int    IntParam::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION IntParam::ObjectEnum{{{*/
+-int IntParam::ObjectEnum(void){
++int IntParam::ObjectEnum(void){/*{{{*/
+ 
+ 	return IntParamEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IntParam::copy{{{*/
+-Object* IntParam::copy() {
++Object* IntParam::copy() {/*{{{*/
+ 
+ 	return new IntParam(this->enum_type,this->value);
+ 
+Index: ../trunk-jpl/src/c/classes/Params/VectorParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/VectorParam.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Params/VectorParam.cpp	(revision 18064)
+@@ -15,13 +15,11 @@
+ /*}}}*/
+ 
+ /*VectorParam constructors and destructor*/
+-/*FUNCTION VectorParam::VectorParam(){{{*/
+-VectorParam::VectorParam(){
++VectorParam::VectorParam(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION VectorParam::VectorParam(int enum_type,IssmVector value){{{*/
+-VectorParam::VectorParam(int in_enum_type,Vector<IssmDouble>* in_value){
++VectorParam::VectorParam(int in_enum_type,Vector<IssmDouble>* in_value){/*{{{*/
+ 
+ 	enum_type=in_enum_type;
+ 
+@@ -33,41 +31,35 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION VectorParam::~VectorParam(){{{*/
+-VectorParam::~VectorParam(){
++VectorParam::~VectorParam(){/*{{{*/
+ 	delete value;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION VectorParam::Echo {{{*/
+-void VectorParam::Echo(void){
++void VectorParam::Echo(void){/*{{{*/
+ 
+ 	_printf_("VectorParam:\n");
+ 	_printf_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
+ 
+ }
+ /*}}}*/
+-/*FUNCTION VectorParam::DeepEcho{{{*/
+-void VectorParam::DeepEcho(void){
++void VectorParam::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_("VectorParam:\n");
+ 	_printf_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
+ 	value->Echo();
+ }
+ /*}}}*/
+-/*FUNCTION VectorParam::Id{{{*/
+-int    VectorParam::Id(void){ return -1; }
++int    VectorParam::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION VectorParam::ObjectEnum{{{*/
+-int VectorParam::ObjectEnum(void){
++int VectorParam::ObjectEnum(void){/*{{{*/
+ 
+ 	return VectorParamEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION VectorParam::copy{{{*/
+-Object* VectorParam::copy() {
++Object* VectorParam::copy() {/*{{{*/
+ 
+ 	return new VectorParam(this->enum_type,this->value);
+ 
+@@ -75,8 +67,7 @@
+ /*}}}*/
+ 
+ /*VectorParam virtual functions definitions: */
+-/*FUNCTION VectorParam::GetParameterValue{{{*/
+-void  VectorParam::GetParameterValue(Vector<IssmDouble>** poutput){
++void  VectorParam::GetParameterValue(Vector<IssmDouble>** poutput){/*{{{*/
+ 	Vector<IssmDouble>*  output=NULL;
+ 
+ 	if(value){
+@@ -86,8 +77,7 @@
+ 	*poutput=output;
+ }
+ /*}}}*/
+-/*FUNCTION VectorParam::SetValue{{{*/
+-void  VectorParam::SetValue(Vector<IssmDouble>* vector){
++void  VectorParam::SetValue(Vector<IssmDouble>* vector){/*{{{*/
+ 
+ 	/*avoid leak: */
+ 	delete value;
+Index: ../trunk-jpl/src/c/classes/Params/MatrixParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/MatrixParam.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Params/MatrixParam.cpp	(revision 18064)
+@@ -15,13 +15,11 @@
+ /*}}}*/
+ 
+ /*MatrixParam constructors and destructor*/
+-/*FUNCTION MatrixParam::MatrixParam(){{{*/
+-MatrixParam::MatrixParam(){
++MatrixParam::MatrixParam(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION MatrixParam::MatrixParam(int enum_type,Matrix<IssmDouble>* value){{{*/
+-MatrixParam::MatrixParam(int in_enum_type,Matrix<IssmDouble>* in_value){
++MatrixParam::MatrixParam(int in_enum_type,Matrix<IssmDouble>* in_value){/*{{{*/
+ 
+ 	enum_type=in_enum_type;
+ 	value=NULL;
+@@ -31,41 +29,35 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION MatrixParam::~MatrixParam(){{{*/
+-MatrixParam::~MatrixParam(){
++MatrixParam::~MatrixParam(){/*{{{*/
+ 	delete value;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION MatrixParam::Echo {{{*/
+-void MatrixParam::Echo(void){
++void MatrixParam::Echo(void){/*{{{*/
+ 
+ 	_printf_("MatrixParam:\n");
+ 	_printf_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
+ 
+ }
+ /*}}}*/
+-/*FUNCTION MatrixParam::DeepEcho{{{*/
+-void MatrixParam::DeepEcho(void){
++void MatrixParam::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_("MatrixParam:\n");
+ 	_printf_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
+ 	this->value->Echo();
+ }
+ /*}}}*/
+-/*FUNCTION MatrixParam::Id{{{*/
+-int    MatrixParam::Id(void){ return -1; }
++int    MatrixParam::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION MatrixParam::ObjectEnum{{{*/
+-int MatrixParam::ObjectEnum(void){
++int MatrixParam::ObjectEnum(void){/*{{{*/
+ 
+ 	return MatrixParamEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION MatrixParam::copy{{{*/
+-Object* MatrixParam::copy() {
++Object* MatrixParam::copy() {/*{{{*/
+ 
+ 	return new MatrixParam(this->enum_type,this->value);
+ 
+@@ -73,8 +65,7 @@
+ /*}}}*/
+ 
+ /*MatrixParam virtual functions definitions: */
+-/*FUNCTION MatrixParam::GetParameterValue{{{*/
+-void  MatrixParam::GetParameterValue(Matrix<IssmDouble>** poutput){
++void  MatrixParam::GetParameterValue(Matrix<IssmDouble>** poutput){/*{{{*/
+ 	Matrix<IssmDouble>* output=NULL;
+ 
+ 	if(value){
+@@ -83,8 +74,7 @@
+ 	*poutput=output;
+ }
+ /*}}}*/
+-/*FUNCTION MatrixParam::SetValue{{{*/
+-void  MatrixParam::SetValue(Matrix<IssmDouble>* matrix){
++void  MatrixParam::SetValue(Matrix<IssmDouble>* matrix){/*{{{*/
+ 
+ 	/*avoid leak: */
+ 	delete value;
+Index: ../trunk-jpl/src/c/classes/Params/StringArrayParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/StringArrayParam.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Params/StringArrayParam.cpp	(revision 18064)
+@@ -15,13 +15,11 @@
+ /*}}}*/
+ 
+ /*StringArrayParam constructors and destructor*/
+-/*FUNCTION StringArrayParam::StringArrayParam(){{{*/
+-StringArrayParam::StringArrayParam(){
++StringArrayParam::StringArrayParam(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION StringArrayParam::StringArrayParam(int enum_type,char** in_values,int in_numstrings){{{*/
+-StringArrayParam::StringArrayParam(int in_enum_type,char** in_values, int in_numstrings){
++StringArrayParam::StringArrayParam(int in_enum_type,char** in_values, int in_numstrings){/*{{{*/
+ 
+ 	int i;
+ 	int size;
+@@ -43,8 +41,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION StringArrayParam::~StringArrayParam(){{{*/
+-StringArrayParam::~StringArrayParam(){
++StringArrayParam::~StringArrayParam(){/*{{{*/
+ 
+ 	int i;
+ 
+@@ -58,31 +55,26 @@
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION StringArrayParam::Echo {{{*/
+-void StringArrayParam::Echo(void){
++void StringArrayParam::Echo(void){/*{{{*/
+ 	this->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION StringArrayParam::DeepEcho{{{*/
+-void StringArrayParam::DeepEcho(void){
++void StringArrayParam::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_(setw(22)<<"   StringArrayParam "<<setw(35)<<left<<EnumToStringx(this->enum_type)<<" {");
+ 	for(int i=0;i<this->numstrings;i++) _printf_(" '"<<this->value[i]<<"'");
+ 	_printf_("}\n");
+ }
+ /*}}}*/
+-/*FUNCTION StringArrayParam::Id{{{*/
+-int    StringArrayParam::Id(void){ return -1; }
++int    StringArrayParam::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION StringArrayParam::ObjectEnum{{{*/
+-int StringArrayParam::ObjectEnum(void){
++int StringArrayParam::ObjectEnum(void){/*{{{*/
+ 
+ 	return StringArrayParamEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION StringArrayParam::copy{{{*/
+-Object* StringArrayParam::copy() {
++Object* StringArrayParam::copy() {/*{{{*/
+ 
+ 	return new StringArrayParam(this->enum_type,this->value,this->numstrings);
+ 
+@@ -90,8 +82,7 @@
+ /*}}}*/
+ 
+ /*StringArrayParam virtual functions definitions: */
+-/*FUNCTION StringArrayParam::GetParameterValue{{{*/
+-void  StringArrayParam::GetParameterValue(char*** pstringarray,int* pM){
++void  StringArrayParam::GetParameterValue(char*** pstringarray,int* pM){/*{{{*/
+ 
+ 	int   i;
+ 	char** outstrings=NULL;
+@@ -121,8 +112,7 @@
+ 	*pstringarray=outstrings;
+ }
+ /*}}}*/
+-/*FUNCTION StringArrayParam::SetValue{{{*/
+-void  StringArrayParam::SetValue(char** stringarray,int M){
++void  StringArrayParam::SetValue(char** stringarray,int M){/*{{{*/
+ 
+ 	int   i;
+ 	char *string     = NULL;
+Index: ../trunk-jpl/src/c/classes/Params/TransientParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/TransientParam.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Params/TransientParam.cpp	(revision 18064)
+@@ -15,13 +15,11 @@
+ /*}}}*/
+ 
+ /*TransientParam constructors and destructor*/
+-/*FUNCTION TransientParam::TransientParam(){{{*/
+-TransientParam::TransientParam(){
++TransientParam::TransientParam(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION TransientParam::TransientParam(int enum_type,IssmDoubleMat value){{{*/
+-TransientParam::TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,int in_N){
++TransientParam::TransientParam(int in_enum_type,IssmDouble* in_values,IssmDouble* in_time,int in_N){/*{{{*/
+ 
+ 	_assert_(in_values && in_time);
+ 
+@@ -35,16 +33,14 @@
+ 	xMemCpy<IssmDouble>(timesteps,in_time,N);
+ }
+ /*}}}*/
+-/*FUNCTION TransientParam::~TransientParam(){{{*/
+-TransientParam::~TransientParam(){
++TransientParam::~TransientParam(){/*{{{*/
+ 	xDelete<IssmDouble>(values);
+ 	xDelete<IssmDouble>(timesteps);
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION TransientParam::Echo {{{*/
+-void TransientParam::Echo(void){
++void TransientParam::Echo(void){/*{{{*/
+ 
+ 	_printf_("TransientParam:\n");
+ 	_printf_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
+@@ -52,8 +48,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TransientParam::DeepEcho{{{*/
+-void TransientParam::DeepEcho(void){
++void TransientParam::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_("TransientParam:\n");
+ 	_printf_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
+@@ -63,18 +58,15 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION TransientParam::Id{{{*/
+-int    TransientParam::Id(void){ return -1; }
++int    TransientParam::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION TransientParam::ObjectEnum{{{*/
+-int TransientParam::ObjectEnum(void){
++int TransientParam::ObjectEnum(void){/*{{{*/
+ 
+ 	return TransientParamEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TransientParam::copy{{{*/
+-Object* TransientParam::copy() {
++Object* TransientParam::copy() {/*{{{*/
+ 
+ 	return new TransientParam(this->enum_type,this->values,this->timesteps,this->N);
+ 
+@@ -82,8 +74,7 @@
+ /*}}}*/
+ 
+ /*TransientParam virtual functions definitions: */
+-/*FUNCTION TransientParam::GetParameterValue(IssmDouble* pdouble,IssmDouble time){{{*/
+-void  TransientParam::GetParameterValue(IssmDouble* pdouble,IssmDouble time){
++void  TransientParam::GetParameterValue(IssmDouble* pdouble,IssmDouble time){/*{{{*/
+ 
+ 	IssmDouble output;
+ 	bool   found;
+Index: ../trunk-jpl/src/c/classes/Params/DoubleParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/DoubleParam.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Params/DoubleParam.cpp	(revision 18064)
+@@ -12,48 +12,40 @@
+ #include "shared/shared.h"
+ 
+ /*DoubleParam constructors and destructor*/
+-/*FUNCTION DoubleParam::DoubleParam(){{{*/
+-DoubleParam::DoubleParam(){
++DoubleParam::DoubleParam(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION DoubleParam::DoubleParam(int enum_type,IssmDouble value){{{*/
+-DoubleParam::DoubleParam(int in_enum_type,IssmDouble in_value){
++DoubleParam::DoubleParam(int in_enum_type,IssmDouble in_value){/*{{{*/
+ 
+ 	enum_type=in_enum_type;
+ 	value=in_value;
+ }
+ /*}}}*/
+-/*FUNCTION DoubleParam::~DoubleParam(){{{*/
+-DoubleParam::~DoubleParam(){
++DoubleParam::~DoubleParam(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION DoubleParam::Echo {{{*/
+-void DoubleParam::Echo(void){
++void DoubleParam::Echo(void){/*{{{*/
+ 	this->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION DoubleParam::DeepEcho{{{*/
+-void DoubleParam::DeepEcho(void){
++void DoubleParam::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_(setw(22)<<"   DoubleParam "<<setw(35)<<left<<EnumToStringx(this->enum_type)<<" "<<this->value<<"\n");
+ }
+ /*}}}*/
+-/*FUNCTION DoubleParam::Id{{{*/
+-int    DoubleParam::Id(void){ return -1; }
++int    DoubleParam::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION DoubleParam::ObjectEnum{{{*/
+-int DoubleParam::ObjectEnum(void){
++int DoubleParam::ObjectEnum(void){/*{{{*/
+ 
+ 	return DoubleParamEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleParam::copy{{{*/
+-Object* DoubleParam::copy() {
++Object* DoubleParam::copy() {/*{{{*/
+ 
+ 	return new DoubleParam(this->enum_type,this->value);
+ 
+@@ -61,33 +53,27 @@
+ /*}}}*/
+ 
+ /*DoubleParam virtual functions definitions: */
+-/*FUNCTION DoubleParam::GetParameterValue(int* pinteger){{{*/
+-void DoubleParam::GetParameterValue(int* pinteger){
++void DoubleParam::GetParameterValue(int* pinteger){/*{{{*/
+ 	_error_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");
+ }
+ /*}}}*/
+-/*FUNCTION DoubleParam::GetParameterValue(bool* pbool){{{*/
+-void DoubleParam::GetParameterValue(bool* pbool){
++void DoubleParam::GetParameterValue(bool* pbool){/*{{{*/
+ 	_error_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an bool");
+ }
+ /*}}}*/
+-/*FUNCTION DoubleParam::GetParameterValue(int** pintarray,int* pM){{{*/
+-void DoubleParam::GetParameterValue(int** pintarray,int* pM){
++void DoubleParam::GetParameterValue(int** pintarray,int* pM){/*{{{*/
+ 	_error_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");
+ }
+ /*}}}*/
+-/*FUNCTION DoubleParam::GetParameterValue(int** pintarray,int* pM,int* pN){{{*/
+-void DoubleParam::GetParameterValue(int** pintarray,int* pM,int* pN){
++void DoubleParam::GetParameterValue(int** pintarray,int* pM,int* pN){/*{{{*/
+ 	_error_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of integers");
+ }
+ /*}}}*/
+-/*FUNCTION DoubleParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){{{*/
+-void DoubleParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){
++void DoubleParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM){/*{{{*/
+ 	_error_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of IssmDouble");
+ }
+ /*}}}*/
+-/*FUNCTION DoubleParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){{{*/
+-void DoubleParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){
++void DoubleParam::GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){/*{{{*/
+ 	_error_("Double param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an array of IssmDouble");
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Params/DoubleMatArrayParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/DoubleMatArrayParam.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Params/DoubleMatArrayParam.cpp	(revision 18064)
+@@ -15,13 +15,11 @@
+ /*}}}*/
+ 
+ /*DoubleMatArrayParam constructors and destructor*/
+-/*FUNCTION DoubleMatArrayParam::DoubleMatArrayParam(){{{*/
+-DoubleMatArrayParam::DoubleMatArrayParam(){
++DoubleMatArrayParam::DoubleMatArrayParam(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION DoubleMatArrayParam::DoubleMatArrayParam(int enum_type,IssmDouble** array, int M, int* mdim_array, int* ndim_array){{{*/
+-DoubleMatArrayParam::DoubleMatArrayParam(int in_enum_type,IssmDouble** in_array, int in_M, int* in_mdim_array, int* in_ndim_array){
++DoubleMatArrayParam::DoubleMatArrayParam(int in_enum_type,IssmDouble** in_array, int in_M, int* in_mdim_array, int* in_ndim_array){/*{{{*/
+ 
+ 	int i;
+ 	IssmDouble* matrix=NULL;
+@@ -58,8 +56,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION DoubleMatArrayParam::~DoubleMatArrayParam(){{{*/
+-DoubleMatArrayParam::~DoubleMatArrayParam(){
++DoubleMatArrayParam::~DoubleMatArrayParam(){/*{{{*/
+ 
+ 	int i;
+ 	IssmDouble* matrix=NULL;
+@@ -78,8 +75,7 @@
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION DoubleMatArrayParam::Echo {{{*/
+-void DoubleMatArrayParam::Echo(void){
++void DoubleMatArrayParam::Echo(void){/*{{{*/
+ 
+ 	_printf_("DoubleMatArrayParam:\n");
+ 	_printf_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
+@@ -88,8 +84,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleMatArrayParam::DeepEcho{{{*/
+-void DoubleMatArrayParam::DeepEcho(void){
++void DoubleMatArrayParam::DeepEcho(void){/*{{{*/
+ 
+ 	int i,j,k;
+ 	int m,n;
+@@ -112,18 +107,15 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION DoubleMatArrayParam::Id{{{*/
+-int    DoubleMatArrayParam::Id(void){ return -1; }
++int    DoubleMatArrayParam::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION DoubleMatArrayParam::ObjectEnum{{{*/
+-int DoubleMatArrayParam::ObjectEnum(void){
++int DoubleMatArrayParam::ObjectEnum(void){/*{{{*/
+ 
+ 	return DoubleMatArrayParamEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleMatArrayParam::copy{{{*/
+-Object* DoubleMatArrayParam::copy() {
++Object* DoubleMatArrayParam::copy() {/*{{{*/
+ 
+ 	return new DoubleMatArrayParam(this->enum_type,this->array, this->M, this->mdim_array,this->ndim_array);
+ 
+@@ -131,8 +123,7 @@
+ /*}}}*/
+ 
+ /*DoubleMatArrayParam virtual functions definitions: */
+-/*FUNCTION DoubleMatArrayParam::GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){{{*/
+-void  DoubleMatArrayParam::GetParameterValue(IssmDouble*** pout_array, int* pout_M,int** pout_mdim_array, int** pout_ndim_array){
++void  DoubleMatArrayParam::GetParameterValue(IssmDouble*** pout_array, int* pout_M,int** pout_mdim_array, int** pout_ndim_array){/*{{{*/
+ 
+ 	int i,m,n;
+ 	IssmDouble* matrix=NULL;
+@@ -182,8 +173,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleMatArrayParam::SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){{{*/
+-void  DoubleMatArrayParam::SetValue(IssmDouble** in_array, int in_M, int* in_mdim_array, int* in_ndim_array){
++void  DoubleMatArrayParam::SetValue(IssmDouble** in_array, int in_M, int* in_mdim_array, int* in_ndim_array){/*{{{*/
+ 
+ 	int i,m,n;
+ 	IssmDouble* in_matrix=NULL;
+Index: ../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.cpp	(revision 18064)
+@@ -12,16 +12,14 @@
+ #include "../../shared/shared.h"
+ 
+ /*ExponentialVariogram constructors and destructor*/
+-/*FUNCTION ExponentialVariogram::ExponentialVariogram(){{{*/
+-ExponentialVariogram::ExponentialVariogram(){
++ExponentialVariogram::ExponentialVariogram(){/*{{{*/
+ 	this->nugget = 0.2;
+ 	this->sill   = 1;
+ 	this->range  = SQRT3;
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION ExponentialVariogram::ExponentialVariogram(Options* options){{{*/
+-ExponentialVariogram::ExponentialVariogram(Options* options){
++ExponentialVariogram::ExponentialVariogram(Options* options){/*{{{*/
+ 
+ 	/*Defaults*/
+ 	this->nugget = 0.2;
+@@ -37,15 +35,13 @@
+ 	if(nugget==sill) _error_("nugget and sill cannot be equal (constant semivariogram not allowed)");
+ }
+ /*}}}*/
+-/*FUNCTION ExponentialVariogram::~ExponentialVariogram(){{{*/
+-ExponentialVariogram::~ExponentialVariogram(){
++ExponentialVariogram::~ExponentialVariogram(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION ExponentialVariogram::Echo {{{*/
+-void ExponentialVariogram::Echo(void){
++void ExponentialVariogram::Echo(void){/*{{{*/
+ 	_printf_("ExponentialVariogram\n");
+ 	_printf_("   nugget: " << this->nugget << "\n");
+ 	_printf_("   sill  : " << this->sill << "\n");
+@@ -54,8 +50,7 @@
+ /*}}}*/
+ 
+ /*Variogram function*/
+-/*FUNCTION ExponentialVariogram::Covariance{{{*/
+-double ExponentialVariogram::Covariance(double deltax,double deltay){
++double ExponentialVariogram::Covariance(double deltax,double deltay){/*{{{*/
+ 	/*The covariance can be deduced from the variogram from the following
+ 	 * relationship:
+ 	 *    2 gamma = C(x,x) + C(y,y) -2 C(x,y)
+@@ -75,8 +70,7 @@
+ 	return cova;
+ }
+ /*}}}*/
+-/*FUNCTION ExponentialVariogram::SemiVariogram{{{*/
+-double ExponentialVariogram::SemiVariogram(double deltax,double deltay){
++double ExponentialVariogram::SemiVariogram(double deltax,double deltay){/*{{{*/
+ 	/*http://en.wikipedia.org/wiki/Variogram*/
+ 	double h,a,gamma;
+ 
+Index: ../trunk-jpl/src/c/classes/kriging/PowerVariogram.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/PowerVariogram.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/kriging/PowerVariogram.cpp	(revision 18064)
+@@ -12,16 +12,14 @@
+ #include "../../shared/shared.h"
+ 
+ /*PowerVariogram constructors and destructor*/
+-/*FUNCTION PowerVariogram::PowerVariogram(){{{*/
+-PowerVariogram::PowerVariogram(){
++PowerVariogram::PowerVariogram(){/*{{{*/
+ 	this->nugget = 0.2;
+ 	this->slope  = 1.;
+ 	this->power  = 1.;
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION PowerVariogram::PowerVariogram(Options* options){{{*/
+-PowerVariogram::PowerVariogram(Options* options){
++PowerVariogram::PowerVariogram(Options* options){/*{{{*/
+ 
+ 	/*Defaults*/
+ 	this->nugget = 0.2;
+@@ -38,15 +36,13 @@
+ 	if(slope<=0) _error_("slope must be positive");
+ }
+ /*}}}*/
+-/*FUNCTION PowerVariogram::~PowerVariogram(){{{*/
+-PowerVariogram::~PowerVariogram(){
++PowerVariogram::~PowerVariogram(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION PowerVariogram::Echo {{{*/
+-void PowerVariogram::Echo(void){
++void PowerVariogram::Echo(void){/*{{{*/
+ 	_printf_("PowerVariogram\n");
+ 	_printf_("   nugget: " << this->nugget << "\n");
+ 	_printf_("   slope : " << this->slope << "\n");
+@@ -55,8 +51,7 @@
+ /*}}}*/
+ 
+ /*Variogram function*/
+-/*FUNCTION PowerVariogram::Covariance{{{*/
+-double PowerVariogram::Covariance(double deltax,double deltay){
++double PowerVariogram::Covariance(double deltax,double deltay){/*{{{*/
+ 	/*The covariance can be deduced from the variogram from the following
+ 	 * relationship:
+ 	 *    2 gamma = C(x,x) + C(y,y) -2 C(x,y)
+@@ -73,8 +68,7 @@
+ 	return cova;
+ }
+ /*}}}*/
+-/*FUNCTION PowerVariogram::SemiVariogram{{{*/
+-double PowerVariogram::SemiVariogram(double deltax,double deltay){
++double PowerVariogram::SemiVariogram(double deltax,double deltay){/*{{{*/
+ 	/*http://en.wikipedia.org/wiki/Variogram*/
+ 	double h,gamma;
+ 
+Index: ../trunk-jpl/src/c/classes/kriging/Quadtree.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/Quadtree.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/kriging/Quadtree.cpp	(revision 18064)
+@@ -80,14 +80,12 @@
+ /*}}}*/
+ 
+ 	/*Constructors/Destructors*/
+-/*FUNCTION Quadtree::Quadtree(){{{*/
+-Quadtree::Quadtree(){
++Quadtree::Quadtree(){/*{{{*/
+ 	_error_("Constructor not supported");
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Quadtree::Quadtree(double xmin,double xmax,double ymin,double ymax,int maxdepth){{{*/
+-Quadtree::Quadtree(double xmin,double xmax,double ymin,double ymax,int maxdepth){
++Quadtree::Quadtree(double xmin,double xmax,double ymin,double ymax,int maxdepth){/*{{{*/
+ 
+ 	/*Intermediaries*/
+ 	double length;
+@@ -105,8 +103,7 @@
+ 	this->root=NewQuadtreeBox(xmin+length/2,ymin+length/2,length);
+ }
+ /*}}}*/
+-	/*FUNCTION Quadtree::~Quadtree(){{{*/
+-	Quadtree::~Quadtree(){
++	Quadtree::~Quadtree(){/*{{{*/
+ 
+ 		delete boxcontainer;
+ 		root=NULL;
+@@ -115,8 +112,7 @@
+ 	/*}}}*/
+ 
+ 	/*Methods*/
+-/*FUNCTION Quadtree::Add{{{*/
+-void  Quadtree::Add(Observation* observation){
++void  Quadtree::Add(Observation* observation){/*{{{*/
+ 
+ 	/*Intermediaries*/
+ 	int          xi,yi,ij,level,levelbin;
+@@ -198,8 +194,7 @@
+ 	NbObs++;
+ 
+ }/*}}}*/
+-/*FUNCTION Quadtree::AddAndAverage{{{*/
+-void Quadtree::AddAndAverage(double x,double y,double value){
++void Quadtree::AddAndAverage(double x,double y,double value){/*{{{*/
+ 
+ 	QuadtreeBox **pbox = NULL;
+ 	QuadtreeBox  *box  = NULL;
+@@ -247,8 +242,7 @@
+ 		_error_("Box is not full");
+ 	}
+ }/*}}}*/
+-/*FUNCTION Quadtree::ClosestObs{{{*/
+-void Quadtree::ClosestObs(int *pindex,double x,double y){
++void Quadtree::ClosestObs(int *pindex,double x,double y){/*{{{*/
+ 
+ 	QuadtreeBox **pbox = NULL;
+ 	QuadtreeBox  *box  = NULL;
+@@ -287,8 +281,7 @@
+ 
+ 	*pindex=index;
+ }/*}}}*/
+-/*FUNCTION Quadtree::Echo{{{*/
+-void  Quadtree::Echo(void){
++void  Quadtree::Echo(void){/*{{{*/
+ 
+ 	_printf_("Quadtree:\n");
+ 	_printf_("   MaxDepth      = " << this->MaxDepth << "\n");
+@@ -297,8 +290,7 @@
+ 	_printf_("   root          = " << this->root << "\n");
+ 
+ }/*}}}*/
+-/*FUNCTION Quadtree::DeepEcho{{{*/
+-void  Quadtree::DeepEcho(void){
++void  Quadtree::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_("Quadtree:\n");
+ 	_printf_("   MaxDepth      = " << this->MaxDepth << "\n");
+@@ -308,8 +300,7 @@
+ 	boxcontainer->Echo();
+ 
+ }/*}}}*/
+-/*FUNCTION Quadtree::IntergerCoordinates{{{*/
+-void  Quadtree::IntergerCoordinates(int *xi,int *yi,double x,double y){
++void  Quadtree::IntergerCoordinates(int *xi,int *yi,double x,double y){/*{{{*/
+ 
+ 	/*Intermediaries*/
+ 	double coefficient;
+@@ -332,8 +323,7 @@
+ 	*xi=int(coefficient*(x - xmin));
+ 	*yi=int(coefficient*(y - ymin));
+ }/*}}}*/
+-/*FUNCTION Quadtree::NewQuadtreeBox(double xcenter,double ycenter,double length){{{*/
+-Quadtree::QuadtreeBox* Quadtree::NewQuadtreeBox(double xcenter,double ycenter,double length){
++Quadtree::QuadtreeBox* Quadtree::NewQuadtreeBox(double xcenter,double ycenter,double length){/*{{{*/
+ 
+ 	/*Output*/
+ 	QuadtreeBox* newbox=NULL;
+@@ -356,8 +346,7 @@
+ 	/*currentbox now points toward next quadtree box*/
+ 	return newbox;
+ }/*}}}*/
+-/*FUNCTION Quadtree::NewQuadtreeBox(QuadtreeBox* master,int index) {{{*/
+-Quadtree::QuadtreeBox* Quadtree::NewQuadtreeBox(QuadtreeBox* master,int index){
++Quadtree::QuadtreeBox* Quadtree::NewQuadtreeBox(QuadtreeBox* master,int index){/*{{{*/
+ 
+ 	/*Output*/
+ 	QuadtreeBox* newbox=NULL;
+@@ -401,8 +390,7 @@
+ 	/*currentbox now points toward next quadtree box*/
+ 	return newbox;
+ }/*}}}*/
+-/*FUNCTION Quadtree::QuadtreeDepth{{{*/
+-void Quadtree::QuadtreeDepth(int* A,int xi,int yi){
++void Quadtree::QuadtreeDepth(int* A,int xi,int yi){/*{{{*/
+ 
+ 	QuadtreeBox **pbox = NULL;
+ 	QuadtreeBox  *box  = NULL;
+@@ -429,8 +417,7 @@
+ 
+ 	*A=level;
+ }/*}}}*/
+-/*FUNCTION Quadtree::QuadtreeDepth2{{{*/
+-void Quadtree::QuadtreeDepth2(int* A,int xi,int yi){
++void Quadtree::QuadtreeDepth2(int* A,int xi,int yi){/*{{{*/
+ 
+ 	QuadtreeBox **pbox = NULL;
+ 	QuadtreeBox  *box  = NULL;
+@@ -482,8 +469,7 @@
+ 
+ 	*A=level;
+ }/*}}}*/
+-/*FUNCTION Quadtree::RangeSearch{{{*/
+-void Quadtree::RangeSearch(int **pindices,int *pnobs,double x,double y,double range){
++void Quadtree::RangeSearch(int **pindices,int *pnobs,double x,double y,double range){/*{{{*/
+ 
+ 	/*Intermediaries*/
+ 	int  nobs;
+@@ -502,8 +488,7 @@
+ }/*}}}*/
+ 
+ /*QuadtreeBox methos*/
+-/*FUNCTION QuadtreeBox::Echo{{{*/
+-void  Quadtree::QuadtreeBox::Echo(void){
++void  Quadtree::QuadtreeBox::Echo(void){/*{{{*/
+ 
+ 	_printf_("QuadtreeBox:\n");
+ 	_printf_("   nbitems = " << this->nbitems << "\n");
+@@ -512,8 +497,7 @@
+ 	_printf_("   length  = " << this->length << "\n");
+ 
+ }/*}}}*/
+-/*FUNCTION QuadtreeBox::IsWithinRange{{{*/
+-int Quadtree::QuadtreeBox::IsWithinRange(double x,double y,double range){
++int Quadtree::QuadtreeBox::IsWithinRange(double x,double y,double range){/*{{{*/
+ 
+ 	/*Return 0 if the 2 boxes do not overlap*/
+ 	if(this->xcenter+this->length/2 < x-range) return 0;
+@@ -531,8 +515,7 @@
+ 	return 1;
+ 
+ }/*}}}*/
+-/*FUNCTION QuadtreeBox::RangeSearch{{{*/
+-void Quadtree::QuadtreeBox::RangeSearch(int* indices,int *pnobs,double x,double y,double range){
++void Quadtree::QuadtreeBox::RangeSearch(int* indices,int *pnobs,double x,double y,double range){/*{{{*/
+ 
+ 	/*Intermediaries*/
+ 	int i,nobs;
+@@ -573,8 +556,7 @@
+ 	/*Assign output pointers: */
+ 	*pnobs=nobs;
+ }/*}}}*/
+-/*FUNCTION QuadtreeBox::WriteObservations{{{*/
+-void Quadtree::QuadtreeBox::WriteObservations(int* indices,int *pnobs){
++void Quadtree::QuadtreeBox::WriteObservations(int* indices,int *pnobs){/*{{{*/
+ 
+ 	/*Intermediaries*/
+ 	int i,nobs;
+Index: ../trunk-jpl/src/c/classes/kriging/Observations.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/Observations.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/kriging/Observations.cpp	(revision 18064)
+@@ -29,14 +29,12 @@
+ /*}}}*/
+ 
+ /*Object constructors and destructor*/
+-/*FUNCTION Observations::Observations(){{{*/
+-Observations::Observations(){
++Observations::Observations(){/*{{{*/
+ 	this->quadtree = NULL;
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Observations::Observations(IssmPDouble* observations_list,IssmPDouble* x,IssmPDouble* y,int n,Options* options){{{*/
+-Observations::Observations(IssmPDouble* observations_list,IssmPDouble* x,IssmPDouble* y,int n,Options* options){
++Observations::Observations(IssmPDouble* observations_list,IssmPDouble* x,IssmPDouble* y,int n,Options* options){/*{{{*/
+ 
+ 	/*Intermediaries*/
+ 	int          i,maxdepth,level,counter,index;
+@@ -111,16 +109,14 @@
+ 	_printf0_("  Final number of observations: " << this->quadtree->NbObs << "\n");
+ }
+ /*}}}*/
+-/*FUNCTION Observations::~Observations(){{{*/
+-Observations::~Observations(){
++Observations::~Observations(){/*{{{*/
+ 	delete quadtree;
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Methods*/
+-/*FUNCTION Observations::ClosestObservation{{{*/
+-void Observations::ClosestObservation(IssmPDouble *px,IssmPDouble *py,IssmPDouble *pobs,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius){
++void Observations::ClosestObservation(IssmPDouble *px,IssmPDouble *py,IssmPDouble *pobs,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius){/*{{{*/
+ 
+ 	/*Output and Intermediaries*/
+ 	int          nobs,i,index;
+@@ -171,8 +167,7 @@
+ 	xDelete<int>(indices);
+ 
+ }/*}}}*/
+-/*FUNCTION Observations::Distances{{{*/
+-void Observations::Distances(IssmPDouble* distances,IssmPDouble *x,IssmPDouble *y,int n,IssmPDouble radius){
++void Observations::Distances(IssmPDouble* distances,IssmPDouble *x,IssmPDouble *y,int n,IssmPDouble radius){/*{{{*/
+ 
+ 	IssmPDouble xi,yi,obs;
+ 
+@@ -186,8 +181,7 @@
+ 		}
+ 	}
+ }/*}}}*/
+-/*FUNCTION Observations::ObservationList(IssmPDouble **px,IssmPDouble **py,IssmPDouble **pobs,int* pnobs,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius,int maxdata){{{*/
+-void Observations::ObservationList(IssmPDouble **px,IssmPDouble **py,IssmPDouble **pobs,int* pnobs,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius,int maxdata){
++void Observations::ObservationList(IssmPDouble **px,IssmPDouble **py,IssmPDouble **pobs,int* pnobs,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius,int maxdata){/*{{{*/
+ 
+ 	/*Output and Intermediaries*/
+ 	bool         stop;
+@@ -269,8 +263,7 @@
+ 	*pobs=obs;
+ 	*pnobs=nobs;
+ }/*}}}*/
+-/*FUNCTION Observations::ObservationList(IssmPDouble **px,IssmPDouble **py,IssmPDouble **pobs,int* pnobs){{{*/
+-void Observations::ObservationList(IssmPDouble **px,IssmPDouble **py,IssmPDouble **pobs,int* pnobs){
++void Observations::ObservationList(IssmPDouble **px,IssmPDouble **py,IssmPDouble **pobs,int* pnobs){/*{{{*/
+ 
+ 	/*Output and Intermediaries*/
+ 	int          nobs;
+@@ -297,8 +290,7 @@
+ 	*pobs=obs;
+ 	*pnobs=nobs;
+ }/*}}}*/
+-/*FUNCTION Observations::InterpolationIDW{{{*/
+-void Observations::InterpolationIDW(IssmPDouble *pprediction,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius,int mindata,int maxdata,IssmPDouble power){
++void Observations::InterpolationIDW(IssmPDouble *pprediction,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius,int mindata,int maxdata,IssmPDouble power){/*{{{*/
+ 
+ 	/*Intermediaries*/
+ 	int         i,n_obs;
+@@ -346,8 +338,7 @@
+ 	xDelete<IssmPDouble>(y);
+ 	xDelete<IssmPDouble>(obs);
+ }/*}}}*/
+-/*FUNCTION Observations::InterpolationKriging{{{*/
+-void Observations::InterpolationKriging(IssmPDouble *pprediction,IssmPDouble *perror,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius,int mindata,int maxdata,Variogram* variogram){
++void Observations::InterpolationKriging(IssmPDouble *pprediction,IssmPDouble *perror,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius,int mindata,int maxdata,Variogram* variogram){/*{{{*/
+ 
+ 	/*Intermediaries*/
+ 	int           i,j,n_obs;
+@@ -423,8 +414,7 @@
+ 	xDelete<IssmPDouble>(Lambda);
+ 
+ }/*}}}*/
+-/*FUNCTION Observations::InterpolationNearestNeighbor{{{*/
+-void Observations::InterpolationNearestNeighbor(IssmPDouble *pprediction,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius){
++void Observations::InterpolationNearestNeighbor(IssmPDouble *pprediction,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius){/*{{{*/
+ 
+ 	/*Intermediaries*/
+ 	IssmPDouble x,y,obs;
+@@ -435,8 +425,7 @@
+ 	/*Assign output pointer*/
+ 	*pprediction = obs;
+ }/*}}}*/
+-/*FUNCTION Observations::InterpolationV4{{{*/
+-void Observations::InterpolationV4(IssmPDouble *pprediction,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius,int mindata,int maxdata){
++void Observations::InterpolationV4(IssmPDouble *pprediction,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius,int mindata,int maxdata){/*{{{*/
+ 	/* Reference:  David T. Sandwell, Biharmonic spline interpolation of GEOS-3
+ 	 * and SEASAT altimeter data, Geophysical Research Letters, 2, 139-142,
+ 	 * 1987.  Describes interpolation using value or gradient of value in any
+@@ -518,8 +507,7 @@
+ 	xDelete<IssmPDouble>(g);
+ 	xDelete<IssmPDouble>(weights);
+ }/*}}}*/
+-/*FUNCTION Observations::QuadtreeColoring{{{*/
+-void Observations::QuadtreeColoring(IssmPDouble* A,IssmPDouble *x,IssmPDouble *y,int n){
++void Observations::QuadtreeColoring(IssmPDouble* A,IssmPDouble *x,IssmPDouble *y,int n){/*{{{*/
+ 
+ 	int xi,yi,level;
+ 
+@@ -530,8 +518,7 @@
+ 	}
+ 
+ }/*}}}*/
+-/*FUNCTION Observations::Variomap{{{*/
+-void Observations::Variomap(IssmPDouble* gamma,IssmPDouble *x,int n){
++void Observations::Variomap(IssmPDouble* gamma,IssmPDouble *x,int n){/*{{{*/
+ 
+ 	/*Output and Intermediaries*/
+ 	int          i,j,k;
+Index: ../trunk-jpl/src/c/classes/kriging/GaussianVariogram.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/GaussianVariogram.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/kriging/GaussianVariogram.cpp	(revision 18064)
+@@ -12,16 +12,14 @@
+ #include "../../shared/shared.h"
+ 
+ /*GaussianVariogram constructors and destructor*/
+-/*FUNCTION GaussianVariogram::GaussianVariogram(){{{*/
+-GaussianVariogram::GaussianVariogram(){
++GaussianVariogram::GaussianVariogram(){/*{{{*/
+ 	this->nugget = 0.2;
+ 	this->sill   = 1;
+ 	this->range  = SQRT3;
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION GaussianVariogram::GaussianVariogram(Options* options){{{*/
+-GaussianVariogram::GaussianVariogram(Options* options){
++GaussianVariogram::GaussianVariogram(Options* options){/*{{{*/
+ 
+ 	/*Defaults*/
+ 	this->nugget = 0.2;
+@@ -37,15 +35,13 @@
+ 	if(nugget==sill) _error_("nugget and sill cannot be equal (constant semivariogram not allowed)");
+ }
+ /*}}}*/
+-/*FUNCTION GaussianVariogram::~GaussianVariogram(){{{*/
+-GaussianVariogram::~GaussianVariogram(){
++GaussianVariogram::~GaussianVariogram(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION GaussianVariogram::Echo {{{*/
+-void GaussianVariogram::Echo(void){
++void GaussianVariogram::Echo(void){/*{{{*/
+ 	_printf_("GaussianVariogram\n");
+ 	_printf_("   nugget: " << this->nugget << "\n");
+ 	_printf_("   sill  : " << this->sill << "\n");
+@@ -54,8 +50,7 @@
+ /*}}}*/
+ 
+ /*Variogram function*/
+-/*FUNCTION GaussianVariogram::Covariance{{{*/
+-double GaussianVariogram::Covariance(double deltax,double deltay){
++double GaussianVariogram::Covariance(double deltax,double deltay){/*{{{*/
+ 	/*The covariance can be deduced from the variogram from the following
+ 	 * relationship:
+ 	 *    2 gamma = C(x,x) + C(y,y) -2 C(x,y)
+@@ -76,8 +71,7 @@
+ 	return cova;
+ }
+ /*}}}*/
+-/*FUNCTION GaussianVariogram::SemiVariogram{{{*/
+-double GaussianVariogram::SemiVariogram(double deltax,double deltay){
++double GaussianVariogram::SemiVariogram(double deltax,double deltay){/*{{{*/
+ 	/*http://en.wikipedia.org/wiki/Variogram*/
+ 	double h2,a,gamma;
+ 
+Index: ../trunk-jpl/src/c/classes/kriging/SphericalVariogram.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/SphericalVariogram.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/kriging/SphericalVariogram.cpp	(revision 18064)
+@@ -12,16 +12,14 @@
+ #include "../../shared/shared.h"
+ 
+ /*SphericalVariogram constructors and destructor*/
+-/*FUNCTION SphericalVariogram::SphericalVariogram(){{{*/
+-SphericalVariogram::SphericalVariogram(){
++SphericalVariogram::SphericalVariogram(){/*{{{*/
+ 	this->nugget = 0.2;
+ 	this->sill   = 1;
+ 	this->range  = SQRT3;
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION SphericalVariogram::SphericalVariogram(Options* options){{{*/
+-SphericalVariogram::SphericalVariogram(Options* options){
++SphericalVariogram::SphericalVariogram(Options* options){/*{{{*/
+ 
+ 	/*Defaults*/
+ 	this->nugget = 0.2;
+@@ -37,15 +35,13 @@
+ 	if(nugget==sill) _error_("nugget and sill cannot be equal (constant semivariogram not allowed)");
+ }
+ /*}}}*/
+-/*FUNCTION SphericalVariogram::~SphericalVariogram(){{{*/
+-SphericalVariogram::~SphericalVariogram(){
++SphericalVariogram::~SphericalVariogram(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION SphericalVariogram::Echo {{{*/
+-void SphericalVariogram::Echo(void){
++void SphericalVariogram::Echo(void){/*{{{*/
+ 	_printf_("SphericalVariogram\n");
+ 	_printf_("   nugget: " << this->nugget << "\n");
+ 	_printf_("   sill  : " << this->sill << "\n");
+@@ -54,8 +50,7 @@
+ /*}}}*/
+ 
+ /*Variogram function*/
+-/*FUNCTION SphericalVariogram::Covariance{{{*/
+-double SphericalVariogram::Covariance(double deltax,double deltay){
++double SphericalVariogram::Covariance(double deltax,double deltay){/*{{{*/
+ 	/*The covariance can be deduced from the variogram from the following
+ 	 * relationship:
+ 	 *    2 gamma = C(x,x) + C(y,y) -2 C(x,y)
+@@ -75,8 +70,7 @@
+ 	return cova;
+ }
+ /*}}}*/
+-/*FUNCTION SphericalVariogram::SemiVariogram{{{*/
+-double SphericalVariogram::SemiVariogram(double deltax,double deltay){
++double SphericalVariogram::SemiVariogram(double deltax,double deltay){/*{{{*/
+ 	/*http://en.wikipedia.org/wiki/Variogram*/
+ 	double h,gamma;
+ 
+Index: ../trunk-jpl/src/c/classes/kriging/Observation.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/Observation.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/kriging/Observation.cpp	(revision 18064)
+@@ -6,13 +6,11 @@
+ #include "../classes.h"
+ 
+ /*Observation constructors and destructor*/
+-/*FUNCTION Observation::Observation(){{{*/
+-Observation::Observation(){
++Observation::Observation(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Observation::Observation(double x,double y,int xi,int yi,int index,double value){{{*/
+-Observation::Observation(double x_in,double y_in,int xi_in,int yi_in,int index_in,double value_in){
++Observation::Observation(double x_in,double y_in,int xi_in,int yi_in,int index_in,double value_in){/*{{{*/
+ 
+ 	this->x      = x_in;
+ 	this->y      = y_in;
+@@ -24,15 +22,13 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Observation::~Observation(){{{*/
+-Observation::~Observation(){
++Observation::~Observation(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION Observation::Echo {{{*/
+-void Observation::Echo(void){
++void Observation::Echo(void){/*{{{*/
+ 
+ 	_printf_("Observation\n");
+ 	_printf_("   index : " << this->index << "\n");
+@@ -46,8 +42,7 @@
+ /*}}}*/
+ 
+ /*Observations functions*/
+-/*FUNCTION Observation::WriteXYObs(double* px,double* py,double* pobs){{{*/
+-void Observation::WriteXYObs(double* px,double* py,double* pobs){
++void Observation::WriteXYObs(double* px,double* py,double* pobs){/*{{{*/
+ 	*px   = this->x;
+ 	*py   = this->y;
+ 	*pobs = this->value;
+Index: ../trunk-jpl/src/c/classes/Options/OptionUtilities.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Options/OptionUtilities.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Options/OptionUtilities.cpp	(revision 18064)
+@@ -14,8 +14,7 @@
+ #include "../../shared/shared.h"
+ /*}}}*/
+ 
+-/*FUNCTION ColumnWiseDimsFromIndex{{{*/
+-int ColumnWiseDimsFromIndex(int* dims,int index,int* size,int ndims){
++int ColumnWiseDimsFromIndex(int* dims,int index,int* size,int ndims){/*{{{*/
+ 
+ 	int   i;
+ 	int   aprod=1;
+@@ -33,8 +32,7 @@
+ 
+ 	return(0);
+ }/*}}}*/
+-/*FUNCTION IndexFromColumnWiseDims{{{*/
+-int IndexFromColumnWiseDims(int* dims, int* size, int ndims) {
++int IndexFromColumnWiseDims(int* dims, int* size, int ndims) {/*{{{*/
+ 
+ 	int   i;
+ 	int   index=0;
+@@ -52,8 +50,7 @@
+ 
+ 	return(index);
+ }/*}}}*/
+-/*FUNCTION RowWiseDimsFromIndex{{{*/
+-int RowWiseDimsFromIndex(int* dims, int index, int* size, int ndims) {
++int RowWiseDimsFromIndex(int* dims, int index, int* size, int ndims) {/*{{{*/
+ 
+ 	int   i;
+ 	int   aprod=1;
+@@ -71,8 +68,7 @@
+ 
+ 	return(0);
+ }/*}}}*/
+-/*FUNCTION IndexFromRowWiseDims{{{*/
+-int IndexFromRowWiseDims(int* dims, int* size, int ndims) {
++int IndexFromRowWiseDims(int* dims, int* size, int ndims) {/*{{{*/
+ 
+ 	int   i;
+ 	int   index=0;
+@@ -90,8 +86,7 @@
+ 
+ 	return(index);
+ }/*}}}*/
+-/*FUNCTION StringFromDims{{{*/
+-int StringFromDims(char* cstr, int* dims, int ndims) {
++int StringFromDims(char* cstr, int* dims, int ndims) {/*{{{*/
+ 
+ 	sprintf(&cstr[0],"[");
+ 	for(int i=0; i<ndims-1; i++) sprintf(&cstr[strlen(cstr)],"%d,",dims[i]);
+@@ -99,8 +94,7 @@
+ 
+ 	return(0);
+ }/*}}}*/
+-/*FUNCTION StringFromSize{{{*/
+-int StringFromSize(char* cstr, int* size, int ndims) {
++int StringFromSize(char* cstr, int* size, int ndims) {/*{{{*/
+ 
+ 	sprintf(&cstr[0],"[");
+ 	for(int i=0; i<ndims-1; i++) sprintf(&cstr[strlen(cstr)],"%dx",size[i]);
+Index: ../trunk-jpl/src/c/classes/Options/Options.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Options/Options.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Options/Options.cpp	(revision 18064)
+@@ -20,20 +20,17 @@
+ /*}}}*/
+ 
+ /*Object constructors and destructor*/
+-/*FUNCTION Options::Options(){{{*/
+-Options::Options(){
++Options::Options(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Options::~Options(){{{*/
+-Options::~Options(){
++Options::~Options(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object management*/
+-/*FUNCTION Options::AddOption{{{*/
+-int  Options::AddOption(Option* in_option){
++int  Options::AddOption(Option* in_option){/*{{{*/
+ 
+ 	char* name=NULL;
+ 
+@@ -67,8 +64,7 @@
+ 	return 1;
+ }
+ /*}}}*/
+-/*FUNCTION Options::GetOption{{{*/
+-Option* Options::GetOption(const char* name){
++Option* Options::GetOption(const char* name){/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Option* option=NULL;
+Index: ../trunk-jpl/src/c/classes/Contours.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Contours.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Contours.cpp	(revision 18064)
+@@ -18,14 +18,12 @@
+ /*}}}*/
+ 
+ /*Object constructors and destructor*/
+-/*FUNCTION Contours::Contours(){{{*/
+-Contours::Contours(){
++Contours::Contours(){/*{{{*/
+ 	enum_type=ContoursEnum;
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Contours::~Contours(){{{*/
+-Contours::~Contours(){
++Contours::~Contours(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Loads/Numericalflux.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Numericalflux.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Loads/Numericalflux.cpp	(revision 18064)
+@@ -20,8 +20,7 @@
+ #define NUMNODES_BOUNDARY 2
+ 
+ /*Numericalflux constructors and destructor*/
+-/*FUNCTION Numericalflux::Numericalflux(){{{*/
+-Numericalflux::Numericalflux(){
++Numericalflux::Numericalflux(){/*{{{*/
+ 	this->parameters = NULL;
+ 	this->helement   = NULL;
+ 	this->element    = NULL;
+@@ -30,8 +29,7 @@
+ 	this->nodes      = NULL;
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::Numericalflux(int id, int i, IoModel* iomodel, int analysis_type) {{{*/
+-Numericalflux::Numericalflux(int numericalflux_id,int i,int index,IoModel* iomodel, int in_analysis_type){
++Numericalflux::Numericalflux(int numericalflux_id,int i,int index,IoModel* iomodel, int in_analysis_type){/*{{{*/
+ 
+ 	/* Intermediary */
+ 	int  j;
+@@ -123,8 +121,7 @@
+ 	this->nodes=NULL;
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::~Numericalflux(){{{*/
+-Numericalflux::~Numericalflux(){
++Numericalflux::~Numericalflux(){/*{{{*/
+ 	this->parameters=NULL;
+ 	delete helement;
+ 	delete hnodes;
+@@ -133,8 +130,7 @@
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION Numericalflux::Echo {{{*/
+-void Numericalflux::Echo(void){
++void Numericalflux::Echo(void){/*{{{*/
+ 	_printf_("Numericalflux:\n");
+ 	_printf_("   id: " << id << "\n");
+ 	_printf_("   analysis_type: " << EnumToStringx(analysis_type) << "\n");
+@@ -145,8 +141,7 @@
+ 	_printf_("   parameters: " << parameters << "\n");
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::DeepEcho {{{*/
+-void Numericalflux::DeepEcho(void){
++void Numericalflux::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_("Numericalflux:\n");
+ 	_printf_("   id: " << id << "\n");
+@@ -162,20 +157,17 @@
+ 	 _printf_("      NULL\n");
+ }		
+ /*}}}*/
+-/*FUNCTION Numericalflux::Id {{{*/
+-int    Numericalflux::Id(void){
++int    Numericalflux::Id(void){/*{{{*/
+ 	return id;
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::ObjectEnum{{{*/
+-int Numericalflux::ObjectEnum(void){
++int Numericalflux::ObjectEnum(void){/*{{{*/
+ 
+ 	return NumericalfluxEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::copy {{{*/
+-Object* Numericalflux::copy() {
++Object* Numericalflux::copy() {/*{{{*/
+ 
+ 	Numericalflux* numericalflux=NULL;
+ 
+@@ -204,8 +196,7 @@
+ /*}}}*/
+ 
+ /*Load virtual functions definitions:*/
+-/*FUNCTION Numericalflux::Configure {{{*/
+-void  Numericalflux::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
++void  Numericalflux::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/
+ 
+ 	/*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 
+ 	 * datasets, using internal ids and offsets hidden in hooks: */
+@@ -222,13 +213,11 @@
+ 	this->parameters=parametersin;
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::SetCurrentConfiguration {{{*/
+-void  Numericalflux::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
++void  Numericalflux::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::CreateKMatrix {{{*/
+-void  Numericalflux::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){
++void  Numericalflux::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){/*{{{*/
+ 
+ 	/*recover some parameters*/
+ 	ElementMatrix* Ke=NULL;
+@@ -258,8 +247,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::CreatePVector {{{*/
+-void  Numericalflux::CreatePVector(Vector<IssmDouble>* pf){
++void  Numericalflux::CreatePVector(Vector<IssmDouble>* pf){/*{{{*/
+ 
+ 	/*recover some parameters*/
+ 	ElementVector* pe=NULL;
+@@ -288,8 +276,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::GetNodesSidList{{{*/
+-void Numericalflux::GetNodesSidList(int* sidlist){
++void Numericalflux::GetNodesSidList(int* sidlist){/*{{{*/
+ 
+ 	_assert_(sidlist);
+ 	_assert_(nodes);
+@@ -306,8 +293,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::GetNodesLidList{{{*/
+-void Numericalflux::GetNodesLidList(int* lidlist){
++void Numericalflux::GetNodesLidList(int* lidlist){/*{{{*/
+ 
+ 	_assert_(lidlist);
+ 	_assert_(nodes);
+@@ -324,8 +310,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::GetNumberOfNodes{{{*/
+-int Numericalflux::GetNumberOfNodes(void){
++int Numericalflux::GetNumberOfNodes(void){/*{{{*/
+ 
+ 	switch(this->flux_type){
+ 		case InternalEnum:
+@@ -338,35 +323,30 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::IsPenalty{{{*/
+-bool Numericalflux::IsPenalty(void){
++bool Numericalflux::IsPenalty(void){/*{{{*/
+ 	return false;
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::PenaltyCreateKMatrix {{{*/
+-void  Numericalflux::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){
++void  Numericalflux::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){/*{{{*/
+ 
+ 	/*No stiffness loads applied, do nothing: */
+ 	return;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::PenaltyCreatePVector{{{*/
+-void  Numericalflux::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){
++void  Numericalflux::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){/*{{{*/
+ 
+ 	/*No penalty loads applied, do nothing: */
+ 	return;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::InAnalysis{{{*/
+-bool Numericalflux::InAnalysis(int in_analysis_type){
++bool Numericalflux::InAnalysis(int in_analysis_type){/*{{{*/
+ 	if (in_analysis_type==this->analysis_type) return true;
+ 	else return false;
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::SetwiseNodeConnectivity{{{*/
+-void Numericalflux::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){
++void Numericalflux::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/
+ 
+ 	/*Output */
+ 	int d_nz = 0;
+@@ -422,8 +402,7 @@
+ /*}}}*/
+ 
+ /*Numericalflux management*/
+-/*FUNCTION Numericalflux::CreateKMatrixMasstransport{{{*/
+-ElementMatrix* Numericalflux::CreateKMatrixMasstransport(void){
++ElementMatrix* Numericalflux::CreateKMatrixMasstransport(void){/*{{{*/
+ 
+ 	switch(this->flux_type){
+ 		case InternalEnum:
+@@ -435,8 +414,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::CreateKMatrixMasstransportInternal {{{*/
+-ElementMatrix* Numericalflux::CreateKMatrixMasstransportInternal(void){
++ElementMatrix* Numericalflux::CreateKMatrixMasstransportInternal(void){/*{{{*/
+ 
+ 	/* constants*/
+ 	const int numdof=NDOF1*NUMNODES_INTERNAL;
+@@ -500,8 +478,7 @@
+ 	return Ke;
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::CreateKMatrixMasstransportBoundary {{{*/
+-ElementMatrix* Numericalflux::CreateKMatrixMasstransportBoundary(void){
++ElementMatrix* Numericalflux::CreateKMatrixMasstransportBoundary(void){/*{{{*/
+ 
+ 	/* constants*/
+ 	const int numdof=NDOF1*NUMNODES_BOUNDARY;
+@@ -572,8 +549,7 @@
+ 	return Ke;
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::CreateKMatrixBalancethickness{{{*/
+-ElementMatrix* Numericalflux::CreateKMatrixBalancethickness(void){
++ElementMatrix* Numericalflux::CreateKMatrixBalancethickness(void){/*{{{*/
+ 
+ 	switch(this->flux_type){
+ 		case InternalEnum:
+@@ -585,8 +561,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::CreateKMatrixBalancethicknessInternal {{{*/
+-ElementMatrix* Numericalflux::CreateKMatrixBalancethicknessInternal(void){
++ElementMatrix* Numericalflux::CreateKMatrixBalancethicknessInternal(void){/*{{{*/
+ 
+ 	/* constants*/
+ 	const int numdof=NDOF1*NUMNODES_INTERNAL;
+@@ -649,8 +624,7 @@
+ 	return Ke;
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::CreateKMatrixBalancethicknessBoundary {{{*/
+-ElementMatrix* Numericalflux::CreateKMatrixBalancethicknessBoundary(void){
++ElementMatrix* Numericalflux::CreateKMatrixBalancethicknessBoundary(void){/*{{{*/
+ 
+ 	/* constants*/
+ 	const int numdof=NDOF1*NUMNODES_BOUNDARY;
+@@ -720,8 +694,7 @@
+ 	return Ke;
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::CreateKMatrixAdjointBalancethickness{{{*/
+-ElementMatrix* Numericalflux::CreateKMatrixAdjointBalancethickness(void){
++ElementMatrix* Numericalflux::CreateKMatrixAdjointBalancethickness(void){/*{{{*/
+ 
+ 	switch(this->flux_type){
+ 		case InternalEnum:
+@@ -733,24 +706,21 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::CreateKMatrixAdjointBalancethicknessInternal {{{*/
+-ElementMatrix* Numericalflux::CreateKMatrixAdjointBalancethicknessInternal(void){
++ElementMatrix* Numericalflux::CreateKMatrixAdjointBalancethicknessInternal(void){/*{{{*/
+ 
+ 	ElementMatrix* Ke=CreateKMatrixBalancethicknessInternal();
+ 	if (Ke) Ke->Transpose();
+ 	return Ke;
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::CreateKMatrixAdjointBalancethicknessBoundary {{{*/
+-ElementMatrix* Numericalflux::CreateKMatrixAdjointBalancethicknessBoundary(void){
++ElementMatrix* Numericalflux::CreateKMatrixAdjointBalancethicknessBoundary(void){/*{{{*/
+ 
+ 	ElementMatrix* Ke=CreateKMatrixBalancethicknessBoundary();
+ 	if(Ke) Ke->Transpose();
+ 	return Ke;
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::CreatePVectorMasstransport{{{*/
+-ElementVector* Numericalflux::CreatePVectorMasstransport(void){
++ElementVector* Numericalflux::CreatePVectorMasstransport(void){/*{{{*/
+ 
+ 	switch(this->flux_type){
+ 		case InternalEnum:
+@@ -762,16 +732,14 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::CreatePVectorMasstransportInternal{{{*/
+-ElementVector* Numericalflux::CreatePVectorMasstransportInternal(void){
++ElementVector* Numericalflux::CreatePVectorMasstransportInternal(void){/*{{{*/
+ 
+ 	/*Nothing added to PVector*/
+ 	return NULL;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::CreatePVectorMasstransportBoundary{{{*/
+-ElementVector* Numericalflux::CreatePVectorMasstransportBoundary(void){
++ElementVector* Numericalflux::CreatePVectorMasstransportBoundary(void){/*{{{*/
+ 
+ 	/* constants*/
+ 	const int numdof=NDOF1*NUMNODES_BOUNDARY;
+@@ -840,8 +808,7 @@
+ 	return pe;
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::CreatePVectorBalancethickness{{{*/
+-ElementVector* Numericalflux::CreatePVectorBalancethickness(void){
++ElementVector* Numericalflux::CreatePVectorBalancethickness(void){/*{{{*/
+ 
+ 	switch(this->flux_type){
+ 		case InternalEnum:
+@@ -853,16 +820,14 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::CreatePVectorBalancethicknessInternal{{{*/
+-ElementVector* Numericalflux::CreatePVectorBalancethicknessInternal(void){
++ElementVector* Numericalflux::CreatePVectorBalancethicknessInternal(void){/*{{{*/
+ 
+ 	/*Nothing added to PVector*/
+ 	return NULL;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::CreatePVectorBalancethicknessBoundary{{{*/
+-ElementVector* Numericalflux::CreatePVectorBalancethicknessBoundary(void){
++ElementVector* Numericalflux::CreatePVectorBalancethicknessBoundary(void){/*{{{*/
+ 
+ 	/* constants*/
+ 	const int numdof=NDOF1*NUMNODES_BOUNDARY;
+@@ -928,15 +893,13 @@
+ 	return pe;
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::CreatePVectorAdjointBalancethickness{{{*/
+-ElementVector* Numericalflux::CreatePVectorAdjointBalancethickness(void){
++ElementVector* Numericalflux::CreatePVectorAdjointBalancethickness(void){/*{{{*/
+ 
+ 	/*No PVector for the Adjoint*/
+ 	return NULL;
+ }
+ /*}}}*/
+-/*FUNCTION Numericalflux::GetNormal {{{*/
+-void Numericalflux:: GetNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]){
++void Numericalflux:: GetNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]){/*{{{*/
+ 
+ 	/*Build unit outward pointing vector*/
+ 	IssmDouble vector[2];
+Index: ../trunk-jpl/src/c/classes/Loads/Penpair.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Penpair.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Loads/Penpair.cpp	(revision 18064)
+@@ -18,8 +18,7 @@
+ #define NUMVERTICES 2
+ 
+ /*Penpair constructors and destructor*/
+-/*FUNCTION Penpair::constructor {{{*/
+-Penpair::Penpair(){
++Penpair::Penpair(){/*{{{*/
+ 
+ 	this->hnodes=NULL;
+ 	this->nodes=NULL;
+@@ -27,8 +26,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::creation {{{*/
+-Penpair::Penpair(int penpair_id, int* penpair_node_ids,int in_analysis_type){
++Penpair::Penpair(int penpair_id, int* penpair_node_ids,int in_analysis_type){/*{{{*/
+ 
+ 	this->id=penpair_id;
+ 	this->analysis_type=in_analysis_type;
+@@ -39,16 +37,14 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::destructor {{{*/
+-Penpair::~Penpair(){
++Penpair::~Penpair(){/*{{{*/
+ 	delete hnodes;
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION Penpair::Echo {{{*/
+-void Penpair::Echo(void){
++void Penpair::Echo(void){/*{{{*/
+ 
+ 	_printf_("Penpair:\n");
+ 	_printf_("   id: " << id << "\n");
+@@ -58,8 +54,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::DeepEcho {{{*/
+-void Penpair::DeepEcho(void){
++void Penpair::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_("Penpair:\n");
+ 	_printf_("   id: " << id << "\n");
+@@ -69,17 +64,14 @@
+ 	return;
+ }		
+ /*}}}*/
+-/*FUNCTION Penpair::Id {{{*/
+-int    Penpair::Id(void){ return id; }
++int    Penpair::Id(void){ return id; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION Penpair::ObjectEnum{{{*/
+-int Penpair::ObjectEnum(void){
++int Penpair::ObjectEnum(void){/*{{{*/
+ 
+ 	return PenpairEnum;
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::copy {{{*/
+-Object* Penpair::copy() {
++Object* Penpair::copy() {/*{{{*/
+ 
+ 	Penpair* penpair=NULL;
+ 
+@@ -102,8 +94,7 @@
+ /*}}}*/
+ 
+ /*Load virtual functions definitions:*/
+-/*FUNCTION Penpair::Configure {{{*/
+-void  Penpair::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
++void  Penpair::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/
+ 
+ 	/*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 
+ 	 * datasets, using internal ids and offsets hidden in hooks: */
+@@ -117,34 +108,29 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::SetCurrentConfiguration {{{*/
+-void  Penpair::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
++void  Penpair::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::CreateKMatrix {{{*/
+-void  Penpair::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){
++void  Penpair::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){/*{{{*/
+ 	/*If you code this piece, don't forget that a penalty will be inactive if it is dealing with clone nodes*/
+ 	/*No loads applied, do nothing: */
+ 	return;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::CreatePVector {{{*/
+-void  Penpair::CreatePVector(Vector<IssmDouble>* pf){
++void  Penpair::CreatePVector(Vector<IssmDouble>* pf){/*{{{*/
+ 
+ 	/*No loads applied, do nothing: */
+ 	return;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::CreateJacobianMatrix{{{*/
+-void  Penpair::CreateJacobianMatrix(Matrix<IssmDouble>* Jff){
++void  Penpair::CreateJacobianMatrix(Matrix<IssmDouble>* Jff){/*{{{*/
+ 	this->CreateKMatrix(Jff,NULL);
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::GetNodesSidList{{{*/
+-void Penpair::GetNodesSidList(int* sidlist){
++void Penpair::GetNodesSidList(int* sidlist){/*{{{*/
+ 
+ 	_assert_(sidlist);
+ 	_assert_(nodes);
+@@ -152,8 +138,7 @@
+ 	for(int i=0;i<NUMVERTICES;i++) sidlist[i]=nodes[i]->Sid();
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::GetNodesLidList{{{*/
+-void Penpair::GetNodesLidList(int* lidlist){
++void Penpair::GetNodesLidList(int* lidlist){/*{{{*/
+ 
+ 	_assert_(lidlist);
+ 	_assert_(nodes);
+@@ -161,19 +146,16 @@
+ 	for(int i=0;i<NUMVERTICES;i++) lidlist[i]=nodes[i]->Lid();
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::GetNumberOfNodes{{{*/
+-int Penpair::GetNumberOfNodes(void){
++int Penpair::GetNumberOfNodes(void){/*{{{*/
+ 
+ 	return NUMVERTICES;
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::IsPenalty{{{*/
+-bool Penpair::IsPenalty(void){
++bool Penpair::IsPenalty(void){/*{{{*/
+ 	return true;
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::PenaltyCreateKMatrix {{{*/
+-void  Penpair::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){
++void  Penpair::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){/*{{{*/
+ 
+ 	/*Retrieve parameters: */
+ 	ElementMatrix* Ke=NULL;
+@@ -198,25 +180,21 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::PenaltyCreatePVector {{{*/
+-void  Penpair::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){
++void  Penpair::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){/*{{{*/
+ 	/*No loads applied, do nothing: */
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::PenaltyCreateJacobianMatrix{{{*/
+-void  Penpair::PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){
++void  Penpair::PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){/*{{{*/
+ 	this->PenaltyCreateKMatrix(Jff,NULL,kmax);
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::InAnalysis{{{*/
+-bool Penpair::InAnalysis(int in_analysis_type){
++bool Penpair::InAnalysis(int in_analysis_type){/*{{{*/
+ 	if (in_analysis_type==this->analysis_type)return true;
+ 	else return false;
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::SetwiseNodeConnectivity{{{*/
+-void Penpair::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){
++void Penpair::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/
+ 
+ 	/*Output */
+ 	int d_nz = 0;
+@@ -272,30 +250,25 @@
+ /*}}}*/
+ 
+ /*Update virtual functions definitions:*/
+-/*FUNCTION Penpair::InputUpdateFromConstant(IssmDouble constant, int name) {{{*/
+-void  Penpair::InputUpdateFromConstant(IssmDouble constant, int name){
++void  Penpair::InputUpdateFromConstant(IssmDouble constant, int name){/*{{{*/
+ 	/*Nothing updated yet*/
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::InputUpdateFromConstant(int constant, int name) {{{*/
+-void  Penpair::InputUpdateFromConstant(int constant, int name){
++void  Penpair::InputUpdateFromConstant(int constant, int name){/*{{{*/
+ 	/*Nothing updated yet*/
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::InputUpdateFromConstant(bool constant, int name) {{{*/
+-void  Penpair::InputUpdateFromConstant(bool constant, int name){
++void  Penpair::InputUpdateFromConstant(bool constant, int name){/*{{{*/
+ 	/*Nothing updated yet*/
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::InputUpdateFromVector(IssmDouble* vector, int name, int type) {{{*/
+-void  Penpair::InputUpdateFromVector(IssmDouble* vector, int name, int type){
++void  Penpair::InputUpdateFromVector(IssmDouble* vector, int name, int type){/*{{{*/
+ 	/*Nothing updated yet*/
+ }
+ /*}}}*/
+ 
+ /*Penpair management:*/
+-/*FUNCTION Penpair::PenaltyCreateKMatrixStressbalanceHoriz{{{*/
+-ElementMatrix* Penpair::PenaltyCreateKMatrixStressbalanceHoriz(IssmDouble kmax){
++ElementMatrix* Penpair::PenaltyCreateKMatrixStressbalanceHoriz(IssmDouble kmax){/*{{{*/
+ 
+ 	int    approximation0=nodes[0]->GetApproximation();
+ 	int    approximation1=nodes[1]->GetApproximation();
+@@ -328,8 +301,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::PenaltyCreateKMatrixStressbalanceSSAHO {{{*/
+-ElementMatrix* Penpair::PenaltyCreateKMatrixStressbalanceSSAHO(IssmDouble kmax){
++ElementMatrix* Penpair::PenaltyCreateKMatrixStressbalanceSSAHO(IssmDouble kmax){/*{{{*/
+ 
+ 	const int numdof=NUMVERTICES*NDOF2;
+ 	IssmDouble penalty_offset;
+@@ -355,8 +327,7 @@
+ 	return Ke;
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::PenaltyCreateKMatrixStressbalanceFS {{{*/
+-ElementMatrix* Penpair::PenaltyCreateKMatrixStressbalanceFS(IssmDouble kmax){
++ElementMatrix* Penpair::PenaltyCreateKMatrixStressbalanceFS(IssmDouble kmax){/*{{{*/
+ 
+ 	const int  numdof=NUMVERTICES*NDOF3;
+ 	IssmDouble penalty_offset;
+@@ -387,8 +358,7 @@
+ 	return Ke;
+ }
+ /*}}}*/
+-/*FUNCTION Penpair::PenaltyCreateKMatrixMasstransport {{{*/
+-ElementMatrix* Penpair::PenaltyCreateKMatrixMasstransport(IssmDouble kmax){
++ElementMatrix* Penpair::PenaltyCreateKMatrixMasstransport(IssmDouble kmax){/*{{{*/
+ 
+ 	const int numdof=NUMVERTICES*NDOF1;
+ 	IssmDouble penalty_factor;
+Index: ../trunk-jpl/src/c/classes/Loads/Loads.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Loads.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Loads/Loads.cpp	(revision 18064)
+@@ -22,21 +22,18 @@
+ /*}}}*/
+ 
+ /*Object constructors and destructor*/
+-/*FUNCTION Loads::Loads(){{{*/
+-Loads::Loads(){
++Loads::Loads(){/*{{{*/
+ 	enum_type=LoadsEnum;
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Loads::~Loads(){{{*/
+-Loads::~Loads(){
++Loads::~Loads(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Numerics:*/
+-/*FUNCTION Loads::Configure{{{*/
+-void Loads::Configure(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters){
++void Loads::Configure(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters){/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Load* load=NULL;
+@@ -50,8 +47,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Loads::IsPenalty{{{*/
+-bool Loads::IsPenalty(int analysis_type){
++bool Loads::IsPenalty(int analysis_type){/*{{{*/
+ 
+ 	int ispenalty=0;
+ 	int allispenalty=0;
+@@ -75,8 +71,7 @@
+ 	 return false;
+ }
+ /*}}}*/
+-/*FUNCTION Loads::MaxNumNodes{{{*/
+-int Loads::MaxNumNodes(int analysis_type){
++int Loads::MaxNumNodes(int analysis_type){/*{{{*/
+ 
+ 	int max=0;
+ 	int allmax;
+@@ -99,8 +94,7 @@
+ 	return max;
+ }
+ /*}}}*/
+-/*FUNCTION Loads::NumberOfLoads(){{{*/
+-int Loads::NumberOfLoads(void){
++int Loads::NumberOfLoads(void){/*{{{*/
+ 
+ 	int localloads;
+ 	int numberofloads;
+@@ -115,8 +109,7 @@
+ 	return numberofloads;
+ }
+ /*}}}*/
+-/*FUNCTION Loads::NumberOfLoads(int analysis){{{*/
+-int Loads::NumberOfLoads(int analysis_type){
++int Loads::NumberOfLoads(int analysis_type){/*{{{*/
+ 
+ 	int localloads = 0;
+ 	int numberofloads;
+@@ -137,14 +130,12 @@
+ 	return numberofloads;
+ }
+ /*}}}*/
+-/*FUNCTION Loads::Size(){{{*/
+-int Loads::Size(void){
++int Loads::Size(void){/*{{{*/
+ 
+ 	return this->DataSet::Size();
+ }
+ /*}}}*/
+-/*FUNCTION Loads::Size(int analysis){{{*/
+-int Loads::Size(int analysis_type){
++int Loads::Size(int analysis_type){/*{{{*/
+ 
+ 	int localloads = 0;
+ 
+@@ -160,8 +151,7 @@
+ 	return localloads;
+ }
+ /*}}}*/
+-/*FUNCTION Loads::SetCurrentConfiguration{{{*/
+-void Loads::SetCurrentConfiguration(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters){
++void Loads::SetCurrentConfiguration(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters){/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Load* load=NULL;
+Index: ../trunk-jpl/src/c/classes/Loads/Pengrid.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Pengrid.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Loads/Pengrid.cpp	(revision 18064)
+@@ -19,8 +19,7 @@
+ #define NUMVERTICES   1
+ 
+ /*Pengrid constructors and destructor*/
+-/*FUNCTION Pengrid::Pengrid(){{{*/
+-Pengrid::Pengrid(){
++Pengrid::Pengrid(){/*{{{*/
+ 	this->parameters=NULL;
+ 	this->hnode=NULL;
+ 	this->node=NULL;
+@@ -35,8 +34,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::Pengrid(int index, int id, IoModel* iomodel,int analysis_type){{{*/
+-Pengrid::Pengrid(int id, int index, IoModel* iomodel, int in_analysis_type){ //i is the element index
++Pengrid::Pengrid(int id, int index, IoModel* iomodel, int in_analysis_type){ //i is the element index/*{{{*/
+ 
+ 	int pengrid_node_id;
+ 	int pengrid_matpar_id;
+@@ -73,8 +71,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::~Pengrid(){{{*/
+-Pengrid::~Pengrid(){
++Pengrid::~Pengrid(){/*{{{*/
+ 	delete hnode;
+ 	delete helement;
+ 	delete hmatpar;
+@@ -83,13 +80,11 @@
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION Pengrid::Echo {{{*/
+-void Pengrid::Echo(void){
++void Pengrid::Echo(void){/*{{{*/
+ 	this->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::DeepEcho{{{*/
+-void Pengrid::DeepEcho(void){
++void Pengrid::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_("Pengrid:\n");
+ 	_printf_("   id: " << id << "\n");
+@@ -103,17 +98,14 @@
+ 	parameters->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::Id {{{*/
+-int    Pengrid::Id(void){ return id; }
++int    Pengrid::Id(void){ return id; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION Pengrid::ObjectEnum{{{*/
+-int Pengrid::ObjectEnum(void){
++int Pengrid::ObjectEnum(void){/*{{{*/
+ 
+ 	return PengridEnum;
+ }
+ /*}}}*/
+-/*FUNCTION Icefront::copy {{{*/
+-Object* Pengrid::copy() {
++Object* Pengrid::copy() {/*{{{*/
+ 
+ 	Pengrid* pengrid=NULL;
+ 
+@@ -146,8 +138,7 @@
+ /*}}}*/
+ 
+ /*Load virtual functions definitions:*/
+-/*FUNCTION Pengrid::Configure {{{*/
+-void  Pengrid::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
++void  Pengrid::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/
+ 
+ 	/*Take care of hooking up all objects for this load, ie links the objects in the hooks to their respective 
+ 	 * datasets, using internal ids and offsets hidden in hooks: */
+@@ -164,21 +155,18 @@
+ 	this->parameters=parametersin;
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::SetCurrentConfiguration {{{*/
+-void  Pengrid::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
++void  Pengrid::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::CreateKMatrix {{{*/
+-void  Pengrid::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){
++void  Pengrid::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){/*{{{*/
+ 
+ 	/*No loads applied, do nothing: */
+ 	return;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::CreatePVector {{{*/
+-void  Pengrid::CreatePVector(Vector<IssmDouble>* pf){
++void  Pengrid::CreatePVector(Vector<IssmDouble>* pf){/*{{{*/
+ 
+ 	ElementVector* pe=NULL;
+ 	int analysis_type;
+@@ -200,8 +188,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::GetNodesSidList{{{*/
+-void Pengrid::GetNodesSidList(int* sidlist){
++void Pengrid::GetNodesSidList(int* sidlist){/*{{{*/
+ 
+ 	_assert_(sidlist);
+ 	_assert_(node);
+@@ -209,8 +196,7 @@
+ 	sidlist[0]=node->Sid();
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::GetNodesLidList{{{*/
+-void Pengrid::GetNodesLidList(int* lidlist){
++void Pengrid::GetNodesLidList(int* lidlist){/*{{{*/
+ 
+ 	_assert_(lidlist);
+ 	_assert_(node);
+@@ -218,14 +204,12 @@
+ 	lidlist[0]=node->Lid();
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::GetNumberOfNodes{{{*/
+-int Pengrid::GetNumberOfNodes(void){
++int Pengrid::GetNumberOfNodes(void){/*{{{*/
+ 
+ 	return NUMVERTICES;
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::PenaltyCreateMatrix {{{*/
+-void  Pengrid::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){
++void  Pengrid::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){/*{{{*/
+ 
+ 	/*Retrieve parameters: */
+ 	ElementMatrix* Ke=NULL;
+@@ -253,8 +237,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::PenaltyCreatePVector {{{*/
+-void  Pengrid::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){
++void  Pengrid::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){/*{{{*/
+ 
+ 	/*Retrieve parameters: */
+ 	ElementVector* pe=NULL;
+@@ -284,19 +267,16 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::InAnalysis{{{*/
+-bool Pengrid::InAnalysis(int in_analysis_type){
++bool Pengrid::InAnalysis(int in_analysis_type){/*{{{*/
+ 	if (in_analysis_type==this->analysis_type)return true;
+ 	else return false;
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::IsPenalty{{{*/
+-bool Pengrid::IsPenalty(void){
++bool Pengrid::IsPenalty(void){/*{{{*/
+ 	return true;
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::SetwiseNodeConnectivity{{{*/
+-void Pengrid::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){
++void Pengrid::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/
+ 
+ 	/*Output */
+ 	int d_nz = 0;
+@@ -348,33 +328,27 @@
+ /*}}}*/
+ 
+ /*Update virtual functions definitions:*/
+-/*FUNCTION Pengrid::InputUpdateFromVector(IssmDouble* vector, int name, int type) {{{*/
+-void  Pengrid::InputUpdateFromVector(IssmDouble* vector, int name, int type){
++void  Pengrid::InputUpdateFromVector(IssmDouble* vector, int name, int type){/*{{{*/
+ 	/*Nothing updated yet*/
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::InputUpdateFromMatrixDakota(IssmDouble* vector, int nrows, int ncols, int name, int type) {{{*/
+-void  Pengrid::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){
++void  Pengrid::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){/*{{{*/
+ 	/*Nothing updated yet*/
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type) {{{*/
+-void  Pengrid::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
++void  Pengrid::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*{{{*/
+ 	/*Nothing updated yet*/
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::InputUpdateFromConstant(IssmDouble constant, int name) {{{*/
+-void  Pengrid::InputUpdateFromConstant(IssmDouble constant, int name){
++void  Pengrid::InputUpdateFromConstant(IssmDouble constant, int name){/*{{{*/
+ 	/*Nothing*/
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::InputUpdateFromConstant(int constant, int name) {{{*/
+-void  Pengrid::InputUpdateFromConstant(int constant, int name){
++void  Pengrid::InputUpdateFromConstant(int constant, int name){/*{{{*/
+ 	/*Nothing updated yet*/
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::InputUpdateFromConstant(bool constant, int name) {{{*/
+-void  Pengrid::InputUpdateFromConstant(bool constant, int name){
++void  Pengrid::InputUpdateFromConstant(bool constant, int name){/*{{{*/
+ 
+ 	switch(name){
+ 
+@@ -387,8 +361,7 @@
+ /*}}}*/
+ 
+ /*Pengrid management:*/
+-/*FUNCTION Pengrid::ConstraintActivate {{{*/
+-void  Pengrid::ConstraintActivate(int* punstable){
++void  Pengrid::ConstraintActivate(int* punstable){/*{{{*/
+ 
+ 	int analysis_type;
+ 
+@@ -416,8 +389,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::ConstraintActivateThermal {{{*/
+-void  Pengrid::ConstraintActivateThermal(int* punstable){
++void  Pengrid::ConstraintActivateThermal(int* punstable){/*{{{*/
+ 
+ 	//   The penalty is stable if it doesn't change during to successive iterations.   
+ 	IssmDouble pressure;
+@@ -480,8 +452,7 @@
+ 	*punstable=unstable;
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::PenaltyCreateKMatrixMelting {{{*/
+-ElementMatrix* Pengrid::PenaltyCreateKMatrixMelting(IssmDouble kmax){
++ElementMatrix* Pengrid::PenaltyCreateKMatrixMelting(IssmDouble kmax){/*{{{*/
+ 
+ 	IssmDouble pressure,temperature,t_pmp;
+ 	IssmDouble penalty_factor;
+@@ -509,8 +480,7 @@
+ 	return Ke;
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::PenaltyCreateKMatrixThermal {{{*/
+-ElementMatrix* Pengrid::PenaltyCreateKMatrixThermal(IssmDouble kmax){
++ElementMatrix* Pengrid::PenaltyCreateKMatrixThermal(IssmDouble kmax){/*{{{*/
+ 
+ 	IssmDouble    penalty_factor;
+ 
+@@ -527,8 +497,7 @@
+ 	return Ke;
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::PenaltyCreatePVectorMelting {{{*/
+-ElementVector* Pengrid::PenaltyCreatePVectorMelting(IssmDouble kmax){
++ElementVector* Pengrid::PenaltyCreatePVectorMelting(IssmDouble kmax){/*{{{*/
+ 
+ 	IssmDouble pressure;
+ 	IssmDouble temperature;
+@@ -569,8 +538,7 @@
+ 	return pe;
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::PenaltyCreatePVectorThermal {{{*/
+-ElementVector* Pengrid::PenaltyCreatePVectorThermal(IssmDouble kmax){
++ElementVector* Pengrid::PenaltyCreatePVectorThermal(IssmDouble kmax){/*{{{*/
+ 
+ 	IssmDouble pressure;
+ 	IssmDouble t_pmp;
+@@ -595,8 +563,7 @@
+ 	return pe;
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::ConstraintActivateHydrologyDCInefficient{{{*/
+-void  Pengrid::ConstraintActivateHydrologyDCInefficient(int* punstable){
++void  Pengrid::ConstraintActivateHydrologyDCInefficient(int* punstable){/*{{{*/
+ 
+ 	//   The penalty is stable if it doesn't change during two consecutive iterations.   
+ 	int        unstable=0;
+@@ -656,8 +623,7 @@
+ 	*punstable=unstable;
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::PenaltyCreateKMatrixHydrologyDCInefficient {{{*/
+-ElementMatrix* Pengrid::PenaltyCreateKMatrixHydrologyDCInefficient(IssmDouble kmax){
++ElementMatrix* Pengrid::PenaltyCreateKMatrixHydrologyDCInefficient(IssmDouble kmax){/*{{{*/
+ 	IssmDouble    penalty_factor;
+ 
+ 	/*Retrieve parameters*/
+@@ -673,8 +639,7 @@
+ 	return Ke;
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::PenaltyCreatePVectorHydrologyDCInefficient {{{*/
+-ElementVector* Pengrid::PenaltyCreatePVectorHydrologyDCInefficient(IssmDouble kmax){
++ElementVector* Pengrid::PenaltyCreatePVectorHydrologyDCInefficient(IssmDouble kmax){/*{{{*/
+ 
+ 	IssmDouble h_max;
+ 	IssmDouble penalty_factor;
+@@ -698,8 +663,7 @@
+ 	return pe;
+ }
+ /*}}}*/
+-/*FUNCTION Pengrid::CreatePVectorHydrologyDCInefficient {{{*/
+-ElementVector* Pengrid::CreatePVectorHydrologyDCInefficient(void){
++ElementVector* Pengrid::CreatePVectorHydrologyDCInefficient(void){/*{{{*/
+ 
+ 	IssmDouble moulin_load,dt;
+ 
+@@ -715,8 +679,7 @@
+ 	return pe;
+  }
+ /*}}}*/
+-/*FUNCTION Pengrid::ResetConstraint {{{*/
+-void  Pengrid::ResetConstraint(void){
++void  Pengrid::ResetConstraint(void){/*{{{*/
+ 	active         = 0;
+ 	zigzag_counter = 0;
+ }
+Index: ../trunk-jpl/src/c/classes/Loads/Friction.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Loads/Friction.cpp	(revision 18064)
+@@ -15,36 +15,31 @@
+ /*}}}*/	
+ 
+ /*Constructors/destructors*/
+-/*FUNCTION Friction::Friction() {{{*/
+-Friction::Friction(){
++Friction::Friction(){/*{{{*/
+ 	this->element=NULL;
+ 	this->dim=0;
+ 	this->law=0;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Friction::Friction(Element* element,int dim){{{*/
+-Friction::Friction(Element* element_in,int dim_in){
++Friction::Friction(Element* element_in,int dim_in){/*{{{*/
+ 
+ 	this->element=element_in;
+ 	this->dim=dim_in;
+ 	element_in->FindParam(&this->law,FrictionLawEnum);
+ }
+ /*}}}*/
+-/*FUNCTION Friction::~Friction() {{{*/
+-Friction::~Friction(){
++Friction::~Friction(){/*{{{*/
+ }
+ /*}}}*/
+ 
+ /*methods: */
+-/*FUNCTION Friction::Echo {{{*/
+-void Friction::Echo(void){
++void Friction::Echo(void){/*{{{*/
+ 	_printf_("Friction:\n");
+ 	_printf_("   dim: " << this->dim<< "\n");
+ }
+ /*}}}*/
+-/*FUNCTION Friction::GetAlpha2{{{*/
+-void Friction::GetAlpha2(IssmDouble* palpha2, Gauss* gauss){
++void Friction::GetAlpha2(IssmDouble* palpha2, Gauss* gauss){/*{{{*/
+ 
+ 	switch(this->law){
+ 		case 1:
+@@ -58,8 +53,7 @@
+ 	}
+ 
+ }/*}}}*/
+-/*FUNCTION Friction::GetAlpha2{{{*/
+-void Friction::GetAlpha2Viscous(IssmDouble* palpha2, Gauss* gauss){
++void Friction::GetAlpha2Viscous(IssmDouble* palpha2, Gauss* gauss){/*{{{*/
+ 
+ 	/*This routine calculates the basal friction coefficient 
+ 	  alpha2= drag^2 * Neff ^r * | vel | ^(s-1), with Neff=rho_ice*g*thickness+rho_ice*g*bed, r=q/p and s=1/p**/
+@@ -119,8 +113,7 @@
+ 	/*Assign output pointers:*/
+ 	*palpha2=alpha2;
+ }/*}}}*/
+-/*FUNCTION Friction::GetAlpha2Weertman{{{*/
+-void Friction::GetAlpha2Weertman(IssmDouble* palpha2, Gauss* gauss){
++void Friction::GetAlpha2Weertman(IssmDouble* palpha2, Gauss* gauss){/*{{{*/
+ 
+ 	/*This routine calculates the basal friction coefficient alpha2= C^-1/m |v|^(1/m-1) */
+ 
+@@ -161,8 +154,7 @@
+ 	/*Assign output pointers:*/
+ 	*palpha2=alpha2;
+ }/*}}}*/
+-/*FUNCTION Friction::GetAlphaComplement(IssmDouble* palpha_complement, Gauss* gauss,int vxenum,int vyenum,int vzenum) {{{*/
+-void Friction::GetAlphaComplement(IssmDouble* palpha_complement, Gauss* gauss){
++void Friction::GetAlphaComplement(IssmDouble* palpha_complement, Gauss* gauss){/*{{{*/
+ 
+ 	/* FrictionGetAlpha2 computes alpha2= drag^2 * Neff ^r * vel ^s, with Neff=rho_ice*g*thickness+rho_ice*g*bed, r=q/p and s=1/p. 
+ 	 * FrictionGetAlphaComplement is used in control methods on drag, and it computes: 
+Index: ../trunk-jpl/src/c/classes/Loads/Riftfront.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Riftfront.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Loads/Riftfront.cpp	(revision 18064)
+@@ -19,8 +19,7 @@
+ #define NUMVERTICES 2
+ 
+ /*Riftfront constructors and destructor*/
+-/*FUNCTION Riftfront::Riftfront(){{{*/
+-Riftfront::Riftfront(){
++Riftfront::Riftfront(){/*{{{*/
+ 	this->parameters=NULL;
+ 	this->hnodes=NULL;
+ 	this->helements=NULL;
+@@ -30,8 +29,7 @@
+ 	this->matpar=NULL;
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::Riftfront(int id, int i, IoModel* iomodel,int analysis_type){{{*/
+-Riftfront::Riftfront(int riftfront_id,int i, IoModel* iomodel,int riftfront_analysis_type){
++Riftfront::Riftfront(int riftfront_id,int i, IoModel* iomodel,int riftfront_analysis_type){/*{{{*/
+ 
+ 	/*data: */
+ 	const int RIFTINFOSIZE = 12;
+@@ -100,8 +98,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::~Riftfront(){{{*/
+-Riftfront::~Riftfront(){
++Riftfront::~Riftfront(){/*{{{*/
+ 	this->parameters=NULL;
+ 	delete hnodes;
+ 	delete helements;
+@@ -110,8 +107,7 @@
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION Riftfront::Echo {{{*/
+-void Riftfront::Echo(void){
++void Riftfront::Echo(void){/*{{{*/
+ 
+ 	_printf_("Riftfront:\n");
+ 	_printf_("   id: " << id << "\n");
+@@ -137,8 +133,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::DeepEcho{{{*/
+-void Riftfront::DeepEcho(void){
++void Riftfront::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_("Riftfront:\n");
+ 	_printf_("   id: " << id << "\n");
+@@ -150,18 +145,15 @@
+ 	if(parameters)parameters->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::Id {{{*/
+-int    Riftfront::Id(void){ return id; }
++int    Riftfront::Id(void){ return id; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION Riftfront::ObjectEnum{{{*/
+-int Riftfront::ObjectEnum(void){
++int Riftfront::ObjectEnum(void){/*{{{*/
+ 
+ 	return RiftfrontEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::copy {{{*/
+-Object* Riftfront::copy() {
++Object* Riftfront::copy() {/*{{{*/
+ 
+ 	Riftfront* riftfront=NULL;
+ 
+@@ -208,17 +200,14 @@
+ /*}}}*/
+ 
+ /*Update virtual functions definitions:*/
+-/*FUNCTION Riftfront::InputUpdateFromConstant(bool constant,int name) {{{*/
+-void  Riftfront::InputUpdateFromConstant(bool constant,int name){
++void  Riftfront::InputUpdateFromConstant(bool constant,int name){/*{{{*/
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::InputUpdateFromConstant(IssmDouble constant,int name) {{{*/
+-void  Riftfront::InputUpdateFromConstant(IssmDouble constant,int name){
++void  Riftfront::InputUpdateFromConstant(IssmDouble constant,int name){/*{{{*/
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::InputUpdateFromVector(IssmDouble* constant,int name) {{{*/
+-void    Riftfront::InputUpdateFromVector(IssmDouble* vector, int name, int type){
++void    Riftfront::InputUpdateFromVector(IssmDouble* vector, int name, int type){/*{{{*/
+ 
+ 	_error_("not implemented yet");
+ 
+@@ -226,8 +215,7 @@
+ /*}}}*/
+ 
+ /*Load virtual functions definitions:*/
+-/*FUNCTION Riftfront::Configure {{{*/
+-void  Riftfront::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
++void  Riftfront::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/
+ 
+ 	/*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 
+ 	 * datasets, using internal ids and offsets hidden in hooks: */
+@@ -245,18 +233,15 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::IsPenalty{{{*/
+-bool Riftfront::IsPenalty(void){
++bool Riftfront::IsPenalty(void){/*{{{*/
+ 	return true;
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::SetCurrentConfiguration {{{*/
+-void  Riftfront::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
++void  Riftfront::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::PenaltyCreateKMatrix {{{*/
+-void  Riftfront::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){
++void  Riftfront::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){/*{{{*/
+ 
+ 	/*Retrieve parameters: */
+ 	ElementMatrix* Ke=NULL;
+@@ -281,8 +266,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::PenaltyCreatePVector {{{*/
+-void  Riftfront::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){
++void  Riftfront::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){/*{{{*/
+ 
+ 	/*Retrieve parameters: */
+ 	ElementVector* pe=NULL;
+@@ -307,20 +291,17 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::CreateKMatrix {{{*/
+-void  Riftfront::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){
++void  Riftfront::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){/*{{{*/
+ 	/*do nothing: */
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::CreatePVector {{{*/
+-void  Riftfront::CreatePVector(Vector<IssmDouble>* pf){
++void  Riftfront::CreatePVector(Vector<IssmDouble>* pf){/*{{{*/
+ 	/*do nothing: */
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::GetNodesSidList{{{*/
+-void Riftfront::GetNodesSidList(int* sidlist){
++void Riftfront::GetNodesSidList(int* sidlist){/*{{{*/
+ 
+ 	_assert_(sidlist);
+ 	_assert_(nodes);
+@@ -328,8 +309,7 @@
+ 	for(int i=0;i<NUMVERTICES;i++) sidlist[i]=nodes[i]->Sid();
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::GetNodesLidList{{{*/
+-void Riftfront::GetNodesLidList(int* lidlist){
++void Riftfront::GetNodesLidList(int* lidlist){/*{{{*/
+ 
+ 	_assert_(lidlist);
+ 	_assert_(nodes);
+@@ -337,20 +317,17 @@
+ 	for(int i=0;i<NUMVERTICES;i++) lidlist[i]=nodes[i]->Lid();
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::GetNumberOfNodes{{{*/
+-int Riftfront::GetNumberOfNodes(void){
++int Riftfront::GetNumberOfNodes(void){/*{{{*/
+ 
+ 	return NUMVERTICES;
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::InAnalysis{{{*/
+-bool Riftfront::InAnalysis(int in_analysis_type){
++bool Riftfront::InAnalysis(int in_analysis_type){/*{{{*/
+ 	if (in_analysis_type==this->analysis_type) return true;
+ 	else return false;
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::SetwiseNodeConnectivity{{{*/
+-void Riftfront::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){
++void Riftfront::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/
+ 
+ 	/*Output */
+ 	int d_nz = 0;
+@@ -406,8 +383,7 @@
+ /*}}}*/
+ 
+ /*Riftfront numerics*/
+-/*FUNCTION Riftfront::PenaltyCreateKMatrixStressbalanceHoriz {{{*/
+-ElementMatrix* Riftfront::PenaltyCreateKMatrixStressbalanceHoriz(IssmDouble kmax){
++ElementMatrix* Riftfront::PenaltyCreateKMatrixStressbalanceHoriz(IssmDouble kmax){/*{{{*/
+ 
+ 	const int   numdof = NDOF2*NUMVERTICES;
+ 	IssmDouble  thickness;
+@@ -484,8 +460,7 @@
+ 	return Ke;
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::PenaltyCreatePVectorStressbalanceHoriz {{{*/
+-ElementVector* Riftfront::PenaltyCreatePVectorStressbalanceHoriz(IssmDouble kmax){
++ElementVector* Riftfront::PenaltyCreatePVectorStressbalanceHoriz(IssmDouble kmax){/*{{{*/
+ 
+ 	int        j;
+ 	IssmDouble rho_ice;
+@@ -579,11 +554,9 @@
+ 	return pe;
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::Constrain {{{*/
+ #define _ZIGZAGCOUNTER_
++int Riftfront::Constrain(int* punstable){/*{{{*/
+ 
+-int Riftfront::Constrain(int* punstable){
+-
+ 	IssmDouble  penetration;
+ 	bool        activate;
+ 	int         unstable;
+@@ -663,16 +636,14 @@
+ 	return 1;
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::FreezeConstraints{{{*/
+-void   Riftfront::FreezeConstraints(void){
++void   Riftfront::FreezeConstraints(void){/*{{{*/
+ 
+ 	/*Just set frozen flag to 1: */
+ 	this->frozen=1;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Riftfront::IsFrozen{{{*/
+-bool   Riftfront::IsFrozen(void){
++bool   Riftfront::IsFrozen(void){/*{{{*/
+ 
+ 	/*Just set frozen flag to 1: */
+ 	if(this->frozen)return 1;
+Index: ../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp	(revision 18064)
+@@ -17,8 +17,7 @@
+ /*}}}*/
+ 
+ /*ElementMatrix constructors and destructor*/
+-/*FUNCTION ElementMatrix::ElementMatrix(){{{*/
+-ElementMatrix::ElementMatrix(){
++ElementMatrix::ElementMatrix(){/*{{{*/
+ 
+ 	this->nrows=0;
+ 	this->ncols=0;
+@@ -41,16 +40,14 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION ElementMatrix::ElementMatrix(ElementMatrix* Ke){{{*/
+-ElementMatrix::ElementMatrix(ElementMatrix* Ke){
++ElementMatrix::ElementMatrix(ElementMatrix* Ke){/*{{{*/
+ 
+ 	if(!Ke) _error_("Input Element Matrix is a NULL pointer");
+ 	this->Init(Ke);
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION ElementMatrix::ElementMatrix(ElementMatrix* Ke1, ElementMatrix* Ke2){{{*/
+-ElementMatrix::ElementMatrix(ElementMatrix* Ke1, ElementMatrix* Ke2){
++ElementMatrix::ElementMatrix(ElementMatrix* Ke1, ElementMatrix* Ke2){/*{{{*/
+ 
+ 	/*intermediaries*/
+ 	int i,j,counter;
+@@ -178,8 +175,7 @@
+ 	xDelete<int>(P);
+ }
+ /*}}}*/
+-/*FUNCTION ElementMatrix::ElementMatrix(ElementMatrix* Ke1, ElementMatrix* Ke2,ElementMatrix* Ke3){{{*/
+-ElementMatrix::ElementMatrix(ElementMatrix* Ke1, ElementMatrix* Ke2,ElementMatrix* Ke3){
++ElementMatrix::ElementMatrix(ElementMatrix* Ke1, ElementMatrix* Ke2,ElementMatrix* Ke3){/*{{{*/
+ 
+ 	/*Concatenate all matrices*/
+ 	ElementMatrix* Ke12 =new ElementMatrix(Ke1,Ke2);
+@@ -193,8 +189,7 @@
+ 	delete Ke123;
+ }
+ /*}}}*/
+-/*FUNCTION ElementMatrix::ElementMatrix(Node** nodes,int numnodes,Parameters* parameters,int approximation){{{*/
+-ElementMatrix::ElementMatrix(Node** nodes,int numnodes,Parameters* parameters,int approximation){
++ElementMatrix::ElementMatrix(Node** nodes,int numnodes,Parameters* parameters,int approximation){/*{{{*/
+ 
+ 	/*get Matrix size and properties*/
+ 	this->dofsymmetrical=true;
+@@ -224,8 +219,7 @@
+ 	this->col_sglobaldoflist=NULL;
+ }
+ /*}}}*/
+-/*FUNCTION ElementMatrix::~ElementMatrix(){{{*/
+-ElementMatrix::~ElementMatrix(){
++ElementMatrix::~ElementMatrix(){/*{{{*/
+ 
+ 	xDelete<IssmDouble>(this->values);
+ 	xDelete<int>(this->gglobaldoflist);
+@@ -241,8 +235,7 @@
+ /*}}}*/
+ 
+ /*ElementMatrix specific routines: */
+-/*FUNCTION ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){{{*/
+-void ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){
++void ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){/*{{{*/
+ 
+ 	int i,j;
+ 	IssmDouble* localvalues=NULL;
+@@ -299,8 +292,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Jff){{{*/
+-void ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Jff){
++void ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Jff){/*{{{*/
+ 
+ 	int i,j;
+ 	IssmDouble* localvalues=NULL;
+@@ -336,8 +328,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION ElementMatrix::CheckConsistency{{{*/
+-void ElementMatrix::CheckConsistency(void){
++void ElementMatrix::CheckConsistency(void){/*{{{*/
+ 	/*Check element matrix values, only in debugging mode*/
+ 	#ifdef _ISSM_DEBUG_ 
+ 	for (int i=0;i<this->nrows;i++){
+@@ -349,8 +340,7 @@
+ 	#endif
+ }
+ /*}}}*/
+-/*FUNCTION ElementMatrix::Transpose{{{*/
+-void ElementMatrix::Transpose(void){
++void ElementMatrix::Transpose(void){/*{{{*/
+ 
+ 	/*Intermediaries*/
+ 	ElementMatrix* Ke_copy=new ElementMatrix(this);
+@@ -372,8 +362,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION ElementMatrix::StaticCondensation{{{*/
+-void ElementMatrix::StaticCondensation(int bsize,int* bindices){
++void ElementMatrix::StaticCondensation(int bsize,int* bindices){/*{{{*/
+ 	/* 
+ 	 * | Kii  Kib | | Ui |    |Fi|
+ 	 * | Kbi  Kbb | | Ub |  = |Fb|
+@@ -476,8 +465,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION ElementMatrix::Echo{{{*/
+-void ElementMatrix::Echo(void){
++void ElementMatrix::Echo(void){/*{{{*/
+ 
+ 	int i,j;
+ 	_printf_("Element Matrix echo:\n");
+@@ -522,8 +510,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION ElementMatrix::Init{{{*/
+-void ElementMatrix::Init(ElementMatrix* Ke){
++void ElementMatrix::Init(ElementMatrix* Ke){/*{{{*/
+ 
+ 	_assert_(Ke);
+ 	_assert_(this);
+Index: ../trunk-jpl/src/c/classes/ExternalResults/Results.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/ExternalResults/Results.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/ExternalResults/Results.cpp	(revision 18064)
+@@ -19,21 +19,18 @@
+ /*}}}*/
+ 
+ /*Object constructors and destructor*/
+-/*FUNCTION Results::Results(){{{*/
+-Results::Results(){
++Results::Results(){/*{{{*/
+ 	enum_type=ResultsEnum;
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Results::~Results(){{{*/
+-Results::~Results(){
++Results::~Results(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object management*/
+-/*FUNCTION Results::Write{{{*/
+-void Results::Write(Parameters* parameters){
++void Results::Write(Parameters* parameters){/*{{{*/
+ 
+ 	FILE       *fid  = NULL;
+ 	bool        io_gather;
+@@ -49,8 +46,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Results::AddResult(ExternalResult* in_result){{{*/
+-int Results::AddResult(ExternalResult* in_result){
++int Results::AddResult(ExternalResult* in_result){/*{{{*/
+ 
+ 	/*First, go through dataset of inputs and check whether any input 
+ 	 * with the same name is already in. If so, erase the corresponding 
+@@ -81,8 +77,7 @@
+ 	return 1;
+ }
+ /*}}}*/
+-/*FUNCTION Results::DeleteResult(ExternalResult* in_result){{{*/
+-int Results::DeleteResult(int result_enum,int result_step){
++int Results::DeleteResult(int result_enum,int result_step){/*{{{*/
+ 
+ 	for(int i=0;i<this->Size();i++){
+ 		ExternalResult* result=dynamic_cast<ExternalResult*>(this->GetObjectByOffset(i));
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18064)
+@@ -42,8 +42,7 @@
+ /*}}}*/
+ 
+ /*Object constructors and destructor*/
+-/*FUNCTION FemModel::FemModel(int argc,char** argv,ISSM_MPI_Comm incomm){{{*/
+-FemModel::FemModel(int argc,char** argv,ISSM_MPI_Comm incomm){
++FemModel::FemModel(int argc,char** argv,ISSM_MPI_Comm incomm){/*{{{*/
+ 
+ 	/*configuration: */
+ 	int* analyses=NULL;
+@@ -93,16 +92,14 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION FemModel::FemModel(char* rootpath, char* inputfilename, char* outputfilename, char* toolkitsfilename, char* lockfilename, const int in_solution_type,const int* analyses,const int nummodels){{{*/
+-FemModel::FemModel(char* rootpath, char* inputfilename, char* outputfilename, char* toolkitsfilename, char* lockfilename, const int in_solution_type,const int* analyses,const int nummodels){
++FemModel::FemModel(char* rootpath, char* inputfilename, char* outputfilename, char* toolkitsfilename, char* lockfilename, const int in_solution_type,const int* analyses,const int nummodels){/*{{{*/
+ 
+ 	/*Call InitFromFiles. This constructor is just a wrapper: */
+ 	this->InitFromFiles(rootpath, inputfilename, outputfilename, toolkitsfilename, lockfilename, in_solution_type,analyses,nummodels);
+ 
+ }
+ /*}}}*/
+-/*FUNCTION FemModel::~FemModel{{{*/
+-FemModel::~FemModel(){
++FemModel::~FemModel(){/*{{{*/
+ 
+ 	/*Intermediary*/
+ 	FILE *output_fid;
+@@ -162,8 +159,7 @@
+ /*}}}*/
+ 
+ /*Object management*/
+-/*FUNCTION FemModel::Echo {{{*/
+-void FemModel::Echo(void){
++void FemModel::Echo(void){/*{{{*/
+ 
+ 	_printf_("FemModel echo: \n");
+ 	_printf_("   number of fem models: " << nummodels << "\n");
+@@ -174,8 +170,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION FemModel::InitFromFiles(char* rootpath, char* inputfilename, char* outputfilename, char* toolkitsfilename, char* lockfilename, const int in_solution_type,const int* analyses,const int nummodels){{{*/
+-void FemModel::InitFromFiles(char* rootpath, char* inputfilename, char* outputfilename, char* toolkitsfilename, char* lockfilename, const int in_solution_type,const int* analyses,const int nummodels){
++void FemModel::InitFromFiles(char* rootpath, char* inputfilename, char* outputfilename, char* toolkitsfilename, char* lockfilename, const int in_solution_type,const int* analyses,const int nummodels){/*{{{*/
+ 
+ 	/*intermediary*/
+ 	int         i;
+@@ -245,8 +240,7 @@
+ 
+ 	}
+ /*}}}*/
+-/*FUNCTION FemModel::SetStaticComm {{{*/
+-void FemModel::SetStaticComm(void){
++void FemModel::SetStaticComm(void){/*{{{*/
+ 
+ 	/*This routine sets the global communicator variable hidden inside the IssmComm 
+ 	 *class: */
+@@ -254,8 +248,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION FemModel::SetCurrentConfiguration(int configuration_type,int analysis_type){{{*/
+-void FemModel::SetCurrentConfiguration(int configuration_type,int analysis_type){
++void FemModel::SetCurrentConfiguration(int configuration_type,int analysis_type){/*{{{*/
+ 
+ 	/*Use configuration_type to setup the analysis counter, the configurations of objects etc ... but use 
+ 	 * analysis_type to drive the element numerics. This allows for use of 1 configuration_type for several 
+@@ -289,13 +282,11 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION FemModel::SetCurrentConfiguration(int configuration_type){{{*/
+-void FemModel::SetCurrentConfiguration(int configuration_type){
++void FemModel::SetCurrentConfiguration(int configuration_type){/*{{{*/
+ 	this->SetCurrentConfiguration(configuration_type,configuration_type);
+ }
+ /*}}}*/
+-/*FUNCTION FemModel::Solve {{{*/
+-void FemModel::Solve(void){
++void FemModel::Solve(void){/*{{{*/
+ 
+ 	/*profiling: */
+ 	bool profiling = false;
+Index: ../trunk-jpl/src/c/classes/DependentObject.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/DependentObject.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/DependentObject.cpp	(revision 18064)
+@@ -13,15 +13,13 @@
+ #include "../modules/modules.h"
+ 
+ /*DependentObject constructors and destructor*/
+-/*FUNCTION DependentObject::DependentObject(){{{*/
+-DependentObject::DependentObject(){
++DependentObject::DependentObject(){/*{{{*/
+ 	this->name=NULL;
+ 	this->type=0;
+ 	this->index=-1;
+ }
+ /*}}}*/
+-/*FUNCTION DependentObject::DependentObject(int in_name, int in_type, int in_index){{{*/
+-DependentObject::DependentObject(char* in_name, int in_type,int in_index){
++DependentObject::DependentObject(char* in_name, int in_type,int in_index){/*{{{*/
+ 
+ 	this->name=xNew<char>(strlen(in_name)+1); xMemCpy<char>(this->name,in_name,strlen(in_name)+1);
+ 	this->type=in_type;
+@@ -31,15 +29,13 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DependentObject::~DependentObject() {{{*/
+-DependentObject::~DependentObject(){ //destructor
++DependentObject::~DependentObject(){ //destructor/*{{{*/
+ 	xDelete<char>(this->name);
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION DependentObject::Echo{{{*/
+-void DependentObject::Echo(void){
++void DependentObject::Echo(void){/*{{{*/
+ 
+ 	_printf_("DependentObject:\n");
+ 	_printf_("   name: " << this->name << "\n");
+@@ -52,29 +48,24 @@
+ 	if(this->index>=0) _printf_("   index: " << this->index << "\n");
+ }
+ /*}}}*/
+-/*FUNCTION DependentObject::DeepEcho{{{*/
+-void DependentObject::DeepEcho(void){
++void DependentObject::DeepEcho(void){/*{{{*/
+ 	this->Echo();
+ }
+ /*}}}*/
+-/*FUNCTION DependentObject::Id{{{*/
+-int    DependentObject::Id(void){ return -1; }
++int    DependentObject::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION DependentObject::ObjectEnum{{{*/
+-int DependentObject::ObjectEnum(void){
++int DependentObject::ObjectEnum(void){/*{{{*/
+ 
+ 	return DependentObjectEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DependentObject::copy{{{*/
+-Object* DependentObject::copy(void) { 
++Object* DependentObject::copy(void) { /*{{{*/
+ 	return new DependentObject(name,type,index);
+ } /*}}}*/
+ 
+ /*DependentObject methods: */
+-/*FUNCTION DependentObject::NumDependents{{{*/
+-int  DependentObject::NumDependents(void){
++int  DependentObject::NumDependents(void){/*{{{*/
+ 
+ 	/*Branch according to the type of variable: */
+ 	if(type==0){ /*scalar:*/
+@@ -86,8 +77,7 @@
+ 	else _error_("should not have a type of " << type);
+ }
+ /*}}}*/
+-/*FUNCTION DependentObject::Responsex{{{*/
+-void  DependentObject::Responsex(IssmDouble* poutput_value,FemModel* femmodel){
++void  DependentObject::Responsex(IssmDouble* poutput_value,FemModel* femmodel){/*{{{*/
+ 
+ 	/*Is this some special type of response for which we need to go in the output definitions? :*/
+ 	if (StringToEnumx(this->name,false)==-1){
+Index: ../trunk-jpl/src/c/classes/Hook.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Hook.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Hook.cpp	(revision 18064)
+@@ -15,16 +15,14 @@
+ #include "../shared/shared.h"
+ 
+ /*Constructor/Destructors*/
+-/*FUNCTION Hook::Hook(){{{*/
+-Hook::Hook(){
++Hook::Hook(){/*{{{*/
+ 	this->num     = 0;
+ 	this->objects = NULL;
+ 	this->ids     = NULL;
+ 	this->offsets = NULL;
+ }
+ /*}}}*/
+-/*FUNCTION Hook::Hook(int* ids, int num){{{*/
+-Hook::Hook(int* in_ids, int in_num){
++Hook::Hook(int* in_ids, int in_num){/*{{{*/
+ 
+ 	/*Get number of objects to hook*/
+ 	this->num=in_num;
+@@ -51,8 +49,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Hook::~Hook(){{{*/
+-Hook::~Hook(){
++Hook::~Hook(){/*{{{*/
+ 	xDelete<Object*>(this->objects);
+ 	xDelete<int>(this->ids);
+ 	xDelete<int>(this->offsets);
+@@ -60,8 +57,7 @@
+ /*}}}*/
+ 
+ /*Some of the Object functionality: */
+-/*FUNCTION Hook::Echo{{{*/
+-void Hook::Echo(void){
++void Hook::Echo(void){/*{{{*/
+ 	_assert_(this);
+ 	int i;
+ 	if (num){
+@@ -79,8 +75,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Hook::DeepEcho{{{*/
+-void Hook::DeepEcho(void){
++void Hook::DeepEcho(void){/*{{{*/
+ 
+ 	int i;
+ 	if (num){
+@@ -107,8 +102,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Hook::copy {{{*/
+-Object* Hook::copy(void){
++Object* Hook::copy(void){/*{{{*/
+ 
+ 	/*output: */
+ 	Hook* output=NULL;
+@@ -135,8 +129,7 @@
+ /*}}}*/
+ 
+ /*Hook management: */
+-/*FUNCTION Hook::configure{{{*/
+-void Hook::configure(DataSet* dataset){
++void Hook::configure(DataSet* dataset){/*{{{*/
+ 
+ 	/*intermediary: */
+ 	Object* object=NULL;
+@@ -177,8 +170,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Hook::delivers{{{*/
+-Object* Hook::delivers(void){
++Object* Hook::delivers(void){/*{{{*/
+ 
+ 	/*first, check that we only have one T object in our object list: */
+ 	if (this->num!=1) _error_("trying to delivery a single hook object when hook holds " << this->num << " objects" << "\n");
+@@ -190,23 +182,19 @@
+ }
+ 
+ /*}}}*/
+-/*FUNCTION Hook::deliverp{{{*/
+-Object** Hook::deliverp(void){
++Object** Hook::deliverp(void){/*{{{*/
+ 	return objects;
+ }
+ /*}}}*/
+-/*FUNCTION Hook::Ids{{{*/
+-int* Hook::Ids(void){
++int* Hook::Ids(void){/*{{{*/
+ 	return this->ids;
+ }
+ /*}}}*/
+-/*FUNCTION Hook::GetNum{{{*/
+-int Hook::GetNum(void){
++int Hook::GetNum(void){/*{{{*/
+ 	return this->num;
+ }
+ /*}}}*/
+-/*FUNCTION Hook::Spawn{{{*/
+-Hook* Hook::Spawn(int* indices, int numindices){
++Hook* Hook::Spawn(int* indices, int numindices){/*{{{*/
+ 
+ 	/*output: */
+ 	Hook* output=NULL;
+Index: ../trunk-jpl/src/c/classes/Misfit.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Misfit.h	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Misfit.h	(revision 18064)
+@@ -30,8 +30,7 @@
+ 		int         lock; // if lock is on, we just return the value stored in "misfit".  this is used so we don't compute misfit past the final_time
+ 		
+ 		/*Misfit constructors, destructors :*/
+-		/*FUNCTION Misfit() {{{*/
+-		Misfit(){
++		Misfit(){/*{{{*/
+ 
+ 			this->name = NULL;
+ 			this->model_enum = UNDEF;
+@@ -43,8 +42,7 @@
+ 
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Misfit(char* in_name, int in_model_enum, int in_observation_enum char* in_timeinterpolation, int in_weights_enum) {{{*/
+-		Misfit(char* in_name, int in_model_enum, int in_observation_enum, char* in_timeinterpolation, int in_weights_enum){
++		Misfit(char* in_name, int in_model_enum, int in_observation_enum, char* in_timeinterpolation, int in_weights_enum){/*{{{*/
+ 
+ 			this->name   = xNew<char>(strlen(in_name)+1);
+ 			xMemCpy<char>(this->name,in_name,strlen(in_name)+1);
+@@ -60,8 +58,7 @@
+ 			this->lock=0;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION ~Misfit() {{{*/
+-		~Misfit(){
++		~Misfit(){/*{{{*/
+ 			if(this->name)xDelete(this->name);
+ 			if(this->timeinterpolation)xDelete(this->timeinterpolation);
+ 			this->misfit=0;
+@@ -69,8 +66,7 @@
+ 		}
+ 		/*}}}*/
+ 		/*Object virtual function resolutoin: */
+-		/*FUNCTION Echo(){{{*/
+-		void Echo(void){
++		void Echo(void){/*{{{*/
+ 			_printf_(" Misfit: " << name << "\n");
+ 			_printf_("    model_enum: " << model_enum << " " << EnumToStringx(model_enum) << "\n");
+ 			_printf_("    observation_enum: " << observation_enum << " " << EnumToStringx(observation_enum) << "\n");
+@@ -78,29 +74,24 @@
+ 			_printf_("    timeinterpolation: " << timeinterpolation << "\n");
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION DeepEcho(){{{*/
+-		void DeepEcho(void){
++		void DeepEcho(void){/*{{{*/
+ 			this->Echo();
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Id(){{{*/
+-		int Id(void){
++		int Id(void){/*{{{*/
+ 			return -1;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION ObjectEnum{{{*/
+-		int ObjectEnum(void){
++		int ObjectEnum(void){/*{{{*/
+ 			return MisfitEnum;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION copy {{{*/
+-		Object* copy() {
++		Object* copy() {/*{{{*/
+ 			return new Misfit(this->name,this->model_enum,this->observation_enum,this->timeinterpolation,this->weights_enum);
+ 		}
+ 		/*}}}*/
+ 		/*Definition virtual function resolutoin: */
+-		/*FUNCTION char* Name() {{{*/
+-		char* Name(){
++		char* Name(){/*{{{*/
+ 
+ 			char* name2=xNew<char>(strlen(this->name)+1);
+ 			xMemCpy(name2,this->name,strlen(this->name)+1);
+@@ -108,8 +99,7 @@
+ 			return name2;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION IssmDouble Response(FemModel* femmodel) {{{*/
+-		 IssmDouble Response(FemModel* femmodel){
++		 IssmDouble Response(FemModel* femmodel){/*{{{*/
+ 
+ 			 int i;
+ 			 IssmDouble misfit_t=0.;
+Index: ../trunk-jpl/src/c/classes/gauss/GaussSeg.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/gauss/GaussSeg.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/gauss/GaussSeg.cpp	(revision 18064)
+@@ -11,8 +11,7 @@
+ #include "../../shared/Numerics/constants.h"
+ 
+ /*GaussSeg constructors and destructors:*/
+-/*FUNCTION GaussSeg::GaussSeg() {{{*/
+-GaussSeg::GaussSeg(){
++GaussSeg::GaussSeg(){/*{{{*/
+ 
+ 	numgauss=-1;
+ 
+@@ -23,8 +22,7 @@
+ 	coord1=UNDEF;
+ }
+ /*}}}*/
+-/*FUNCTION GaussSeg::GaussSeg(int order) {{{*/
+-GaussSeg::GaussSeg(int order){
++GaussSeg::GaussSeg(int order){/*{{{*/
+ 
+ 	IssmPDouble* pcoords1=NULL;
+ 	IssmPDouble* pweights=NULL;
+@@ -51,8 +49,7 @@
+ 	coord1=UNDEF;
+ }
+ /*}}}*/
+-/*FUNCTION GaussSeg::GaussSeg(IssmDouble position) {{{*/
+-GaussSeg::GaussSeg(IssmDouble position){
++GaussSeg::GaussSeg(IssmDouble position){/*{{{*/
+ 
+ 	/*Get gauss points*/
+ 	this->numgauss = 1;
+@@ -69,16 +66,14 @@
+ 	coord1=UNDEF;
+ }
+ /*}}}*/
+-/*FUNCTION GaussSeg::~GaussSeg(){{{*/
+-GaussSeg::~GaussSeg(){
++GaussSeg::~GaussSeg(){/*{{{*/
+ 	xDelete<IssmDouble>(weights);
+ 	xDelete<IssmDouble>(coords1);
+ }
+ /*}}}*/
+ 
+ /*Methods*/
+-/*FUNCTION GaussSeg::Echo{{{*/
+-void GaussSeg::Echo(void){
++void GaussSeg::Echo(void){/*{{{*/
+ 
+ 	_printf_("GaussSeg:\n");
+ 	_printf_("   numgauss: " << numgauss << "\n");
+@@ -99,13 +94,11 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussSeg::Enum{{{*/
+-int GaussSeg::Enum(void){
++int GaussSeg::Enum(void){/*{{{*/
+ 	return GaussSegEnum;
+ }
+ /*}}}*/
+-/*FUNCTION GaussSeg::GaussPoint{{{*/
+-void GaussSeg::GaussPoint(int ig){
++void GaussSeg::GaussPoint(int ig){/*{{{*/
+ 
+ 	/*Check input in debugging mode*/
+ 	 _assert_(ig>=0 && ig< numgauss);
+@@ -115,8 +108,7 @@
+ 	 coord1=coords1[ig];
+ }
+ /*}}}*/
+-/*FUNCTION GaussSeg::GaussVertex{{{*/
+-void GaussSeg::GaussVertex(int iv){
++void GaussSeg::GaussVertex(int iv){/*{{{*/
+ 
+ 	/*in debugging mode: check that the default constructor has been called*/
+ 	_assert_(numgauss==-1);
+@@ -129,8 +121,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION GaussSeg::GaussNode{{{*/
+-void GaussSeg::GaussNode(int finiteelement,int iv){
++void GaussSeg::GaussNode(int finiteelement,int iv){/*{{{*/
+ 
+ 	/*in debugging mode: check that the default constructor has been called*/
+ 	_assert_(numgauss==-1);
+@@ -149,8 +140,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussSeg::begin{{{*/
+-int GaussSeg::begin(void){
++int GaussSeg::begin(void){/*{{{*/
+ 
+ 	/*Check that this has been initialized*/
+ 	_assert_(numgauss>0);
+@@ -161,8 +151,7 @@
+ 	return 0;
+ }
+ /*}}}*/
+-/*FUNCTION GaussSeg::end{{{*/
+-int GaussSeg::end(void){
++int GaussSeg::end(void){/*{{{*/
+ 
+ 	/*Check that this has been initialized*/
+ 	_assert_(numgauss>0);
+@@ -173,8 +162,7 @@
+ 	return numgauss;
+ }
+ /*}}}*/
+-/*FUNCTION GaussSeg::SynchronizeGaussBase{{{*/
+-void GaussSeg::SynchronizeGaussBase(Gauss* gauss){
++void GaussSeg::SynchronizeGaussBase(Gauss* gauss){/*{{{*/
+ 
+ 	_error_("not supported");
+ }
+Index: ../trunk-jpl/src/c/classes/gauss/GaussTetra.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/gauss/GaussTetra.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/gauss/GaussTetra.cpp	(revision 18064)
+@@ -12,8 +12,7 @@
+ #include "../../shared/Numerics/constants.h"
+ 
+ /*GaussTetra constructors and destructors:*/
+-/*FUNCTION GaussTetra::GaussTetra() {{{*/
+-GaussTetra::GaussTetra(){
++GaussTetra::GaussTetra(){/*{{{*/
+ 
+ 	numgauss=-1;
+ 
+@@ -30,8 +29,7 @@
+ 	coord4=UNDEF;
+ }
+ /*}}}*/
+-/*FUNCTION GaussTetra::GaussTetra(int order) {{{*/
+-GaussTetra::GaussTetra(int order){
++GaussTetra::GaussTetra(int order){/*{{{*/
+ 
+ 	/*Get gauss points*/
+ 	GaussLegendreTetra(&numgauss,&coords1,&coords2,&coords3,&coords4,&weights,order);
+@@ -57,8 +55,7 @@
+ 	coord3=UNDEF;
+ }
+ /*}}}*/
+-/*FUNCTION GaussTetra::GaussTetra(int index1,int index2,int index3,int order) {{{*/
+-GaussTetra::GaussTetra(int index1,int index2,int index3,int order){
++GaussTetra::GaussTetra(int index1,int index2,int index3,int order){/*{{{*/
+ 
+ 	/*Basal Tria*/
+ 	if(index1==0 && index2==1 && index3==2){
+@@ -86,8 +83,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION GaussTetra::~GaussTetra(){{{*/
+-GaussTetra::~GaussTetra(){
++GaussTetra::~GaussTetra(){/*{{{*/
+ 	xDelete<IssmDouble>(weights);
+ 	xDelete<IssmDouble>(coords1);
+ 	xDelete<IssmDouble>(coords2);
+@@ -97,8 +93,7 @@
+ /*}}}*/
+ 
+ /*Methods*/
+-/*FUNCTION GaussTetra::Echo{{{*/
+-void GaussTetra::Echo(void){
++void GaussTetra::Echo(void){/*{{{*/
+ 
+ 	_printf_("GaussTetra:\n");
+ 	_printf_("   numgauss: " << numgauss << "\n");
+@@ -142,13 +137,11 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussTetra::Enum{{{*/
+-int GaussTetra::Enum(void){
++int GaussTetra::Enum(void){/*{{{*/
+ 	return GaussTetraEnum;
+ }
+ /*}}}*/
+-/*FUNCTION GaussTetra::GaussPoint{{{*/
+-void GaussTetra::GaussPoint(int ig){
++void GaussTetra::GaussPoint(int ig){/*{{{*/
+ 
+ 	/*Check input in debugging mode*/
+ 	 _assert_(ig>=0 && ig< numgauss);
+@@ -162,8 +155,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussTetra::GaussVertex{{{*/
+-void GaussTetra::GaussVertex(int iv){
++void GaussTetra::GaussVertex(int iv){/*{{{*/
+ 
+ 	/*in debugging mode: check that the default constructor has been called*/
+ 	_assert_(numgauss==-1);
+@@ -180,8 +172,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussTetra::GaussNode{{{*/
+-void GaussTetra::GaussNode(int finiteelement,int iv){
++void GaussTetra::GaussNode(int finiteelement,int iv){/*{{{*/
+ 
+ 	/*in debugging mode: check that the default constructor has been called*/
+ 	_assert_(numgauss==-1);
+@@ -228,8 +219,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussTetra::begin{{{*/
+-int GaussTetra::begin(void){
++int GaussTetra::begin(void){/*{{{*/
+ 
+ 	/*Check that this has been initialized*/
+ 	_assert_(numgauss>0);
+@@ -243,8 +233,7 @@
+ 	return 0;
+ }
+ /*}}}*/
+-/*FUNCTION GaussTetra::end{{{*/
+-int GaussTetra::end(void){
++int GaussTetra::end(void){/*{{{*/
+ 
+ 	/*Check that this has been initialized*/
+ 	_assert_(numgauss>0);
+@@ -258,8 +247,7 @@
+ 	return numgauss;
+ }
+ /*}}}*/
+-/*FUNCTION GaussTetra::SynchronizeGaussBase{{{*/
+-void GaussTetra::SynchronizeGaussBase(Gauss* gauss){
++void GaussTetra::SynchronizeGaussBase(Gauss* gauss){/*{{{*/
+ 
+ 	_error_("not supported");
+ }
+Index: ../trunk-jpl/src/c/classes/gauss/GaussTria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 18064)
+@@ -6,8 +6,7 @@
+ #include "../../shared/shared.h"
+ 
+ /*GaussTria constructors and destructors:*/
+-/*FUNCTION GaussTria::GaussTria() {{{*/
+-GaussTria::GaussTria(){
++GaussTria::GaussTria(){/*{{{*/
+ 
+ 	numgauss=-1;
+ 
+@@ -22,8 +21,7 @@
+ 	coord3=UNDEF;
+ }
+ /*}}}*/
+-/*FUNCTION GaussTria::GaussTria(int order) {{{*/
+-GaussTria::GaussTria(int order){
++GaussTria::GaussTria(int order){/*{{{*/
+ 
+ 	/*Get gauss points*/
+ 	GaussLegendreTria(&numgauss,&coords1,&coords2,&coords3,&weights,order);
+@@ -36,8 +34,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussTria::GaussTria(int index1,int index2,int order) {{{*/
+-GaussTria::GaussTria(int index1,int index2,int order){
++GaussTria::GaussTria(int index1,int index2,int order){/*{{{*/
+ 
+ 	/*Intermediaties*/
+ 	IssmPDouble *seg_coords  = NULL;
+@@ -99,8 +96,7 @@
+ 	xDelete<double>(seg_weights);
+ }
+ /*}}}*/
+-/*FUNCTION GaussTria::GaussTria(IssmDouble area_coordinates,int order) {{{*/
+-GaussTria::GaussTria(IssmDouble area_coordinates[2][3],int order){
++GaussTria::GaussTria(IssmDouble area_coordinates[2][3],int order){/*{{{*/
+ 
+ 	/*Intermediaties*/
+ 	IssmPDouble *seg_coords  = NULL;
+@@ -135,8 +131,7 @@
+ 	xDelete<IssmPDouble>(seg_weights);
+ }
+ /*}}}*/
+-/*FUNCTION GaussTria::GaussTria(int index,double r1,double r2,int order) {{{*/
+-GaussTria::GaussTria(int index,IssmDouble r1,IssmDouble r2,bool mainlyfloating,int order){
++GaussTria::GaussTria(int index,IssmDouble r1,IssmDouble r2,bool mainlyfloating,int order){/*{{{*/
+ 
+ 	/*
+ 	 *  ^ 
+@@ -291,8 +286,7 @@
+ 	coord3=UNDEF;
+ }
+ /*}}}*/
+-/*FUNCTION GaussTria::~GaussTria(){{{*/
+-GaussTria::~GaussTria(){
++GaussTria::~GaussTria(){/*{{{*/
+ 	xDelete<IssmDouble>(weights);
+ 	xDelete<IssmDouble>(coords3);
+ 	xDelete<IssmDouble>(coords2);
+@@ -302,8 +296,7 @@
+ /*}}}*/
+ 
+ /*Methods*/
+-/*FUNCTION GaussTria::Echo{{{*/
+-void GaussTria::Echo(void){
++void GaussTria::Echo(void){/*{{{*/
+ 
+ 	_printf_("GaussTria:\n");
+ 	_printf_("   numgauss: " << numgauss << "\n");
+@@ -340,13 +333,11 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussTria::Enum{{{*/
+-int GaussTria::Enum(void){
++int GaussTria::Enum(void){/*{{{*/
+ 	return GaussTriaEnum;
+ }
+ /*}}}*/
+-/*FUNCTION GaussTria::GaussEdgeCenter{{{*/
+-void GaussTria::GaussEdgeCenter(int index1,int index2){
++void GaussTria::GaussEdgeCenter(int index1,int index2){/*{{{*/
+ 
+ 	int     index3;
+ 
+@@ -376,8 +367,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussTria::GaussPoint{{{*/
+-void GaussTria::GaussPoint(int ig){
++void GaussTria::GaussPoint(int ig){/*{{{*/
+ 
+ 	/*Check input in debugging mode*/
+ 	 _assert_(ig>=0 && ig< numgauss);
+@@ -390,8 +380,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussTria::GaussFromCoords{{{*/
+-void GaussTria::GaussFromCoords(IssmDouble x,IssmDouble y,IssmDouble* xyz_list){
++void GaussTria::GaussFromCoords(IssmDouble x,IssmDouble y,IssmDouble* xyz_list){/*{{{*/
+ 
+ 	/*Intermediaries*/
+ 	IssmDouble    area = 0;
+@@ -417,8 +406,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussTria::GaussVertex{{{*/
+-void GaussTria::GaussVertex(int iv){
++void GaussTria::GaussVertex(int iv){/*{{{*/
+ 
+ 	/*in debugging mode: check that the default constructor has been called*/
+ 	_assert_(numgauss==-1);
+@@ -433,8 +421,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussTria::GaussNode{{{*/
+-void GaussTria::GaussNode(int finiteelement,int iv){
++void GaussTria::GaussNode(int finiteelement,int iv){/*{{{*/
+ 
+ 	/*in debugging mode: check that the default constructor has been called*/
+ 	_assert_(numgauss==-1);
+@@ -480,8 +467,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussTria::begin{{{*/
+-int GaussTria::begin(void){
++int GaussTria::begin(void){/*{{{*/
+ 
+ 	/*Check that this has been initialized*/
+ 	_assert_(numgauss>0);
+@@ -494,8 +480,7 @@
+ 	return 0;
+ }
+ /*}}}*/
+-/*FUNCTION GaussTria::end{{{*/
+-int GaussTria::end(void){
++int GaussTria::end(void){/*{{{*/
+ 
+ 	/*Check that this has been initialized*/
+ 	_assert_(numgauss>0);
+@@ -508,8 +493,7 @@
+ 	return numgauss;
+ }
+ /*}}}*/
+-/*FUNCTION GaussTria::SynchronizeGaussBase{{{*/
+-void GaussTria::SynchronizeGaussBase(Gauss* gauss){
++void GaussTria::SynchronizeGaussBase(Gauss* gauss){/*{{{*/
+ 
+ 	_error_("not supported");
+ }
+Index: ../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp	(revision 18064)
+@@ -12,8 +12,7 @@
+ #include "../../shared/Numerics/constants.h"
+ 
+ /*GaussPenta constructors and destructors:*/
+-/*FUNCTION GaussPenta::GaussPenta() {{{*/
+-GaussPenta::GaussPenta(){
++GaussPenta::GaussPenta(){/*{{{*/
+ 
+ 	numgauss=-1;
+ 
+@@ -30,8 +29,7 @@
+ 	coord4=UNDEF;
+ }
+ /*}}}*/
+-/*FUNCTION GaussPenta::GaussPenta(int order_horiz,int order_vert) {{{*/
+-GaussPenta::GaussPenta(int order_horiz,int order_vert){
++GaussPenta::GaussPenta(int order_horiz,int order_vert){/*{{{*/
+ 
+ 	/*Intermediaries*/
+ 	int     ighoriz,igvert;
+@@ -84,8 +82,7 @@
+ 	xDelete<double>(weights_vert);
+ }
+ /*}}}*/
+-/*FUNCTION GaussPenta::GaussPenta(int index1, int index2, int order){{{*/
+-GaussPenta::GaussPenta(int index1, int index2,int order){
++GaussPenta::GaussPenta(int index1, int index2,int order){/*{{{*/
+ 
+ 	/*Intermediaties*/
+ 	double *seg_coords  = NULL;
+@@ -141,8 +138,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussPenta::GaussPenta(int index1, int index2, int index3, int order){{{*/
+-GaussPenta::GaussPenta(int index1, int index2, int index3, int order){
++GaussPenta::GaussPenta(int index1, int index2, int index3, int order){/*{{{*/
+ 
+ 	/*Basal Tria*/
+ 	if(index1==0 && index2==1 && index3==2){
+@@ -170,8 +166,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussPenta::GaussPenta(int index1, int index2, int index3, int index4,int order_horiz,int order_vert){{{*/
+-GaussPenta::GaussPenta(int index1, int index2, int index3, int index4,int order_horiz,int order_vert){
++GaussPenta::GaussPenta(int index1, int index2, int index3, int index4,int order_horiz,int order_vert){/*{{{*/
+ 
+ 	/*Intermediaties*/
+ 	double *seg_horiz_coords  = NULL;
+@@ -237,8 +232,7 @@
+ 	xDelete<double>(seg_vert_weights);
+ }
+ /*}}}*/
+-/*FUNCTION GaussPenta::GaussPenta(int index,double r1,double r2,int order) {{{*/
+-GaussPenta::GaussPenta(int index,IssmDouble r1,IssmDouble r2,bool mainlyfloating,int order){
++GaussPenta::GaussPenta(int index,IssmDouble r1,IssmDouble r2,bool mainlyfloating,int order){/*{{{*/
+ 
+ 	/*
+ 	 *  ^ 
+@@ -399,8 +393,7 @@
+ 	coord4=UNDEF;
+ }
+ /*}}}*/
+-/*FUNCTION GaussPenta::GaussPenta(IssmDouble area_coordinates[4][3],int order_horiz,int order_vert){{{*/
+-GaussPenta::GaussPenta(IssmDouble area_coordinates[4][3],int order_horiz,int order_vert){
++GaussPenta::GaussPenta(IssmDouble area_coordinates[4][3],int order_horiz,int order_vert){/*{{{*/
+ 
+ 	/*Intermediaties*/
+ 	IssmPDouble *seg_horiz_coords  = NULL;
+@@ -438,8 +431,7 @@
+ 	xDelete<IssmPDouble>(seg_vert_weights);
+ }
+ /*}}}*/
+-/*FUNCTION GaussPenta::~GaussPenta(){{{*/
+-GaussPenta::~GaussPenta(){
++GaussPenta::~GaussPenta(){/*{{{*/
+ 	xDelete<IssmDouble>(weights);
+ 	xDelete<IssmDouble>(coords1);
+ 	xDelete<IssmDouble>(coords2);
+@@ -449,8 +441,7 @@
+ /*}}}*/
+ 
+ /*Methods*/
+-/*FUNCTION GaussPenta::Echo{{{*/
+-void GaussPenta::Echo(void){
++void GaussPenta::Echo(void){/*{{{*/
+ 
+ 	_printf_("GaussPenta:\n");
+ 	_printf_("   numgauss: " << numgauss << "\n");
+@@ -494,13 +485,11 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussPenta::Enum{{{*/
+-int GaussPenta::Enum(void){
++int GaussPenta::Enum(void){/*{{{*/
+ 	return GaussPentaEnum;
+ }
+ /*}}}*/
+-/*FUNCTION GaussPenta::GaussPoint{{{*/
+-void GaussPenta::GaussPoint(int ig){
++void GaussPenta::GaussPoint(int ig){/*{{{*/
+ 
+ 	/*Check input in debugging mode*/
+ 	 _assert_(ig>=0 && ig< numgauss);
+@@ -514,8 +503,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussPenta::GaussVertex{{{*/
+-void GaussPenta::GaussVertex(int iv){
++void GaussPenta::GaussVertex(int iv){/*{{{*/
+ 
+ 	/*in debugging mode: check that the default constructor has been called*/
+ 	_assert_(numgauss==-1);
+@@ -534,8 +522,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussPenta::GaussFaceTria{{{*/
+-void GaussPenta::GaussFaceTria(int index1, int index2, int index3, int order){
++void GaussPenta::GaussFaceTria(int index1, int index2, int index3, int order){/*{{{*/
+ 
+ 	/*in debugging mode: check that the default constructor has been called*/
+ 	_assert_(numgauss==-1);
+@@ -552,8 +539,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussPenta::GaussNode{{{*/
+-void GaussPenta::GaussNode(int finiteelement,int iv){
++void GaussPenta::GaussNode(int finiteelement,int iv){/*{{{*/
+ 
+ 	/*in debugging mode: check that the default constructor has been called*/
+ 	_assert_(numgauss==-1);
+@@ -704,8 +690,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION GaussPenta::begin{{{*/
+-int GaussPenta::begin(void){
++int GaussPenta::begin(void){/*{{{*/
+ 
+ 	/*Check that this has been initialized*/
+ 	_assert_(numgauss>0);
+@@ -719,8 +704,7 @@
+ 	return 0;
+ }
+ /*}}}*/
+-/*FUNCTION GaussPenta::end{{{*/
+-int GaussPenta::end(void){
++int GaussPenta::end(void){/*{{{*/
+ 
+ 	/*Check that this has been initialized*/
+ 	_assert_(numgauss>0);
+@@ -734,8 +718,7 @@
+ 	return numgauss;
+ }
+ /*}}}*/
+-/*FUNCTION GaussPenta::SynchronizeGaussBase{{{*/
+-void GaussPenta::SynchronizeGaussBase(Gauss* gauss){
++void GaussPenta::SynchronizeGaussBase(Gauss* gauss){/*{{{*/
+ 
+ 	_assert_(gauss->Enum()==GaussTriaEnum);
+ 	GaussTria* gauss_tria = dynamic_cast<GaussTria*>(gauss);
+Index: ../trunk-jpl/src/c/classes/Inputs/SegInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/SegInput.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Inputs/SegInput.cpp	(revision 18064)
+@@ -12,13 +12,11 @@
+ #include "../../shared/shared.h"
+ 
+ /*SegInput constructors and destructor*/
+-/*FUNCTION SegInput::SegInput(){{{*/
+-SegInput::SegInput(){
++SegInput::SegInput(){/*{{{*/
+ 	values = NULL;
+ }
+ /*}}}*/
+-/*FUNCTION SegInput::SegInput(int in_enum_type,IssmDouble* invalues,element_type_in){{{*/
+-SegInput::SegInput(int in_enum_type,IssmDouble* in_values,int element_type_in)
++SegInput::SegInput(int in_enum_type,IssmDouble* in_values,int element_type_in)/*{{{*/
+ 	:SegRef(1)
+ {
+ 
+@@ -34,38 +32,32 @@
+ 	for(int i=0;i<this->NumberofNodes();i++) values[i]=in_values[i];
+ }
+ /*}}}*/
+-/*FUNCTION SegInput::~SegInput(){{{*/
+-SegInput::~SegInput(){
++SegInput::~SegInput(){/*{{{*/
+ 	xDelete<IssmDouble>(this->values);
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION SegInput::Echo {{{*/
+-void SegInput::Echo(void){
++void SegInput::Echo(void){/*{{{*/
+ 	this->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION SegInput::DeepEcho{{{*/
+-void SegInput::DeepEcho(void){
++void SegInput::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_(setw(15)<<"   SegInput "<<setw(25)<<left<<EnumToStringx(this->enum_type)<<" [");
+ 	for(int i=0;i<this->NumberofNodes();i++) _printf_(" "<<this->values[i]);
+ 	_printf_("]\n");
+ }
+ /*}}}*/
+-/*FUNCTION SegInput::Id{{{*/
+-int    SegInput::Id(void){ return -1; }
++int    SegInput::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION SegInput::ObjectEnum{{{*/
+-int SegInput::ObjectEnum(void){
++int SegInput::ObjectEnum(void){/*{{{*/
+ 
+ 	return SegInputEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION SegInput::copy{{{*/
+-Object* SegInput::copy() {
++Object* SegInput::copy() {/*{{{*/
+ 
+ 	return new SegInput(this->enum_type,this->values,this->element_type);
+ 
+@@ -73,8 +65,7 @@
+ /*}}}*/
+ 
+ /*SegInput management*/
+-/*FUNCTION SegInput::InstanceEnum{{{*/
+-int SegInput::InstanceEnum(void){
++int SegInput::InstanceEnum(void){/*{{{*/
+ 
+ 	return this->enum_type;
+ 
+@@ -82,8 +73,7 @@
+ /*}}}*/
+ 
+ /*Object functions*/
+-/*FUNCTION SegInput::GetInputAverage{{{*/
+-void SegInput::GetInputAverage(IssmDouble* pvalue){
++void SegInput::GetInputAverage(IssmDouble* pvalue){/*{{{*/
+ 
+ 	int        numnodes  = this->NumberofNodes();
+ 	IssmDouble numnodesd = reCast<int,IssmDouble>(numnodes);
+@@ -95,8 +85,7 @@
+ 	*pvalue=value;
+ }
+ /*}}}*/
+-/*FUNCTION SegInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){{{*/
+-void SegInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){
++void SegInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){/*{{{*/
+ 
+ 	/*Call SegRef function*/
+ 	_assert_(gauss->Enum()==GaussSegEnum);
+@@ -104,21 +93,18 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION SegInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, Gauss* gauss){{{*/
+-void SegInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list,Gauss* gauss){
++void SegInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+ 
+ 	/*Call SegRef function*/
+ 	_assert_(gauss->Enum()==GaussSegEnum);
+ 	SegRef::GetInputDerivativeValue(p,&values[0],xyz_list,(GaussSeg*)gauss);
+ }
+ /*}}}*/
+-/*FUNCTION SegInput::Configure{{{*/
+-void SegInput::Configure(Parameters* parameters){
++void SegInput::Configure(Parameters* parameters){/*{{{*/
+ 	/*do nothing: */
+ }
+ /*}}}*/
+-/*FUNCTION SegInput::Min{{{*/
+-IssmDouble SegInput::Min(void){
++IssmDouble SegInput::Min(void){/*{{{*/
+ 
+ 	const int  numnodes=this->NumberofNodes();
+ 	IssmDouble min=values[0];
+Index: ../trunk-jpl/src/c/classes/Inputs/TetraInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TetraInput.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Inputs/TetraInput.cpp	(revision 18064)
+@@ -12,13 +12,11 @@
+ #include "../../shared/shared.h"
+ 
+ /*TetraInput constructors and destructor*/
+-/*FUNCTION TetraInput::TetraInput(){{{*/
+-TetraInput::TetraInput(){
++TetraInput::TetraInput(){/*{{{*/
+ 	values = NULL;
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::TetraInput(int in_enum_type,IssmDouble* invalues,element_type_in){{{*/
+-TetraInput::TetraInput(int in_enum_type,IssmDouble* in_values,int element_type_in)
++TetraInput::TetraInput(int in_enum_type,IssmDouble* in_values,int element_type_in)/*{{{*/
+ 	:TetraRef(1)
+ {
+ 
+@@ -34,38 +32,32 @@
+ 	for(int i=0;i<this->NumberofNodes();i++) values[i]=in_values[i];
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::~TetraInput(){{{*/
+-TetraInput::~TetraInput(){
++TetraInput::~TetraInput(){/*{{{*/
+ 	xDelete<IssmDouble>(this->values);
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION TetraInput::Echo {{{*/
+-void TetraInput::Echo(void){
++void TetraInput::Echo(void){/*{{{*/
+ 	this->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::DeepEcho{{{*/
+-void TetraInput::DeepEcho(void){
++void TetraInput::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_(setw(15)<<"   TetraInput "<<setw(25)<<left<<EnumToStringx(this->enum_type)<<" [");
+ 	for(int i=0;i<this->NumberofNodes();i++) _printf_(" "<<this->values[i]);
+ 	_printf_("] ("<<EnumToStringx(this->element_type)<<")\n");
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::Id{{{*/
+-int    TetraInput::Id(void){ return -1; }
++int    TetraInput::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION TetraInput::ObjectEnum{{{*/
+-int TetraInput::ObjectEnum(void){
++int TetraInput::ObjectEnum(void){/*{{{*/
+ 
+ 	return TetraInputEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::copy{{{*/
+-Object* TetraInput::copy() {
++Object* TetraInput::copy() {/*{{{*/
+ 
+ 	return new TetraInput(this->enum_type,this->values,this->element_type);
+ 
+@@ -73,15 +65,13 @@
+ /*}}}*/
+ 
+ /*TetraInput management*/
+-/*FUNCTION TetraInput::InstanceEnum{{{*/
+-int TetraInput::InstanceEnum(void){
++int TetraInput::InstanceEnum(void){/*{{{*/
+ 
+ 	return this->enum_type;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::GetResultInterpolation{{{*/
+-int  TetraInput::GetResultInterpolation(void){
++int  TetraInput::GetResultInterpolation(void){/*{{{*/
+ 
+ 	if(this->element_type==P0Enum){
+ 		return P0Enum;
+@@ -90,15 +80,13 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::GetResultNumberOfNodes{{{*/
+-int  TetraInput::GetResultNumberOfNodes(void){
++int  TetraInput::GetResultNumberOfNodes(void){/*{{{*/
+ 
+ 	return this->NumberofNodes();
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::ResultToPatch{{{*/
+-void TetraInput::ResultToPatch(IssmDouble* values,int nodesperelement,int sid){
++void TetraInput::ResultToPatch(IssmDouble* values,int nodesperelement,int sid){/*{{{*/
+ 
+ 	int numnodes = this->NumberofNodes();
+ 
+@@ -112,8 +100,7 @@
+ /*}}}*/
+ 
+ /*Object functions*/
+-/*FUNCTION TetraInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){{{*/
+-void TetraInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){
++void TetraInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){/*{{{*/
+ 
+ 	/*Call TetraRef function*/
+ 	_assert_(gauss->Enum()==GaussTetraEnum);
+@@ -121,21 +108,18 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, Gauss* gauss){{{*/
+-void TetraInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, Gauss* gauss){
++void TetraInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, Gauss* gauss){/*{{{*/
+ 
+ 	/*Call TetraRef function*/
+ 	_assert_(gauss->Enum()==GaussTetraEnum);
+ 	TetraRef::GetInputDerivativeValue(p,&values[0],xyz_list,(GaussTetra*)gauss);
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::ChangeEnum{{{*/
+-void TetraInput::ChangeEnum(int newenumtype){
++void TetraInput::ChangeEnum(int newenumtype){/*{{{*/
+ 	this->enum_type=newenumtype;
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::GetInputAverage{{{*/
+-void TetraInput::GetInputAverage(IssmDouble* pvalue){
++void TetraInput::GetInputAverage(IssmDouble* pvalue){/*{{{*/
+ 
+ 	int        numnodes  = this->NumberofNodes();
+ 	IssmDouble numnodesd = reCast<int,IssmDouble>(numnodes);
+@@ -147,8 +131,7 @@
+ 	*pvalue=value;
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::GetInputAllTimeAverages{{{*/
+-void TetraInput::GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){
++void TetraInput::GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){/*{{{*/
+ 
+ 	IssmDouble* outvalues=NULL;
+ 	IssmDouble* times=NULL;
+@@ -167,8 +150,7 @@
+ 	*pnumtimes=numtimes;
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::GetInputUpToCurrentTimeAverages{{{*/
+-void TetraInput::GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){
++void TetraInput::GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){/*{{{*/
+ 
+ 	IssmDouble* outvalues=NULL;
+ 	IssmDouble* times=NULL;
+@@ -187,8 +169,7 @@
+ 	*pnumtimes=numtimes;
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::SpawnTriaInput{{{*/
+-Input* TetraInput::SpawnTriaInput(int index1,int index2,int index3){
++Input* TetraInput::SpawnTriaInput(int index1,int index2,int index3){/*{{{*/
+ 
+ 	/*output*/
+ 	TriaInput* outinput=NULL;
+@@ -220,8 +201,7 @@
+ /*}}}*/
+ 
+ /*Intermediary*/
+-/*FUNCTION TetraInput::SquareMin{{{*/
+-void TetraInput::SquareMin(IssmDouble* psquaremin,Parameters* parameters){
++void TetraInput::SquareMin(IssmDouble* psquaremin,Parameters* parameters){/*{{{*/
+ 
+ 	int        numnodes=this->NumberofNodes();
+ 	IssmDouble squaremin;
+@@ -235,15 +215,13 @@
+ 	*psquaremin=squaremin;
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::ContrainMin{{{*/
+-void TetraInput::ConstrainMin(IssmDouble minimum){
++void TetraInput::ConstrainMin(IssmDouble minimum){/*{{{*/
+ 
+ 	int numnodes = this->NumberofNodes();
+ 	for(int i=0;i<numnodes;i++) if (values[i]<minimum) values[i]=minimum;
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::InfinityNorm{{{*/
+-IssmDouble TetraInput::InfinityNorm(void){
++IssmDouble TetraInput::InfinityNorm(void){/*{{{*/
+ 
+ 	/*Output*/
+ 	IssmDouble norm=0.;
+@@ -253,8 +231,7 @@
+ 	return norm;
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::Max{{{*/
+-IssmDouble TetraInput::Max(void){
++IssmDouble TetraInput::Max(void){/*{{{*/
+ 
+ 	int  numnodes=this->NumberofNodes();
+ 	IssmDouble max=values[0];
+@@ -265,8 +242,7 @@
+ 	return max;
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::MaxAbs{{{*/
+-IssmDouble TetraInput::MaxAbs(void){
++IssmDouble TetraInput::MaxAbs(void){/*{{{*/
+ 
+ 	int  numnodes=this->NumberofNodes();
+ 	IssmDouble max=fabs(values[0]);
+@@ -277,8 +253,7 @@
+ 	return max;
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::Min{{{*/
+-IssmDouble TetraInput::Min(void){
++IssmDouble TetraInput::Min(void){/*{{{*/
+ 
+ 	const int  numnodes=this->NumberofNodes();
+ 	IssmDouble min=values[0];
+@@ -289,8 +264,7 @@
+ 	return min;
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::MinAbs{{{*/
+-IssmDouble TetraInput::MinAbs(void){
++IssmDouble TetraInput::MinAbs(void){/*{{{*/
+ 
+ 	const int  numnodes=this->NumberofNodes();
+ 	IssmDouble min=fabs(values[0]);
+@@ -301,22 +275,19 @@
+ 	return min;
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::Scale{{{*/
+-void TetraInput::Scale(IssmDouble scale_factor){
++void TetraInput::Scale(IssmDouble scale_factor){/*{{{*/
+ 
+ 	const int numnodes=this->NumberofNodes();
+ 	for(int i=0;i<numnodes;i++)values[i]=values[i]*scale_factor;
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::Set{{{*/
+-void TetraInput::Set(IssmDouble setvalue){
++void TetraInput::Set(IssmDouble setvalue){/*{{{*/
+ 
+ 	const int numnodes=this->NumberofNodes();
+ 	for(int i=0;i<numnodes;i++)values[i]=setvalue;
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::AXPY{{{*/
+-void TetraInput::AXPY(Input* xinput,IssmDouble scalar){
++void TetraInput::AXPY(Input* xinput,IssmDouble scalar){/*{{{*/
+ 
+ 	const int numnodes=this->NumberofNodes();
+ 	TetraInput*  xtriainput=NULL;
+@@ -331,8 +302,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::Constrain{{{*/
+-void TetraInput::Constrain(IssmDouble cm_min, IssmDouble cm_max){
++void TetraInput::Constrain(IssmDouble cm_min, IssmDouble cm_max){/*{{{*/
+ 
+ 	int i;
+ 	const int numnodes=this->NumberofNodes();
+@@ -342,13 +312,11 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::GetVectorFromInputs{{{*/
+-void TetraInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
++void TetraInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){/*{{{*/
+ 	const int numvertices=4;
+ 	vector->SetValues(numvertices,doflist,this->values,INS_VAL);
+ } /*}}}*/
+-/*FUNCTION TetraInput::PointwiseMin{{{*/
+-Input* TetraInput::PointwiseMin(Input* inputB){
++Input* TetraInput::PointwiseMin(Input* inputB){/*{{{*/
+ 
+ 	/*Ouput*/
+ 	TetraInput* outinput=NULL;
+@@ -379,8 +347,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::PointwiseMax{{{*/
+-Input* TetraInput::PointwiseMax(Input* inputB){
++Input* TetraInput::PointwiseMax(Input* inputB){/*{{{*/
+ 
+ 	/*Ouput*/
+ 	TetraInput* outinput=NULL;
+@@ -411,8 +378,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::PointwiseDivide{{{*/
+-Input* TetraInput::PointwiseDivide(Input* inputB){
++Input* TetraInput::PointwiseDivide(Input* inputB){/*{{{*/
+ 
+ 	/*Ouput*/
+ 	TetraInput* outinput=NULL;
+@@ -444,8 +410,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TetraInput::Configure{{{*/
+-void TetraInput::Configure(Parameters* parameters){
++void TetraInput::Configure(Parameters* parameters){/*{{{*/
+ 	/*do nothing: */
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Inputs/ControlInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/ControlInput.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Inputs/ControlInput.cpp	(revision 18064)
+@@ -12,8 +12,7 @@
+ #include "../../shared/shared.h"
+ 
+ /*ControlInput constructors and destructor*/
+-/*FUNCTION ControlInput::ControlInput(){{{*/
+-ControlInput::ControlInput(){
++ControlInput::ControlInput(){/*{{{*/
+ 	control_id  = 0;
+ 	values      = NULL;
+ 	savedvalues = NULL;
+@@ -22,8 +21,7 @@
+ 	gradient    = NULL;
+ }
+ /*}}}*/
+-/*FUNCTION ControlInput::ControlInput(int enum_type,int enum_input,IssmDouble* pvalues,IssmDouble* pmin,IssmDouble* pmax,int id){{{*/
+-ControlInput::ControlInput(int in_enum_type,int enum_input,IssmDouble* pvalues,IssmDouble* pmin,IssmDouble* pmax,int id){
++ControlInput::ControlInput(int in_enum_type,int enum_input,IssmDouble* pvalues,IssmDouble* pmin,IssmDouble* pmax,int id){/*{{{*/
+ 
+ 	control_id=id;
+ 	enum_type=in_enum_type;
+@@ -47,8 +45,7 @@
+ 	gradient   =NULL;
+ }
+ /*}}}*/
+-/*FUNCTION ControlInput::~ControlInput(){{{*/
+-ControlInput::~ControlInput(){
++ControlInput::~ControlInput(){/*{{{*/
+ 	delete values;
+ 	delete savedvalues;
+ 	delete minvalues;
+@@ -58,13 +55,11 @@
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-		/*FUNCTION ControlInput::Echo {{{*/
+-void ControlInput::Echo(void){
++void ControlInput::Echo(void){/*{{{*/
+ 	this->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION ControlInput::DeepEcho{{{*/
+-void ControlInput::DeepEcho(void){
++void ControlInput::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_("ControlInput:\n");
+ 	_printf_(setw(15)<<"   ControlInput "<<setw(25)<<left<<EnumToStringx(this->enum_type)<<"\n");
+@@ -75,18 +70,15 @@
+ 	_printf_("---gradient: \n");   if (gradient)    gradient->Echo();
+ }
+ /*}}}*/
+-/*FUNCTION ControlInput::Id{{{*/
+-int    ControlInput::Id(void){ return -1; }
++int    ControlInput::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION ControlInput::ObjectEnum{{{*/
+-int ControlInput::ObjectEnum(void){
++int ControlInput::ObjectEnum(void){/*{{{*/
+ 
+ 	return ControlInputEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION ControlInput::copy{{{*/
+-Object* ControlInput::copy() {
++Object* ControlInput::copy() {/*{{{*/
+ 
+ 	ControlInput* output=NULL;
+ 
+@@ -105,8 +97,7 @@
+ /*}}}*/
+ 
+ /*ControlInput management*/
+-/*FUNCTION ControlInput::InstanceEnum{{{*/
+-int ControlInput::InstanceEnum(void){
++int ControlInput::InstanceEnum(void){/*{{{*/
+ 
+ 	return this->enum_type;
+ 
+@@ -114,12 +105,10 @@
+ /*}}}*/
+ 
+ /*Object functions*/
+-/*FUNCTION ControlInput::AXPY(){{{*/
+-void ControlInput::AXPY(Input* xinput,IssmDouble scalar){
++void ControlInput::AXPY(Input* xinput,IssmDouble scalar){/*{{{*/
+ 	values->AXPY(xinput,scalar);
+ }/*}}}*/
+-/*FUNCTION ControlInput::Constrain(){{{*/
+-void ControlInput::Constrain(void){
++void ControlInput::Constrain(void){/*{{{*/
+ 
+ 	Input* newvalues=NULL;
+ 
+@@ -128,41 +117,34 @@
+ 	newvalues=this->values->PointwiseMax(minvalues);
+ 	delete values; this->values=newvalues;
+ }/*}}}*/
+-/*FUNCTION ControlInput::Constrain(IssmDouble min, IssmDouble max){{{*/
+-void ControlInput::Constrain(IssmDouble min, IssmDouble max){
++void ControlInput::Constrain(IssmDouble min, IssmDouble max){/*{{{*/
+ 	   values->Constrain(min,max);
+ }/*}}}*/
+-/*FUNCTION ControlInput::Extrude{{{*/
+-void ControlInput::Extrude(void){
++void ControlInput::Extrude(void){/*{{{*/
+ 	values->Extrude();
+ 	savedvalues->Extrude();
+ 	//gradient->Extrude();
+ }/*}}}*/
+-/*FUNCTION ControlInput::GetResultInterpolation{{{*/
+-int  ControlInput::GetResultInterpolation(void){
++int  ControlInput::GetResultInterpolation(void){/*{{{*/
+ 
+ 	return values->GetResultInterpolation();
+ 
+ }
+ /*}}}*/
+-/*FUNCTION ControlInput::GetResultNumberOfNodes{{{*/
+-int  ControlInput::GetResultNumberOfNodes(void){
++int  ControlInput::GetResultNumberOfNodes(void){/*{{{*/
+ 
+ 	return values->GetResultNumberOfNodes();
+ 
+ }
+ /*}}}*/
+-/*FUNCTION ControlInput::GetGradient{{{*/
+-void ControlInput::GetGradient(Vector<IssmDouble>* gradient_vec,int* doflist){
++void ControlInput::GetGradient(Vector<IssmDouble>* gradient_vec,int* doflist){/*{{{*/
+ 	if(gradient) gradient->GetVectorFromInputs(gradient_vec,doflist);
+ }/*}}}*/
+-/*FUNCTION ControlInput::ScaleGradient{{{*/
+-void ControlInput::ScaleGradient(IssmDouble scaling_factor){
++void ControlInput::ScaleGradient(IssmDouble scaling_factor){/*{{{*/
+ 	if(!gradient) _error_("Gradient of ControlInput " << EnumToStringx(enum_type) << " not found");
+ 	gradient->Scale(scaling_factor);
+ }/*}}}*/
+-/*FUNCTION ControlInput::SetGradient{{{*/
+-void ControlInput::SetGradient(Input* gradient_in){
++void ControlInput::SetGradient(Input* gradient_in){/*{{{*/
+ 
+ 	/*Get enum for current gradient*/
+ 	switch(this->control_id){
+@@ -184,27 +166,22 @@
+ 	gradient=gradient_in;
+ 
+ }/*}}}*/
+-/*FUNCTION ControlInput::SetInput{{{*/
+-void ControlInput::SetInput(Input* in_input){
++void ControlInput::SetInput(Input* in_input){/*{{{*/
+ 
+ 	delete values; this->values=in_input;
+ 	this->SaveValue(); //because this is what SpawnResult saves FIXME
+ 
+ }/*}}}*/
+-/*FUNCTION ControlInput::SpawnTriaInput{{{*/
+-Input* ControlInput::SpawnTriaInput(int index1,int index2,int index3){
++Input* ControlInput::SpawnTriaInput(int index1,int index2,int index3){/*{{{*/
+ 	return values->SpawnTriaInput(index1,index2,index3);
+ }/*}}}*/
+-/*FUNCTION ControlInput::SpawnSegInput{{{*/
+-Input* ControlInput::SpawnSegInput(int index1,int index2){
++Input* ControlInput::SpawnSegInput(int index1,int index2){/*{{{*/
+ 	return values->SpawnSegInput(index1,index2);
+ }/*}}}*/
+-/*FUNCTION ControlInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){{{*/
+-void ControlInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
++void ControlInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){/*{{{*/
+ 	values->GetVectorFromInputs(vector,doflist);
+ }/*}}}*/
+-/*FUNCTION ControlInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist,const char* data){{{*/
+-void ControlInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist,const char* data){
++void ControlInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist,const char* data){/*{{{*/
+ 	 if(strcmp(data,"value")==0){
+ 		 _assert_(values);
+ 		 values->GetVectorFromInputs(vector,doflist);
+@@ -225,43 +202,34 @@
+ 		 _error_("Data " << data << " not supported yet");
+ 	 }
+ }/*}}}*/
+-/*FUNCTION ControlInput::GetInputAverage(IssmDouble* pvalue){{{*/
+-void ControlInput::GetInputAverage(IssmDouble* pvalue){
++void ControlInput::GetInputAverage(IssmDouble* pvalue){/*{{{*/
+ 	values->GetInputAverage(pvalue);
+ }/*}}}*/
+-/*FUNCTION ControlInput::GetInputValue(bool* pvalue){{{*/
+-void ControlInput::GetInputValue(bool* pvalue){
++void ControlInput::GetInputValue(bool* pvalue){/*{{{*/
+ 	values->GetInputValue(pvalue);
+ }/*}}}*/
+-/*FUNCTION ControlInput::GetInputValue(int* pvalue){{{*/
+-void ControlInput::GetInputValue(int* pvalue){
++void ControlInput::GetInputValue(int* pvalue){/*{{{*/
+ 	values->GetInputValue(pvalue);
+ }/*}}}*/
+-/*FUNCTION ControlInput::GetInputValue(IssmDouble* pvalue){{{*/
+-void ControlInput::GetInputValue(IssmDouble* pvalue){
++void ControlInput::GetInputValue(IssmDouble* pvalue){/*{{{*/
+ 	values->GetInputValue(pvalue);
+ }/*}}}*/
+-/*FUNCTION ControlInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){{{*/
+-void ControlInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){
++void ControlInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){/*{{{*/
+ 	values->GetInputValue(pvalue,gauss);
+ }/*}}}*/
+-/*FUNCTION ControlInput::GetGradientValue{{{*/
+-void ControlInput::GetGradientValue(IssmDouble* pvalue,Gauss* gauss){
++void ControlInput::GetGradientValue(IssmDouble* pvalue,Gauss* gauss){/*{{{*/
+ 	gradient->GetInputValue(pvalue,gauss);
+ }/*}}}*/
+-/*FUNCTION ControlInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, Gauss* gauss){{{*/
+-void ControlInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, Gauss* gauss){
++void ControlInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, Gauss* gauss){/*{{{*/
+ 	values->GetInputDerivativeValue(derivativevalues,xyz_list,gauss);
+ }/*}}}*/
+-/*FUNCTION ControlInput::SaveValue{{{*/
+-void ControlInput::SaveValue(void){
++void ControlInput::SaveValue(void){/*{{{*/
+ 	if(!values) _error_("Values of " << EnumToStringx(this->enum_type) << " not found");
+ 
+ 	if(savedvalues) delete this->savedvalues;
+ 	this->savedvalues=dynamic_cast<Input*>(this->values->copy());
+ }/*}}}*/
+-/*FUNCTION ControlInput::UpdateValue{{{*/
+-void ControlInput::UpdateValue(IssmDouble scalar){
++void ControlInput::UpdateValue(IssmDouble scalar){/*{{{*/
+ 	if(!gradient)    _error_("Gradient of " << EnumToStringx(this->enum_type) << " not found");
+ 	if(!savedvalues) _error_("Values of " << EnumToStringx(this->enum_type) << " not found");
+ 
+@@ -269,12 +237,10 @@
+ 	this->values=dynamic_cast<Input*>(this->savedvalues->copy());
+ 	this->values->AXPY(gradient,scalar);
+ }/*}}}*/
+-/*FUNCTION ControlInput::VerticallyIntegrate{{{*/
+-void ControlInput::VerticallyIntegrate(Input* thickness_input){
++void ControlInput::VerticallyIntegrate(Input* thickness_input){/*{{{*/
+ 	values->VerticallyIntegrate(thickness_input);
+ }/*}}}*/
+-/*FUNCTION ControlInput::Configure{{{*/
+-void ControlInput::Configure(Parameters* parameters){
++void ControlInput::Configure(Parameters* parameters){/*{{{*/
+ 	/*do nothing: */
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp	(revision 18064)
+@@ -13,16 +13,14 @@
+ /*}}}*/
+ 
+ /*DatasetInput constructors and destructor*/
+-/*FUNCTION DatasetInput::DatasetInput(){{{*/
+-DatasetInput::DatasetInput(){
++DatasetInput::DatasetInput(){/*{{{*/
+ 	enum_type = UNDEF;
+ 	inputs    = NULL;
+ 	numids    = 0;
+ 	ids       = NULL;
+ }
+ /*}}}*/
+-/*FUNCTION DatasetInput::DatasetInput(int in_enum_type,int* idlist,int numids) {{{*/
+-DatasetInput::DatasetInput(int in_enum_type){
++DatasetInput::DatasetInput(int in_enum_type){/*{{{*/
+ 
+ 	enum_type = in_enum_type;
+ 	numids    = 0;
+@@ -30,21 +28,18 @@
+ 	ids       = NULL;
+ }
+ /*}}}*/
+-/*FUNCTION DatasetInput::~DatasetInput(){{{*/
+-DatasetInput::~DatasetInput(){
++DatasetInput::~DatasetInput(){/*{{{*/
+ 	xDelete<int>(this->ids);
+ 	delete inputs;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-		/*FUNCTION DatasetInput::Echo {{{*/
+-void DatasetInput::Echo(void){
++void DatasetInput::Echo(void){/*{{{*/
+ 	this->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION DatasetInput::DeepEcho{{{*/
+-void DatasetInput::DeepEcho(void){
++void DatasetInput::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_("DatasetInput:\n");
+ 	_printf_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n");
+@@ -55,18 +50,15 @@
+ 	_printf_("   inputs: \n"); inputs->Echo();
+ }
+ /*}}}*/
+-/*FUNCTION DatasetInput::Id{{{*/
+-int    DatasetInput::Id(void){ return -1; }
++int    DatasetInput::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION DatasetInput::ObjectEnum{{{*/
+-int DatasetInput::ObjectEnum(void){
++int DatasetInput::ObjectEnum(void){/*{{{*/
+ 
+ 	return DatasetInputEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DatasetInput::copy{{{*/
+-Object* DatasetInput::copy() {
++Object* DatasetInput::copy() {/*{{{*/
+ 
+ 	DatasetInput* output=NULL;
+ 
+@@ -77,8 +69,7 @@
+ 	return output;
+ }
+ /*}}}*/
+-/*FUNCTION DatasetInput::SpawnTriaInput{{{*/
+-Input* DatasetInput::SpawnTriaInput(int index1,int index2,int index3){
++Input* DatasetInput::SpawnTriaInput(int index1,int index2,int index3){/*{{{*/
+ 
+ 	/*output*/
+ 	DatasetInput* outinput=NULL;
+@@ -95,8 +86,7 @@
+ 	return outinput;
+ }
+ /*}}}*/
+-/*FUNCTION DatasetInput::SpawnSegInput{{{*/
+-Input* DatasetInput::SpawnSegInput(int index1,int index2){
++Input* DatasetInput::SpawnSegInput(int index1,int index2){/*{{{*/
+ 
+ 	/*output*/
+ 	DatasetInput* outinput=NULL;
+@@ -115,8 +105,7 @@
+ /*}}}*/
+ 
+ /*DatasetInput management*/
+-/*FUNCTION DatasetInput::AddInput{{{*/
+-void DatasetInput::AddInput(Input* input,int id){
++void DatasetInput::AddInput(Input* input,int id){/*{{{*/
+ 
+ 	_assert_(this->numids == this->inputs->Size());
+ 
+@@ -143,8 +132,7 @@
+ 	_assert_(this->numids == this->inputs->Size());
+ }
+ /*}}}*/
+-/*FUNCTION DatasetInput::InstanceEnum{{{*/
+-int DatasetInput::InstanceEnum(void){
++int DatasetInput::InstanceEnum(void){/*{{{*/
+ 
+ 	return this->enum_type;
+ 
+@@ -152,13 +140,11 @@
+ /*}}}*/
+ 
+ /*Object functions*/
+-/*FUNCTION DatasetInput::Configure{{{*/
+-void DatasetInput::Configure(Parameters* parameters){
++void DatasetInput::Configure(Parameters* parameters){/*{{{*/
+ 	/*do nothing: */
+ }
+ /*}}}*/
+-/*FUNCTION DatasetInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss,int id){{{*/
+-void DatasetInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss,int id){
++void DatasetInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss,int id){/*{{{*/
+ 
+ 	int  offset = -1;
+ 	_assert_(this->numids == this->inputs->Size());
+Index: ../trunk-jpl/src/c/classes/Inputs/IntInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/IntInput.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Inputs/IntInput.cpp	(revision 18064)
+@@ -12,43 +12,36 @@
+ #include "../../shared/shared.h"
+ 
+ /*IntInput constructors and destructor*/
+-/*FUNCTION IntInput::IntInput(){{{*/
+-IntInput::IntInput(){
++IntInput::IntInput(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION IntInput::IntInput(IssmDouble* values){{{*/
+-IntInput::IntInput(int in_enum_type,IssmInt in_value){
++IntInput::IntInput(int in_enum_type,IssmInt in_value){/*{{{*/
+ 
+ 	enum_type=in_enum_type;
+ 	value=in_value;
+ }
+ /*}}}*/
+-/*FUNCTION IntInput::~IntInput(){{{*/
+-IntInput::~IntInput(){
++IntInput::~IntInput(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION IntInput::DeepEcho{{{*/
+-void IntInput::DeepEcho(void){
++void IntInput::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_(setw(15)<<"   IntInput "<<setw(25)<<left<<EnumToStringx(this->enum_type)<<" "<<this->value<<"\n");
+ }
+ /*}}}*/
+-/*FUNCTION IntInput::Id{{{*/
+-int    IntInput::Id(void){ return -1; }
++int    IntInput::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION IntInput::ObjectEnum{{{*/
+-int IntInput::ObjectEnum(void){
++int IntInput::ObjectEnum(void){/*{{{*/
+ 
+ 	return IntInputEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IntInput::copy{{{*/
+-Object* IntInput::copy() {
++Object* IntInput::copy() {/*{{{*/
+ 
+ 	return new IntInput(this->enum_type,this->value);
+ 
+@@ -56,20 +49,17 @@
+ /*}}}*/
+ 
+ /*IntInput management*/
+-/*FUNCTION IntInput::Echo {{{*/
+-void IntInput::Echo(void){
++void IntInput::Echo(void){/*{{{*/
+ 	this->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION IntInput::InstanceEnum{{{*/
+-int IntInput::InstanceEnum(void){
++int IntInput::InstanceEnum(void){/*{{{*/
+ 
+ 	return this->enum_type;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IntInput::SpawnTriaInput{{{*/
+-Input* IntInput::SpawnTriaInput(int index1,int index2,int index3){
++Input* IntInput::SpawnTriaInput(int index1,int index2,int index3){/*{{{*/
+ 
+ 	/*output*/
+ 	IntInput* outinput=new IntInput();
+@@ -82,8 +72,7 @@
+ 	return outinput;
+ }
+ /*}}}*/
+-/*FUNCTION IntInput::SpawnSegInput{{{*/
+-Input* IntInput::SpawnSegInput(int index1,int index2){
++Input* IntInput::SpawnSegInput(int index1,int index2){/*{{{*/
+ 
+ 	/*output*/
+ 	IntInput* outinput=new IntInput();
+@@ -98,42 +87,34 @@
+ /*}}}*/
+ 
+ /*Object functions*/
+-/*FUNCTION IntInput::GetInputValue(bool* pvalue) {{{*/
+-void IntInput::GetInputValue(bool* pvalue){_error_("not supported yet!");}
++void IntInput::GetInputValue(bool* pvalue){_error_("not supported yet!");}/*{{{*/
+ /*}}}*/
+-/*FUNCTION IntInput::GetInputValue(int* pvalue){{{*/
+-void IntInput::GetInputValue(int* pvalue){
++void IntInput::GetInputValue(int* pvalue){/*{{{*/
+ 	*pvalue=value;
+ }
+ /*}}}*/
+-/*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue){{{*/
+-void IntInput::GetInputValue(IssmDouble* pvalue){
++void IntInput::GetInputValue(IssmDouble* pvalue){/*{{{*/
+ 	_error_("IntInput cannot return a IssmDouble in parallel");
+ }
+ /*}}}*/
+-/*FUNCTION IntInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){{{*/
+-void IntInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){_error_("not supported yet!");}
++void IntInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){_error_("not supported yet!");}/*{{{*/
+ /*}}}*/
+-/*FUNCTION IntInput::ChangeEnum{{{*/
+-void IntInput::ChangeEnum(int newenumtype){
++void IntInput::ChangeEnum(int newenumtype){/*{{{*/
+ 	this->enum_type=newenumtype;
+ }
+ /*}}}*/
+-/*FUNCTION IntInput::SquareMin{{{*/
+-void IntInput::SquareMin(IssmDouble* psquaremin,Parameters* parameters){
++void IntInput::SquareMin(IssmDouble* psquaremin,Parameters* parameters){/*{{{*/
+ 
+ 	/*square min of an integer is the square of the integer itself: */
+ 	*psquaremin=pow((IssmDouble)value,2);
+ }
+ /*}}}*/
+-/*FUNCTION IntInput::Scale{{{*/
+-void IntInput::Scale(IssmDouble scale_factor){
++void IntInput::Scale(IssmDouble scale_factor){/*{{{*/
+ 	IssmDouble dvalue=(IssmDouble)value*scale_factor;
+ 	value=reCast<int>(dvalue);
+ }
+ /*}}}*/
+-/*FUNCTION IntInput::AXPY{{{*/
+-void IntInput::AXPY(Input* xinput,IssmDouble scalar){
++void IntInput::AXPY(Input* xinput,IssmDouble scalar){/*{{{*/
+ 
+ 	IssmDouble dvalue;
+ 	IntInput*  xintinput=NULL;
+@@ -155,23 +136,20 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IntInput::Constrain{{{*/
+-void IntInput::Constrain(IssmDouble cm_min, IssmDouble cm_max){
++void IntInput::Constrain(IssmDouble cm_min, IssmDouble cm_max){/*{{{*/
+ 
+ 	if(!xIsNan<IssmDouble>(cm_min)) if (this->value<cm_min)this->value=reCast<int>(cm_min);
+ 	if(!xIsNan<IssmDouble>(cm_max)) if (this->value>cm_max)this->value=reCast<int>(cm_max);
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IntInput::GetVectorFromInputs{{{*/
+-void IntInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
++void IntInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){/*{{{*/
+ 
+ 	_error_("not supporte yet!");
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IntInput::Configure{{{*/
+-void IntInput::Configure(Parameters* parameters){
++void IntInput::Configure(Parameters* parameters){/*{{{*/
+ 	/*do nothing: */
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Inputs/BoolInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/BoolInput.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Inputs/BoolInput.cpp	(revision 18064)
+@@ -12,48 +12,40 @@
+ #include "../../shared/shared.h"
+ 
+ /*BoolInput constructors and destructor*/
+-/*FUNCTION BoolInput::BoolInput(){{{*/
+-BoolInput::BoolInput(){
++BoolInput::BoolInput(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION BoolInput::BoolInput(int in_enum_type,bool in_value){{{*/
+-BoolInput::BoolInput(int in_enum_type,bool in_value){
++BoolInput::BoolInput(int in_enum_type,bool in_value){/*{{{*/
+ 
+ 	enum_type=in_enum_type;
+ 	value=in_value;
+ }
+ /*}}}*/
+-/*FUNCTION BoolInput::~BoolInput(){{{*/
+-BoolInput::~BoolInput(){
++BoolInput::~BoolInput(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION BoolInput::Echo {{{*/
+-void BoolInput::Echo(void){
++void BoolInput::Echo(void){/*{{{*/
+ 	this->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION BoolInput::DeepEcho{{{*/
+-void BoolInput::DeepEcho(void){
++void BoolInput::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_(setw(15)<<"   BoolInput "<<setw(25)<<left<<EnumToStringx(this->enum_type)<<" "<<(value?"true":"false") << "\n");
+ }
+ /*}}}*/
+-/*FUNCTION BoolInput::Id{{{*/
+-int    BoolInput::Id(void){ return -1; }
++int    BoolInput::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION BoolInput::ObjectEnum{{{*/
+-int BoolInput::ObjectEnum(void){
++int BoolInput::ObjectEnum(void){/*{{{*/
+ 
+ 	return BoolInputEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION BoolInput::copy{{{*/
+-Object* BoolInput::copy() {
++Object* BoolInput::copy() {/*{{{*/
+ 
+ 	return new BoolInput(this->enum_type,this->value);
+ 
+@@ -61,15 +53,13 @@
+ /*}}}*/
+ 
+ /*BoolInput management*/
+-/*FUNCTION BoolInput::InstanceEnum{{{*/
+-int BoolInput::InstanceEnum(void){
++int BoolInput::InstanceEnum(void){/*{{{*/
+ 
+ 	return this->enum_type;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION BoolInput::SpawnTriaInput{{{*/
+-Input* BoolInput::SpawnTriaInput(int index1,int index2,int index3){
++Input* BoolInput::SpawnTriaInput(int index1,int index2,int index3){/*{{{*/
+ 
+ 		/*output*/
+ 		BoolInput* outinput=new BoolInput();
+@@ -83,8 +73,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION BoolInput::SpawnSegInput{{{*/
+-Input* BoolInput::SpawnSegInput(int index1,int index2){
++Input* BoolInput::SpawnSegInput(int index1,int index2){/*{{{*/
+ 
+ 		/*output*/
+ 		BoolInput* outinput=new BoolInput();
+@@ -100,38 +89,30 @@
+ /*}}}*/
+ 
+ /*Object functions*/
+-/*FUNCTION BoolInput::GetInputValue(bool* pvalue) {{{*/
+-void BoolInput::GetInputValue(bool* pvalue){
++void BoolInput::GetInputValue(bool* pvalue){/*{{{*/
+ 	*pvalue=value;
+ }
+ /*}}}*/
+-/*FUNCTION BoolInput::GetInputValue(int* pvalue){{{*/
+-void BoolInput::GetInputValue(int* pvalue){_error_("not supported yet!");}
++void BoolInput::GetInputValue(int* pvalue){_error_("not supported yet!");}/*{{{*/
+ /*}}}*/
+-/*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue){{{*/
+-void BoolInput::GetInputValue(IssmDouble* pvalue){_error_("not supported yet!");}
++void BoolInput::GetInputValue(IssmDouble* pvalue){_error_("not supported yet!");}/*{{{*/
+ /*}}}*/
+-/*FUNCTION BoolInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){{{*/
+-void BoolInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){_error_("not supported yet!");}
++void BoolInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){_error_("not supported yet!");}/*{{{*/
+ /*}}}*/
+-/*FUNCTION BoolInput::ChangeEnum{{{*/
+-void BoolInput::ChangeEnum(int newenumtype){
++void BoolInput::ChangeEnum(int newenumtype){/*{{{*/
+ 	this->enum_type=newenumtype;
+ }
+ /*}}}*/
+-/*FUNCTION BoolInput::SquareMin{{{*/
+-void BoolInput::SquareMin(IssmDouble* psquaremin,Parameters* parameters){
++void BoolInput::SquareMin(IssmDouble* psquaremin,Parameters* parameters){/*{{{*/
+ 	/*square of a bool is the bool itself: */
+ 	*psquaremin=value;
+ }
+ /*}}}*/
+-/*FUNCTION BoolInput::Scale{{{*/
+-void BoolInput::Scale(IssmDouble scale_factor){
++void BoolInput::Scale(IssmDouble scale_factor){/*{{{*/
+ 	/*a bool cannot be scaled: */
+ }
+ /*}}}*/
+-/*FUNCTION BoolInput::AXPY{{{*/
+-void BoolInput::AXPY(Input* xinput,IssmDouble scalar){
++void BoolInput::AXPY(Input* xinput,IssmDouble scalar){/*{{{*/
+ 
+ 	BoolInput*  xboolinput=NULL;
+ 
+@@ -151,22 +132,19 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION BoolInput::Extrude{{{*/
+-void BoolInput::Extrude(void){
++void BoolInput::Extrude(void){/*{{{*/
+ 
+ 	/*do nothing*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION BoolInput::GetVectorFromInputs{{{*/
+-void BoolInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
++void BoolInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){/*{{{*/
+ 
+ 	_error_("not supporte yet!");
+ 
+ }
+ /*}}}*/
+-/*FUNCTION BoolInput::Configure{{{*/
+-void BoolInput::Configure(Parameters* parameters){
++void BoolInput::Configure(Parameters* parameters){/*{{{*/
+ 	/*do nothing: */
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Inputs/TriaInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TriaInput.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Inputs/TriaInput.cpp	(revision 18064)
+@@ -12,13 +12,11 @@
+ #include "../../shared/shared.h"
+ 
+ /*TriaInput constructors and destructor*/
+-/*FUNCTION TriaInput::TriaInput(){{{*/
+-TriaInput::TriaInput(){
++TriaInput::TriaInput(){/*{{{*/
+ 	values = NULL;
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::TriaInput(int in_enum_type,IssmDouble* invalues,element_type_in){{{*/
+-TriaInput::TriaInput(int in_enum_type,IssmDouble* in_values,int element_type_in)
++TriaInput::TriaInput(int in_enum_type,IssmDouble* in_values,int element_type_in)/*{{{*/
+ 	:TriaRef(1)
+ {
+ 
+@@ -34,38 +32,32 @@
+ 	for(int i=0;i<this->NumberofNodes();i++) values[i]=in_values[i];
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::~TriaInput(){{{*/
+-TriaInput::~TriaInput(){
++TriaInput::~TriaInput(){/*{{{*/
+ 	xDelete<IssmDouble>(this->values);
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION TriaInput::Echo {{{*/
+-void TriaInput::Echo(void){
++void TriaInput::Echo(void){/*{{{*/
+ 	this->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::DeepEcho{{{*/
+-void TriaInput::DeepEcho(void){
++void TriaInput::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_(setw(15)<<"   TriaInput "<<setw(25)<<left<<EnumToStringx(this->enum_type)<<" [");
+ 	for(int i=0;i<this->NumberofNodes();i++) _printf_(" "<<this->values[i]);
+ 	_printf_("] ("<<EnumToStringx(this->element_type)<<")\n");
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::Id{{{*/
+-int    TriaInput::Id(void){ return -1; }
++int    TriaInput::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION TriaInput::ObjectEnum{{{*/
+-int TriaInput::ObjectEnum(void){
++int TriaInput::ObjectEnum(void){/*{{{*/
+ 
+ 	return TriaInputEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::copy{{{*/
+-Object* TriaInput::copy() {
++Object* TriaInput::copy() {/*{{{*/
+ 
+ 	return new TriaInput(this->enum_type,this->values,this->element_type);
+ 
+@@ -73,15 +65,13 @@
+ /*}}}*/
+ 
+ /*TriaInput management*/
+-/*FUNCTION TriaInput::InstanceEnum{{{*/
+-int TriaInput::InstanceEnum(void){
++int TriaInput::InstanceEnum(void){/*{{{*/
+ 
+ 	return this->enum_type;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::SpawnTriaInput{{{*/
+-Input* TriaInput::SpawnTriaInput(int index1,int index2,int index3){
++Input* TriaInput::SpawnTriaInput(int index1,int index2,int index3){/*{{{*/
+ 
+ 	/*output*/
+ 	TriaInput* outinput=NULL;
+@@ -94,8 +84,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::SpawnSegInput{{{*/
+-Input* TriaInput::SpawnSegInput(int index1,int index2){
++Input* TriaInput::SpawnSegInput(int index1,int index2){/*{{{*/
+ 
+ 	/*output*/
+ 	SegInput* outinput=NULL;
+@@ -120,8 +109,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::GetResultInterpolation{{{*/
+-int  TriaInput::GetResultInterpolation(void){
++int  TriaInput::GetResultInterpolation(void){/*{{{*/
+ 
+ 	if(this->element_type==P0Enum){
+ 		return P0Enum;
+@@ -130,15 +118,13 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::GetResultNumberOfNodes{{{*/
+-int  TriaInput::GetResultNumberOfNodes(void){
++int  TriaInput::GetResultNumberOfNodes(void){/*{{{*/
+ 
+ 	return this->NumberofNodes();
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::ResultToPatch{{{*/
+-void TriaInput::ResultToPatch(IssmDouble* values,int nodesperelement,int sid){
++void TriaInput::ResultToPatch(IssmDouble* values,int nodesperelement,int sid){/*{{{*/
+ 
+ 	int numnodes = this->NumberofNodes();
+ 
+@@ -152,8 +138,7 @@
+ /*}}}*/
+ 
+ /*Object functions*/
+-/*FUNCTION TriaInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){{{*/
+-void TriaInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){
++void TriaInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){/*{{{*/
+ 
+ 	/*Call TriaRef function*/
+ 	_assert_(gauss->Enum()==GaussTriaEnum);
+@@ -161,21 +146,18 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, Gauss* gauss){{{*/
+-void TriaInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, Gauss* gauss){
++void TriaInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, Gauss* gauss){/*{{{*/
+ 
+ 	/*Call TriaRef function*/
+ 	_assert_(gauss->Enum()==GaussTriaEnum);
+ 	TriaRef::GetInputDerivativeValue(p,&values[0],xyz_list,(GaussTria*)gauss);
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::ChangeEnum{{{*/
+-void TriaInput::ChangeEnum(int newenumtype){
++void TriaInput::ChangeEnum(int newenumtype){/*{{{*/
+ 	this->enum_type=newenumtype;
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::GetInputAverage{{{*/
+-void TriaInput::GetInputAverage(IssmDouble* pvalue){
++void TriaInput::GetInputAverage(IssmDouble* pvalue){/*{{{*/
+ 
+ 	int        numnodes  = this->NumberofNodes();
+ 	IssmDouble numnodesd = reCast<int,IssmDouble>(numnodes);
+@@ -187,8 +169,7 @@
+ 	*pvalue=value;
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::GetInputAllTimeAverages{{{*/
+-void TriaInput::GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){
++void TriaInput::GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){/*{{{*/
+ 
+ 	IssmDouble* outvalues=NULL;
+ 	IssmDouble* times=NULL;
+@@ -207,8 +188,7 @@
+ 	*pnumtimes=numtimes;
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::GetInputUpToCurrentTimeAverages{{{*/
+-void TriaInput::GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){
++void TriaInput::GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){/*{{{*/
+ 
+ 	IssmDouble* outvalues=NULL;
+ 	IssmDouble* times=NULL;
+@@ -229,8 +209,7 @@
+ /*}}}*/
+ 
+ /*Intermediary*/
+-/*FUNCTION TriaInput::SquareMin{{{*/
+-void TriaInput::SquareMin(IssmDouble* psquaremin,Parameters* parameters){
++void TriaInput::SquareMin(IssmDouble* psquaremin,Parameters* parameters){/*{{{*/
+ 
+ 	int        numnodes=this->NumberofNodes();
+ 	IssmDouble squaremin;
+@@ -244,15 +223,13 @@
+ 	*psquaremin=squaremin;
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::ContrainMin{{{*/
+-void TriaInput::ConstrainMin(IssmDouble minimum){
++void TriaInput::ConstrainMin(IssmDouble minimum){/*{{{*/
+ 
+ 	int numnodes = this->NumberofNodes();
+ 	for(int i=0;i<numnodes;i++) if (values[i]<minimum) values[i]=minimum;
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::InfinityNorm{{{*/
+-IssmDouble TriaInput::InfinityNorm(void){
++IssmDouble TriaInput::InfinityNorm(void){/*{{{*/
+ 
+ 	/*Output*/
+ 	IssmDouble norm=0.;
+@@ -262,8 +239,7 @@
+ 	return norm;
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::Max{{{*/
+-IssmDouble TriaInput::Max(void){
++IssmDouble TriaInput::Max(void){/*{{{*/
+ 
+ 	int  numnodes=this->NumberofNodes();
+ 	IssmDouble max=values[0];
+@@ -274,8 +250,7 @@
+ 	return max;
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::MaxAbs{{{*/
+-IssmDouble TriaInput::MaxAbs(void){
++IssmDouble TriaInput::MaxAbs(void){/*{{{*/
+ 
+ 	int  numnodes=this->NumberofNodes();
+ 	IssmDouble max=fabs(values[0]);
+@@ -286,8 +261,7 @@
+ 	return max;
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::Min{{{*/
+-IssmDouble TriaInput::Min(void){
++IssmDouble TriaInput::Min(void){/*{{{*/
+ 
+ 	const int  numnodes=this->NumberofNodes();
+ 	IssmDouble min=values[0];
+@@ -298,8 +272,7 @@
+ 	return min;
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::MinAbs{{{*/
+-IssmDouble TriaInput::MinAbs(void){
++IssmDouble TriaInput::MinAbs(void){/*{{{*/
+ 
+ 	const int  numnodes=this->NumberofNodes();
+ 	IssmDouble min=fabs(values[0]);
+@@ -310,22 +283,19 @@
+ 	return min;
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::Scale{{{*/
+-void TriaInput::Scale(IssmDouble scale_factor){
++void TriaInput::Scale(IssmDouble scale_factor){/*{{{*/
+ 
+ 	const int numnodes=this->NumberofNodes();
+ 	for(int i=0;i<numnodes;i++)values[i]=values[i]*scale_factor;
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::Set{{{*/
+-void TriaInput::Set(IssmDouble setvalue){
++void TriaInput::Set(IssmDouble setvalue){/*{{{*/
+ 
+ 	const int numnodes=this->NumberofNodes();
+ 	for(int i=0;i<numnodes;i++)values[i]=setvalue;
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::AXPY{{{*/
+-void TriaInput::AXPY(Input* xinput,IssmDouble scalar){
++void TriaInput::AXPY(Input* xinput,IssmDouble scalar){/*{{{*/
+ 
+ 	const int numnodes=this->NumberofNodes();
+ 	TriaInput*  xtriainput=NULL;
+@@ -340,8 +310,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::Constrain{{{*/
+-void TriaInput::Constrain(IssmDouble cm_min, IssmDouble cm_max){
++void TriaInput::Constrain(IssmDouble cm_min, IssmDouble cm_max){/*{{{*/
+ 
+ 	int i;
+ 	const int numnodes=this->NumberofNodes();
+@@ -351,13 +320,11 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::GetVectorFromInputs{{{*/
+-void TriaInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
++void TriaInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){/*{{{*/
+ 	const int numvertices=3;
+ 	vector->SetValues(numvertices,doflist,this->values,INS_VAL);
+ } /*}}}*/
+-/*FUNCTION TriaInput::PointwiseMin{{{*/
+-Input* TriaInput::PointwiseMin(Input* inputB){
++Input* TriaInput::PointwiseMin(Input* inputB){/*{{{*/
+ 
+ 	/*Ouput*/
+ 	TriaInput* outinput=NULL;
+@@ -388,8 +355,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::PointwiseMax{{{*/
+-Input* TriaInput::PointwiseMax(Input* inputB){
++Input* TriaInput::PointwiseMax(Input* inputB){/*{{{*/
+ 
+ 	/*Ouput*/
+ 	TriaInput* outinput=NULL;
+@@ -420,8 +386,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::PointwiseDivide{{{*/
+-Input* TriaInput::PointwiseDivide(Input* inputB){
++Input* TriaInput::PointwiseDivide(Input* inputB){/*{{{*/
+ 
+ 	/*Ouput*/
+ 	TriaInput* outinput=NULL;
+@@ -453,8 +418,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TriaInput::Configure{{{*/
+-void TriaInput::Configure(Parameters* parameters){
++void TriaInput::Configure(Parameters* parameters){/*{{{*/
+ 	/*do nothing: */
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Inputs/Inputs.cpp	(revision 18064)
+@@ -18,20 +18,17 @@
+ /*}}}*/
+ 
+ /*Object constructors and destructor*/
+-/*FUNCTION Inputs::Inputs(){{{*/
+-Inputs::Inputs(){
++Inputs::Inputs(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::~Inputs(){{{*/
+-Inputs::~Inputs(){
++Inputs::~Inputs(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object management*/
+-/*FUNCTION Inputs::GetInputValue(bool* pvalue,int enum-type){{{*/
+-void Inputs::GetInputValue(bool* pvalue,int enum_type){
++void Inputs::GetInputValue(bool* pvalue,int enum_type){/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Input* input=NULL;
+@@ -58,8 +55,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::GetInputValue(int* pvalue,int enum-type){{{*/
+-void Inputs::GetInputValue(int* pvalue,int enum_type){
++void Inputs::GetInputValue(int* pvalue,int enum_type){/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Input* input=NULL;
+@@ -86,8 +82,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::GetInputValue(IssmDouble* pvalue,int enum-type){{{*/
+-void Inputs::GetInputValue(IssmDouble* pvalue,int enum_type){
++void Inputs::GetInputValue(IssmDouble* pvalue,int enum_type){/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Input* input=NULL;
+@@ -114,8 +109,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::GetInputAverage{{{*/
+-void Inputs::GetInputAverage(IssmDouble* pvalue,int enum_type){
++void Inputs::GetInputAverage(IssmDouble* pvalue,int enum_type){/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Input* input=NULL;
+@@ -142,8 +136,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::AddInput{{{*/
+-int  Inputs::AddInput(Input* in_input){
++int  Inputs::AddInput(Input* in_input){/*{{{*/
+ 
+ 	/*First, go through dataset of inputs and check whether any input 
+ 	 * with the same name is already in. If so, erase the corresponding 
+@@ -168,8 +161,7 @@
+ 	return 1;
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::ChangeEnum{{{*/
+-void  Inputs::ChangeEnum(int oldenumtype,int newenumtype){
++void  Inputs::ChangeEnum(int oldenumtype,int newenumtype){/*{{{*/
+ 
+ 	/*Go through dataset of inputs and look for input with 
+ 	 * same enum as input enum, once found, just change its name */
+@@ -198,8 +190,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::ConstrainMin{{{*/
+-void  Inputs::ConstrainMin(int constrain_enum, IssmDouble minimum){
++void  Inputs::ConstrainMin(int constrain_enum, IssmDouble minimum){/*{{{*/
+ 
+ 	/*Find x and y inputs: */
+ 	Input* constrain_input=dynamic_cast<Input*>(this->GetInput(constrain_enum));
+@@ -211,8 +202,7 @@
+ 	constrain_input->ConstrainMin(minimum);
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::InfinityNorm{{{*/
+-IssmDouble Inputs::InfinityNorm(int enumtype){
++IssmDouble Inputs::InfinityNorm(int enumtype){/*{{{*/
+ 
+ 	/*Output*/
+ 	IssmDouble norm;
+@@ -232,8 +222,7 @@
+ 	return norm;
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::Max{{{*/
+-IssmDouble Inputs::Max(int enumtype){
++IssmDouble Inputs::Max(int enumtype){/*{{{*/
+ 
+ 	/*Output*/
+ 	IssmDouble max;
+@@ -253,8 +242,7 @@
+ 	return max;
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::MaxAbs{{{*/
+-IssmDouble Inputs::MaxAbs(int enumtype){
++IssmDouble Inputs::MaxAbs(int enumtype){/*{{{*/
+ 
+ 	/*Output*/
+ 	IssmDouble max;
+@@ -274,8 +262,7 @@
+ 	return max;
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::Min{{{*/
+-IssmDouble Inputs::Min(int enumtype){
++IssmDouble Inputs::Min(int enumtype){/*{{{*/
+ 
+ 	/*Output*/
+ 	IssmDouble min;
+@@ -295,8 +282,7 @@
+ 	return min;
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::MinAbs{{{*/
+-IssmDouble Inputs::MinAbs(int enumtype){
++IssmDouble Inputs::MinAbs(int enumtype){/*{{{*/
+ 
+ 	/*Output*/
+ 	IssmDouble min;
+@@ -316,8 +302,7 @@
+ 	return min;
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::GetInput{{{*/
+-Input* Inputs::GetInput(int enum_name){
++Input* Inputs::GetInput(int enum_name){/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Input* input=NULL;
+@@ -333,8 +318,7 @@
+ 	return NULL;
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::DeleteInput{{{*/
+-int  Inputs::DeleteInput(int enum_type){
++int  Inputs::DeleteInput(int enum_type){/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Input* input=NULL;
+@@ -353,8 +337,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::DuplicateInput{{{*/
+-void  Inputs::DuplicateInput(int original_enum,int new_enum){
++void  Inputs::DuplicateInput(int original_enum,int new_enum){/*{{{*/
+ 
+ 	/*Make a copy of the original input: */
+ 	Input* original=dynamic_cast<Input*>(this->GetInput(original_enum));
+@@ -368,8 +351,7 @@
+ 	this->AddInput(dynamic_cast<Input*>(copy));
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::SpawnTriaInputs{{{*/
+-Inputs* Inputs::SpawnTriaInputs(int index1,int index2,int index3){
++Inputs* Inputs::SpawnTriaInputs(int index1,int index2,int index3){/*{{{*/
+ 
+ 	/*Intermediary*/
+ 	vector<Object*>::iterator object;
+@@ -394,8 +376,7 @@
+ 	return newinputs;
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::SpawnSegInputs{{{*/
+-Inputs* Inputs::SpawnSegInputs(int index1,int index2){
++Inputs* Inputs::SpawnSegInputs(int index1,int index2){/*{{{*/
+ 
+ 	/*Intermediary*/
+ 	vector<Object*>::iterator object;
+@@ -420,8 +401,7 @@
+ 	return newinputs;
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::AXPY{{{*/
+-void  Inputs::AXPY(int inputy_enum, IssmDouble scalar, int inputx_enum){
++void  Inputs::AXPY(int inputy_enum, IssmDouble scalar, int inputx_enum){/*{{{*/
+ 
+ 	/*Find x and y inputs: */
+ 	Input* xinput=dynamic_cast<Input*>(this->GetInput(inputx_enum));
+@@ -435,8 +415,7 @@
+ 	yinput->AXPY(xinput,scalar);
+ }
+ /*}}}*/
+-/*FUNCTION Inputs::Configure{{{*/
+-void Inputs::Configure(Parameters* parameters){
++void Inputs::Configure(Parameters* parameters){/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 	Input* input=NULL;
+Index: ../trunk-jpl/src/c/classes/Inputs/PentaInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/PentaInput.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Inputs/PentaInput.cpp	(revision 18064)
+@@ -12,13 +12,11 @@
+ #include "../../shared/shared.h"
+ 
+ /*PentaInput constructors and destructor*/
+-/*FUNCTION PentaInput::PentaInput(){{{*/
+-PentaInput::PentaInput(){
++PentaInput::PentaInput(){/*{{{*/
+ 	values = NULL;
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::PentaInput(int in_enum_type,IssmDouble* values,int element_type){{{*/
+-PentaInput::PentaInput(int in_enum_type,IssmDouble* in_values,int element_type_in)
++PentaInput::PentaInput(int in_enum_type,IssmDouble* in_values,int element_type_in)/*{{{*/
+ 		:PentaRef(1)
+ {
+ 
+@@ -34,38 +32,32 @@
+ 	for(int i=0;i<this->NumberofNodes();i++) values[i]=in_values[i];
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::~PentaInput(){{{*/
+-PentaInput::~PentaInput(){
++PentaInput::~PentaInput(){/*{{{*/
+ 	xDelete<IssmDouble>(this->values);
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION PentaInput::Echo {{{*/
+-void PentaInput::Echo(void){
++void PentaInput::Echo(void){/*{{{*/
+ 	this->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::DeepEcho{{{*/
+-void PentaInput::DeepEcho(void){
++void PentaInput::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_(setw(15)<<"   PentaInput "<<setw(25)<<left<<EnumToStringx(this->enum_type)<<" [");
+ 	for(int i=0;i<this->NumberofNodes();i++) _printf_(" "<<this->values[i]);
+ 	_printf_("]\n");
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::Id{{{*/
+-int    PentaInput::Id(void){ return -1; }
++int    PentaInput::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION PentaInput::ObjectEnum{{{*/
+-int PentaInput::ObjectEnum(void){
++int PentaInput::ObjectEnum(void){/*{{{*/
+ 
+ 	return PentaInputEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::copy{{{*/
+-Object* PentaInput::copy() {
++Object* PentaInput::copy() {/*{{{*/
+ 
+ 	return new PentaInput(this->enum_type,this->values,this->element_type);
+ 
+@@ -73,15 +65,13 @@
+ /*}}}*/
+ 
+ /*PentaInput management*/
+-/*FUNCTION PentaInput::InstanceEnum{{{*/
+-int PentaInput::InstanceEnum(void){
++int PentaInput::InstanceEnum(void){/*{{{*/
+ 
+ 	return this->enum_type;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::SpawnTriaInput{{{*/
+-Input* PentaInput::SpawnTriaInput(int index1,int index2,int index3){
++Input* PentaInput::SpawnTriaInput(int index1,int index2,int index3){/*{{{*/
+ 
+ 	/*output*/
+ 	TriaInput* outinput=NULL;
+@@ -111,14 +101,12 @@
+ 	return outinput;
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::SpawnSegInput{{{*/
+-Input* PentaInput::SpawnSegInput(int index1,int index2){
++Input* PentaInput::SpawnSegInput(int index1,int index2){/*{{{*/
+ 
+ 	_error_("not supported");
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::GetResultInterpolation{{{*/
+-int  PentaInput::GetResultInterpolation(void){
++int  PentaInput::GetResultInterpolation(void){/*{{{*/
+ 
+ 	if(this->element_type==P0Enum){
+ 		return P0Enum;
+@@ -127,15 +115,13 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::GetResultNumberOfNodes{{{*/
+-int  PentaInput::GetResultNumberOfNodes(void){
++int  PentaInput::GetResultNumberOfNodes(void){/*{{{*/
+ 
+ 	return this->NumberofNodes();;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::ResultToPatch{{{*/
+-void PentaInput::ResultToPatch(IssmDouble* values,int nodesperelement,int sid){
++void PentaInput::ResultToPatch(IssmDouble* values,int nodesperelement,int sid){/*{{{*/
+ 
+ 	int numnodes = this->NumberofNodes();
+ 
+@@ -149,8 +135,7 @@
+ /*}}}*/
+ 
+ /*Object functions*/
+-/*FUNCTION PentaInput::GetInputValue(IssmDouble* pvalue){{{*/
+-void PentaInput::GetInputValue(IssmDouble* pvalue){
++void PentaInput::GetInputValue(IssmDouble* pvalue){/*{{{*/
+ 
+ 	if(this->element_type==P0Enum){
+ 		pvalue=&values[0];
+@@ -158,8 +143,7 @@
+ 	else _error_("not implemented yet");
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){{{*/
+-void PentaInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){
++void PentaInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){/*{{{*/
+ 
+ 	/*Call PentaRef function*/
+ 	_assert_(gauss->Enum()==GaussPentaEnum);
+@@ -167,21 +151,18 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, Gauss* gauss){{{*/
+-void PentaInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list,Gauss* gauss){
++void PentaInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+ 
+ 	/*Call PentaRef function*/
+ 	_assert_(gauss->Enum()==GaussPentaEnum);
+ 	PentaRef::GetInputDerivativeValue(p,&values[0],xyz_list,(GaussPenta*)gauss);
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::ChangeEnum{{{*/
+-void PentaInput::ChangeEnum(int newenumtype){
++void PentaInput::ChangeEnum(int newenumtype){/*{{{*/
+ 	this->enum_type=newenumtype;
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::GetInputAverage{{{*/
+-void PentaInput::GetInputAverage(IssmDouble* pvalue){
++void PentaInput::GetInputAverage(IssmDouble* pvalue){/*{{{*/
+ 
+ 	int        numnodes  = this->NumberofNodes();
+ 	IssmDouble numnodesd = reCast<int,IssmDouble>(numnodes);
+@@ -195,8 +176,7 @@
+ /*}}}*/
+ 
+ /*Intermediary*/
+-/*FUNCTION PentaInput::SquareMin{{{*/
+-void PentaInput::SquareMin(IssmDouble* psquaremin,Parameters* parameters){
++void PentaInput::SquareMin(IssmDouble* psquaremin,Parameters* parameters){/*{{{*/
+ 
+ 	int        numnodes=this->NumberofNodes();
+ 	IssmDouble squaremin;
+@@ -210,15 +190,13 @@
+ 	*psquaremin=squaremin;
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::ConstrainMin{{{*/
+-void PentaInput::ConstrainMin(IssmDouble minimum){
++void PentaInput::ConstrainMin(IssmDouble minimum){/*{{{*/
+ 
+ 	int numnodes = this->NumberofNodes();
+ 	for(int i=0;i<numnodes;i++) if (values[i]<minimum) values[i]=minimum;
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::InfinityNorm{{{*/
+-IssmDouble PentaInput::InfinityNorm(void){
++IssmDouble PentaInput::InfinityNorm(void){/*{{{*/
+ 
+ 	/*Output*/
+ 	IssmDouble norm=0.;
+@@ -228,8 +206,7 @@
+ 	return norm;
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::Max{{{*/
+-IssmDouble PentaInput::Max(void){
++IssmDouble PentaInput::Max(void){/*{{{*/
+ 
+ 	int  numnodes=this->NumberofNodes();
+ 	IssmDouble max=values[0];
+@@ -240,8 +217,7 @@
+ 	return max;
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::MaxAbs{{{*/
+-IssmDouble PentaInput::MaxAbs(void){
++IssmDouble PentaInput::MaxAbs(void){/*{{{*/
+ 
+ 	int  numnodes=this->NumberofNodes();
+ 	IssmDouble max=fabs(values[0]);
+@@ -252,8 +228,7 @@
+ 	return max;
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::Min{{{*/
+-IssmDouble PentaInput::Min(void){
++IssmDouble PentaInput::Min(void){/*{{{*/
+ 
+ 	const int  numnodes=this->NumberofNodes();
+ 	IssmDouble min=values[0];
+@@ -264,8 +239,7 @@
+ 	return min;
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::MinAbs{{{*/
+-IssmDouble PentaInput::MinAbs(void){
++IssmDouble PentaInput::MinAbs(void){/*{{{*/
+ 
+ 	const int  numnodes=this->NumberofNodes();
+ 	IssmDouble min=fabs(values[0]);
+@@ -276,15 +250,13 @@
+ 	return min;
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::Scale{{{*/
+-void PentaInput::Scale(IssmDouble scale_factor){
++void PentaInput::Scale(IssmDouble scale_factor){/*{{{*/
+ 
+ 	const int numnodes=this->NumberofNodes();
+ 	for(int i=0;i<numnodes;i++)values[i]=values[i]*scale_factor;
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::AXPY{{{*/
+-void PentaInput::AXPY(Input* xinput,IssmDouble scalar){
++void PentaInput::AXPY(Input* xinput,IssmDouble scalar){/*{{{*/
+ 
+ 	const int numnodes=this->NumberofNodes();
+ 	PentaInput* xpentainput=NULL;
+@@ -305,8 +277,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::Constrain{{{*/
+-void PentaInput::Constrain(IssmDouble cm_min, IssmDouble cm_max){
++void PentaInput::Constrain(IssmDouble cm_min, IssmDouble cm_max){/*{{{*/
+ 
+ 	int i;
+ 	const int numnodes=this->NumberofNodes();
+@@ -316,8 +287,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::Extrude{{{*/
+-void PentaInput::Extrude(void){
++void PentaInput::Extrude(void){/*{{{*/
+ 
+ 	switch(this->element_type){
+ 		case P1Enum:
+@@ -328,8 +298,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::VerticallyIntegrate{{{*/
+-void PentaInput::VerticallyIntegrate(Input* thickness_input){
++void PentaInput::VerticallyIntegrate(Input* thickness_input){/*{{{*/
+ 
+ 	IssmDouble thickness;
+ 	IssmDouble value=0.;
+@@ -359,8 +328,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::PointwiseDivide{{{*/
+-Input* PentaInput::PointwiseDivide(Input* inputB){
++Input* PentaInput::PointwiseDivide(Input* inputB){/*{{{*/
+ 
+ 	/*Ouput*/
+ 	PentaInput* outinput=NULL;
+@@ -392,8 +360,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::PointwiseMin{{{*/
+-Input* PentaInput::PointwiseMin(Input* inputB){
++Input* PentaInput::PointwiseMin(Input* inputB){/*{{{*/
+ 
+ 	/*Ouput*/
+ 	PentaInput* outinput=NULL;
+@@ -423,8 +390,7 @@
+ 	return outinput;
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::PointwiseMax{{{*/
+-Input* PentaInput::PointwiseMax(Input* inputB){
++Input* PentaInput::PointwiseMax(Input* inputB){/*{{{*/
+ 
+ 	/*Ouput*/
+ 	PentaInput* outinput=NULL;
+@@ -454,13 +420,11 @@
+ 	return outinput;
+ }
+ /*}}}*/
+-/*FUNCTION PentaInput::GetVectorFromInputs{{{*/
+-void PentaInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
++void PentaInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){/*{{{*/
+ 	const int numvertices=6;
+ 	vector->SetValues(numvertices,doflist,this->values,INS_VAL);
+ } /*}}}*/
+-/*FUNCTION PentaInput::Configure{{{*/
+-void PentaInput::Configure(Parameters* parameters){
++void PentaInput::Configure(Parameters* parameters){/*{{{*/
+ 	/*do nothing: */
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 18064)
+@@ -13,8 +13,7 @@
+ /*}}}*/
+ 
+ /*TransientInput constructors and destructor*/
+-/*FUNCTION TransientInput::TransientInput(){{{*/
+-TransientInput::TransientInput(){
++TransientInput::TransientInput(){/*{{{*/
+ 
+ 	enum_type=UNDEF;
+ 	inputs=NULL;
+@@ -24,8 +23,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::TransientInput(int in_enum_type){{{*/
+-TransientInput::TransientInput(int in_enum_type)
++TransientInput::TransientInput(int in_enum_type)/*{{{*/
+ {
+ 	/*Set Enum*/
+ 	enum_type=in_enum_type;
+@@ -38,8 +36,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::TransientInput(int in_enum_type,IssmDouble* timesin,int N){{{*/
+-TransientInput::TransientInput(int in_enum_type,IssmDouble* timesin,int N){
++TransientInput::TransientInput(int in_enum_type,IssmDouble* timesin,int N){/*{{{*/
+ 
+ 	/*Set Enum*/
+ 	enum_type=in_enum_type;
+@@ -53,8 +50,7 @@
+ 	this->parameters=NULL;
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::~TransientInput{{{*/
+-TransientInput::~TransientInput(){
++TransientInput::~TransientInput(){/*{{{*/
+ 	xDelete(this->timesteps);
+ 	this->timesteps=NULL;
+ 	this->numtimesteps=0;
+@@ -65,13 +61,11 @@
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION TransientInput::Echo {{{*/
+-void TransientInput::Echo(void){
++void TransientInput::Echo(void){/*{{{*/
+ 	this->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::DeepEcho{{{*/
+-void TransientInput::DeepEcho(void){
++void TransientInput::DeepEcho(void){/*{{{*/
+ 
+ 	int i;
+ 
+@@ -85,18 +79,15 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::Id{{{*/
+-int    TransientInput::Id(void){ return -1; }
++int    TransientInput::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION TransientInput::ObjectEnum{{{*/
+-int TransientInput::ObjectEnum(void){
++int TransientInput::ObjectEnum(void){/*{{{*/
+ 
+ 	return TransientInputEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::copy{{{*/
+-Object* TransientInput::copy() {
++Object* TransientInput::copy() {/*{{{*/
+ 
+ 	TransientInput* output=NULL;
+ 
+@@ -114,15 +105,13 @@
+ /*}}}*/
+ 
+ /*TransientInput management*/
+-/*FUNCTION TransientInput::InstanceEnum{{{*/
+-int TransientInput::InstanceEnum(void){
++int TransientInput::InstanceEnum(void){/*{{{*/
+ 
+ 	return this->enum_type;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::SpawnTriaInput{{{*/
+-Input* TransientInput::SpawnTriaInput(int index1,int index2,int index3){
++Input* TransientInput::SpawnTriaInput(int index1,int index2,int index3){/*{{{*/
+ 
+ 	/*output*/
+ 	TransientInput* outinput=NULL;
+@@ -141,8 +130,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::SpawnSegInput{{{*/
+-Input* TransientInput::SpawnSegInput(int index1,int index2){
++Input* TransientInput::SpawnSegInput(int index1,int index2){/*{{{*/
+ 
+ 	/*output*/
+ 	TransientInput* outinput=NULL;
+@@ -163,8 +151,7 @@
+ /*}}}*/
+ 
+ /*Object functions*/
+-/*FUNCTION TransientInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){{{*/
+-void TransientInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){
++void TransientInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){/*{{{*/
+ 	IssmDouble time;
+ 
+ 	/*First, recover current time from parameters: */
+@@ -179,8 +166,7 @@
+ 	delete input;
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss,IssmDouble time){{{*/
+-void TransientInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss,IssmDouble time){
++void TransientInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss,IssmDouble time){/*{{{*/
+ 
+ 	/*Retrieve interpolated values for this time step: */
+ 	Input* input=GetTimeInput(time);
+@@ -191,8 +177,7 @@
+ 	delete input;
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, Gauss* gauss){{{*/
+-void TransientInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, Gauss* gauss){
++void TransientInput::GetInputDerivativeValue(IssmDouble* p, IssmDouble* xyz_list, Gauss* gauss){/*{{{*/
+ 
+ 	IssmDouble time;
+ 
+@@ -208,13 +193,11 @@
+ 	delete input;
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::ChangeEnum{{{*/
+-void TransientInput::ChangeEnum(int newenumtype){
++void TransientInput::ChangeEnum(int newenumtype){/*{{{*/
+ 	this->enum_type=newenumtype;
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::GetInputAverage{{{*/
+-void TransientInput::GetInputAverage(IssmDouble* pvalue){
++void TransientInput::GetInputAverage(IssmDouble* pvalue){/*{{{*/
+ 
+ 	IssmDouble time;
+ 
+@@ -231,8 +214,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::GetInputAllTimeAverages{{{*/
+-void TransientInput::GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){
++void TransientInput::GetInputAllTimeAverages(IssmDouble** pvalues,IssmDouble** ptimes, int* pnumtimes){/*{{{*/
+ 
+ 	int i;
+ 	IssmDouble* times=NULL;
+@@ -253,8 +235,7 @@
+ 	*pnumtimes=numtimesteps;
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::GetInputUpToCurrentTimeAverages{{{*/
+-void TransientInput::GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){
++void TransientInput::GetInputUpToCurrentTimeAverages(IssmDouble** pvalues, IssmDouble** ptimes, int* pnumtimes, IssmDouble currenttime){/*{{{*/
+ 
+ 	int         i;
+ 	IssmDouble *times  = NULL;
+@@ -298,8 +279,7 @@
+ /*}}}*/
+ 
+ /*Intermediary*/
+-/*FUNCTION TransientInput::AddTimeInput{{{*/
+-void TransientInput::AddTimeInput(Input* input,IssmDouble time){
++void TransientInput::AddTimeInput(Input* input,IssmDouble time){/*{{{*/
+ 
+ 	/*insert values at time step: */
+ 	if (this->numtimesteps>0 && time<=this->timesteps[this->numtimesteps-1]) _error_("timestep values must increase sequentially");
+@@ -327,16 +307,14 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::AddTimeInput{{{*/
+-void TransientInput::AddTimeInput(Input* input){
++void TransientInput::AddTimeInput(Input* input){/*{{{*/
+ 
+ 	_assert_(this->inputs->Size()<this->numtimesteps);
+ 	inputs->AddObject(input);
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::GetResultInterpolation{{{*/
+-int TransientInput::GetResultInterpolation(void){
++int TransientInput::GetResultInterpolation(void){/*{{{*/
+ 
+ 	IssmDouble time;
+ 	int        output;
+@@ -351,8 +329,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::GetResultNumberOfNodes{{{*/
+-int TransientInput::GetResultNumberOfNodes(void){
++int TransientInput::GetResultNumberOfNodes(void){/*{{{*/
+ 
+ 	IssmDouble time;
+ 	int        output;
+@@ -367,16 +344,14 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::Extrude{{{*/
+-void TransientInput::Extrude(void){
++void TransientInput::Extrude(void){/*{{{*/
+ 
+ 	for(int i=0;i<this->numtimesteps;i++){
+ 		((Input*)this->inputs->GetObjectByOffset(i))->Extrude();
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::SquareMin{{{*/
+-void TransientInput::SquareMin(IssmDouble* psquaremin,Parameters* parameters){
++void TransientInput::SquareMin(IssmDouble* psquaremin,Parameters* parameters){/*{{{*/
+ 
+ 	IssmDouble time;
+ 
+@@ -393,8 +368,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::InfinityNorm{{{*/
+-IssmDouble TransientInput::InfinityNorm(void){
++IssmDouble TransientInput::InfinityNorm(void){/*{{{*/
+ 
+ 	IssmDouble time;
+ 	IssmDouble infnorm;
+@@ -413,8 +387,7 @@
+ 	return infnorm;
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::Max{{{*/
+-IssmDouble TransientInput::Max(void){
++IssmDouble TransientInput::Max(void){/*{{{*/
+ 
+ 	IssmDouble time;
+ 	IssmDouble max;
+@@ -433,8 +406,7 @@
+ 	return max;
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::MaxAbs{{{*/
+-IssmDouble TransientInput::MaxAbs(void){
++IssmDouble TransientInput::MaxAbs(void){/*{{{*/
+ 
+ 	IssmDouble time;
+ 	IssmDouble maxabs;
+@@ -454,8 +426,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::Min{{{*/
+-IssmDouble TransientInput::Min(void){
++IssmDouble TransientInput::Min(void){/*{{{*/
+ 
+ 	IssmDouble time;
+ 	IssmDouble min;
+@@ -475,8 +446,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::MinAbs{{{*/
+-IssmDouble TransientInput::MinAbs(void){
++IssmDouble TransientInput::MinAbs(void){/*{{{*/
+ 
+ 	IssmDouble time;
+ 	IssmDouble minabs;
+@@ -495,8 +465,7 @@
+ 	return minabs;
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::GetVectorFromInputs{{{*/
+-void TransientInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
++void TransientInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){/*{{{*/
+ 
+ 	IssmDouble time;
+ 
+@@ -512,8 +481,7 @@
+ 	delete input;
+ 
+ } /*}}}*/
+-/*FUNCTION TransientInput::GetTimeInput{{{*/
+-Input* TransientInput::GetTimeInput(IssmDouble intime){
++Input* TransientInput::GetTimeInput(IssmDouble intime){/*{{{*/
+ 
+ 	IssmDouble deltat;
+ 	IssmDouble alpha1,alpha2;
+@@ -562,8 +530,7 @@
+ 	return input;
+ }
+ /*}}}*/
+-/*FUNCTION TransientInput::Configure{{{*/
+-void TransientInput::Configure(Parameters* parameters){
++void TransientInput::Configure(Parameters* parameters){/*{{{*/
+ 	this->parameters=parameters;
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Inputs/DoubleInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/DoubleInput.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Inputs/DoubleInput.cpp	(revision 18064)
+@@ -12,48 +12,40 @@
+ #include "../../shared/shared.h"
+ 
+ /*DoubleInput constructors and destructor*/
+-/*FUNCTION DoubleInput::DoubleInput(){{{*/
+-DoubleInput::DoubleInput(){
++DoubleInput::DoubleInput(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::DoubleInput(IssmDouble value){{{*/
+-DoubleInput::DoubleInput(int in_enum_type,IssmDouble in_value){
++DoubleInput::DoubleInput(int in_enum_type,IssmDouble in_value){/*{{{*/
+ 
+ 	enum_type=in_enum_type;
+ 	value=in_value;
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::~DoubleInput(){{{*/
+-DoubleInput::~DoubleInput(){
++DoubleInput::~DoubleInput(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-		/*FUNCTION DoubleInput::Echo {{{*/
+-void DoubleInput::Echo(void){
++void DoubleInput::Echo(void){/*{{{*/
+ 	this->DeepEcho();
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::DeepEcho{{{*/
+-void DoubleInput::DeepEcho(void){
++void DoubleInput::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_(setw(15)<<"   DoubleInput "<<setw(25)<<left<<EnumToStringx(this->enum_type)<<" "<<this->value<<"\n");
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::Id{{{*/
+-int    DoubleInput::Id(void){ return -1; }
++int    DoubleInput::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION DoubleInput::ObjectEnum{{{*/
+-int DoubleInput::ObjectEnum(void){
++int DoubleInput::ObjectEnum(void){/*{{{*/
+ 
+ 	return DoubleInputEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::copy{{{*/
+-Object* DoubleInput::copy() {
++Object* DoubleInput::copy() {/*{{{*/
+ 
+ 	return new DoubleInput(this->enum_type,this->value);
+ 
+@@ -61,15 +53,13 @@
+ /*}}}*/
+ 
+ /*DoubleInput management*/
+-/*FUNCTION DoubleInput::InstanceEnum{{{*/
+-int DoubleInput::InstanceEnum(void){
++int DoubleInput::InstanceEnum(void){/*{{{*/
+ 
+ 	return this->enum_type;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::SpawnTriaInput{{{*/
+-Input* DoubleInput::SpawnTriaInput(int index1,int index2,int index3){
++Input* DoubleInput::SpawnTriaInput(int index1,int index2,int index3){/*{{{*/
+ 
+ 	/*output*/
+ 	DoubleInput* outinput=new DoubleInput();
+@@ -83,8 +73,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::SpawnSegInput{{{*/
+-Input* DoubleInput::SpawnSegInput(int index1,int index2){
++Input* DoubleInput::SpawnSegInput(int index1,int index2){/*{{{*/
+ 
+ 	/*output*/
+ 	DoubleInput* outinput=new DoubleInput();
+@@ -100,52 +89,43 @@
+ /*}}}*/
+ 
+ /*Object functions*/
+-/*FUNCTION DoubleInput::GetInputValue(bool* pvalue) {{{*/
+-void DoubleInput::GetInputValue(bool* pvalue){
++void DoubleInput::GetInputValue(bool* pvalue){/*{{{*/
+ 	_error_("Double input of enum " << EnumToStringx(enum_type) << " cannot return a boolean");
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::GetInputValue(int* pvalue){{{*/
+-void DoubleInput::GetInputValue(int* pvalue){
++void DoubleInput::GetInputValue(int* pvalue){/*{{{*/
+ 	_error_("Double input of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return an integer");
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::GetInputValue(IssmDouble* pvalue){{{*/
+-void DoubleInput::GetInputValue(IssmDouble* pvalue){
++void DoubleInput::GetInputValue(IssmDouble* pvalue){/*{{{*/
+ 
+ 	/*return value*/
+ 	*pvalue=value;
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){{{*/
+-void DoubleInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){*pvalue=this->value;}
++void DoubleInput::GetInputValue(IssmDouble* pvalue,Gauss* gauss){*pvalue=this->value;}/*{{{*/
+ /*}}}*/
+-/*FUNCTION DoubleInput::ChangeEnum{{{*/
+-void DoubleInput::ChangeEnum(int newenumtype){
++void DoubleInput::ChangeEnum(int newenumtype){/*{{{*/
+ 	this->enum_type=newenumtype;
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::SquareMin{{{*/
+-void DoubleInput::SquareMin(IssmDouble* psquaremin,Parameters* parameters){
++void DoubleInput::SquareMin(IssmDouble* psquaremin,Parameters* parameters){/*{{{*/
+ 
+ 	/*square min of a IssmDouble is the square of the IssmDouble itself: */
+ 	*psquaremin=pow(value,2);
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::Scale{{{*/
+-void DoubleInput::Scale(IssmDouble scale_factor){
++void DoubleInput::Scale(IssmDouble scale_factor){/*{{{*/
+ 	value=value*scale_factor;
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::ConstrainMin{{{*/
+-void DoubleInput::ConstrainMin(IssmDouble minimum){
++void DoubleInput::ConstrainMin(IssmDouble minimum){/*{{{*/
+ 	if (value<minimum) value=minimum;
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::AXPY{{{*/
+-void DoubleInput::AXPY(Input* xinput,IssmDouble scalar){
++void DoubleInput::AXPY(Input* xinput,IssmDouble scalar){/*{{{*/
+ 
+ 	DoubleInput*  xIssmDoubleinput=NULL;
+ 
+@@ -165,48 +145,40 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::Constrain{{{*/
+-void DoubleInput::Constrain(IssmDouble cm_min, IssmDouble cm_max){
++void DoubleInput::Constrain(IssmDouble cm_min, IssmDouble cm_max){/*{{{*/
+ 
+ 	if(!xIsNan<IssmDouble>(cm_min)) if (this->value<cm_min)this->value=cm_min;
+ 	if(!xIsNan<IssmDouble>(cm_max)) if (this->value>cm_max)this->value=cm_max;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::Max{{{*/
+-IssmDouble DoubleInput::Max(void){
++IssmDouble DoubleInput::Max(void){/*{{{*/
+ 	return this->value;
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::MaxAbs{{{*/
+-IssmDouble DoubleInput::MaxAbs(void){
++IssmDouble DoubleInput::MaxAbs(void){/*{{{*/
+ 	return fabs(this->value);
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::Min{{{*/
+-IssmDouble DoubleInput::Min(void){
++IssmDouble DoubleInput::Min(void){/*{{{*/
+ 	return this->value;
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::MinAbs{{{*/
+-IssmDouble DoubleInput::MinAbs(void){
++IssmDouble DoubleInput::MinAbs(void){/*{{{*/
+ 	return fabs(this->value);
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::GetVectorFromInputs{{{*/
+-void DoubleInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
++void DoubleInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){/*{{{*/
+ 
+ 	_error_("not supporte yet!");
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::GetInputAverage{{{*/
+-void DoubleInput::GetInputAverage(IssmDouble* pvalue){
++void DoubleInput::GetInputAverage(IssmDouble* pvalue){/*{{{*/
+ 	*pvalue=value;
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::VerticallyIntegrate{{{*/
+-void DoubleInput::VerticallyIntegrate(Input* thickness_input){
++void DoubleInput::VerticallyIntegrate(Input* thickness_input){/*{{{*/
+ 
+ 	/*Intermediaries*/
+ 	IssmDouble thickness_value;
+@@ -227,8 +199,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::PointwiseDivide{{{*/
+-Input* DoubleInput::PointwiseDivide(Input* inputB){
++Input* DoubleInput::PointwiseDivide(Input* inputB){/*{{{*/
+ 
+ 	/*Ouput*/
+ 	DoubleInput* outinput=NULL;
+@@ -247,8 +218,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::PointwiseMin{{{*/
+-Input* DoubleInput::PointwiseMin(Input* input){
++Input* DoubleInput::PointwiseMin(Input* input){/*{{{*/
+ 
+ 	/*Ouput*/
+ 	DoubleInput* outinput=NULL;
+@@ -268,8 +238,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::PointwiseMax{{{*/
+-Input* DoubleInput::PointwiseMax(Input* input){
++Input* DoubleInput::PointwiseMax(Input* input){/*{{{*/
+ 
+ 	/*Ouput*/
+ 	DoubleInput* outinput=NULL;
+@@ -289,8 +258,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION DoubleInput::Configure{{{*/
+-void DoubleInput::Configure(Parameters* parameters){
++void DoubleInput::Configure(Parameters* parameters){/*{{{*/
+ 	/*do nothing: */
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/IndependentObject.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/IndependentObject.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/IndependentObject.cpp	(revision 18064)
+@@ -13,15 +13,13 @@
+ #include "IoModel.h"
+ 
+ /*IndependentObject constructors and destructor*/
+-/*FUNCTION IndependentObject::IndependentObject(){{{*/
+-IndependentObject::IndependentObject(){
++IndependentObject::IndependentObject(){/*{{{*/
+ 	this->name=NoneEnum;
+ 	this->type=0;
+ 	this->numberofindependents=0;
+ }
+ /*}}}*/
+-/*FUNCTION IndependentObject::IndependentObject(int in_name, int in_type){{{*/
+-IndependentObject::IndependentObject(int in_name, int in_type){
++IndependentObject::IndependentObject(int in_name, int in_type){/*{{{*/
+ 
+ 	this->numberofindependents=0;
+ 	this->name=in_name;
+@@ -30,14 +28,12 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IndependentObject::~IndependentObject() {{{*/
+-IndependentObject::~IndependentObject(){ //destructor
++IndependentObject::~IndependentObject(){ //destructor/*{{{*/
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION IndependentObject::Echo{{{*/
+-void IndependentObject::Echo(void){
++void IndependentObject::Echo(void){/*{{{*/
+ 
+ 	_printf_("IndependentObject:\n");
+ 	_printf_("   name: " << EnumToStringx(this->name) << "\n");
+@@ -50,23 +46,19 @@
+ 	_printf_("   numberofindependents: " << this->numberofindependents << "\n");
+ }
+ /*}}}*/
+-/*FUNCTION IndependentObject::DeepEcho{{{*/
+-void IndependentObject::DeepEcho(void){
++void IndependentObject::DeepEcho(void){/*{{{*/
+ 	this->Echo();
+ }
+ /*}}}*/
+-/*FUNCTION IndependentObject::Id{{{*/
+-int    IndependentObject::Id(void){ return -1; }
++int    IndependentObject::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION IndependentObject::ObjectEnum{{{*/
+-int IndependentObject::ObjectEnum(void){
++int IndependentObject::ObjectEnum(void){/*{{{*/
+ 
+ 	return IndependentObjectEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IndependentObject::copy{{{*/
+-Object* IndependentObject::copy(void) { 
++Object* IndependentObject::copy(void) { /*{{{*/
+ 
+ 	IndependentObject* object=new IndependentObject();
+ 	object->name=this->name;
+@@ -77,8 +69,7 @@
+ } /*}}}*/
+ 
+ /*IndependentObject methods: */
+-/*FUNCTION IndependentObject::FetchIndependent{{{*/
+-void IndependentObject::FetchIndependent(IoModel* iomodel){
++void IndependentObject::FetchIndependent(IoModel* iomodel){/*{{{*/
+ 
+ 	int my_rank;
+ 	FILE* fid=NULL;
+@@ -182,14 +173,12 @@
+ 	#endif
+ }
+ /*}}}*/
+-/*FUNCTION IndependentObject::NumIndependents{{{*/
+-int  IndependentObject::NumIndependents(void){
++int  IndependentObject::NumIndependents(void){/*{{{*/
+ 
+ 	return this->numberofindependents;;
+ }
+ /*}}}*/
+-/*FUNCTION IndependentObject::FillIndependents{{{*/
+-void IndependentObject::FillIndependents(IssmDouble** data, IssmDouble* xp){
++void IndependentObject::FillIndependents(IssmDouble** data, IssmDouble* xp){/*{{{*/
+ 
+ 	int i;
+ 
+Index: ../trunk-jpl/src/c/classes/Node.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Node.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Node.cpp	(revision 18064)
+@@ -16,13 +16,11 @@
+ /*}}}*/
+ 
+ /*Node constructors and destructors:*/
+-/*FUNCTION Node::Node() default constructor {{{*/
+-Node::Node(){
++Node::Node(){/*{{{*/
+ 	this->approximation=0;
+ }
+ /*}}}*/
+-/*FUNCTION Node::Node(int node_id,int node_sid,int node_lid,int io_index, IoModel* iomodel,int analysis_enum,int approximation) {{{*/
+-Node::Node(int node_id,int node_sid,int node_lid,int io_index, IoModel* iomodel,int analysis_enum,int in_approximation){
++Node::Node(int node_id,int node_sid,int node_lid,int io_index, IoModel* iomodel,int analysis_enum,int in_approximation){/*{{{*/
+ 
+ 	/*Intermediary*/
+ 	int k,l;
+@@ -122,15 +120,13 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Node::~Node(){{{*/
+-Node::~Node(){
++Node::~Node(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION Node::Echo{{{*/
+-void Node::Echo(void){
++void Node::Echo(void){/*{{{*/
+ 
+ 	_printf_("Node:\n");
+ 	_printf_("   id : " << id << "\n");
+@@ -142,8 +138,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Node::DeepEcho{{{*/
+-void Node::DeepEcho(void){
++void Node::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_("Node:\n");
+ 	_printf_("   id: " << id << "\n");
+@@ -155,11 +150,9 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Node::Id{{{*/
+-int    Node::Id(void){ return id; }
++int  Node::Id(void){ return id; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION Node::ObjectEnum{{{*/
+-int Node::ObjectEnum(void){
++int  Node::ObjectEnum(void){/*{{{*/
+ 
+ 	return NodeEnum;
+ 
+@@ -167,8 +160,7 @@
+ /*}}}*/
+ 
+ /*Node management:*/
+-/*FUNCTION Node::GetDof {{{*/
+-int   Node::GetDof(int dofindex,int setenum){
++int  Node::GetDof(int dofindex,int setenum){/*{{{*/
+ 
+ 	_assert_(!this->indexingupdate);
+ 	if(setenum==GsetEnum){
+@@ -186,8 +178,7 @@
+ 	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ 
+ } /*}}}*/
+-/*FUNCTION Node::GetDofList{{{*/
+-void  Node::GetDofList(int* outdoflist,int approximation_enum,int setenum){
++void Node::GetDofList(int* outdoflist,int approximation_enum,int setenum){/*{{{*/
+ 	int i;
+ 	int count=0;
+ 	int count2=0;
+@@ -250,8 +241,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Node::GetLocalDofList{{{*/
+-void  Node::GetLocalDofList(int* outdoflist,int approximation_enum,int setenum){
++void Node::GetLocalDofList(int* outdoflist,int approximation_enum,int setenum){/*{{{*/
+ 	int i;
+ 	int count=0;
+ 	int count2=0;
+@@ -351,34 +341,29 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Node::Sid{{{*/
+-int Node::Sid(void){
++int  Node::Sid(void){/*{{{*/
+ 	return sid; 
+ }
+ /*}}}*/
+-/*FUNCTION Node::Lid{{{*/
+-int  Node::Lid(void){
++int  Node::Lid(void){/*{{{*/
+ 	return lid; 
+ }
+ /*}}}*/
+-/*FUNCTION Node::GetCoordinateSystem{{{*/
+-void Node::GetCoordinateSystem(IssmDouble* coord_system_out){
++void Node::GetCoordinateSystem(IssmDouble* coord_system_out){/*{{{*/
+ 
+ 	/*Copy coord_system*/
+ 	for(int k=0;k<3;k++) for(int l=0;l<3;l++) coord_system_out[3*k+l]=this->coord_system[k][l];
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Node::InAnalysis{{{*/
+-bool Node::InAnalysis(int in_analysis_enum){
++bool Node::InAnalysis(int in_analysis_enum){/*{{{*/
+ 	if (in_analysis_enum==this->analysis_enum) return true;
+ 	else return false;
+ }
+ /*}}}*/
+ 
+ /*Node numerics:*/
+-/*FUNCTION Node::ApplyConstraints{{{*/
+-void  Node::ApplyConstraint(int dof,IssmDouble value){
++void Node::ApplyConstraint(int dof,IssmDouble value){/*{{{*/
+ 
+ 	/*Dof should be added in the s set, describing which 
+ 	 * dofs are constrained to a certain value (dirichlet boundary condition*/
+@@ -386,30 +371,26 @@
+ 	this->indexing.svalues[dof]=value;
+ }
+ /*}}}*/
+-/*FUNCTION Node::RequiresDofReindexing{{{*/
+-bool Node::RequiresDofReindexing(void){
++bool Node::RequiresDofReindexing(void){/*{{{*/
+ 
+ 	return this->indexingupdate;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Node::ReindexingDone{{{*/
+-void Node::ReindexingDone(void){
++void Node::ReindexingDone(void){/*{{{*/
+ 
+ 	this->indexingupdate = false;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Node::RelaxConstraint{{{*/
+-void  Node::RelaxConstraint(int dof){
++void Node::RelaxConstraint(int dof){/*{{{*/
+ 
+ 	/*Dof should be added to the f-set, and taken out of the s-set:*/
+ 	DofInFSet(dof);
+ 	this->indexing.svalues[dof]=0.;
+ }
+ /*}}}*/
+-/*FUNCTION Node::CreateNodalConstraints{{{*/
+-void  Node::CreateNodalConstraints(Vector<IssmDouble>* ys){
++void Node::CreateNodalConstraints(Vector<IssmDouble>* ys){/*{{{*/
+ 
+ 	int i;
+ 	IssmDouble* values=NULL;
+@@ -436,8 +417,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Node::DofInSSet {{{*/
+-void  Node::DofInSSet(int dof){
++void Node::DofInSSet(int dof){/*{{{*/
+ 
+ 	/*Put dof for this node into the s set (ie, this dof will be constrained 
+ 	 * to a fixed value during computations. */
+@@ -450,8 +430,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Node::DofInFSet {{{*/
+-void  Node::DofInFSet(int dof){
++void Node::DofInFSet(int dof){/*{{{*/
+ 
+ 	/*Put dof for this node into the f set (ie, this dof will NOT be constrained 
+ 	 * to a fixed value during computations. */
+@@ -464,15 +443,13 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Node::FreezeDof{{{*/
+-void  Node::FreezeDof(int dof){
++void Node::FreezeDof(int dof){/*{{{*/
+ 
+ 	DofInSSet(dof); //with 0 displacement for this dof.
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Node::Deactivate{{{*/
+-void  Node::Deactivate(void){
++void Node::Deactivate(void){/*{{{*/
+ 
+ 	if(IsActive()){
+ 		this->indexingupdate = true;
+@@ -481,8 +458,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Node::Activate{{{*/
+-void  Node::Activate(void){
++void Node::Activate(void){/*{{{*/
+ 
+ 	if(!IsActive()){
+ 		this->indexingupdate = true;
+@@ -491,21 +467,18 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Node::IsActive{{{*/
+-bool Node::IsActive(void){
++bool Node::IsActive(void){/*{{{*/
+ 
+ 	return indexing.active;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Node::GetApproximation {{{*/
+-int   Node::GetApproximation(){
++int  Node::GetApproximation(){/*{{{*/
+ 
+ 	return approximation;
+ }
+ /*}}}*/
+-/*FUNCTION Node::GetNumberOfDofs{{{*/
+-int   Node::GetNumberOfDofs(int approximation_enum,int setenum){
++int  Node::GetNumberOfDofs(int approximation_enum,int setenum){/*{{{*/
+ 
+ 	/*Get number of degrees of freedom in a node, for a certain set (g,f or s-set)
+ 	 *and for a certain approximation type: */
+@@ -552,15 +525,13 @@
+ 	return numdofs;
+ }
+ /*}}}*/
+-/*FUNCTION Node::IsClone {{{*/
+-int   Node::IsClone(){
++int  Node::IsClone(){/*{{{*/
+ 
+ 	return indexing.clone;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Node::VecMerge {{{*/
+-void Node::VecMerge(Vector<IssmDouble>* ug, IssmDouble* vector_serial,int setenum){
++void Node::VecMerge(Vector<IssmDouble>* ug, IssmDouble* vector_serial,int setenum){/*{{{*/
+ 
+ 	IssmDouble *values  = NULL;
+ 	int        *indices = NULL;
+@@ -610,8 +581,7 @@
+ 	xDelete<int>(indices);
+ }
+ /*}}}*/
+-/*FUNCTION Node::VecReduce {{{*/
+-void   Node::VecReduce(Vector<IssmDouble>* vector, IssmDouble* ug_serial,int setenum){
++void Node::VecReduce(Vector<IssmDouble>* vector, IssmDouble* ug_serial,int setenum){/*{{{*/
+ 
+ 	IssmDouble* values=NULL;
+ 	int     count=0;
+@@ -657,8 +627,7 @@
+ /*}}}*/
+ 
+ /* indexing routines:*/
+-/*FUNCTION Node::DistributeDofs{{{*/
+-void  Node::DistributeDofs(int* pdofcount,int setenum){
++void Node::DistributeDofs(int* pdofcount,int setenum){/*{{{*/
+ 
+ 	int i;
+ 	int dofcount;
+@@ -699,8 +668,7 @@
+ 	*pdofcount=dofcount;
+ }
+ /*}}}*/
+-/*FUNCTION Node::OffsetDofs{{{*/
+-void  Node::OffsetDofs(int dofcount,int setenum){
++void Node::OffsetDofs(int dofcount,int setenum){/*{{{*/
+ 
+ 	int i;
+ 
+@@ -722,8 +690,7 @@
+ 	else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!");
+ }
+ /*}}}*/
+-/*FUNCTION Node::ShowTrueDofs{{{*/
+-void  Node::ShowTrueDofs(int* truedofs, int ncols,int setenum){
++void Node::ShowTrueDofs(int* truedofs, int ncols,int setenum){/*{{{*/
+ 
+ 	int j;
+ 
+@@ -747,8 +714,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION Node::UpdateCloneDofs{{{*/
+-void  Node::UpdateCloneDofs(int* alltruedofs,int ncols,int setenum){
++void Node::UpdateCloneDofs(int* alltruedofs,int ncols,int setenum){/*{{{*/
+ 
+ 	int j;
+ 
+@@ -772,8 +738,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION Node::SetClone {{{*/
+-void  Node::SetClone(int* minranks){
++void Node::SetClone(int* minranks){/*{{{*/
+ 
+ 	int my_rank;
+ 
+Index: ../trunk-jpl/src/c/classes/Constraints/Constraints.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Constraints/Constraints.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Constraints/Constraints.cpp	(revision 18064)
+@@ -18,8 +18,7 @@
+ /*}}}*/
+ 
+ /*Numerics: */
+-/*FUNCTION Constraints::NumberOfConstraints{{{*/
+-int Constraints::NumberOfConstraints(void){
++int Constraints::NumberOfConstraints(void){/*{{{*/
+ 
+ 	int localconstraints;
+ 	int numberofconstraints;
+Index: ../trunk-jpl/src/c/classes/Constraints/SpcDynamic.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Constraints/SpcDynamic.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Constraints/SpcDynamic.cpp	(revision 18064)
+@@ -13,13 +13,11 @@
+ #include "../../shared/shared.h"
+ 
+ /*SpcDynamic constructors and destructor*/
+-/*FUNCTION SpcDynamic::SpcDynamic(){{{*/
+-SpcDynamic::SpcDynamic(){
++SpcDynamic::SpcDynamic(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION SpcDynamic::SpcDynamic(int spc_sid,int spc_nodeid,...){{{*/
+-SpcDynamic::SpcDynamic(int spc_sid,int spc_nodeid, int spc_dof,int spc_analysis_type){
++SpcDynamic::SpcDynamic(int spc_sid,int spc_nodeid, int spc_dof,int spc_analysis_type){/*{{{*/
+ 
+ 	sid=spc_sid;
+ 	nodeid=spc_nodeid;
+@@ -31,15 +29,13 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION SpcDynamic::~SpcDynamic{{{*/
+-SpcDynamic::~SpcDynamic(){
++SpcDynamic::~SpcDynamic(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION SpcDynamic::Echo {{{*/
+-void SpcDynamic::Echo(void){
++void SpcDynamic::Echo(void){/*{{{*/
+ 
+ 	_printf_("SpcDynamic:\n");
+ 	_printf_("   sid: " << sid << "\n");
+@@ -51,38 +47,32 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION SpcDynamic::DeepEcho {{{*/
+-void SpcDynamic::DeepEcho(void){
++void SpcDynamic::DeepEcho(void){/*{{{*/
+ 
+ 	this->Echo();
+ 	return;
+ }		
+ /*}}}*/
+-/*FUNCTION SpcDynamic::Id {{{*/
+-int    SpcDynamic::Id(void){ return sid; }
++int    SpcDynamic::Id(void){ return sid; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION SpcDynamic::ObjectEnum{{{*/
+-int SpcDynamic::ObjectEnum(void){
++int SpcDynamic::ObjectEnum(void){/*{{{*/
+ 
+ 	return SpcDynamicEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION SpcDynamic::copy {{{*/
+-Object* SpcDynamic::copy() {
++Object* SpcDynamic::copy() {/*{{{*/
+ 	return new SpcDynamic(*this); 
+ }
+ /*}}}*/
+ 
+ /*Constraint virtual functions definitions: */
+-/*FUNCTION SpcDynamic::InAnalysis{{{*/
+-bool SpcDynamic::InAnalysis(int in_analysis_type){
++bool SpcDynamic::InAnalysis(int in_analysis_type){/*{{{*/
+ 	if (in_analysis_type==this->analysis_type) return true;
+ 	else return false;
+ }
+ /*}}}*/
+-/*FUNCTION SpcDynamic::ConstrainNode{{{*/
+-void SpcDynamic::ConstrainNode(Nodes* nodes,Parameters* parameters){
++void SpcDynamic::ConstrainNode(Nodes* nodes,Parameters* parameters){/*{{{*/
+ 
+ 	Node* node=NULL;
+ 
+@@ -99,26 +89,22 @@
+ /*}}}*/
+ 
+ /*SpcDynamic functions*/
+-/*FUNCTION SpcDynamic::GetDof {{{*/
+-int SpcDynamic::GetDof(){
++int SpcDynamic::GetDof(){/*{{{*/
+ 	return dof;
+ }
+ /*}}}*/
+-/*FUNCTION SpcDynamic::GetNodeId {{{*/
+-int   SpcDynamic::GetNodeId(){
++int   SpcDynamic::GetNodeId(){/*{{{*/
+ 
+ 	return nodeid;
+ }
+ /*}}}*/
+-/*FUNCTION SpcDynamic::GetValue {{{*/
+-IssmDouble SpcDynamic::GetValue(){
++IssmDouble SpcDynamic::GetValue(){/*{{{*/
+ 	_assert_(this->isset);
+ 	_assert_(!xIsNan<IssmDouble>(value));
+ 	return value;
+ }
+ /*}}}*/
+-/*FUNCTION SpcDynamic::SetDynamicConstraint {{{*/
+-void SpcDynamic::SetDynamicConstraint(Nodes* nodes,IssmDouble* yg_serial){
++void SpcDynamic::SetDynamicConstraint(Nodes* nodes,IssmDouble* yg_serial){/*{{{*/
+ 
+ 	int pos;
+ 
+Index: ../trunk-jpl/src/c/classes/Constraints/Constraints.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Constraints/Constraints.h	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Constraints/Constraints.h	(revision 18064)
+@@ -15,14 +15,12 @@
+ 	public:
+ 
+ 		/*Object constructors and destructor*/
+-		/*FUNCTION Constraints::Constraints(){{{*/
+-		Constraints(){
++		Constraints(){/*{{{*/
+ 			enum_type=ConstraintsEnum;
+ 			return;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Constraints::~Constraints(){{{*/
+-		~Constraints(){
++		~Constraints(){/*{{{*/
+ 			return;
+ 		}
+ 		/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Constraints/SpcStatic.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Constraints/SpcStatic.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Constraints/SpcStatic.cpp	(revision 18064)
+@@ -13,13 +13,11 @@
+ #include "../../shared/shared.h"
+ 
+ /*SpcStatic constructors and destructor*/
+-/*FUNCTION SpcStatic::SpcStatic(){{{*/
+-SpcStatic::SpcStatic(){
++SpcStatic::SpcStatic(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION SpcStatic::SpcStatic(int spc_sid,int spc_nodeid,...){{{*/
+-SpcStatic::SpcStatic(int spc_sid,int spc_nodeid, int spc_dof,IssmDouble spc_value,int spc_analysis_type){
++SpcStatic::SpcStatic(int spc_sid,int spc_nodeid, int spc_dof,IssmDouble spc_value,int spc_analysis_type){/*{{{*/
+ 
+ 	sid           = spc_sid;
+ 	nodeid        = spc_nodeid;
+@@ -30,15 +28,13 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION SpcStatic::~SpcStatic{{{*/
+-SpcStatic::~SpcStatic(){
++SpcStatic::~SpcStatic(){/*{{{*/
+ 	return;
+ }
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION SpcStatic::Echo {{{*/
+-void SpcStatic::Echo(void){
++void SpcStatic::Echo(void){/*{{{*/
+ 
+ 	_printf_("SpcStatic:\n");
+ 	_printf_("   sid: " << sid << "\n");
+@@ -49,8 +45,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION SpcStatic::DeepEcho {{{*/
+-void SpcStatic::DeepEcho(void){
++void SpcStatic::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_("SpcStatic:\n");
+ 	_printf_("   sid: " << sid << "\n");
+@@ -61,31 +56,26 @@
+ 	return;
+ }		
+ /*}}}*/
+-/*FUNCTION SpcStatic::Id {{{*/
+-int    SpcStatic::Id(void){ return sid; }
++int    SpcStatic::Id(void){ return sid; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION SpcStatic::ObjectEnum{{{*/
+-int SpcStatic::ObjectEnum(void){
++int SpcStatic::ObjectEnum(void){/*{{{*/
+ 
+ 	return SpcStaticEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION SpcStatic::copy {{{*/
+-Object* SpcStatic::copy() {
++Object* SpcStatic::copy() {/*{{{*/
+ 	return new SpcStatic(*this); 
+ }
+ /*}}}*/
+ 
+ /*Constraint virtual functions definitions: */
+-/*FUNCTION SpcStatic::InAnalysis{{{*/
+-bool SpcStatic::InAnalysis(int in_analysis_type){
++bool SpcStatic::InAnalysis(int in_analysis_type){/*{{{*/
+ 	if (in_analysis_type==this->analysis_type) return true;
+ 	else return false;
+ }
+ /*}}}*/
+-/*FUNCTION SpcStatic::ConstrainNode{{{*/
+-void SpcStatic::ConstrainNode(Nodes* nodes,Parameters* parameters){
++void SpcStatic::ConstrainNode(Nodes* nodes,Parameters* parameters){/*{{{*/
+ 
+ 	Node* node=NULL;
+ 
+@@ -100,19 +90,16 @@
+ /*}}}*/
+ 
+ /*SpcStatic functions*/
+-/*FUNCTION SpcStatic::GetDof {{{*/
+-int SpcStatic::GetDof(){
++int SpcStatic::GetDof(){/*{{{*/
+ 	return dof;
+ }
+ /*}}}*/
+-/*FUNCTION SpcStatic::GetNodeId {{{*/
+-int   SpcStatic::GetNodeId(){
++int   SpcStatic::GetNodeId(){/*{{{*/
+ 
+ 	return nodeid;
+ }
+ /*}}}*/
+-/*FUNCTION SpcStatic::GetValue {{{*/
+-IssmDouble SpcStatic::GetValue(){
++IssmDouble SpcStatic::GetValue(){/*{{{*/
+ 	_assert_(!xIsNan<IssmDouble>(value));
+ 	return value;
+ }
+Index: ../trunk-jpl/src/c/classes/Constraints/SpcTransient.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Constraints/SpcTransient.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Constraints/SpcTransient.cpp	(revision 18064)
+@@ -13,8 +13,7 @@
+ #include "shared/shared.h"
+ 
+ /*SpcTransient constructors and destructor*/
+-/*FUNCTION SpcTransient::SpcTransient(){{{*/
+-SpcTransient::SpcTransient(){
++SpcTransient::SpcTransient(){/*{{{*/
+ 	sid=-1;
+ 	nodeid=-1;
+ 	dof=-1;
+@@ -25,8 +24,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION SpcTransient::SpcTransient(int spc_sid,int spc_nodeid,...){{{*/
+-SpcTransient::SpcTransient(int spc_sid,int spc_nodeid, int spc_dof,int spc_nsteps, IssmDouble* spc_times, IssmDouble* spc_values,int spc_analysis_type){
++SpcTransient::SpcTransient(int spc_sid,int spc_nodeid, int spc_dof,int spc_nsteps, IssmDouble* spc_times, IssmDouble* spc_values,int spc_analysis_type){/*{{{*/
+ 
+ 	sid=spc_sid;
+ 	nodeid=spc_nodeid;
+@@ -42,8 +40,7 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION SpcTransient::~SpcTransient{{{*/
+-SpcTransient::~SpcTransient(){
++SpcTransient::~SpcTransient(){/*{{{*/
+ 	xDelete<IssmDouble>(times);
+ 	xDelete<IssmDouble>(values);
+ 	return;
+@@ -51,8 +48,7 @@
+ /*}}}*/
+ 
+ /*Object virtual functions definitions:*/
+-/*FUNCTION SpcTransient::Echo {{{*/
+-void SpcTransient::Echo(void){
++void SpcTransient::Echo(void){/*{{{*/
+ 
+ 	int i;
+ 	_printf_("SpcTransient:\n");
+@@ -68,37 +64,31 @@
+ 	return;
+ }
+ /*}}}*/
+-/*FUNCTION SpcTransient::DeepEcho {{{*/
+-void SpcTransient::DeepEcho(void){
++void SpcTransient::DeepEcho(void){/*{{{*/
+ 	this->Echo();
+ }		
+ /*}}}*/
+-/*FUNCTION SpcTransient::Id {{{*/
+-int    SpcTransient::Id(void){ return sid; }
++int    SpcTransient::Id(void){ return sid; }/*{{{*/
+ /*}}}*/
+-/*FUNCTION SpcTransient::ObjectEnum{{{*/
+-int SpcTransient::ObjectEnum(void){
++int SpcTransient::ObjectEnum(void){/*{{{*/
+ 
+ 	return SpcTransientEnum;
+ 
+ }
+ /*}}}*/
+-/*FUNCTION SpcTransient::copy {{{*/
+-Object* SpcTransient::copy() {
++Object* SpcTransient::copy() {/*{{{*/
+ 	return new SpcTransient(sid,nodeid,dof,nsteps,times,values,analysis_type);
+ }
+ /*}}}*/
+ 
+ /*Constraint virtual functions definitions:*/
+-/*FUNCTION SpcTransient::InAnalysis{{{*/
+-bool SpcTransient::InAnalysis(int in_analysis_type){
++bool SpcTransient::InAnalysis(int in_analysis_type){/*{{{*/
+ 
+ 	if (in_analysis_type==this->analysis_type) return true;
+ 	else return false;
+ }
+ /*}}}*/
+-/*FUNCTION SpcTransient::ConstrainNode{{{*/
+-void SpcTransient::ConstrainNode(Nodes* nodes,Parameters* parameters){
++void SpcTransient::ConstrainNode(Nodes* nodes,Parameters* parameters){/*{{{*/
+ 
+ 	Node       *node  = NULL;
+ 	IssmDouble  time  = 0.;
+@@ -148,19 +138,16 @@
+ /*}}}*/
+ 
+ /*SpcTransient functions*/
+-/*FUNCTION SpcTransient::GetDof {{{*/
+-int SpcTransient::GetDof(){
++int SpcTransient::GetDof(){/*{{{*/
+ 	return dof;
+ }
+ /*}}}*/
+-/*FUNCTION SpcTransient::GetNodeId {{{*/
+-int   SpcTransient::GetNodeId(){
++int   SpcTransient::GetNodeId(){/*{{{*/
+ 
+ 	return nodeid;
+ }
+ /*}}}*/
+-/*FUNCTION SpcTransient::GetValue {{{*/
+-IssmDouble SpcTransient::GetValue(){
++IssmDouble SpcTransient::GetValue(){/*{{{*/
+ 	return values[0];
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/IoModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 18063)
++++ ../trunk-jpl/src/c/classes/IoModel.cpp	(revision 18064)
+@@ -18,8 +18,7 @@
+ #include "../shared/io/io.h"
+ #include "../shared/shared.h"
+ 
+-/*FUNCTION IoModel::IoModel(){{{*/
+-IoModel::IoModel(){
++IoModel::IoModel(){/*{{{*/
+ 	this->fid=NULL;
+ 	this->data=NULL;
+ 	this->independents=NULL;
+@@ -50,8 +49,7 @@
+ 	this->constraintcounter=0;
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::IoModel(FILE*  iomodel_handle){{{*/
+-IoModel::IoModel(FILE* iomodel_handle){
++IoModel::IoModel(FILE* iomodel_handle){/*{{{*/
+ 
+ 	/*First, keep track of the file handle: */
+ 	this->fid=iomodel_handle;
+@@ -96,8 +94,7 @@
+ 	this->constraintcounter=0;
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::~IoModel(){{{*/
+-IoModel::~IoModel(){
++IoModel::~IoModel(){/*{{{*/
+ 
+ 	/*Delete independents*/
+ 	if(this->independents){
+@@ -139,8 +136,7 @@
+ }
+ /*}}}*/
+ 
+-/*FUNCTION IoModel::CheckEnumSync{{{*/
+-void  IoModel::CheckEnumSync(void){
++void  IoModel::CheckEnumSync(void){/*{{{*/
+ 
+ 	int record_enum,record_length;
+ 
+@@ -225,8 +221,7 @@
+ 	}
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::Constant(bool* poutput,int constant_enum){{{*/
+-void IoModel::Constant(bool* poutput,int constant_enum){
++void IoModel::Constant(bool* poutput,int constant_enum){/*{{{*/
+ 
+ 	_assert_(constant_enum>=0);
+ 	_assert_(this->constants);
+@@ -234,8 +229,7 @@
+ 	this->constants->FindParam(poutput,constant_enum);
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::Constant(int* poutput,int constant_enum){{{*/
+-void IoModel::Constant(int* poutput,int constant_enum){
++void IoModel::Constant(int* poutput,int constant_enum){/*{{{*/
+ 
+ 	_assert_(constant_enum>=0);
+ 	_assert_(this->constants);
+@@ -243,8 +237,7 @@
+ 	this->constants->FindParam(poutput,constant_enum);
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::Constant(IssmDouble* poutput,int constant_enum){{{*/
+-void IoModel::Constant(IssmDouble* poutput,int constant_enum){
++void IoModel::Constant(IssmDouble* poutput,int constant_enum){/*{{{*/
+ 
+ 	_assert_(constant_enum>=0);
+ 	_assert_(this->constants);
+@@ -252,8 +245,7 @@
+ 	this->constants->FindParam(poutput,constant_enum);
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::Constant(char** poutput,int constant_enum){{{*/
+-void IoModel::Constant(char** poutput,int constant_enum){
++void IoModel::Constant(char** poutput,int constant_enum){/*{{{*/
+ 
+ 	_assert_(constant_enum>=0);
+ 	_assert_(this->constants);
+@@ -261,8 +253,7 @@
+ 	this->constants->FindParam(poutput,constant_enum);
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::CopyConstantObject{{{*/
+-Param* IoModel::CopyConstantObject(int constant_enum){
++Param* IoModel::CopyConstantObject(int constant_enum){/*{{{*/
+ 
+ 	_assert_(this->constants);
+ 
+@@ -273,8 +264,7 @@
+ 	return dynamic_cast<Param*>(param->copy());
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::Data{{{*/
+-IssmDouble* IoModel::Data(int data_enum){
++IssmDouble* IoModel::Data(int data_enum){/*{{{*/
+ 
+ 	_assert_(data_enum<MaximumNumberOfDefinitionsEnum);
+ 	_assert_(data_enum>=0);
+@@ -282,8 +272,7 @@
+ 	return this->data[data_enum];
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::StartTrace{{{*/
+-void IoModel::StartTrace(void){
++void IoModel::StartTrace(void){/*{{{*/
+ 
+ 	bool autodiff = false;
+ 	bool keep=false;
+@@ -321,8 +310,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::DeclareIndependents{{{*/
+-void IoModel::DeclareIndependents(void){
++void IoModel::DeclareIndependents(void){/*{{{*/
+ 
+ 	int  i;
+ 	bool autodiff = false;
+@@ -373,8 +361,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::DeleteData(int num,...){{{*/
+-void  IoModel::DeleteData(int num,...){
++void  IoModel::DeleteData(int num,...){/*{{{*/
+ 
+ 	va_list ap;
+ 	int     dataenum;
+@@ -390,15 +377,13 @@
+ 	}
+ 	va_end(ap);
+ } /*}}}*/
+-/*FUNCTION IoModel::DeleteData(IssmDouble* {{{*/
+-void  IoModel::DeleteData(IssmDouble* vector, int dataenum){
++void  IoModel::DeleteData(IssmDouble* vector, int dataenum){/*{{{*/
+ 
+ 	/*do not erase independent variables for the AD mode computations!: */
+ 	if(vector)if (!this->independents[dataenum]) xDelete<IssmDouble>(vector);
+ 
+ } /*}}}*/
+-/*FUNCTION IoModel::DeleteData(char*** pstringarray, int numstrings, int dataenum) {{{*/
+-void  IoModel::DeleteData(char*** pstringarray, int numstrings, int dataenum){
++void  IoModel::DeleteData(char*** pstringarray, int numstrings, int dataenum){/*{{{*/
+ 
+ 	int i;
+ 	char** stringarray=*pstringarray;
+@@ -412,8 +397,7 @@
+ 	}
+ 	*pstringarray=NULL;
+ } /*}}}*/
+-/*FUNCTION IoModel::FetchConstants{{{*/
+-void  IoModel::FetchConstants(void){
++void  IoModel::FetchConstants(void){/*{{{*/
+ 
+ 	int my_rank;
+ 
+@@ -636,8 +620,7 @@
+ 	} //}}}
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::FetchData(bool*         pbool,int data_enum){{{*/
+-void  IoModel::FetchData(bool* pboolean,int data_enum){
++void  IoModel::FetchData(bool* pboolean,int data_enum){/*{{{*/
+ 
+ 	int my_rank;
+ 
+@@ -665,8 +648,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::FetchData(int*          pinteger,int data_enum){{{*/
+-void  IoModel::FetchData(int* pinteger,int data_enum){
++void  IoModel::FetchData(int* pinteger,int data_enum){/*{{{*/
+ 
+ 	int my_rank;
+ 
+@@ -693,8 +675,7 @@
+ 	*pinteger=integer;
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::FetchData(IssmDouble*   pscalar,int data_enum){{{*/
+-void  IoModel::FetchData(IssmDouble* pscalar,int data_enum){
++void  IoModel::FetchData(IssmDouble* pscalar,int data_enum){/*{{{*/
+ 
+ 	int my_rank;
+ 
+@@ -721,8 +702,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::FetchData(char**        pstring,int data_enum){{{*/
+-void  IoModel::FetchData(char** pstring,int data_enum){
++void  IoModel::FetchData(char** pstring,int data_enum){/*{{{*/
+ 
+ 	int my_rank;
+ 
+@@ -768,8 +748,7 @@
+ 	*pstring=string;
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::FetchData(int**         pintegerematrix,int* pM,int* pN,int data_enum){{{*/
+-void  IoModel::FetchData(int** pmatrix,int* pM,int* pN,int data_enum){
++void  IoModel::FetchData(int** pmatrix,int* pM,int* pN,int data_enum){/*{{{*/
+ 
+ 	int my_rank;
+ 	int i,j;
+@@ -837,8 +816,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::FetchData(IssmDouble**  pIssmDoublematrix,int* pM,int* pN,int data_enum){{{*/
+-void  IoModel::FetchData(IssmDouble** pmatrix,int* pM,int* pN,int data_enum){
++void  IoModel::FetchData(IssmDouble** pmatrix,int* pM,int* pN,int data_enum){/*{{{*/
+ 
+ 	int my_rank;
+ 
+@@ -897,8 +875,7 @@
+ 	if (pN)*pN=N;
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::FetchData(char***       pstrings,int* pnumstrings,int data_enum){{{*/
+-void  IoModel::FetchData(char*** pstrings,int* pnumstrings,int data_enum){
++void  IoModel::FetchData(char*** pstrings,int* pnumstrings,int data_enum){/*{{{*/
+ 
+ 	int my_rank;
+ 
+@@ -963,8 +940,7 @@
+ 	*pnumstrings=numstrings;
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::FetchData(IssmDouble*** pmatrices,int** pmdims,int** pndims, int* pM,int data_enum){{{*/
+-void  IoModel::FetchData(IssmDouble*** pmatrices,int** pmdims,int** pndims, int* pnumrecords,int data_enum){
++void  IoModel::FetchData(IssmDouble*** pmatrices,int** pmdims,int** pndims, int* pnumrecords,int data_enum){/*{{{*/
+ 
+ 	int i;
+ 
+@@ -1049,8 +1025,7 @@
+ 	*pnumrecords=numrecords;
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::FetchData(Option**  poption,int data_enum){{{*/
+-void  IoModel::FetchData(Option** poption,int index){
++void  IoModel::FetchData(Option** poption,int index){/*{{{*/
+ 
+ 	/*output: */
+ 	int     code;
+@@ -1095,8 +1070,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::FetchData(int num,...){{{*/
+-void  IoModel::FetchData(int num,...){
++void  IoModel::FetchData(int num,...){/*{{{*/
+ 
+ 	va_list     ap;
+ 	int         dataenum;
+@@ -1137,8 +1111,7 @@
+ 
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::FetchMultipleData(char***       pstrings,int* pnumstrings,int data_enum){{{*/
+-void  IoModel::FetchMultipleData(char*** pstrings,int* pnumstrings,int data_enum){
++void  IoModel::FetchMultipleData(char*** pstrings,int* pnumstrings,int data_enum){/*{{{*/
+ 
+ 	int  num_instances;
+ 
+@@ -1202,8 +1175,7 @@
+ 	*pnumstrings=num_instances;
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::FetchMultipleData(int** pvector, int* pM,int data_enum){{{*/
+-void  IoModel::FetchMultipleData(int** pvector, int* pnum_instances,int data_enum){
++void  IoModel::FetchMultipleData(int** pvector, int* pnum_instances,int data_enum){/*{{{*/
+ 
+ 	int     num_instances;
+ 	fpos_t* file_positions=NULL;
+@@ -1256,8 +1228,7 @@
+ 	*pnum_instances=num_instances;
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::FetchMultipleData(IssmDouble*** pmatrices,int** pmdims,int** pndims, int* pM,int data_enum){{{*/
+-void  IoModel::FetchMultipleData(IssmDouble*** pmatrices,int** pmdims,int** pndims, int* pnumrecords,int data_enum){
++void  IoModel::FetchMultipleData(IssmDouble*** pmatrices,int** pmdims,int** pndims, int* pnumrecords,int data_enum){/*{{{*/
+ 
+ 	int     num_instances;
+ 	fpos_t* file_positions=NULL;
+@@ -1361,8 +1332,7 @@
+ 	*pnumrecords=num_instances;
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::FetchMultipleData(int*** pmatrices,int** pmdims,int** pndims, int* pM,int data_enum){{{*/
+-void  IoModel::FetchMultipleData(int*** pmatrices,int** pmdims,int** pndims, int* pnumrecords,int data_enum){
++void  IoModel::FetchMultipleData(int*** pmatrices,int** pmdims,int** pndims, int* pnumrecords,int data_enum){/*{{{*/
+ 
+ 	int     num_instances;
+ 	fpos_t* file_positions=NULL;
+@@ -1468,8 +1438,7 @@
+ 	*pnumrecords=num_instances;
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::FetchDataToInput(Elements* elements,int vector_enum,IssmDouble default_value){{{*/
+-void IoModel::FetchDataToInput(Elements* elements,int vector_enum,IssmDouble default_value){
++void IoModel::FetchDataToInput(Elements* elements,int vector_enum,IssmDouble default_value){/*{{{*/
+ 
+ 	/*intermediary: */
+ 	int         code,vector_layout;
+@@ -1494,8 +1463,7 @@
+ 	if(!this->independents[vector_enum]) xDelete<IssmDouble>(doublearray);
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::FetchDataToInput(Elements* elements,int vector_enum){{{*/
+-void IoModel::FetchDataToInput(Elements* elements,int vector_enum){
++void IoModel::FetchDataToInput(Elements* elements,int vector_enum){/*{{{*/
+ 
+ 	/*intermediary: */
+ 	int     i;
+@@ -1567,8 +1535,7 @@
+ 	xDelete<char>(string);
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::LastIndex{{{*/
+-void IoModel::LastIndex(int *pindex){
++void IoModel::LastIndex(int *pindex){/*{{{*/
+ 
+ 	int my_rank;
+ 	int lastindex,index;
+@@ -1668,8 +1635,7 @@
+ 	return fid;
+ }
+ /*}}}*/
+-/*FUNCTION IoModel::SetFilePointersToData{{{*/
+-fpos_t* IoModel::SetFilePointersToData(int** pcodes,int** pvector_types, int* pnum_instances, int data_enum){
++fpos_t* IoModel::SetFilePointersToData(int** pcodes,int** pvector_types, int* pnum_instances, int data_enum){/*{{{*/
+ 
+ 	int     found          = 0;
+ 	int     record_enum;
+Index: ../trunk-jpl/src/c/classes/Massfluxatgate.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Massfluxatgate.h	(revision 18063)
++++ ../trunk-jpl/src/c/classes/Massfluxatgate.h	(revision 18064)
+@@ -28,15 +28,13 @@
+ 		int*        elements;
+ 
+ 		/*Massfluxatgate constructors, destructors :*/
+-		/*FUNCTION Massfluxatgate() {{{*/
+-		Massfluxatgate(){
++		Massfluxatgate(){/*{{{*/
+ 			this->name        = 0;
+ 			this->numsegments = 0;
+ 			this->segments    = 0;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Massfluxatgate(char* name, int numsegments, doubletype* segments) {{{*/
+-		Massfluxatgate(char* in_name, int in_numsegments, doubletype* in_segments) {
++		Massfluxatgate(char* in_name, int in_numsegments, doubletype* in_segments) {/*{{{*/
+ 			
+ 			int i;
+ 
+@@ -62,8 +60,7 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Massfluxatgate(char* name, int numsegments, doubletype* x1, doubletype* y1, doubletype* x2, doubletype* y2,int* elements) {{{*/
+-		Massfluxatgate(char* in_name, int in_numsegments, doubletype* in_x1, doubletype* in_y1, doubletype* in_x2, doubletype* in_y2,int* in_elements){
++		Massfluxatgate(char* in_name, int in_numsegments, doubletype* in_x1, doubletype* in_y1, doubletype* in_x2, doubletype* in_y2,int* in_elements){/*{{{*/
+ 
+ 			this->name   = xNew<char>(strlen(in_name)+1);
+ 			xMemCpy<char>(this->name,in_name,strlen(in_name)+1);
+@@ -80,8 +77,7 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION ~Massfluxatgate() {{{*/
+-		~Massfluxatgate(){
++		~Massfluxatgate(){/*{{{*/
+ 			xDelete<doubletype>(this->x1);
+ 			xDelete<doubletype>(this->y1);
+ 			xDelete<doubletype>(this->x2);
+@@ -92,8 +88,7 @@
+ 		/*}}}*/
+ 
+ 		/*Object virtual function resolutoin: */
+-		/*FUNCTION Echo(){{{*/
+-		void Echo(void){
++		void Echo(void){/*{{{*/
+ 			_printf_(" Massfluxatgate: " << name << "\n");
+ 			_printf_("    numsegments: " << numsegments << "\n");
+ 			if(numsegments){
+@@ -104,29 +99,24 @@
+ 			}
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION DeepEcho(){{{*/
+-		void DeepEcho(void){
++		void DeepEcho(void){/*{{{*/
+ 			this->Echo();
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION Id(){{{*/
+-		int Id(void){
++		int Id(void){/*{{{*/
+ 			return -1;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION ObjectEnum{{{*/
+-		int ObjectEnum(void){
++		int ObjectEnum(void){/*{{{*/
+ 			return MassfluxatgateEnum;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION copy {{{*/
+-		Object* copy() {
++		Object* copy() {/*{{{*/
+ 			return new Massfluxatgate(this->name,this->numsegments,this->x1,this->y1,this->x2,this->y2,this->elements); 
+ 		}
+ 		/*}}}*/
+ 		/*Definition virtual function resolutoin: */
+-		/*FUNCTION char* Name() {{{*/
+-		char* Name(){
++		char* Name(){/*{{{*/
+ 
+ 			char* name2=xNew<char>(strlen(this->name)+1);
+ 			xMemCpy(name2,this->name,strlen(this->name)+1);
+@@ -134,8 +124,7 @@
+ 			return name2;
+ 		}
+ 		/*}}}*/
+-		/*FUNCTION doubletype* Response(FemModel* femmodel) {{{*/
+-		 IssmDouble Response(FemModel* femmodel){
++		 IssmDouble Response(FemModel* femmodel){/*{{{*/
+ 
+ 			int          i,j;
+ 			Element     *element       = NULL;
Index: /issm/oecreview/Archive/17984-18295/ISSM-18064-18065.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18064-18065.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18064-18065.diff	(revision 18296)
@@ -0,0 +1,182 @@
+Index: ../trunk-jpl/externalpackages/android/android-sdk/installSDK-linux-x86.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/android/android-sdk/installSDK-linux-x86.sh	(revision 0)
++++ ../trunk-jpl/externalpackages/android/android-sdk/installSDK-linux-x86.sh	(revision 18065)
+@@ -0,0 +1,85 @@
++#!/bin/bash
++
++# This installs the Android SDK (Software Development Kit)
++# which is needed for the compilation of the Java project. 
++
++source $ANDROID_DIR/android_aux.sh
++
++# Different steps here. 
++#   0: do all
++#   1: install sdk, ant and sdk tools
++#   2: install an emulator.
++#   3: test the emulator
++#   4: cleanup
++
++present_dir=`pwd`;
++sd_card="issm-sdcard"
++
++if [[ $step == "1" || $step == "0" ]]; then
++
++	# Cleanup the install
++	rm -rf install
++
++	# Download from ISSM server
++#	$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://developer.android.com/sdk/index.html#download' 'android-sdk-linux.zip'
++	
++	#Download from Google server
++	wget https://dl.google.com/android/android-sdk_r$sdk_rev-linux.tgz
++
++	# Install Android SDK.
++	tar -zxvf android-sdk_r$sdk_rev-linux.tgz
++	rm -rf android-sdk_r$sdk_rev-linux.tgz
++	# Move to install
++	mv -f android-sdk-linux install
++
++	# Post_install configuration: 
++	# We need specific settings for specific platforms, for the SDK to 
++	# function properly
++
++	# For now, we need to install:  
++	# android sdk platform tools  
++	# and a specific android api: API 16, API 15 and API 14
++	# Note: API 16, API 15 and 14 correspond to Android 4.1, 4.0.3 and 4.0 respectively. 
++
++	cd install/tools/ && source ./android update sdk -t platform-tool,${api_levels},system-image --no-ui
++
++fi
++
++if [[ $step == "2" || $step == "0" ]]; then
++
++	# Once this is done, we need to install an emulator. Location will default to ~/.android/avd, 
++	# which we will move to $ISSM_DIR/externalpackages/android-emulators.  
++	# For now, it's called: Android-4.0.3
++
++	# Here we delete the Android-4.0.3 device if it already exists.
++	cd $present_dir/install/tools
++
++    if [ -e $ANDROID_DIR/android-emulators/$default_droid ] 
++    then
++        echo "Deleting previously created device: $default_droid"
++	    ./android delete avd -n $default_droid
++    fi
++
++	# Android will prompt the user to specify hardware emulation options. For now, default
++	# default settings will suffice. Press 'enter' to take default settings or enter 'no'.
++
++	./android create avd -f -n $default_droid -t 1 -p $ANDROID_DIR/android-emulators/$default_droid --abi armeabi-v7a
++    echo "Creating an SD Card"
++    ./mksdcard -l $sd_card 2G $ANDROID_DIR/android-emulators/$sd_card.img
++fi
++
++if [[ $step == "3" || $step == "0" ]]; then
++    # Here we will start up our default emulator to test that it is working properly.
++    # Once the device has booted we will use the Android Debug Bridge tool to gain
++    # a terminal in our device.
++
++	cd $present_dir/install/tools
++	./emulator -avd $default_droid -sdcard $ANDROID_DIR/android-emulators/$sd_card.img &
++
++    cd ../platform-tools
++    ./adb wait-for-device shell
++fi
++
++#if [[ $step == "4" || $step == "0" ]]; then
++#	rm -rf install
++#fi
+Index: ../trunk-jpl/externalpackages/android/android-ndk/android_aux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/android/android-ndk/android_aux.sh	(revision 0)
++++ ../trunk-jpl/externalpackages/android/android-ndk/android_aux.sh	(revision 18065)
+@@ -0,0 +1,43 @@
++#!/bin/bash
++#
++# android_aux.sh serves as an auxiliary script for all installation
++# scripts with the Android suffix.
++#
++# TODO: include M4 macros for generic options.
++#
++
++sdk_rev=22.6.2
++ndk_rev=9
++api_levels="android-14,android-15,android-16"
++host_triplet="arm-linux-androideabi"
++default_droid="android-4.1"
++
++step=0;
++j=1;
++
++echo ""
++echo "This install script utilizes 'android_aux.sh' to allow for options."
++echo "For usage information enter: '--help'"
++echo Number of arguments is: $#
++
++for arg in $* 
++do 
++    if [[ "$arg" =~ --step=([0-9])* ]]; then
++        step=${BASH_REMATCH[1]}; 
++        echo "Setting step to: " $step
++    elif [[ "$arg" == "--help" ]]; then
++        echo ""
++        echo "USAGE: $ install.sh [--step=#] [-j#]"
++        echo ""
++        echo "Where '#' is some integer."
++        echo "To check the number of steps check the install script."
++        echo ""
++        exit 1;
++    elif [[ "$arg" =~ -j=([1-9]+[0-9]*) ]]; then
++        j=${BASH_REMATCH[1]}; 
++        echo "Number of jobs set to: " $j
++    else
++        echo "Option not recognized"
++        exit 1;
++    fi
++done
+Index: ../trunk-jpl/externalpackages/android/android-ndk/installNDK-linux-x86.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/android/android-ndk/installNDK-linux-x86.sh	(revision 0)
++++ ../trunk-jpl/externalpackages/android/android-ndk/installNDK-linux-x86.sh	(revision 18065)
+@@ -0,0 +1,39 @@
++#!/bin/bash
++
++# This installs the Android NDK (Native Development Kit)
++# which is needed for the compilation of C/C++ code into the 
++# native architecture of the Android device.
++
++# The android-ndk-r8-darwin-x86.tar.bz2 ndk.tar.bz2 file was downloaded 
++# from the android developer website: 
++source $ANDROID_DIR/android_aux.sh
++
++if [[ $step == "1" || $step == "0" ]]; then
++    # Cleanup the install
++    rm -rf install
++    rm -rf $ANDROID_DIR/arm-linux-android-${default_droid}
++
++    # Download from ISSM server
++#    $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/android-ndk-r'${ndk_rev}'-darwin-x86.tar.bz2' 'ndk.tar.bz2'
++    # Download from google
++#    if ["$(uname -m)" = "x86_64"]; then
++#	wget 'https://dl.google.com/android/ndk/android-ndk-r'${ndk_rev}'d-linux-x86_64.tar.bz2' 'ndk.tar.bz2'
++#   fi
++
++#    if ["$(uname -m)" = "x86"]; then
++	wget 'https://dl.google.com/android/ndk/android-ndk-r'${ndk_rev}'d-linux-x86.tar.bz2'
++ #   fi
++    # Install Android NDK
++    mv 'android-ndk-r'${ndk_rev}'d-linux-x86.tar.bz2' ndk.tar.bz2
++    tar -xvf ndk.tar.bz2
++    rm -rf ndk.tar ndk.tar.bz2
++
++    # Move to install
++    mv android-ndk-r${ndk_rev}d install
++fi
++
++# Create Standalone Development Directory
++# Note: API-14 corresponds to Android 4.0.
++if [[ $step == "2" || $step == "0" ]]; then
++    $ANDROID_DIR/android-ndk/install/build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=$ANDROID_DIR/android-ndk/install/arm-linux-android-install
++fi
Index: /issm/oecreview/Archive/17984-18295/ISSM-18067-18068.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18067-18068.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18067-18068.diff	(revision 18296)
@@ -0,0 +1,3919 @@
+Index: ../trunk-jpl/test/Par/SquareEISMINT.py
+===================================================================
+--- ../trunk-jpl/test/Par/SquareEISMINT.py	(revision 18067)
++++ ../trunk-jpl/test/Par/SquareEISMINT.py	(revision 18068)
+@@ -30,7 +30,8 @@
+ 
+ print "      creating surface mass balance"
+ md.surfaceforcings.mass_balance=0.2*numpy.ones((md.mesh.numberofvertices,1))    #0m/a
+-md.basalforcings.melting_rate=0.*numpy.ones((md.mesh.numberofvertices,1))    #0m/a
++md.basalforcings.floatingice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices,1))    #0m/a
++md.basalforcings.groundedice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices,1))    #0m/a
+ 
+ print "      boundary conditions"
+ md=SetMarineIceSheetBC(md,'../Exp/SquareFrontEISMINT.exp')
+Index: ../trunk-jpl/test/Par/RoundSheetShelf.py
+===================================================================
+--- ../trunk-jpl/test/Par/RoundSheetShelf.py	(revision 18067)
++++ ../trunk-jpl/test/Par/RoundSheetShelf.py	(revision 18068)
+@@ -69,9 +69,10 @@
+ 
+ #Surface mass balance and basal melting
+ md.surfaceforcings.mass_balance=-10.*numpy.ones((md.mesh.numberofvertices,1))
+-md.basalforcings.melting_rate=numpy.zeros((md.mesh.numberofvertices,1))
++md.basalforcings.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices,1))
+ pos=numpy.nonzero(md.mask.groundedice_levelset>0.)[0]
+-md.basalforcings.melting_rate[pos]=10.
++md.basalforcings.groudedice_melting_rate[pos]=10.
++md.basalforcings.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices,1))
+ md.basalforcings.geothermalflux=numpy.ones((md.mesh.numberofvertices,1))
+ 
+ #Friction
+Index: ../trunk-jpl/test/Par/79North.par
+===================================================================
+--- ../trunk-jpl/test/Par/79North.par	(revision 18067)
++++ ../trunk-jpl/test/Par/79North.par	(revision 18068)
+@@ -27,8 +27,9 @@
+ md.friction.q=ones(md.mesh.numberofelements,1);
+ 
+ %Ice shelf melting and surface mass balance 
+-md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices,1);
+-md.basalforcings.melting_rate(find(md.mask.groundedice_levelset<0.))=0.;
++md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate(find(md.mask.groundedice_levelset<0.))=0.;
++md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
+ md.surfaceforcings.mass_balance=15.*ones(md.mesh.numberofvertices,1);
+ 
+ %Numerical parameters
+Index: ../trunk-jpl/test/Par/SquareThermal.par
+===================================================================
+--- ../trunk-jpl/test/Par/SquareThermal.par	(revision 18067)
++++ ../trunk-jpl/test/Par/SquareThermal.par	(revision 18068)
+@@ -28,7 +28,8 @@
+ 
+ disp('      creating surface mass balance');
+ md.surfaceforcings.mass_balance=ones(md.mesh.numberofvertices,1)/md.constants.yts; %1m/a
+-md.basalforcings.melting_rate=0.*ones(md.mesh.numberofvertices,1)/md.constants.yts; %1m/a
++md.basalforcings.groundedice_melting_rate=0.*ones(md.mesh.numberofvertices,1)/md.constants.yts; %1m/a
++md.basalforcings.floatingice_melting_rate=0.*ones(md.mesh.numberofvertices,1)/md.constants.yts; %1m/a
+ 
+ %Deal with boundary conditions:
+ 
+Index: ../trunk-jpl/test/Par/SquareShelfConstrained.py
+===================================================================
+--- ../trunk-jpl/test/Par/SquareShelfConstrained.py	(revision 18067)
++++ ../trunk-jpl/test/Par/SquareShelfConstrained.py	(revision 18068)
+@@ -41,7 +41,8 @@
+ 
+ #Surface mass balance and basal melting
+ md.surfaceforcings.mass_balance=10.*numpy.ones((md.mesh.numberofvertices,1))
+-md.basalforcings.melting_rate=5.*numpy.ones((md.mesh.numberofvertices,1))
++md.basalforcings.groundedice_melting_rate=5.*numpy.ones((md.mesh.numberofvertices,1))
++md.basalforcings.floatingice_melting_rate=5.*numpy.ones((md.mesh.numberofvertices,1))
+ 
+ #Friction
+ md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices,1))
+Index: ../trunk-jpl/test/Par/RoundSheetShelf.par
+===================================================================
+--- ../trunk-jpl/test/Par/RoundSheetShelf.par	(revision 18067)
++++ ../trunk-jpl/test/Par/RoundSheetShelf.par	(revision 18068)
+@@ -62,8 +62,9 @@
+ 
+ %Surface mass balance and basal melting
+ md.surfaceforcings.mass_balance=-10.*ones(md.mesh.numberofvertices,1);
+-md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices,1);
+-pos=find(md.mask.groundedice_levelset>0.);md.basalforcings.melting_rate(pos)=10.;
++md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
++pos=find(md.mask.groundedice_levelset>0.);md.basalforcings.groundedice_melting_rate(pos)=10.;
++md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+ md.basalforcings.geothermalflux=ones(md.mesh.numberofvertices,1);
+ 
+ %Friction
+Index: ../trunk-jpl/test/Par/ValleyGlacierShelf.par
+===================================================================
+--- ../trunk-jpl/test/Par/ValleyGlacierShelf.par	(revision 18067)
++++ ../trunk-jpl/test/Par/ValleyGlacierShelf.par	(revision 18068)
+@@ -49,7 +49,8 @@
+ 
+ %Surface mass balance and basal melting
+ md.surfaceforcings.mass_balance = 0.3*ones(md.mesh.numberofvertices,1);
+-md.basalforcings.melting_rate = md.surfaceforcings.mass_balance;
++md.basalforcings.floatingice_melting_rate = md.surfaceforcings.mass_balance;
++md.basalforcings.groundedice_melting_rate = md.surfaceforcings.mass_balance;
+ 
+ %Friction
+ md.friction.coefficient = 20.*ones(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/test/Par/SquareSheetShelf.par
+===================================================================
+--- ../trunk-jpl/test/Par/SquareSheetShelf.par	(revision 18067)
++++ ../trunk-jpl/test/Par/SquareSheetShelf.par	(revision 18068)
+@@ -33,7 +33,8 @@
+ 
+ %Accumulation and melting
+ md.surfaceforcings.mass_balance=10.*ones(md.mesh.numberofvertices,1);
+-md.basalforcings.melting_rate=5.*ones(md.mesh.numberofvertices,1);
++md.basalforcings.groundedice_melting_rate=5.*ones(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate=5.*ones(md.mesh.numberofvertices,1);
+ 
+ %Friction
+ md.friction.coefficient=20.*ones(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/test/Par/SquareShelfConstrained.par
+===================================================================
+--- ../trunk-jpl/test/Par/SquareShelfConstrained.par	(revision 18067)
++++ ../trunk-jpl/test/Par/SquareShelfConstrained.par	(revision 18068)
+@@ -30,7 +30,8 @@
+ 
+ %Surface mass balance and basal melting
+ md.surfaceforcings.mass_balance=10*ones(md.mesh.numberofvertices,1);
+-md.basalforcings.melting_rate=5*ones(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate=5*ones(md.mesh.numberofvertices,1);
++md.basalforcings.groundedice_melting_rate=5*ones(md.mesh.numberofvertices,1);
+ 
+ %Friction
+ md.friction.coefficient=20*ones(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/test/Par/79North.py
+===================================================================
+--- ../trunk-jpl/test/Par/79North.py	(revision 18067)
++++ ../trunk-jpl/test/Par/79North.py	(revision 18068)
+@@ -39,8 +39,9 @@
+ md.friction.q=numpy.ones((md.mesh.numberofelements,1))
+ 
+ #Ice shelf melting and surface mass balance 
+-md.basalforcings.melting_rate=numpy.zeros((md.mesh.numberofvertices,1))
+-md.basalforcings.melting_rate[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
++md.basalforcings.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices,1))
++md.basalforcings.floatingice_melting_rate[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
++md.basalforcings.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices,1))
+ md.surfaceforcings.mass_balance=15*numpy.ones((md.mesh.numberofvertices,1))
+ 
+ #Numerical parameters
+Index: ../trunk-jpl/test/Par/SquareSheetShelf.py
+===================================================================
+--- ../trunk-jpl/test/Par/SquareSheetShelf.py	(revision 18067)
++++ ../trunk-jpl/test/Par/SquareSheetShelf.py	(revision 18068)
+@@ -44,7 +44,8 @@
+ 
+ #Accumulation and melting
+ md.surfaceforcings.mass_balance=10.*numpy.ones((md.mesh.numberofvertices,1))
+-md.basalforcings.melting_rate=5.*numpy.ones((md.mesh.numberofvertices,1))
++md.basalforcings.groundedice_melting_rate=5.*numpy.ones((md.mesh.numberofvertices,1))
++md.basalforcings.floatingice_melting_rate=5.*numpy.ones((md.mesh.numberofvertices,1))
+ 
+ #Friction
+ md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices,1))
+Index: ../trunk-jpl/test/Par/SquareEISMINT.par
+===================================================================
+--- ../trunk-jpl/test/Par/SquareEISMINT.par	(revision 18067)
++++ ../trunk-jpl/test/Par/SquareEISMINT.par	(revision 18068)
+@@ -27,7 +27,8 @@
+ 
+ disp('      creating surface mass balance');
+ md.surfaceforcings.mass_balance=0.2*ones(md.mesh.numberofvertices,1); %0m/a
+-md.basalforcings.melting_rate=0.*ones(md.mesh.numberofvertices,1); %0m/a
++md.basalforcings.floatingice_melting_rate=0.*ones(md.mesh.numberofvertices,1); %0m/a
++md.basalforcings.groundedice_melting_rate=0.*ones(md.mesh.numberofvertices,1); %0m/a
+ 
+ disp('      boundary conditions');
+ md=SetMarineIceSheetBC(md,'../Exp/SquareFrontEISMINT.exp');
+Index: ../trunk-jpl/test/NightlyRun/test109.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test109.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test109.py	(revision 18068)
+@@ -20,9 +20,9 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Temperature','BasalforcingsMeltingRate']
++field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-13,1e-13]
+ field_values=[\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test703.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test703.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test703.m	(revision 18068)
+@@ -42,10 +42,12 @@
+ md.timestepping.final_time=0.000005;
+ md.stressbalance.shelf_dampening=1;
+ md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
+-md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices,1);
++md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
+ md.basalforcings.geothermalflux=zeros(md.mesh.numberofvertices,1);
+ posb=find((md.mesh.x>0) & md.mesh.vertexonbase);
+-md.basalforcings.melting_rate(posb)=18;
++md.basalforcings.groundedice_melting_rate(posb)=18;
++md.basalforcings.floatingice_melting_rate(posb)=18;
+ md.initialization.vx=zeros(md.mesh.numberofvertices,1);
+ md.initialization.vy=zeros(md.mesh.numberofvertices,1);
+ md.initialization.pressure=zeros(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/test/NightlyRun/test507.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test507.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test507.m	(revision 18068)
+@@ -7,8 +7,8 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
+-				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2'};
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', ...
++				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2'};
+ field_tolerances={1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06,1e-06,1e-06,1e-06,1e-06,1e-06,1e-06,1e-06,3e-06,1e-06};
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+@@ -20,7 +20,7 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vz),...
+@@ -30,5 +30,5 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test409.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test409.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test409.m	(revision 18068)
+@@ -7,9 +7,9 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
+-				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', ...
+-					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3'};
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', ...
++				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', ...
++					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3'};
+ field_tolerances={...
+ 	1e-05,1e-05,1e-05,1e-05,1e-05,1e-05,1e-05,1e-05,1e-05,1e-05,...
+ 	1e-03,1e-03,1e-02,1e-03,1e-02,1e-04,1e-01,1e-03,1e-01,1e-01,...
+@@ -24,7 +24,7 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vz),...
+@@ -34,7 +34,7 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(3).Vx),...
+ 	(md.results.TransientSolution(3).Vy),...
+ 	(md.results.TransientSolution(3).Vz),...
+@@ -44,5 +44,5 @@
+ 	(md.results.TransientSolution(3).Surface),...
+ 	(md.results.TransientSolution(3).Thickness),...
+ 	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(3).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test3108.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test3108.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test3108.py	(revision 18068)
+@@ -19,9 +19,9 @@
+ md=solve(md,ThermalSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Temperature','BasalforcingsMeltingRate']
++field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-13,1e-13]
+ field_values=[\
+ 	md.results.ThermalSolution.Temperature,\
+-	md.results.ThermalSolution.BasalforcingsMeltingRate,\
++	md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test3009.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test3009.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test3009.m	(revision 18068)
+@@ -14,9 +14,9 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-13,1e-13};
+ field_values={...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test211.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test211.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test211.py	(revision 18068)
+@@ -22,9 +22,9 @@
+ # Fields and tolerances to track changes
+ 
+ field_names=[\
+-	'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', \
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', \
+-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3']
++	'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', \
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
+ field_tolerances=[\
+ 	2e-08,2e-08,1e-06,2e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,\
+ 	5e-07,5e-07,5e-05,1e-07,1e-08,1e-08,1e-08,1e-08,5e-08,2e-06,\
+@@ -39,7 +39,7 @@
+ 	md.results.TransientSolution[0].Surface,\
+ 	md.results.TransientSolution[0].Thickness,\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].Vx,\
+ 	md.results.TransientSolution[1].Vy,\
+ 	md.results.TransientSolution[1].Vz,\
+@@ -49,7 +49,7 @@
+ 	md.results.TransientSolution[1].Surface,\
+ 	md.results.TransientSolution[1].Thickness,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[2].Vx,\
+ 	md.results.TransientSolution[2].Vy,\
+ 	md.results.TransientSolution[2].Vz,\
+@@ -59,5 +59,5 @@
+ 	md.results.TransientSolution[2].Surface,\
+ 	md.results.TransientSolution[2].Thickness,\
+ 	md.results.TransientSolution[2].Temperature,\
+-	md.results.TransientSolution[2].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test410.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test410.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test410.m	(revision 18068)
+@@ -8,7 +8,7 @@
+ md=solve(md,SteadystateSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-09,1e-09,1e-08,3e-10,1e-13,3e-10,1e-06};
+ field_values={...
+ 	(md.results.SteadystateSolution.Vx),...
+@@ -17,5 +17,5 @@
+ 	(md.results.SteadystateSolution.Vel),...
+ 	(md.results.SteadystateSolution.Pressure),...
+ 	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.BasalforcingsMeltingRate),...
++	(md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test225.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test225.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test225.py	(revision 18068)
+@@ -19,9 +19,9 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', \
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', \
+-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3']
++field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', \
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
+ field_tolerances=[\
+ 	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,\
+ 	2e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,\
+@@ -36,7 +36,7 @@
+ 	md.results.TransientSolution[0].Surface,\
+ 	md.results.TransientSolution[0].Thickness,\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].Vx,\
+ 	md.results.TransientSolution[1].Vy,\
+ 	md.results.TransientSolution[1].Vz,\
+@@ -46,7 +46,7 @@
+ 	md.results.TransientSolution[1].Surface,\
+ 	md.results.TransientSolution[1].Thickness,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[2].Vx,\
+ 	md.results.TransientSolution[2].Vy,\
+ 	md.results.TransientSolution[2].Vz,\
+@@ -56,5 +56,5 @@
+ 	md.results.TransientSolution[2].Surface,\
+ 	md.results.TransientSolution[2].Thickness,\
+ 	md.results.TransientSolution[2].Temperature,\
+-	md.results.TransientSolution[2].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test312.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test312.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test312.m	(revision 18068)
+@@ -8,9 +8,9 @@
+ md=solve(md,ThermalSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-13,1e-8};
+ field_values={...
+ 	(md.results.ThermalSolution.Temperature),...
+-	(md.results.ThermalSolution.BasalforcingsMeltingRate),...
++	(md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test508.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test508.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test508.py	(revision 18068)
+@@ -17,7 +17,7 @@
+ md=solve(md,SteadystateSolutionEnum())
+ 
+ # Fields and tolerances to track changes
+-field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate']
++field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[5e-08,1.6e-08,5e-08,1.6e-08,1e-09,6e-08,5e-07]
+ field_values=[\
+ 	md.results.SteadystateSolution.Vx,\
+@@ -26,5 +26,5 @@
+ 	md.results.SteadystateSolution.Vel,\
+ 	md.results.SteadystateSolution.Pressure,\
+ 	md.results.SteadystateSolution.Temperature,\
+-	md.results.SteadystateSolution.BasalforcingsMeltingRate,\
++	md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test516.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test516.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test516.m	(revision 18068)
+@@ -10,9 +10,9 @@
+ md=solve(md,ThermalSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-11,1e-11};
+ field_values={...
+ 	(md.results.ThermalSolution.Temperature),...
+-	(md.results.ThermalSolution.BasalforcingsMeltingRate),...
++	(md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test435.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test435.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test435.m	(revision 18068)
+@@ -30,7 +30,8 @@
+ md.friction.coefficient(:)=sqrt(10^7)*ones(md.mesh.numberofvertices,1);
+ md.friction.p=3*ones(md.mesh.numberofelements,1);
+ md.surfaceforcings.mass_balance(:)=1;
+-md.basalforcings.melting_rate(:)=0;
++md.basalforcings.groundedice_melting_rate(:)=0;
++md.basalforcings.floatingice_melting_rate(:)=0;
+ md.transient.isthermal=0;
+ md.transient.isstressbalance=1;
+ md.transient.isgroundingline=1;
+Index: ../trunk-jpl/test/NightlyRun/test315.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test315.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test315.py	(revision 18068)
+@@ -16,9 +16,9 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1',\
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2',\
+-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3']
++field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1',\
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2',\
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
+ field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
+ 	1e-10,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
+ 	1e-10,2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
+@@ -32,7 +32,7 @@
+ 	md.results.TransientSolution[0].Surface,\
+ 	md.results.TransientSolution[0].Thickness,\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].Vx,\
+ 	md.results.TransientSolution[1].Vy,\
+ 	md.results.TransientSolution[1].Vz,\
+@@ -42,7 +42,7 @@
+ 	md.results.TransientSolution[1].Surface,\
+ 	md.results.TransientSolution[1].Thickness,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[2].Vx,\
+ 	md.results.TransientSolution[2].Vy,\
+ 	md.results.TransientSolution[2].Vz,\
+@@ -52,5 +52,5 @@
+ 	md.results.TransientSolution[2].Surface,\
+ 	md.results.TransientSolution[2].Thickness,\
+ 	md.results.TransientSolution[2].Temperature,\
+-	md.results.TransientSolution[2].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test206.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test206.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test206.m	(revision 18068)
+@@ -8,9 +8,9 @@
+ md=solve(md,ThermalSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-13,5e-6};
+ field_values={...
+ 	(md.results.ThermalSolution.Temperature),...
+-	(md.results.ThermalSolution.BasalforcingsMeltingRate),...
++	(md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test108.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test108.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test108.m	(revision 18068)
+@@ -8,9 +8,9 @@
+ md=solve(md,ThermalSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-13,1e-5};
+ field_values={...
+ 	(md.results.ThermalSolution.Temperature),...
+-	(md.results.ThermalSolution.BasalforcingsMeltingRate),...
++	(md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test508.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test508.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test508.m	(revision 18068)
+@@ -8,7 +8,7 @@
+ md=solve(md,SteadystateSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={5e-08,3e-08,5e-08,3e-08,1e-09,2e-07,8e-07};
+ field_values={...
+ 	(md.results.SteadystateSolution.Vx),...
+@@ -17,5 +17,5 @@
+ 	(md.results.SteadystateSolution.Vel),...
+ 	(md.results.SteadystateSolution.Pressure),...
+ 	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.BasalforcingsMeltingRate),...
++	(md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test1301.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test1301.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test1301.m	(revision 18068)
+@@ -28,7 +28,7 @@
+ md=solve(md,ThermalSolutionEnum());
+ 
+ %plot results
+-comp_melting=md.results.ThermalSolution.BasalforcingsMeltingRate;
++comp_melting=md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate;
+ relative=abs((comp_melting-melting)./melting)*100.;
+ relative(find(comp_melting==melting))=0.;
+ plotmodel(md,'data',comp_melting,'title','Modeled melting','data',melting,'title','Analytical melting',...
+Index: ../trunk-jpl/test/NightlyRun/test3108.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test3108.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test3108.m	(revision 18068)
+@@ -11,9 +11,9 @@
+ md=solve(md,ThermalSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-13,1e-13};
+ field_values={...
+ 	(md.results.ThermalSolution.Temperature),...
+-	(md.results.ThermalSolution.BasalforcingsMeltingRate),...
++	(md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test324.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test324.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test324.py	(revision 18068)
+@@ -19,9 +19,9 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1',\
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2']
+-	#'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3']
++field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1',\
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2']
++	#'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
+ field_tolerances=[1e-13,  1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
+ 	5*1e-11,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\
+ 	1e-10,  1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
+@@ -35,7 +35,7 @@
+ 	md.results.TransientSolution[0].Surface,\
+ 	md.results.TransientSolution[0].Thickness,\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].Vx,\
+ 	md.results.TransientSolution[1].Vy,\
+ 	md.results.TransientSolution[1].Vz,\
+@@ -45,7 +45,7 @@
+ 	md.results.TransientSolution[1].Surface,\
+ 	md.results.TransientSolution[1].Thickness,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ #	md.results.TransientSolution[2].Vx,\
+ #	md.results.TransientSolution[2].Vy,\
+ #	md.results.TransientSolution[2].Vz,\
+@@ -55,5 +55,5 @@
+ #	md.results.TransientSolution[2].Surface,\
+ #	md.results.TransientSolution[2].Thickness,\
+ #	md.results.TransientSolution[2].Temperature,\
+-#	md.results.TransientSolution[2].BasalforcingsMeltingRate,\
++#	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test411.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test411.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test411.m	(revision 18068)
+@@ -8,7 +8,7 @@
+ md=solve(md,SteadystateSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={2e-09,1e-09,1e-08,1e-09,1e-09,1e-08,1e-05
+ };
+ field_values={...
+@@ -18,5 +18,5 @@
+ 	(md.results.SteadystateSolution.Vel),...
+ 	(md.results.SteadystateSolution.Pressure),...
+ 	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.BasalforcingsMeltingRate),...
++	(md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test232.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test232.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test232.m	(revision 18068)
+@@ -14,15 +14,15 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature1','BasalforcingsMeltingRate1','Temperature2','BasalforcingsMeltingRate2','Temperature3','BasalforcingsMeltingRate3','Temperature4','BasalforcingsMeltingRate4'};
++field_names     ={'Temperature1','BasalforcingsGroundediceMeltingRate1','Temperature2','BasalforcingsGroundediceMeltingRate2','Temperature3','BasalforcingsGroundediceMeltingRate3','Temperature4','BasalforcingsGroundediceMeltingRate4'};
+ field_tolerances={1e-13,1e-6,1e-13,1e-6,1e-13,1e-6,1e-13,1e-6};
+ field_values={...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(3).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(4).Temperature),...
+-	(md.results.TransientSolution(4).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(4).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test313.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test313.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test313.m	(revision 18068)
+@@ -12,9 +12,9 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-13,1e-13};
+ field_values={...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test3109.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test3109.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test3109.py	(revision 18068)
+@@ -22,9 +22,9 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Temperature','BasalforcingsMeltingRate']
++field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-13,1e-13]
+ field_values=[\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test224.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test224.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test224.m	(revision 18068)
+@@ -8,9 +8,9 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', ...
+-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3'};
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', ...
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', ...
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3'};
+ field_tolerances={...
+ 	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,...
+ 	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06,...
+@@ -25,7 +25,7 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vz),...
+@@ -35,7 +35,7 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(3).Vx),...
+ 	(md.results.TransientSolution(3).Vy),...
+ 	(md.results.TransientSolution(3).Vz),...
+@@ -45,5 +45,5 @@
+ 	(md.results.TransientSolution(3).Surface),...
+ 	(md.results.TransientSolution(3).Thickness),...
+ 	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(3).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test207.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test207.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test207.m	(revision 18068)
+@@ -11,13 +11,13 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature1','BasalforcingsMeltingRate1','Temperature2','BasalforcingsMeltingRate2','Temperature3','BasalforcingsMeltingRate3'};
++field_names     ={'Temperature1','BasalforcingsGroundediceMeltingRate1','Temperature2','BasalforcingsGroundediceMeltingRate2','Temperature3','BasalforcingsGroundediceMeltingRate3'};
+ field_tolerances={1e-13,1e-6,1e-13,1e-6,1e-13,1e-6};
+ field_values={...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(3).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test509.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test509.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test509.py	(revision 18068)
+@@ -18,7 +18,7 @@
+ md=solve(md,SteadystateSolutionEnum())
+ 
+ # Fields and tolerances to track changes
+-field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate']
++field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06]
+ field_values=[\
+ 	md.results.SteadystateSolution.Vx,\
+@@ -27,5 +27,5 @@
+ 	md.results.SteadystateSolution.Vel,\
+ 	md.results.SteadystateSolution.Pressure,\
+ 	md.results.SteadystateSolution.Temperature,\
+-	md.results.SteadystateSolution.BasalforcingsMeltingRate,\
++	md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test109.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test109.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test109.m	(revision 18068)
+@@ -11,9 +11,9 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-13,1e-13};
+ field_values={...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test509.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test509.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test509.m	(revision 18068)
+@@ -9,7 +9,7 @@
+ md=solve(md,SteadystateSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06
+ };
+ field_values={...
+@@ -19,5 +19,5 @@
+ 	(md.results.SteadystateSolution.Vel),...
+ 	(md.results.SteadystateSolution.Pressure),...
+ 	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.BasalforcingsMeltingRate),...
++	(md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test3109.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test3109.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test3109.m	(revision 18068)
+@@ -14,9 +14,9 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-13,1e-13};
+ field_values={...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test510.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test510.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test510.m	(revision 18068)
+@@ -8,7 +8,7 @@
+ md=solve(md,SteadystateSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06};
+ field_values={...
+ 	(md.results.SteadystateSolution.Vx),...
+@@ -17,5 +17,5 @@
+ 	(md.results.SteadystateSolution.Vel),...
+ 	(md.results.SteadystateSolution.Pressure),...
+ 	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.BasalforcingsMeltingRate),...
++	(md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test209.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test209.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test209.py	(revision 18068)
+@@ -20,9 +20,9 @@
+ 
+ # Fields and tolerances to track changes
+ 
+-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', \
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', \
+-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3']
++field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', \
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
+ field_tolerances=[\
+ 	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,\
+ 	1e-13,1e-13,3e-9,1e-13,3.8e-11,3.85e-11,3.85e-11,3.85e-11,1e-13,2e-8,\
+@@ -38,7 +38,7 @@
+ 	md.results.TransientSolution[0].Surface,\
+ 	md.results.TransientSolution[0].Thickness,\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].Vx,\
+ 	md.results.TransientSolution[1].Vy,\
+ 	md.results.TransientSolution[1].Vz,\
+@@ -48,7 +48,7 @@
+ 	md.results.TransientSolution[1].Surface,\
+ 	md.results.TransientSolution[1].Thickness,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[2].Vx,\
+ 	md.results.TransientSolution[2].Vy,\
+ 	md.results.TransientSolution[2].Vz,\
+@@ -58,5 +58,5 @@
+ 	md.results.TransientSolution[2].Surface,\
+ 	md.results.TransientSolution[2].Thickness,\
+ 	md.results.TransientSolution[2].Temperature,\
+-	md.results.TransientSolution[2].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test233.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test233.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test233.m	(revision 18068)
+@@ -10,10 +10,10 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', ...
+-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3', ...
+-	'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','Temperature4','BasalforcingsMeltingRate4'};
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', ...
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', ...
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3', ...
++	'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','Temperature4','BasalforcingsGroundediceMeltingRate4'};
+ field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09, ...
+ 	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06, ...
+ 	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06, ...
+@@ -28,7 +28,7 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vz),...
+@@ -38,7 +38,7 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(3).Vx),...
+ 	(md.results.TransientSolution(3).Vy),...
+ 	(md.results.TransientSolution(3).Vz),...
+@@ -48,7 +48,7 @@
+ 	(md.results.TransientSolution(3).Surface),...
+ 	(md.results.TransientSolution(3).Thickness),...
+ 	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(3).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(4).Vx),...
+ 	(md.results.TransientSolution(4).Vy),...
+ 	(md.results.TransientSolution(4).Vz),...
+@@ -58,5 +58,5 @@
+ 	(md.results.TransientSolution(4).Surface),...
+ 	(md.results.TransientSolution(4).Thickness),...
+ 	(md.results.TransientSolution(4).Temperature),...
+-	(md.results.TransientSolution(4).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(4).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test513.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test513.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test513.py	(revision 18068)
+@@ -34,7 +34,7 @@
+ md=solve(md,SteadystateSolutionEnum())
+ 
+ # Fields and tolerances to track changes
+-field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsMeltingRate']
++field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[2e-10,2e-10,1e-10,1e-10,3e-6,3e-6,3e-6,3e-6,2e-6,2e-06]
+ field_values=[\
+ 	md.results.SteadystateSolution.Gradient1,\
+@@ -46,5 +46,5 @@
+ 	md.results.SteadystateSolution.Vy,\
+ 	md.results.SteadystateSolution.Vz,\
+ 	md.results.SteadystateSolution.Temperature,\
+-	md.results.SteadystateSolution.BasalforcingsMeltingRate
++	md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate
+ ]
+Index: ../trunk-jpl/test/NightlyRun/test406.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test406.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test406.py	(revision 18068)
+@@ -18,9 +18,9 @@
+ md=solve(md,ThermalSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Temperature','BasalforcingsMeltingRate']
++field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-13,1e-5]
+ field_values=[\
+ 	md.results.ThermalSolution.Temperature,\
+-	md.results.ThermalSolution.BasalforcingsMeltingRate,\
++	md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test225.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test225.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test225.m	(revision 18068)
+@@ -9,9 +9,9 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', ...
+-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3'};
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', ...
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', ...
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3'};
+ field_tolerances={...
+ 	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,...
+ 	2e-09,1e-09,2e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,...
+@@ -26,7 +26,7 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vz),...
+@@ -36,7 +36,7 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(3).Vx),...
+ 	(md.results.TransientSolution(3).Vy),...
+ 	(md.results.TransientSolution(3).Vz),...
+@@ -46,5 +46,5 @@
+ 	(md.results.TransientSolution(3).Surface),...
+ 	(md.results.TransientSolution(3).Thickness),...
+ 	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(3).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test111.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test111.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test111.m	(revision 18068)
+@@ -9,9 +9,9 @@
+ 
+ %Fields and tolerances to track changes
+ field_names={...
+-	'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface2','Thickness1','Temperature1','BasalforcingsMeltingRate1','Volume1', ...
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2','Volume2', ...
+-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3','Volume3'};
++	'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface2','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1','Volume1', ...
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2','Volume2', ...
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3','Volume3'};
+ field_tolerances={...
+ 	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,1e-13,...
+ 	1e-09,1e-08,1e-08,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,2e-11,...
+@@ -26,7 +26,7 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(1).IceVolume),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+@@ -37,7 +37,7 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).IceVolume),...
+ 	(md.results.TransientSolution(3).Vx),...
+ 	(md.results.TransientSolution(3).Vy),...
+@@ -48,6 +48,6 @@
+ 	(md.results.TransientSolution(3).Surface),...
+ 	(md.results.TransientSolution(3).Thickness),...
+ 	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(3).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(3).IceVolume),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test415.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test415.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test415.py	(revision 18068)
+@@ -34,7 +34,7 @@
+ md=solve(md,SteadystateSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsMeltingRate']
++field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-9,1e-9,2e-10,1e-13,1e-09,1e-09,1e-09,1e-8,1e-09,1e-6]
+ field_values=[\
+ 	md.results.SteadystateSolution.Gradient1,\
+@@ -46,5 +46,5 @@
+ 	md.results.SteadystateSolution.Vy,\
+ 	md.results.SteadystateSolution.Vz,\
+ 	md.results.SteadystateSolution.Temperature,\
+-	md.results.SteadystateSolution.BasalforcingsMeltingRate
++	md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate
+ ]
+Index: ../trunk-jpl/test/NightlyRun/test227.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test227.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test227.py	(revision 18068)
+@@ -18,9 +18,9 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', \
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', \
+-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3']
++field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', \
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
+ field_tolerances=[\
+ 	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,\
+ 	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06,\
+@@ -35,7 +35,7 @@
+ 	md.results.TransientSolution[0].Surface,\
+ 	md.results.TransientSolution[0].Thickness,\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].Vx,\
+ 	md.results.TransientSolution[1].Vy,\
+ 	md.results.TransientSolution[1].Vz,\
+@@ -45,7 +45,7 @@
+ 	md.results.TransientSolution[1].Surface,\
+ 	md.results.TransientSolution[1].Thickness,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[2].Vx,\
+ 	md.results.TransientSolution[2].Vy,\
+ 	md.results.TransientSolution[2].Vz,\
+@@ -55,5 +55,5 @@
+ 	md.results.TransientSolution[2].Surface,\
+ 	md.results.TransientSolution[2].Thickness,\
+ 	md.results.TransientSolution[2].Temperature,\
+-	md.results.TransientSolution[2].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test332.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test332.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test332.m	(revision 18068)
+@@ -14,7 +14,8 @@
+ md.hydrology.spcsediment_head=NaN*ones(md.mesh.numberofvertices,1);
+ pos=find(md.mesh.y==0);
+ md.hydrology.spcsediment_head(pos)=0.0;
+-md.basalforcings.melting_rate = 2.0*ones(md.mesh.numberofvertices,1);
++md.basalforcings.groundedice_melting_rate = 2.0*ones(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate = 0.0*ones(md.mesh.numberofvertices,1);
+ md.hydrology.sediment_transmitivity=3*ones(md.mesh.numberofvertices,1);
+ md.timestepping.time_step=0;
+ md.timestepping.final_time=1.0;
+Index: ../trunk-jpl/test/NightlyRun/test315.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test315.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test315.m	(revision 18068)
+@@ -7,9 +7,9 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1',...
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2',...
+-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3'};
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1',...
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2',...
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3'};
+ field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...,
+ 	1e-10,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...
+ 	1e-10,2e-13,2e-13,2e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+@@ -23,7 +23,7 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vz),...
+@@ -33,7 +33,7 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(3).Vx),...
+ 	(md.results.TransientSolution(3).Vy),...
+ 	(md.results.TransientSolution(3).Vz),...
+@@ -43,5 +43,5 @@
+ 	(md.results.TransientSolution(3).Surface),...
+ 	(md.results.TransientSolution(3).Thickness),...
+ 	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(3).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test410.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test410.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test410.py	(revision 18068)
+@@ -18,7 +18,7 @@
+ md=solve(md,SteadystateSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate']
++field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-09,1e-09,1e-08,1e-09,1e-13,3e-10,1e-06]
+ field_values=[\
+ 	md.results.SteadystateSolution.Vx,\
+@@ -27,5 +27,5 @@
+ 	md.results.SteadystateSolution.Vel,\
+ 	md.results.SteadystateSolution.Pressure,\
+ 	md.results.SteadystateSolution.Temperature,\
+-	md.results.SteadystateSolution.BasalforcingsMeltingRate,\
++	md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test505.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test505.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test505.py	(revision 18068)
+@@ -16,8 +16,8 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ # Fields and tolerances to track changes
+-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', \
+-				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2']
++field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
++				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2']
+ field_tolerances=[1e-12,1e-12,1e-10,1e-12,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13, \
+ 						1e-13,1e-12,1e-10,1e-12,1e-13,1e-11,1e-11,2e-12,1e-11,1e-8]
+ field_values=[\
+@@ -30,7 +30,7 @@
+ 	md.results.TransientSolution[0].Surface,\
+ 	md.results.TransientSolution[0].Thickness,\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].Vx,\
+ 	md.results.TransientSolution[1].Vy,\
+ 	md.results.TransientSolution[1].Vz,\
+@@ -40,5 +40,5 @@
+ 	md.results.TransientSolution[1].Surface,\
+ 	md.results.TransientSolution[1].Thickness,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test317.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test317.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test317.py	(revision 18068)
+@@ -16,9 +16,9 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1',\
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2',\
+-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3']
++field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1',\
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2',\
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
+ field_tolerances=[1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
+ 		1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,\
+ 		1e-09,5e-10,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10]
+@@ -32,7 +32,7 @@
+ 	md.results.TransientSolution[0].Surface,\
+ 	md.results.TransientSolution[0].Thickness,\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].Vx,\
+ 	md.results.TransientSolution[1].Vy,\
+ 	md.results.TransientSolution[1].Vz,\
+@@ -42,7 +42,7 @@
+ 	md.results.TransientSolution[1].Surface,\
+ 	md.results.TransientSolution[1].Thickness,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[2].Vx,\
+ 	md.results.TransientSolution[2].Vy,\
+ 	md.results.TransientSolution[2].Vz,\
+@@ -52,5 +52,5 @@
+ 	md.results.TransientSolution[2].Surface,\
+ 	md.results.TransientSolution[2].Thickness,\
+ 	md.results.TransientSolution[2].Temperature,\
+-	md.results.TransientSolution[2].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test324.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test324.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test324.m	(revision 18068)
+@@ -9,9 +9,9 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1',...
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2'};
+-	%'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3'};
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1',...
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2'};
++	%'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3'};
+ field_tolerances={1e-13,  1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,...,
+ 	5*1e-11,1e-13,1.5e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+ 	%1e-10,  1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+@@ -25,7 +25,7 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vz),...
+@@ -35,7 +35,7 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ %	(md.results.TransientSolution(3).Vx),...
+ %	(md.results.TransientSolution(3).Vy),...
+ %	(md.results.TransientSolution(3).Vz),...
+@@ -45,5 +45,5 @@
+ %	(md.results.TransientSolution(3).Surface),...
+ %	(md.results.TransientSolution(3).Thickness),...
+ %	(md.results.TransientSolution(3).Temperature),...
+-%	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++%	(md.results.TransientSolution(3).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test209.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test209.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test209.m	(revision 18068)
+@@ -7,9 +7,9 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', ...
+-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3'};
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', ...
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', ...
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3'};
+ field_tolerances={...
+ 	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,...
+ 	1e-13,1e-13,3e-9,1e-13,3.8e-11,3.85e-11,3.85e-11,3.85e-11,1e-13,2e-8,...
+@@ -24,7 +24,7 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vz),...
+@@ -34,7 +34,7 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(3).Vx),...
+ 	(md.results.TransientSolution(3).Vy),...
+ 	(md.results.TransientSolution(3).Vz),...
+@@ -44,5 +44,5 @@
+ 	(md.results.TransientSolution(3).Surface),...
+ 	(md.results.TransientSolution(3).Thickness),...
+ 	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(3).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test312.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test312.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test312.py	(revision 18068)
+@@ -17,9 +17,9 @@
+ md=solve(md,ThermalSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Temperature','BasalforcingsMeltingRate']
++field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-13,1e-8]
+ field_values=[\
+ 	md.results.ThermalSolution.Temperature,\
+-	md.results.ThermalSolution.BasalforcingsMeltingRate,\
++	md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test210.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test210.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test210.m	(revision 18068)
+@@ -7,9 +7,9 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
+-				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', ...
+-					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3'};
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', ...
++				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', ...
++					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3'};
+ field_tolerances={...
+ 	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,...
+ 	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06,...
+@@ -24,7 +24,7 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vz),...
+@@ -34,7 +34,7 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(3).Vx),...
+ 	(md.results.TransientSolution(3).Vy),...
+ 	(md.results.TransientSolution(3).Vz),...
+@@ -44,5 +44,5 @@
+ 	(md.results.TransientSolution(3).Surface),...
+ 	(md.results.TransientSolution(3).Thickness),...
+ 	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(3).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test407.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test407.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test407.py	(revision 18068)
+@@ -21,9 +21,9 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Temperature','BasalforcingsMeltingRate']
++field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-13,1e-13]
+ field_values=[\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test333.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test333.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test333.m	(revision 18068)
+@@ -12,14 +12,14 @@
+ md.hydrology.sedimentlimit=800.0;
+ md.initialization.sediment_head=0.0*ones(md.mesh.numberofvertices,1);
+ md.hydrology.spcsediment_head=NaN*ones(md.mesh.numberofvertices,1);
+-md.basalforcings.melting_rate = 2.0*ones(md.mesh.numberofvertices,1);
++md.basalforcings.groundedice_melting_rate = 2.0*ones(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate = 0.0*ones(md.mesh.numberofvertices,1);
+ md.hydrology.sediment_transmitivity=3*ones(md.mesh.numberofvertices,1);
+ 
+ md.initialization.epl_head=0.0*ones(md.mesh.numberofvertices,1);
+ md.initialization.epl_thickness=1.0*ones(md.mesh.numberofvertices,1);
+ md.hydrology.spcepl_head=NaN*ones(md.mesh.numberofvertices,1);
+ md.hydrology.mask_eplactive_node=0*ones(md.mesh.numberofvertices,1);
+-md.basalforcings.melting_rate = 2.0*ones(md.mesh.numberofvertices,1);
+ md.hydrology.epl_conductivity=30;
+ md.hydrology.epl_initial_thickness=1;
+ md.hydrology.epl_max_thickness=1;
+Index: ../trunk-jpl/test/NightlyRun/test1301.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test1301.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test1301.py	(revision 18068)
+@@ -42,7 +42,7 @@
+ md=solve(md,ThermalSolutionEnum())
+ 
+ #plot results
+-comp_melting=md.results.ThermalSolution.BasalforcingsMeltingRate
++comp_melting=md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate
+ relative=numpy.abs((comp_melting-melting)/melting)*100.
+ relative[numpy.nonzero(comp_melting==melting)[0]]=0.
+ #plotmodel(md,'data',comp_melting,'title','Modeled melting','data',melting,'title','Analytical melting',...
+Index: ../trunk-jpl/test/NightlyRun/test1208.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test1208.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test1208.py	(revision 18068)
+@@ -42,7 +42,7 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Vx','Vy','Vz','Vel','Pressure','Thickness','Base','Surface','Temperature','BasalforcingsMeltingRate']
++field_names     =['Vx','Vy','Vz','Vel','Pressure','Thickness','Base','Surface','Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-08,1e-08,1e-07,1e-08,1e-08,1e-08,1e-08,1e-08,1e-07,1e-07]
+ field_values=[\
+ 	md.results.TransientSolution[-1].Vx,\
+@@ -54,5 +54,5 @@
+ 	md.results.TransientSolution[-1].Base,\
+ 	md.results.TransientSolution[-1].Surface,\
+ 	md.results.TransientSolution[-1].Temperature,\
+-	md.results.TransientSolution[-1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[-1].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test416.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test416.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test416.py	(revision 18068)
+@@ -34,7 +34,7 @@
+ md=solve(md,SteadystateSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsMeltingRate']
++field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-08,1e-07,1e-08,1e-08,1e-08,1e-08,1e-08,1e-07,1e-08,1e-05]
+ field_values=[\
+ 	md.results.SteadystateSolution.Gradient1,\
+@@ -46,5 +46,5 @@
+ 	md.results.SteadystateSolution.Vy,\
+ 	md.results.SteadystateSolution.Vz,\
+ 	md.results.SteadystateSolution.Temperature,\
+-	md.results.SteadystateSolution.BasalforcingsMeltingRate
++	md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate
+ ]
+Index: ../trunk-jpl/test/NightlyRun/test406.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test406.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test406.m	(revision 18068)
+@@ -8,9 +8,9 @@
+ md=solve(md,ThermalSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-13,1e-5};
+ field_values={...
+ 	(md.results.ThermalSolution.Temperature),...
+-	(md.results.ThermalSolution.BasalforcingsMeltingRate),...
++	(md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test227.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test227.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test227.m	(revision 18068)
+@@ -9,9 +9,9 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', ...
+-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3'};
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', ...
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', ...
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3'};
+ field_tolerances={...
+ 	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,...
+ 	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06,...
+@@ -26,7 +26,7 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vz),...
+@@ -36,7 +36,7 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(3).Vx),...
+ 	(md.results.TransientSolution(3).Vy),...
+ 	(md.results.TransientSolution(3).Vz),...
+@@ -46,5 +46,5 @@
+ 	(md.results.TransientSolution(3).Surface),...
+ 	(md.results.TransientSolution(3).Thickness),...
+ 	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(3).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test411.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test411.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test411.py	(revision 18068)
+@@ -18,7 +18,7 @@
+ md=solve(md,SteadystateSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate']
++field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-09,1e-09,1e-08,1e-09,1e-09,1e-08,1e-05
+ ]
+ field_values=[\
+@@ -28,5 +28,5 @@
+ 	md.results.SteadystateSolution.Vel,\
+ 	md.results.SteadystateSolution.Pressure,\
+ 	md.results.SteadystateSolution.Temperature,\
+-	md.results.SteadystateSolution.BasalforcingsMeltingRate,\
++	md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test211.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test211.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test211.m	(revision 18068)
+@@ -9,9 +9,9 @@
+ 
+ %Fields and tolerances to track changes
+ field_names={...
+-	'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', ...
+-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3'};
++	'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', ...
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', ...
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3'};
+ field_tolerances={...
+ 	2e-08,2e-08,1e-06,2e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,...
+ 	5e-07,5e-07,5e-05,1e-07,1e-08,1e-08,1e-08,1e-08,5e-08,2e-06,...
+@@ -26,7 +26,7 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vz),...
+@@ -36,7 +36,7 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(3).Vx),...
+ 	(md.results.TransientSolution(3).Vy),...
+ 	(md.results.TransientSolution(3).Vz),...
+@@ -46,5 +46,5 @@
+ 	(md.results.TransientSolution(3).Surface),...
+ 	(md.results.TransientSolution(3).Thickness),...
+ 	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(3).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test506.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test506.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test506.py	(revision 18068)
+@@ -16,8 +16,8 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ # Fields and tolerances to track changes
+-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', \
+-				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2']
++field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
++				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2']
+ field_tolerances=[1e-10,1e-10,1e-10,1e-10,1e-12,1e-11,2e-12,1e-11,1e-12,1e-09,\
+ 						1e-11,1e-11,1e-09,1e-11,1e-11,1e-10,1e-11,1e-10,1e-11,2e-08]
+ field_values=[\
+@@ -30,7 +30,7 @@
+ 	md.results.TransientSolution[0].Surface,\
+ 	md.results.TransientSolution[0].Thickness,\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].Vx,\
+ 	md.results.TransientSolution[1].Vy,\
+ 	md.results.TransientSolution[1].Vz,\
+@@ -40,5 +40,5 @@
+ 	md.results.TransientSolution[1].Surface,\
+ 	md.results.TransientSolution[1].Thickness,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test237.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test237.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test237.py	(revision 18068)
+@@ -65,9 +65,9 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', \
+-						'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', \
+-						'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3']
++field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
++						'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', \
++						'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
+ field_tolerances=[\
+ 	1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,1e-8,1e-13,1e-13,1e-8,\
+ 	1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,1e-8,1e-13,1e-13,1e-8,\
+@@ -82,7 +82,7 @@
+ 	md.results.TransientSolution[0].Surface,\
+ 	md.results.TransientSolution[0].Thickness,\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[0].SurfaceforcingsMonthlytemperatures,\
+ 	md.results.TransientSolution[0].SurfaceforcingsMassBalance,\
+ 	md.results.TransientSolution[1].Vx,\
+@@ -94,7 +94,7 @@
+ 	md.results.TransientSolution[1].Surface,\
+ 	md.results.TransientSolution[1].Thickness,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].SurfaceforcingsMonthlytemperatures,\
+ 	md.results.TransientSolution[1].SurfaceforcingsMassBalance,\
+ 	md.results.TransientSolution[2].Vx,\
+@@ -106,7 +106,7 @@
+ 	md.results.TransientSolution[2].Surface,\
+ 	md.results.TransientSolution[2].Thickness,\
+ 	md.results.TransientSolution[2].Temperature,\
+-	md.results.TransientSolution[2].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[2].SurfaceforcingsMonthlytemperatures,\
+ 	md.results.TransientSolution[2].SurfaceforcingsMassBalance,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test318.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test318.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test318.py	(revision 18068)
+@@ -17,7 +17,7 @@
+ md=solve(md,SteadystateSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate']
++field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-13,1e-13,1.5e-10,1e-10,1e-13,1e-11,1e-6]
+ field_values=[\
+ 	md.results.SteadystateSolution.Vx,\
+@@ -26,5 +26,5 @@
+ 	md.results.SteadystateSolution.Vel,\
+ 	md.results.SteadystateSolution.Pressure,\
+ 	md.results.SteadystateSolution.Temperature,\
+-	md.results.SteadystateSolution.BasalforcingsMeltingRate,\
++	md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test513.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test513.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test513.m	(revision 18068)
+@@ -23,7 +23,7 @@
+ md=solve(md,SteadystateSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={2e-10,2e-10,1e-10,1e-10,3e-6,3e-6,3e-6,3e-6,2e-6,2e-06};
+ field_values={...
+ 	(md.results.SteadystateSolution.Gradient1),...
+@@ -35,5 +35,5 @@
+ 	(md.results.SteadystateSolution.Vy),...
+ 	(md.results.SteadystateSolution.Vz),...
+ 	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.BasalforcingsMeltingRate)
++	(md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate)
+ };
+Index: ../trunk-jpl/test/NightlyRun/test334.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test334.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test334.m	(revision 18068)
+@@ -14,7 +14,8 @@
+ md.hydrology.spcsediment_head=NaN*ones(md.mesh.numberofvertices,1);
+ pos=find(md.mesh.y==0);
+ md.hydrology.spcsediment_head(pos)=0.0;
+-md.basalforcings.melting_rate = 2.0*ones(md.mesh.numberofvertices,1);
++md.basalforcings.groundedice_melting_rate = 2.0*ones(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate = 0.0*ones(md.mesh.numberofvertices,1);
+ md.hydrology.sediment_transmitivity= 3.0*ones(md.mesh.numberofvertices,1);
+ md.timestepping.time_step=0;
+ md.timestepping.final_time=1.0;
+Index: ../trunk-jpl/test/NightlyRun/test415.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test415.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test415.m	(revision 18068)
+@@ -22,7 +22,7 @@
+ md=solve(md,SteadystateSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-09,1e-9,2e-10,1e-13,1e-09,1e-09,1e-09,1e-8,1e-09,1e-6};
+ field_values={...
+ 	(md.results.SteadystateSolution.Gradient1),...
+@@ -34,5 +34,5 @@
+ 	(md.results.SteadystateSolution.Vy),...
+ 	(md.results.SteadystateSolution.Vz),...
+ 	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.BasalforcingsMeltingRate)
++	(md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate)
+ };
+Index: ../trunk-jpl/test/NightlyRun/test317.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test317.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test317.m	(revision 18068)
+@@ -7,9 +7,9 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1',...
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2',...
+-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3'};
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1',...
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2',...
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3'};
+ field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+ 	1e-09,1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+ 	1e-09,5e-10,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10};
+@@ -23,7 +23,7 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vz),...
+@@ -33,7 +33,7 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(3).Vx),...
+ 	(md.results.TransientSolution(3).Vy),...
+ 	(md.results.TransientSolution(3).Vz),...
+@@ -43,5 +43,5 @@
+ 	(md.results.TransientSolution(3).Surface),...
+ 	(md.results.TransientSolution(3).Thickness),...
+ 	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(3).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test3008.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test3008.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test3008.py	(revision 18068)
+@@ -19,9 +19,9 @@
+ md=solve(md,ThermalSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Temperature','BasalforcingsMeltingRate']
++field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-13,1e-13]
+ field_values=[\
+ 	md.results.ThermalSolution.Temperature,\
+-	md.results.ThermalSolution.BasalforcingsMeltingRate,\
++	md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test111.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test111.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test111.py	(revision 18068)
+@@ -18,9 +18,9 @@
+ 
+ #Fields and tolerances to track changes
+ field_names=[\
+-	'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface2','Thickness1','Temperature1','BasalforcingsMeltingRate1','Volume1', \
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2','Volume2', \
+-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3','Volume3']
++	'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface2','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1','Volume1', \
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2','Volume2', \
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3','Volume3']
+ field_tolerances=[\
+ 	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,1e-13,\
+ 	1e-09,1e-08,1e-08,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,2e-11,\
+@@ -35,7 +35,7 @@
+ 	md.results.TransientSolution[0].Surface,\
+ 	md.results.TransientSolution[0].Thickness,\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[0].IceVolume,\
+ 	md.results.TransientSolution[1].Vx,\
+ 	md.results.TransientSolution[1].Vy,\
+@@ -46,7 +46,7 @@
+ 	md.results.TransientSolution[1].Surface,\
+ 	md.results.TransientSolution[1].Thickness,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].IceVolume,\
+ 	md.results.TransientSolution[2].Vx,\
+ 	md.results.TransientSolution[2].Vy,\
+@@ -57,6 +57,6 @@
+ 	md.results.TransientSolution[2].Surface,\
+ 	md.results.TransientSolution[2].Thickness,\
+ 	md.results.TransientSolution[2].Temperature,\
+-	md.results.TransientSolution[2].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[2].IceVolume,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test232.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test232.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test232.py	(revision 18068)
+@@ -24,15 +24,15 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Temperature1','BasalforcingsMeltingRate1','Temperature2','BasalforcingsMeltingRate2','Temperature3','BasalforcingsMeltingRate3','Temperature4','BasalforcingsMeltingRate4']
++field_names     =['Temperature1','BasalforcingsGroundediceMeltingRate1','Temperature2','BasalforcingsGroundediceMeltingRate2','Temperature3','BasalforcingsGroundediceMeltingRate3','Temperature4','BasalforcingsGroundediceMeltingRate4']
+ field_tolerances=[1e-13,1e-6,1e-13,1e-6,1e-13,1e-6,1e-13,1e-6]
+ field_values=[\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[2].Temperature,\
+-	md.results.TransientSolution[2].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[3].Temperature,\
+-	md.results.TransientSolution[3].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[3].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test313.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test313.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test313.py	(revision 18068)
+@@ -21,9 +21,9 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Temperature','BasalforcingsMeltingRate']
++field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-13,1e-13]
+ field_values=[\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test206.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test206.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test206.py	(revision 18068)
+@@ -21,9 +21,9 @@
+ 
+ # Fields and tolerances to track changes
+ 
+-field_names     =['Temperature','BasalforcingsMeltingRate']
++field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-13,5e-6]
+ field_values=[\
+ 	md.results.ThermalSolution.Temperature,\
+-	md.results.ThermalSolution.BasalforcingsMeltingRate,\
++	md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test515.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test515.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test515.py	(revision 18068)
+@@ -21,12 +21,12 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ # Fields and tolerances to track changes
+-field_names     =['Temperature1','BasalforcingsMeltingRate1', \
+-				      'Temperature2','BasalforcingsMeltingRate2']
++field_names     =['Temperature1','BasalforcingsGroundediceMeltingRate1', \
++				      'Temperature2','BasalforcingsGroundediceMeltingRate2']
+ field_tolerances=[1e-13,1e-8,1e-13,2e-8]
+ field_values=[\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test505.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test505.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test505.m	(revision 18068)
+@@ -7,8 +7,8 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
+-				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2'};
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', ...
++				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2'};
+ field_tolerances={1e-12,1e-12,3e-10,1e-12,1e-13,1e-11,5e-12,9e-12,1e-13,5e-9,...
+ 						5e-11,5e-11,1e-10,2e-11,7e-12,1e-11,1e-11,5e-12,1e-11,2e-8};
+ field_values={...
+@@ -21,7 +21,7 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vz),...
+@@ -31,5 +31,5 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test407.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test407.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test407.m	(revision 18068)
+@@ -11,9 +11,9 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-13,1e-13};
+ field_values={...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test1208.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test1208.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test1208.m	(revision 18068)
+@@ -29,7 +29,7 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure','Thickness','Base','Surface','Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure','Thickness','Base','Surface','Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-08,1e-08,1e-07,1e-08,1e-08,1e-08,1e-08,1e-08,1e-07,3e-07};
+ field_values={...
+ 	(md.results.TransientSolution(end).Vx),...
+@@ -41,5 +41,5 @@
+ 	(md.results.TransientSolution(end).Base),...
+ 	(md.results.TransientSolution(end).Surface),...
+ 	(md.results.TransientSolution(end).Temperature),...
+-	(md.results.TransientSolution(end).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(end).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test510.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test510.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test510.py	(revision 18068)
+@@ -17,7 +17,7 @@
+ md=solve(md,SteadystateSolutionEnum())
+ 
+ # Fields and tolerances to track changes
+-field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate']
++field_names     =['Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06]
+ field_values=[\
+ 	md.results.SteadystateSolution.Vx,\
+@@ -26,5 +26,5 @@
+ 	md.results.SteadystateSolution.Vel,\
+ 	md.results.SteadystateSolution.Pressure,\
+ 	md.results.SteadystateSolution.Temperature,\
+-	md.results.SteadystateSolution.BasalforcingsMeltingRate,\
++	md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test108.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test108.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test108.py	(revision 18068)
+@@ -17,9 +17,9 @@
+ md=solve(md,ThermalSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Temperature','BasalforcingsMeltingRate']
++field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-13,1e-5]
+ field_values=[\
+ 	md.results.ThermalSolution.Temperature,\
+-	md.results.ThermalSolution.BasalforcingsMeltingRate,\
++	md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test335.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test335.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test335.m	(revision 18068)
+@@ -12,14 +12,14 @@
+ md.hydrology.sedimentlimit=800.0;
+ md.initialization.sediment_head=0.0*ones(md.mesh.numberofvertices,1);
+ md.hydrology.spcsediment_head=NaN*ones(md.mesh.numberofvertices,1);
+-md.basalforcings.melting_rate = 2.0*ones(md.mesh.numberofvertices,1);
++md.basalforcings.groundedice_melting_rate = 2.0*ones(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate = 0.0*ones(md.mesh.numberofvertices,1);
+ md.hydrology.sediment_transmitivity=3*ones(md.mesh.numberofvertices,1);
+ 
+ md.initialization.epl_head=0.0*ones(md.mesh.numberofvertices,1);
+ md.initialization.epl_thickness=1.0*ones(md.mesh.numberofvertices,1);
+ md.hydrology.spcepl_head=NaN*ones(md.mesh.numberofvertices,1);
+ md.hydrology.mask_eplactive_node=0*ones(md.mesh.numberofvertices,1);
+-md.basalforcings.melting_rate = 2.0*ones(md.mesh.numberofvertices,1);
+ md.hydrology.epl_conductivity=30;
+ md.hydrology.epl_initial_thickness=1;
+ md.hydrology.epl_max_thickness=1;
+Index: ../trunk-jpl/test/NightlyRun/test416.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test416.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test416.m	(revision 18068)
+@@ -22,7 +22,7 @@
+ md=solve(md,SteadystateSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-08,1e-07,1e-08,1e-08,1e-08,1e-08,1e-08,1e-07,1e-08,1e-05};
+ field_values={...
+ 	(md.results.SteadystateSolution.Gradient1),...
+@@ -34,5 +34,5 @@
+ 	(md.results.SteadystateSolution.Vy),...
+ 	(md.results.SteadystateSolution.Vz),...
+ 	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.BasalforcingsMeltingRate)
++	(md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate)
+ };
+Index: ../trunk-jpl/test/NightlyRun/test237.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test237.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test237.m	(revision 18068)
+@@ -53,9 +53,9 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
+-						'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', ...
+-						'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3'};
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', ...
++						'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', ...
++						'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3'};
+ field_tolerances={...
+ 	1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,1e-8,1e-8,1e-13,1e-8,...
+ 	1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,1e-8,1e-8,1e-13,1e-8,...
+@@ -70,7 +70,7 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(1).SurfaceforcingsMonthlytemperatures),...
+ 	(md.results.TransientSolution(1).SurfaceforcingsMassBalance),...
+ 	(md.results.TransientSolution(2).Vx),...
+@@ -82,7 +82,7 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).SurfaceforcingsMonthlytemperatures),...
+ 	(md.results.TransientSolution(2).SurfaceforcingsMassBalance),...
+ 	(md.results.TransientSolution(3).Vx),...
+@@ -94,7 +94,7 @@
+ 	(md.results.TransientSolution(3).Surface),...
+ 	(md.results.TransientSolution(3).Thickness),...
+ 	(md.results.TransientSolution(3).Temperature),...
+-	(md.results.TransientSolution(3).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(3).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(3).SurfaceforcingsMonthlytemperatures),...
+ 	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test318.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test318.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test318.m	(revision 18068)
+@@ -8,7 +8,7 @@
+ md=solve(md,SteadystateSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Vx','Vy','Vz','Vel','Pressure','Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-13,1e-13,4e-10,1e-10,1e-13,1e-11,1e-6};
+ field_values={...
+ 	(md.results.SteadystateSolution.Vx),...
+@@ -17,5 +17,5 @@
+ 	(md.results.SteadystateSolution.Vel),...
+ 	(md.results.SteadystateSolution.Pressure),...
+ 	(md.results.SteadystateSolution.Temperature),...
+-	(md.results.SteadystateSolution.BasalforcingsMeltingRate),...
++	(md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test210.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test210.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test210.py	(revision 18068)
+@@ -20,9 +20,9 @@
+ 
+ # Fields and tolerances to track changes
+ 
+-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', \
+-				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', \
+-					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3']
++field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
++				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', \
++					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
+ field_tolerances=[\
+ 	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,\
+ 	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06,\
+@@ -37,7 +37,7 @@
+ 	md.results.TransientSolution[0].Surface,\
+ 	md.results.TransientSolution[0].Thickness,\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].Vx,\
+ 	md.results.TransientSolution[1].Vy,\
+ 	md.results.TransientSolution[1].Vz,\
+@@ -47,7 +47,7 @@
+ 	md.results.TransientSolution[1].Surface,\
+ 	md.results.TransientSolution[1].Thickness,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[2].Vx,\
+ 	md.results.TransientSolution[2].Vy,\
+ 	md.results.TransientSolution[2].Vz,\
+@@ -57,5 +57,5 @@
+ 	md.results.TransientSolution[2].Surface,\
+ 	md.results.TransientSolution[2].Thickness,\
+ 	md.results.TransientSolution[2].Temperature,\
+-	md.results.TransientSolution[2].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test224.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test224.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test224.py	(revision 18068)
+@@ -17,9 +17,9 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', \
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', \
+-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3']
++field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', \
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
+ field_tolerances=[\
+ 	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,\
+ 	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06,\
+@@ -34,7 +34,7 @@
+ 	md.results.TransientSolution[0].Surface,\
+ 	md.results.TransientSolution[0].Thickness,\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].Vx,\
+ 	md.results.TransientSolution[1].Vy,\
+ 	md.results.TransientSolution[1].Vz,\
+@@ -44,7 +44,7 @@
+ 	md.results.TransientSolution[1].Surface,\
+ 	md.results.TransientSolution[1].Thickness,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[2].Vx,\
+ 	md.results.TransientSolution[2].Vy,\
+ 	md.results.TransientSolution[2].Vz,\
+@@ -54,5 +54,5 @@
+ 	md.results.TransientSolution[2].Surface,\
+ 	md.results.TransientSolution[2].Thickness,\
+ 	md.results.TransientSolution[2].Temperature,\
+-	md.results.TransientSolution[2].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test507.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test507.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test507.py	(revision 18068)
+@@ -16,8 +16,8 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ # Fields and tolerances to track changes
+-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', \
+-				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2']
++field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
++				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2']
+ field_tolerances=[1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06,1e-06,1e-06,1e-06,1e-06,1e-06,1e-06,1e-06,1e-06,1e-06]
+ field_values=[\
+ 	md.results.TransientSolution[0].Vx,\
+@@ -29,7 +29,7 @@
+ 	md.results.TransientSolution[0].Surface,\
+ 	md.results.TransientSolution[0].Thickness,\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].Vx,\
+ 	md.results.TransientSolution[1].Vy,\
+ 	md.results.TransientSolution[1].Vz,\
+@@ -39,5 +39,5 @@
+ 	md.results.TransientSolution[1].Surface,\
+ 	md.results.TransientSolution[1].Thickness,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test506.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test506.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test506.m	(revision 18068)
+@@ -7,8 +7,8 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
+-				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2'};
++field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', ...
++				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2'};
+ field_tolerances={1e-10,1e-10,1e-10,1e-10,1e-12,1e-11,2e-12,1e-11,1e-12,1e-09,...
+ 						1e-11,1e-11,1e-09,1e-11,1e-11,1e-10,1e-11,1e-10,1e-11,2e-08};
+ field_values={...
+@@ -21,7 +21,7 @@
+ 	(md.results.TransientSolution(1).Surface),...
+ 	(md.results.TransientSolution(1).Thickness),...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).Vx),...
+ 	(md.results.TransientSolution(2).Vy),...
+ 	(md.results.TransientSolution(2).Vz),...
+@@ -31,5 +31,5 @@
+ 	(md.results.TransientSolution(2).Surface),...
+ 	(md.results.TransientSolution(2).Thickness),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test3009.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test3009.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test3009.py	(revision 18068)
+@@ -22,9 +22,9 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Temperature','BasalforcingsMeltingRate']
++field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-13,1e-13]
+ field_values=[\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test3008.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test3008.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test3008.m	(revision 18068)
+@@ -11,9 +11,9 @@
+ md=solve(md,ThermalSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature','BasalforcingsMeltingRate'};
++field_names     ={'Temperature','BasalforcingsGroundediceMeltingRate'};
+ field_tolerances={1e-13,1e-13};
+ field_values={...
+ 	(md.results.ThermalSolution.Temperature),...
+-	(md.results.ThermalSolution.BasalforcingsMeltingRate),...
++	(md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/test/NightlyRun/test233.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test233.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test233.py	(revision 18068)
+@@ -20,10 +20,10 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', \
+-	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', \
+-	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3', \
+-	'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','Temperature4','BasalforcingsMeltingRate4']
++field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
++	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', \
++	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3', \
++	'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','Temperature4','BasalforcingsGroundediceMeltingRate4']
+ field_tolerances=[1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09, \
+ 	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06, \
+ 	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06, \
+@@ -38,7 +38,7 @@
+ 	md.results.TransientSolution[0].Surface,\
+ 	md.results.TransientSolution[0].Thickness,\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].Vx,\
+ 	md.results.TransientSolution[1].Vy,\
+ 	md.results.TransientSolution[1].Vz,\
+@@ -48,7 +48,7 @@
+ 	md.results.TransientSolution[1].Surface,\
+ 	md.results.TransientSolution[1].Thickness,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[2].Vx,\
+ 	md.results.TransientSolution[2].Vy,\
+ 	md.results.TransientSolution[2].Vz,\
+@@ -58,7 +58,7 @@
+ 	md.results.TransientSolution[2].Surface,\
+ 	md.results.TransientSolution[2].Thickness,\
+ 	md.results.TransientSolution[2].Temperature,\
+-	md.results.TransientSolution[2].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[3].Vx,\
+ 	md.results.TransientSolution[3].Vy,\
+ 	md.results.TransientSolution[3].Vz,\
+@@ -68,5 +68,5 @@
+ 	md.results.TransientSolution[3].Surface,\
+ 	md.results.TransientSolution[3].Thickness,\
+ 	md.results.TransientSolution[3].Temperature,\
+-	md.results.TransientSolution[3].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[3].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test207.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test207.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test207.py	(revision 18068)
+@@ -22,13 +22,13 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ # Fields and tolerances to track changes
+-field_names     =['Temperature1','BasalforcingsMeltingRate1','Temperature2','BasalforcingsMeltingRate2','Temperature3','BasalforcingsMeltingRate3']
++field_names     =['Temperature1','BasalforcingsGroundediceMeltingRate1','Temperature2','BasalforcingsGroundediceMeltingRate2','Temperature3','BasalforcingsGroundediceMeltingRate3']
+ field_tolerances=[1e-13,1e-6,1e-13,1e-6,1e-13,1e-6]
+ field_values=[\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[2].Temperature,\
+-	md.results.TransientSolution[2].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test516.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test516.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test516.py	(revision 18068)
+@@ -20,9 +20,9 @@
+ md=solve(md,ThermalSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Temperature','BasalforcingsMeltingRate']
++field_names     =['Temperature','BasalforcingsGroundediceMeltingRate']
+ field_tolerances=[1e-11,1e-11]
+ field_values=[\
+ 	md.results.ThermalSolution.Temperature,\
+-	md.results.ThermalSolution.BasalforcingsMeltingRate,\
++	md.results.ThermalSolution.BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test409.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test409.py	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test409.py	(revision 18068)
+@@ -17,9 +17,9 @@
+ md=solve(md,TransientSolutionEnum())
+ 
+ #Fields and tolerances to track changes
+-field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', \
+-				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', \
+-					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3']
++field_names     =['Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsGroundediceMeltingRate1', \
++				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsGroundediceMeltingRate2', \
++					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsGroundediceMeltingRate3']
+ field_tolerances=[\
+ 	1e-05,1e-05,1e-05,1e-05,1e-05,1e-05,1e-05,1e-05,1e-05,1e-05,\
+ 	1e-03,1e-03,1e-02,1e-03,1e-02,1e-04,1e-01,1e-03,1e-01,1e-01,\
+@@ -34,7 +34,7 @@
+ 	md.results.TransientSolution[0].Surface,\
+ 	md.results.TransientSolution[0].Thickness,\
+ 	md.results.TransientSolution[0].Temperature,\
+-	md.results.TransientSolution[0].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[0].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[1].Vx,\
+ 	md.results.TransientSolution[1].Vy,\
+ 	md.results.TransientSolution[1].Vz,\
+@@ -44,7 +44,7 @@
+ 	md.results.TransientSolution[1].Surface,\
+ 	md.results.TransientSolution[1].Thickness,\
+ 	md.results.TransientSolution[1].Temperature,\
+-	md.results.TransientSolution[1].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[1].BasalforcingsGroundediceMeltingRate,\
+ 	md.results.TransientSolution[2].Vx,\
+ 	md.results.TransientSolution[2].Vy,\
+ 	md.results.TransientSolution[2].Vz,\
+@@ -54,5 +54,5 @@
+ 	md.results.TransientSolution[2].Surface,\
+ 	md.results.TransientSolution[2].Thickness,\
+ 	md.results.TransientSolution[2].Temperature,\
+-	md.results.TransientSolution[2].BasalforcingsMeltingRate,\
++	md.results.TransientSolution[2].BasalforcingsGroundediceMeltingRate,\
+ 	]
+Index: ../trunk-jpl/test/NightlyRun/test515.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test515.m	(revision 18067)
++++ ../trunk-jpl/test/NightlyRun/test515.m	(revision 18068)
+@@ -12,12 +12,12 @@
+ md=solve(md,TransientSolutionEnum());
+ 
+ %Fields and tolerances to track changes
+-field_names     ={'Temperature1','BasalforcingsMeltingRate1', ...
+-				      'Temperature2','BasalforcingsMeltingRate2'};
++field_names     ={'Temperature1','BasalforcingsGroundediceMeltingRate1', ...
++				      'Temperature2','BasalforcingsGroundediceMeltingRate2'};
+ field_tolerances={1e-13,1e-8,1e-13,3e-8};
+ field_values={...
+ 	(md.results.TransientSolution(1).Temperature),...
+-	(md.results.TransientSolution(1).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(1).BasalforcingsGroundediceMeltingRate),...
+ 	(md.results.TransientSolution(2).Temperature),...
+-	(md.results.TransientSolution(2).BasalforcingsMeltingRate),...
++	(md.results.TransientSolution(2).BasalforcingsGroundediceMeltingRate),...
+ 	};
+Index: ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp	(revision 18068)
+@@ -40,7 +40,7 @@
+ 	iomodel->FetchDataToInput(elements,MaskIceLevelsetEnum);
+ 	iomodel->FetchDataToInput(elements,VxEnum);
+ 	iomodel->FetchDataToInput(elements,VyEnum);
+-	iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateEnum);
++	iomodel->FetchDataToInput(elements,BasalforcingsGroundediceMeltingRateEnum);
+ 	iomodel->FetchDataToInput(elements,SurfaceforcingsMassBalanceEnum);
+ 	iomodel->FetchDataToInput(elements,BalancethicknessThickeningRateEnum);
+ 
+@@ -353,7 +353,7 @@
+ 
+ 	/*Retrieve all inputs and parameters*/
+ 	element->GetVerticesCoordinates(&xyz_list);
+-	Input* mb_input   = element->GetInput(BasalforcingsMeltingRateEnum);       _assert_(mb_input);
++	Input* mb_input   = element->GetInput(BasalforcingsGroundediceMeltingRateEnum);       _assert_(mb_input);
+ 	Input* ms_input   = element->GetInput(SurfaceforcingsMassBalanceEnum);     _assert_(ms_input);
+ 	Input* dhdt_input = element->GetInput(BalancethicknessThickeningRateEnum); _assert_(dhdt_input);
+ 
+@@ -394,7 +394,7 @@
+ 
+ 	/*Retrieve all inputs and parameters*/
+ 	element->GetVerticesCoordinates(&xyz_list);
+-	Input* mb_input   = element->GetInput(BasalforcingsMeltingRateEnum);       _assert_(mb_input);
++	Input* mb_input   = element->GetInput(BasalforcingsGroundediceMeltingRateEnum);       _assert_(mb_input);
+ 	Input* ms_input   = element->GetInput(SurfaceforcingsMassBalanceEnum);     _assert_(ms_input);
+ 	Input* dhdt_input = element->GetInput(BalancethicknessThickeningRateEnum); _assert_(dhdt_input);
+ 
+@@ -511,14 +511,14 @@
+ 	/*Retrieve all inputs we will be needing: */
+ 	element->GetVerticesCoordinates(&xyz_list);
+ 	element->GradientIndexing(&vertexpidlist[0],control_index);
+-	Input* thickness_input            = element->GetInput(ThicknessEnum);                          _assert_(thickness_input);
+-	Input* thicknessobs_input         = element->GetInput(InversionThicknessObsEnum);              _assert_(thicknessobs_input);
+-	Input* weights_input              = element->GetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
+-	Input* vx_input                   = element->GetInput(VxEnum);                                 _assert_(vx_input);
+-	Input* vy_input                   = element->GetInput(VyEnum);                                 _assert_(vy_input);
+-	Input* surface_mass_balance_input = element->GetInput(SurfaceforcingsMassBalanceEnum);         _assert_(surface_mass_balance_input);
+-	Input* basal_melting_input        = element->GetInput(BasalforcingsMeltingRateEnum);           _assert_(basal_melting_input);
+-	Input* dhdt_input                 = element->GetInput(BalancethicknessThickeningRateEnum);     _assert_(dhdt_input);
++	Input* thickness_input            = element->GetInput(ThicknessEnum);                           _assert_(thickness_input);
++	Input* thicknessobs_input         = element->GetInput(InversionThicknessObsEnum);               _assert_(thicknessobs_input);
++	Input* weights_input              = element->GetInput(InversionCostFunctionsCoefficientsEnum);  _assert_(weights_input);
++	Input* vx_input                   = element->GetInput(VxEnum);                                  _assert_(vx_input);
++	Input* vy_input                   = element->GetInput(VyEnum);                                  _assert_(vy_input);
++	Input* surface_mass_balance_input = element->GetInput(SurfaceforcingsMassBalanceEnum);          _assert_(surface_mass_balance_input);
++	Input* basal_melting_input        = element->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(basal_melting_input);
++	Input* dhdt_input                 = element->GetInput(BalancethicknessThickeningRateEnum);      _assert_(dhdt_input);
+ 
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss=element->NewGauss(4);
+Index: ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 18068)
+@@ -37,7 +37,8 @@
+ 		iomodel->FetchDataToInput(elements,MeshVertexonbaseEnum);
+ 		iomodel->FetchDataToInput(elements,MeshVertexonsurfaceEnum);
+ 	}
+-	iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateEnum);
++	iomodel->FetchDataToInput(elements,BasalforcingsGroundediceMeltingRateEnum);
++	iomodel->FetchDataToInput(elements,BasalforcingsFloatingiceMeltingRateEnum);
+ 	iomodel->FetchDataToInput(elements,VxEnum,0.);
+ 	iomodel->FetchDataToInput(elements,VyEnum,0.);
+ }/*}}}*/
+@@ -277,7 +278,8 @@
+ 	IssmDouble *xyz_list      = NULL;
+ 	IssmDouble *xyz_list_base = NULL;
+ 	IssmDouble  Jdet,slope[3];
+-	IssmDouble  vx,vy,vz=0.,dbdx,dbdy,basalmeltingvalue;
++	IssmDouble  vx,vy,vz=0.,dbdx,dbdy;
++	IssmDouble  gmb,fmb,phi,basalmeltingvalue;
+ 
+ 	if(!element->IsOnBase()) return NULL;
+ 
+@@ -292,10 +294,12 @@
+ 	element->GetVerticesCoordinates(&xyz_list);
+ 	element->GetVerticesCoordinatesBase(&xyz_list_base);
+ 	element->GetInputValue(&approximation,ApproximationEnum);
+-	Input* base_input=element->GetInput(BaseEnum);                                _assert_(base_input);
+-	Input* basal_melting_input=element->GetInput(BasalforcingsMeltingRateEnum); _assert_(basal_melting_input);
+-	Input* vx_input=element->GetInput(VxEnum);                                  _assert_(vx_input);
+-	Input* vy_input=element->GetInput(VyEnum);                                  _assert_(vy_input);
++	Input* base_input=element->GetInput(BaseEnum);                                               _assert_(base_input);
++	Input* groundedice_input=element->GetInput(MaskGroundediceLevelsetEnum);                     _assert_(groundedice_input);
++	Input* groundedice_melting_input=element->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(groundedice_melting_input);
++	Input* floatingice_melting_input=element->GetInput(BasalforcingsFloatingiceMeltingRateEnum); _assert_(floatingice_melting_input);
++	Input* vx_input=element->GetInput(VxEnum);                                                   _assert_(vx_input);
++	Input* vy_input=element->GetInput(VyEnum);                                                   _assert_(vy_input);
+ 	Input* vzFS_input=NULL;
+ 	if(approximation==HOFSApproximationEnum || approximation==SSAFSApproximationEnum){
+ 		vzFS_input=element->GetInput(VzFSEnum);       _assert_(vzFS_input);
+@@ -306,7 +310,9 @@
+ 	for(int ig=gauss->begin();ig<gauss->end();ig++){
+ 		gauss->GaussPoint(ig);
+ 
+-		basal_melting_input->GetInputValue(&basalmeltingvalue,gauss);
++		groundedice_melting_input->GetInputValue(&gmb,gauss);
++		floatingice_melting_input->GetInputValue(&fmb,gauss);
++		groundedice_input->GetInputValue(&phi,gauss);
+ 		base_input->GetInputDerivativeValue(&slope[0],xyz_list,gauss);
+ 		vx_input->GetInputValue(&vx,gauss);
+ 		vy_input->GetInputValue(&vy,gauss);
+@@ -315,6 +321,8 @@
+ 		}
+ 		dbdx=slope[0];
+ 		dbdy=slope[1];
++		if(phi>0.) basalmeltingvalue=gmb;
++		else basalmeltingvalue=fmb;
+ 
+ 		element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
+ 		element->NodalFunctions(basis,gauss);
+Index: ../trunk-jpl/src/c/analyses/MeltingAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MeltingAnalysis.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/analyses/MeltingAnalysis.cpp	(revision 18068)
+@@ -42,7 +42,7 @@
+ 	iomodel->FetchDataToInput(elements,FlowequationElementEquationEnum);
+ 	iomodel->FetchDataToInput(elements,MaterialsRheologyBEnum);
+ 	iomodel->FetchDataToInput(elements,MaterialsRheologyNEnum);
+-	iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateEnum);
++	iomodel->FetchDataToInput(elements,BasalforcingsGroundediceMeltingRateEnum);
+ 	iomodel->FetchDataToInput(elements,PressureEnum);
+ 	
+ 	/*Friction law variables*/
+@@ -154,7 +154,7 @@
+ 	_error_("Not implemented yet");
+ }/*}}}*/
+ void MeltingAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+-	element->InputUpdateFromSolutionOneDof(solution,BasalforcingsMeltingRateEnum);
++	element->InputUpdateFromSolutionOneDof(solution,BasalforcingsGroundediceMeltingRateEnum);
+ }/*}}}*/
+ void MeltingAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+ 	/*Default, do nothing*/
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 18068)
+@@ -63,8 +63,8 @@
+ 	iomodel->FetchDataToInput(elements,BaseEnum);
+ 	iomodel->FetchDataToInput(elements,MaskIceLevelsetEnum);
+ 	iomodel->FetchDataToInput(elements,MaskGroundediceLevelsetEnum);
+-	iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateEnum);
+-	iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateCorrectionEnum,0.);
++	iomodel->FetchDataToInput(elements,BasalforcingsGroundediceMeltingRateEnum);
++	iomodel->FetchDataToInput(elements,BasalforcingsFloatingiceMeltingRateEnum);
+ 	iomodel->FetchDataToInput(elements,VxEnum);
+ 	iomodel->FetchDataToInput(elements,VyEnum);
+ 
+@@ -523,7 +523,7 @@
+ 
+ 	/*Intermediaries */
+ 	IssmDouble  Jdet,dt;
+-	IssmDouble  ms,mb,mb_correction=0.,thickness;
++	IssmDouble  ms,mb,gmb,fmb,thickness,phi;
+ 	IssmDouble* xyz_list = NULL;
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+@@ -536,12 +536,12 @@
+ 	/*Retrieve all inputs and parameters*/
+ 	element->GetVerticesCoordinates(&xyz_list);
+ 	element->FindParam(&dt,TimesteppingTimeStepEnum);
+-	Input* mb_correction_input = element->GetInput(BasalforcingsMeltingRateCorrectionEnum);
+-	Input* mb_input            = element->GetInput(BasalforcingsMeltingRateEnum);     _assert_(mb_input);
+-	Input* ms_input            = element->GetInput(SurfaceforcingsMassBalanceEnum);   _assert_(ms_input);
+-	Input* thickness_input     = element->GetInput(ThicknessEnum);                    _assert_(thickness_input);
++	Input* gmb_input           = element->GetInput(BasalforcingsGroundediceMeltingRateEnum);  _assert_(gmb_input);
++	Input* fmb_input           = element->GetInput(BasalforcingsFloatingiceMeltingRateEnum);  _assert_(fmb_input);
++	Input* groundedice_input   = element->GetInput(MaskGroundediceLevelsetEnum);              _assert_(groundedice_input);
++	Input* ms_input            = element->GetInput(SurfaceforcingsMassBalanceEnum);           _assert_(ms_input);
++	Input* thickness_input     = element->GetInput(ThicknessEnum);                            _assert_(thickness_input);
+ 
+-	/*Initialize mb_correction to 0, do not forget!:*/
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss=element->NewGauss(2);
+ 	for(int ig=gauss->begin();ig<gauss->end();ig++){
+@@ -551,12 +551,14 @@
+ 		element->NodalFunctions(basis,gauss);
+ 
+ 		ms_input->GetInputValue(&ms,gauss);
+-		mb_input->GetInputValue(&mb,gauss);
++		gmb_input->GetInputValue(&gmb,gauss);
++		fmb_input->GetInputValue(&fmb,gauss);
++		groundedice_input->GetInputValue(&phi,gauss);
+ 		thickness_input->GetInputValue(&thickness,gauss);
+-		if(mb_correction_input)
+-		 mb_correction_input->GetInputValue(&mb_correction,gauss);
++		if(phi>0.) mb=gmb;
++		else mb=fmb;
+ 
+-		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*(thickness+dt*(ms-mb-mb_correction))*basis[i];
++		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*(thickness+dt*(ms-mb))*basis[i];
+ 	}
+ 
+ 	/*Clean up and return*/
+@@ -572,7 +574,7 @@
+ 
+ 	/*Intermediaries */
+ 	IssmDouble  Jdet,dt;
+-	IssmDouble  ms,mb,mb_correction=0.,thickness;
++	IssmDouble  ms,mb,gmb,fmb,thickness,phi;
+ 	IssmDouble* xyz_list = NULL;
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+@@ -585,12 +587,12 @@
+ 	/*Retrieve all inputs and parameters*/
+ 	element->GetVerticesCoordinates(&xyz_list);
+ 	element->FindParam(&dt,TimesteppingTimeStepEnum);
+-	Input* mb_correction_input = element->GetInput(BasalforcingsMeltingRateCorrectionEnum);
+-	Input* mb_input            = element->GetInput(BasalforcingsMeltingRateEnum);     _assert_(mb_input);
+-	Input* ms_input            = element->GetInput(SurfaceforcingsMassBalanceEnum);   _assert_(ms_input);
+-	Input* thickness_input     = element->GetInput(ThicknessEnum);                    _assert_(thickness_input);
++	Input* gmb_input           = element->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(gmb_input);
++	Input* fmb_input           = element->GetInput(BasalforcingsFloatingiceMeltingRateEnum); _assert_(fmb_input);
++	Input* ms_input            = element->GetInput(SurfaceforcingsMassBalanceEnum);          _assert_(ms_input);
++	Input* groundedice_input   = element->GetInput(MaskGroundediceLevelsetEnum);             _assert_(groundedice_input);
++	Input* thickness_input     = element->GetInput(ThicknessEnum);                           _assert_(thickness_input);
+ 
+-	/*Initialize mb_correction to 0, do not forget!:*/
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss=element->NewGauss(2);
+ 	for(int ig=gauss->begin();ig<gauss->end();ig++){
+@@ -600,12 +602,14 @@
+ 		element->NodalFunctions(basis,gauss);
+ 
+ 		ms_input->GetInputValue(&ms,gauss);
+-		mb_input->GetInputValue(&mb,gauss);
++		gmb_input->GetInputValue(&gmb,gauss);
++		fmb_input->GetInputValue(&fmb,gauss);
++		groundedice_input->GetInputValue(&phi,gauss);
+ 		thickness_input->GetInputValue(&thickness,gauss);
+-		if(mb_correction_input)
+-		 mb_correction_input->GetInputValue(&mb_correction,gauss);
++		if(phi>0) mb=gmb;
++		else mb=fmb;
+ 
+-		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*(thickness+dt*(ms-mb-mb_correction))*basis[i];
++		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*(thickness+dt*(ms-mb))*basis[i];
+ 	}
+ 
+ 	/*Clean up and return*/
+Index: ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp	(revision 18068)
+@@ -49,7 +49,7 @@
+ 	}
+ 	iomodel->FetchDataToInput(elements,MaskIceLevelsetEnum);
+ 	iomodel->FetchDataToInput(elements,MaskGroundediceLevelsetEnum);
+-	iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateEnum);
++	iomodel->FetchDataToInput(elements,BasalforcingsGroundediceMeltingRateEnum);
+ 	iomodel->FetchDataToInput(elements,WatercolumnEnum);
+ 
+ 	elements->InputDuplicate(WatercolumnEnum,WaterColumnOldEnum);
+@@ -204,8 +204,8 @@
+ 	/*Retrieve all inputs and parameters*/
+ 	element->GetVerticesCoordinates(&xyz_list);
+ 	element->FindParam(&dt,TimesteppingTimeStepEnum);
+-	Input* mb_input   = element->GetInput(BasalforcingsMeltingRateEnum); _assert_(mb_input);
+-	Input* oldw_input = element->GetInput(WaterColumnOldEnum);           _assert_(oldw_input);
++	Input* mb_input   = element->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(mb_input);
++	Input* oldw_input = element->GetInput(WaterColumnOldEnum);                      _assert_(oldw_input);
+ 
+ 	/*Initialize mb_correction to 0, do not forget!:*/
+ 	/* Start  looping on the number of gaussian points: */
+Index: ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp	(revision 18068)
+@@ -28,7 +28,7 @@
+ 	iomodel->FetchDataToInput(elements,MaskIceLevelsetEnum);
+ 	iomodel->FetchDataToInput(elements,VxEnum);
+ 	iomodel->FetchDataToInput(elements,VyEnum);
+-	iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateEnum);
++	iomodel->FetchDataToInput(elements,BasalforcingsGroundediceMeltingRateEnum);
+ 	iomodel->FetchDataToInput(elements,SurfaceforcingsMassBalanceEnum);
+ 	iomodel->FetchDataToInput(elements,BalancethicknessThickeningRateEnum);
+ 
+@@ -182,10 +182,10 @@
+ 
+ 	/*Retrieve all inputs and parameters*/
+ 	basalelement->GetVerticesCoordinates(&xyz_list);
+-	Input* ms_input   = basalelement->GetInput(SurfaceforcingsMassBalanceEnum);     _assert_(ms_input);
+-	Input* mb_input   = basalelement->GetInput(BasalforcingsMeltingRateEnum);       _assert_(mb_input);
+-	Input* dhdt_input = basalelement->GetInput(BalancethicknessThickeningRateEnum); _assert_(dhdt_input);
+-	Input* H_input    = basalelement->GetInput(ThicknessEnum);                      _assert_(H_input);
++	Input* ms_input   = basalelement->GetInput(SurfaceforcingsMassBalanceEnum);          _assert_(ms_input);
++	Input* mb_input   = basalelement->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(mb_input);
++	Input* dhdt_input = basalelement->GetInput(BalancethicknessThickeningRateEnum);      _assert_(dhdt_input);
++	Input* H_input    = basalelement->GetInput(ThicknessEnum);                           _assert_(H_input);
+ 	IssmDouble h = basalelement->CharacteristicLength();
+ 
+ 	/*Get vector N for all nodes*/
+Index: ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp	(revision 18068)
+@@ -39,6 +39,7 @@
+ 
+ 	iomodel->FetchDataToInput(elements,ThicknessEnum);
+ 	iomodel->FetchDataToInput(elements,FrictionCoefficientEnum);
++	iomodel->FetchDataToInput(elements,MaskGroundediceLevelsetEnum);
+ 	if(islevelset){
+ 		iomodel->FetchDataToInput(elements,IceMaskNodeActivationEnum);
+ 		if(iomodel->domaintype!=Domain2DhorizontalEnum)
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18068)
+@@ -230,7 +230,7 @@
+ 	}
+ 	if(isFS){
+ 		iomodel->FetchDataToInput(elements,PressureEnum,0.);
+-		iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateEnum,0.);
++		iomodel->FetchDataToInput(elements,BasalforcingsFloatingiceMeltingRateEnum,0.);
+ 		if(dakota_analysis)elements->InputDuplicate(PressureEnum,QmuPressureEnum);
+ 	}
+ 	if(islevelset){
+@@ -3617,7 +3617,7 @@
+ 	int shelf_dampening;
+ 	element->FindParam(&shelf_dampening,StressbalanceShelfDampeningEnum);
+ 	if(shelf_dampening) {
+-		Input*      mb_input=element->GetInput(BasalforcingsMeltingRateEnum); _assert_(mb_input);
++		Input*      mb_input=element->GetInput(BasalforcingsFloatingiceMeltingRateEnum); _assert_(mb_input);
+ 		IssmDouble dt,mb,normal_b;
+ 		element->FindParam(&dt,TimesteppingTimeStepEnum);
+ 		for(int ig=gauss->begin();ig<gauss->end();ig++){
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 18068)
+@@ -83,7 +83,7 @@
+ 	iomodel->FetchDataToInput(elements,ThicknessEnum);
+ 	iomodel->FetchDataToInput(elements,BaseEnum);
+ 	iomodel->FetchDataToInput(elements,MaskIceLevelsetEnum);
+-	iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateEnum);
++	iomodel->FetchDataToInput(elements,BasalforcingsGroundediceMeltingRateEnum);
+ 	iomodel->FetchDataToInput(elements,HydrologydcBasalMoulinInputEnum);
+ 	iomodel->FetchDataToInput(elements,SedimentHeadEnum);
+ 	iomodel->FetchDataToInput(elements,HydrologydcSedimentTransmitivityEnum);
+@@ -306,8 +306,8 @@
+ 	Input* sed_trans_input   = basalelement->GetInput(HydrologydcSedimentTransmitivityEnum);
+ 	Input* thickness_input   = basalelement->GetInput(ThicknessEnum);
+ 	Input* base_input        = basalelement->GetInput(BaseEnum);
+-	Input* water_input       = basalelement->GetInput(BasalforcingsMeltingRateEnum);    _assert_(water_input);
+-	if(dt!= 0.){old_wh_input = basalelement->GetInput(SedimentHeadOldEnum);             _assert_(old_wh_input);}
++	Input* water_input       = basalelement->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(water_input);
++	if(dt!= 0.){old_wh_input = basalelement->GetInput(SedimentHeadOldEnum);                     _assert_(old_wh_input);}
+ 
+ 	IssmDouble sediment_storing    = SedimentStoring(basalelement);
+ 
+Index: ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp	(revision 18068)
+@@ -76,7 +76,7 @@
+ 	InputUpdateFromConstantx(elements,0.,VzMeshEnum);
+ 	if(dakota_analysis){
+ 		elements->InputDuplicate(TemperatureEnum,QmuTemperatureEnum);
+-		elements->InputDuplicate(BasalforcingsMeltingRateEnum,QmuMeltingEnum);
++		elements->InputDuplicate(BasalforcingsGroundediceMeltingRateEnum,QmuMeltingEnum);
+ 		elements->InputDuplicate(VxMeshEnum,QmuVxMeshEnum);
+ 		elements->InputDuplicate(VxMeshEnum,QmuVyMeshEnum);
+ 		elements->InputDuplicate(VxMeshEnum,QmuVzMeshEnum);
+Index: ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 18068)
+@@ -70,7 +70,7 @@
+ 	iomodel->FetchDataToInput(elements,EnthalpyEnum);
+ 	iomodel->FetchDataToInput(elements,BasalforcingsGeothermalfluxEnum);
+ 	iomodel->FetchDataToInput(elements,WatercolumnEnum);
+-	iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateEnum);
++	iomodel->FetchDataToInput(elements,BasalforcingsGroundediceMeltingRateEnum);
+ 	iomodel->FetchDataToInput(elements,VxEnum);
+ 	iomodel->FetchDataToInput(elements,VyEnum);
+ 	iomodel->FetchDataToInput(elements,VzEnum);
+@@ -79,7 +79,7 @@
+ 	InputUpdateFromConstantx(elements,0.,VzMeshEnum);
+ 	if(dakota_analysis){
+ 		elements->InputDuplicate(TemperatureEnum,QmuTemperatureEnum);
+-		elements->InputDuplicate(BasalforcingsMeltingRateEnum,QmuMeltingEnum);
++		elements->InputDuplicate(BasalforcingsGroundediceMeltingRateEnum,QmuMeltingEnum);
+ 		elements->InputDuplicate(VxMeshEnum,QmuVxMeshEnum);
+ 		elements->InputDuplicate(VxMeshEnum,QmuVyMeshEnum);
+ 		elements->InputDuplicate(VxMeshEnum,QmuVzMeshEnum);
+@@ -964,7 +964,7 @@
+ 	element->GetInputListOnVertices(enthalpy,EnthalpyEnum);
+ 	element->GetInputListOnVertices(pressure,PressureEnum);
+ 	element->GetInputListOnVertices(watercolumn,WatercolumnEnum);
+-	element->GetInputListOnVertices(basalmeltingrate,BasalforcingsMeltingRateEnum);
++	element->GetInputListOnVertices(basalmeltingrate,BasalforcingsGroundediceMeltingRateEnum);
+ 
+ 	Gauss* gauss=element->NewGauss();
+ 	
+@@ -1044,7 +1044,7 @@
+ 	/*feed updated variables back into model*/
+ 	element->AddInput(EnthalpyEnum,enthalpy,P1Enum);
+ 	element->AddInput(WatercolumnEnum,watercolumn,P1Enum);
+-	element->AddInput(BasalforcingsMeltingRateEnum,basalmeltingrate,P1Enum);
++	element->AddInput(BasalforcingsGroundediceMeltingRateEnum,basalmeltingrate,P1Enum);
+ 
+ 	/*Clean up and return*/
+ 	delete gauss;
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 18068)
+@@ -30,8 +30,8 @@
+ 
+ 	iomodel->FetchDataToInput(elements,SurfaceEnum);
+ 	iomodel->FetchDataToInput(elements,MaskIceLevelsetEnum);
+-	iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateEnum);
+-	iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateCorrectionEnum,0.);
++	iomodel->FetchDataToInput(elements,BasalforcingsGroundediceMeltingRateEnum);
++	iomodel->FetchDataToInput(elements,BasalforcingsFloatingiceMeltingRateEnum);
+ 	iomodel->FetchDataToInput(elements,VxEnum);
+ 	iomodel->FetchDataToInput(elements,VyEnum);
+ 	if(iomodel->domaindim==3){
+@@ -231,7 +231,7 @@
+ 	/*Intermediaries*/
+ 	int         domaintype,dim;
+ 	IssmDouble  Jdet,dt;
+-	IssmDouble  mb,mb_correction,bed,vz;
++	IssmDouble  gmb,fmb,mb,bed,phi,vz;
+ 	Element*    basalelement = NULL;
+ 	IssmDouble *xyz_list  = NULL;
+ 
+@@ -265,9 +265,10 @@
+ 	/*Retrieve all inputs and parameters*/
+ 	basalelement->GetVerticesCoordinates(&xyz_list);
+ 	basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
+-	Input* mb_input            = basalelement->GetInput(BasalforcingsMeltingRateEnum);   _assert_(mb_input);
+-	Input* mb_correction_input = basalelement->GetInput(BasalforcingsMeltingRateCorrectionEnum);
+-	Input* base_input           = basalelement->GetInput(BaseEnum);                        _assert_(base_input);
++	Input* groundedice_input   = basalelement->GetInput(MaskGroundediceLevelsetEnum);              _assert_(groundedice_input);
++	Input* gmb_input           = basalelement->GetInput(BasalforcingsGroundediceMeltingRateEnum);  _assert_(gmb_input);
++	Input* fmb_input           = basalelement->GetInput(BasalforcingsFloatingiceMeltingRateEnum);  _assert_(fmb_input);
++	Input* base_input          = basalelement->GetInput(BaseEnum);                                 _assert_(base_input);
+ 	Input* vz_input      = NULL;
+ 	switch(dim){
+ 		case 1: vz_input = basalelement->GetInput(VyEnum); _assert_(vz_input); break;
+@@ -275,7 +276,6 @@
+ 		default: _error_("not implemented");
+ 	}
+ 
+-	/*Initialize mb_correction to 0, do not forget!:*/
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss=basalelement->NewGauss(2);
+ 	for(int ig=gauss->begin();ig<gauss->end();ig++){
+@@ -285,14 +285,14 @@
+ 		basalelement->NodalFunctions(basis,gauss);
+ 
+ 		vz_input->GetInputValue(&vz,gauss);
+-		mb_input->GetInputValue(&mb,gauss);
++		gmb_input->GetInputValue(&gmb,gauss);
++		fmb_input->GetInputValue(&fmb,gauss);
+ 		base_input->GetInputValue(&bed,gauss);
+-		if(mb_correction_input)
+-		 mb_correction_input->GetInputValue(&mb_correction,gauss);
+-		else
+-		 mb_correction=0.;
++		groundedice_input->GetInputValue(&phi,gauss);
++		if(phi>0) mb=gmb;
++		else mb=fmb;
+ 
+-		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*(bed+dt*(mb-mb_correction) + dt*vz)*basis[i];
++		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*(bed+dt*(mb) + dt*vz)*basis[i];
+ 	}
+ 
+ 	/*Clean up and return*/
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18067)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18068)
+@@ -38,8 +38,11 @@
+ 	BalancethicknessStabilizationEnum,
+ 	BalancethicknessThickeningRateEnum,
+ 	BasalforcingsGeothermalfluxEnum,
+-	BasalforcingsMeltingRateCorrectionEnum,
+-	BasalforcingsMeltingRateEnum,
++	BasalforcingsGroundediceMeltingRateEnum,
++	BasalforcingsFloatingiceMeltingRateEnum,
++	BasalforcingsDeepwaterMeltingRateEnum,
++	BasalforcingsDeepwaterElevationEnum,
++	BasalforcingsUpperwaterElevationEnum,
+ 	BedEnum,
+ 	BaseEnum,
+ 	ConstantsGEnum,
+@@ -498,7 +501,6 @@
+ 	FillEnum,
+ 	FractionIncrementEnum,
+ 	FrictionEnum,
+-	GroundinglineMeltingRateEnum,
+ 	InternalEnum,
+ 	MassFluxEnum,
+ 	MeltingOffsetEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18068)
+@@ -46,8 +46,11 @@
+ 		case BalancethicknessStabilizationEnum : return "BalancethicknessStabilization";
+ 		case BalancethicknessThickeningRateEnum : return "BalancethicknessThickeningRate";
+ 		case BasalforcingsGeothermalfluxEnum : return "BasalforcingsGeothermalflux";
+-		case BasalforcingsMeltingRateCorrectionEnum : return "BasalforcingsMeltingRateCorrection";
+-		case BasalforcingsMeltingRateEnum : return "BasalforcingsMeltingRate";
++		case BasalforcingsGroundediceMeltingRateEnum : return "BasalforcingsGroundediceMeltingRate";
++		case BasalforcingsFloatingiceMeltingRateEnum : return "BasalforcingsFloatingiceMeltingRate";
++		case BasalforcingsDeepwaterMeltingRateEnum : return "BasalforcingsDeepwaterMeltingRate";
++		case BasalforcingsDeepwaterElevationEnum : return "BasalforcingsDeepwaterElevation";
++		case BasalforcingsUpperwaterElevationEnum : return "BasalforcingsUpperwaterElevation";
+ 		case BedEnum : return "Bed";
+ 		case BaseEnum : return "Base";
+ 		case ConstantsGEnum : return "ConstantsG";
+@@ -489,7 +492,6 @@
+ 		case FillEnum : return "Fill";
+ 		case FractionIncrementEnum : return "FractionIncrement";
+ 		case FrictionEnum : return "Friction";
+-		case GroundinglineMeltingRateEnum : return "GroundinglineMeltingRate";
+ 		case InternalEnum : return "Internal";
+ 		case MassFluxEnum : return "MassFlux";
+ 		case MeltingOffsetEnum : return "MeltingOffset";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18068)
+@@ -46,8 +46,11 @@
+ 	      else if (strcmp(name,"BalancethicknessStabilization")==0) return BalancethicknessStabilizationEnum;
+ 	      else if (strcmp(name,"BalancethicknessThickeningRate")==0) return BalancethicknessThickeningRateEnum;
+ 	      else if (strcmp(name,"BasalforcingsGeothermalflux")==0) return BasalforcingsGeothermalfluxEnum;
+-	      else if (strcmp(name,"BasalforcingsMeltingRateCorrection")==0) return BasalforcingsMeltingRateCorrectionEnum;
+-	      else if (strcmp(name,"BasalforcingsMeltingRate")==0) return BasalforcingsMeltingRateEnum;
++	      else if (strcmp(name,"BasalforcingsGroundediceMeltingRate")==0) return BasalforcingsGroundediceMeltingRateEnum;
++	      else if (strcmp(name,"BasalforcingsFloatingiceMeltingRate")==0) return BasalforcingsFloatingiceMeltingRateEnum;
++	      else if (strcmp(name,"BasalforcingsDeepwaterMeltingRate")==0) return BasalforcingsDeepwaterMeltingRateEnum;
++	      else if (strcmp(name,"BasalforcingsDeepwaterElevation")==0) return BasalforcingsDeepwaterElevationEnum;
++	      else if (strcmp(name,"BasalforcingsUpperwaterElevation")==0) return BasalforcingsUpperwaterElevationEnum;
+ 	      else if (strcmp(name,"Bed")==0) return BedEnum;
+ 	      else if (strcmp(name,"Base")==0) return BaseEnum;
+ 	      else if (strcmp(name,"ConstantsG")==0) return ConstantsGEnum;
+@@ -133,13 +136,13 @@
+ 	      else if (strcmp(name,"HydrologydcLeakageFactor")==0) return HydrologydcLeakageFactorEnum;
+ 	      else if (strcmp(name,"HydrologydcPenaltyFactor")==0) return HydrologydcPenaltyFactorEnum;
+ 	      else if (strcmp(name,"HydrologydcPenaltyLock")==0) return HydrologydcPenaltyLockEnum;
+-	      else if (strcmp(name,"HydrologydcBasalMoulinInput")==0) return HydrologydcBasalMoulinInputEnum;
+-	      else if (strcmp(name,"HydrologyLayer")==0) return HydrologyLayerEnum;
+-	      else if (strcmp(name,"HydrologySediment")==0) return HydrologySedimentEnum;
+          else stage=2;
+    }
+    if(stage==2){
+-	      if (strcmp(name,"HydrologyEfficient")==0) return HydrologyEfficientEnum;
++	      if (strcmp(name,"HydrologydcBasalMoulinInput")==0) return HydrologydcBasalMoulinInputEnum;
++	      else if (strcmp(name,"HydrologyLayer")==0) return HydrologyLayerEnum;
++	      else if (strcmp(name,"HydrologySediment")==0) return HydrologySedimentEnum;
++	      else if (strcmp(name,"HydrologyEfficient")==0) return HydrologyEfficientEnum;
+ 	      else if (strcmp(name,"HydrologySedimentKmax")==0) return HydrologySedimentKmaxEnum;
+ 	      else if (strcmp(name,"IndependentObject")==0) return IndependentObjectEnum;
+ 	      else if (strcmp(name,"InversionControlParameters")==0) return InversionControlParametersEnum;
+@@ -256,13 +259,13 @@
+ 	      else if (strcmp(name,"QmuNumberofresponses")==0) return QmuNumberofresponsesEnum;
+ 	      else if (strcmp(name,"QmuPartition")==0) return QmuPartitionEnum;
+ 	      else if (strcmp(name,"QmuResponsedescriptors")==0) return QmuResponsedescriptorsEnum;
+-	      else if (strcmp(name,"QmuVariabledescriptors")==0) return QmuVariabledescriptorsEnum;
+-	      else if (strcmp(name,"QmuMaterialsRheologyB")==0) return QmuMaterialsRheologyBEnum;
+-	      else if (strcmp(name,"RiftsNumrifts")==0) return RiftsNumriftsEnum;
+          else stage=3;
+    }
+    if(stage==3){
+-	      if (strcmp(name,"RiftsRiftstruct")==0) return RiftsRiftstructEnum;
++	      if (strcmp(name,"QmuVariabledescriptors")==0) return QmuVariabledescriptorsEnum;
++	      else if (strcmp(name,"QmuMaterialsRheologyB")==0) return QmuMaterialsRheologyBEnum;
++	      else if (strcmp(name,"RiftsNumrifts")==0) return RiftsNumriftsEnum;
++	      else if (strcmp(name,"RiftsRiftstruct")==0) return RiftsRiftstructEnum;
+ 	      else if (strcmp(name,"SettingsResultsOnNodes")==0) return SettingsResultsOnNodesEnum;
+ 	      else if (strcmp(name,"SettingsIoGather")==0) return SettingsIoGatherEnum;
+ 	      else if (strcmp(name,"SettingsLowmem")==0) return SettingsLowmemEnum;
+@@ -379,13 +382,13 @@
+ 	      else if (strcmp(name,"MeltingAnalysis")==0) return MeltingAnalysisEnum;
+ 	      else if (strcmp(name,"MasstransportAnalysis")==0) return MasstransportAnalysisEnum;
+ 	      else if (strcmp(name,"MasstransportSolution")==0) return MasstransportSolutionEnum;
+-	      else if (strcmp(name,"FreeSurfaceBaseAnalysis")==0) return FreeSurfaceBaseAnalysisEnum;
+-	      else if (strcmp(name,"FreeSurfaceTopAnalysis")==0) return FreeSurfaceTopAnalysisEnum;
+-	      else if (strcmp(name,"SurfaceNormalVelocity")==0) return SurfaceNormalVelocityEnum;
+          else stage=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"ExtrudeFromBaseAnalysis")==0) return ExtrudeFromBaseAnalysisEnum;
++	      if (strcmp(name,"FreeSurfaceBaseAnalysis")==0) return FreeSurfaceBaseAnalysisEnum;
++	      else if (strcmp(name,"FreeSurfaceTopAnalysis")==0) return FreeSurfaceTopAnalysisEnum;
++	      else if (strcmp(name,"SurfaceNormalVelocity")==0) return SurfaceNormalVelocityEnum;
++	      else if (strcmp(name,"ExtrudeFromBaseAnalysis")==0) return ExtrudeFromBaseAnalysisEnum;
+ 	      else if (strcmp(name,"ExtrudeFromTopAnalysis")==0) return ExtrudeFromTopAnalysisEnum;
+ 	      else if (strcmp(name,"DepthAverageAnalysis")==0) return DepthAverageAnalysisEnum;
+ 	      else if (strcmp(name,"SteadystateSolution")==0) return SteadystateSolutionEnum;
+@@ -498,17 +501,16 @@
+ 	      else if (strcmp(name,"Fill")==0) return FillEnum;
+ 	      else if (strcmp(name,"FractionIncrement")==0) return FractionIncrementEnum;
+ 	      else if (strcmp(name,"Friction")==0) return FrictionEnum;
+-	      else if (strcmp(name,"GroundinglineMeltingRate")==0) return GroundinglineMeltingRateEnum;
+ 	      else if (strcmp(name,"Internal")==0) return InternalEnum;
+ 	      else if (strcmp(name,"MassFlux")==0) return MassFluxEnum;
+ 	      else if (strcmp(name,"MeltingOffset")==0) return MeltingOffsetEnum;
+ 	      else if (strcmp(name,"Misfit")==0) return MisfitEnum;
+-	      else if (strcmp(name,"Pressure")==0) return PressureEnum;
+-	      else if (strcmp(name,"PressurePicard")==0) return PressurePicardEnum;
+          else stage=5;
+    }
+    if(stage==5){
+-	      if (strcmp(name,"QmuPressure")==0) return QmuPressureEnum;
++	      if (strcmp(name,"Pressure")==0) return PressureEnum;
++	      else if (strcmp(name,"PressurePicard")==0) return PressurePicardEnum;
++	      else if (strcmp(name,"QmuPressure")==0) return QmuPressureEnum;
+ 	      else if (strcmp(name,"QmuVx")==0) return QmuVxEnum;
+ 	      else if (strcmp(name,"QmuVy")==0) return QmuVyEnum;
+ 	      else if (strcmp(name,"QmuVz")==0) return QmuVzEnum;
+@@ -626,12 +628,12 @@
+ 	      else if (strcmp(name,"MisfitName")==0) return MisfitNameEnum;
+ 	      else if (strcmp(name,"MisfitModelEnum")==0) return MisfitModelEnumEnum;
+ 	      else if (strcmp(name,"MisfitObservation")==0) return MisfitObservationEnum;
+-	      else if (strcmp(name,"MisfitObservationEnum")==0) return MisfitObservationEnumEnum;
+-	      else if (strcmp(name,"MisfitTimeinterpolation")==0) return MisfitTimeinterpolationEnum;
+          else stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"MisfitWeights")==0) return MisfitWeightsEnum;
++	      if (strcmp(name,"MisfitObservationEnum")==0) return MisfitObservationEnumEnum;
++	      else if (strcmp(name,"MisfitTimeinterpolation")==0) return MisfitTimeinterpolationEnum;
++	      else if (strcmp(name,"MisfitWeights")==0) return MisfitWeightsEnum;
+ 	      else if (strcmp(name,"MisfitWeightsEnum")==0) return MisfitWeightsEnumEnum;
+ 	      else if (strcmp(name,"SurfaceObservation")==0) return SurfaceObservationEnum;
+ 	      else if (strcmp(name,"WeightsSurfaceObservation")==0) return WeightsSurfaceObservationEnum;
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 18068)
+@@ -57,7 +57,6 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject(DebugProfilingEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(MeshAverageVertexConnectivityEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(ConstantsReferencetemperatureEnum));
+-	parameters->AddObject(iomodel->CopyConstantObject(GroundinglineMeltingRateEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(SettingsWaitonlockEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(MeshNumberofelementsEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(MeshNumberofverticesEnum));
+Index: ../trunk-jpl/src/c/cores/thermal_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/thermal_core.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/cores/thermal_core.cpp	(revision 18068)
+@@ -32,7 +32,7 @@
+ 		InputDuplicatex(femmodel,QmuVyMeshEnum,VyMeshEnum);
+ 		InputDuplicatex(femmodel,QmuVzMeshEnum,VzMeshEnum);
+ 		InputDuplicatex(femmodel,QmuTemperatureEnum,TemperatureEnum);
+-		InputDuplicatex(femmodel,QmuMeltingEnum,BasalforcingsMeltingRateEnum);
++		InputDuplicatex(femmodel,QmuMeltingEnum,BasalforcingsGroundediceMeltingRateEnum);
+ 		InputDuplicatex(femmodel,QmuMaterialsRheologyBEnum,MaterialsRheologyBEnum);
+ 		femmodel->SetCurrentConfiguration(ThermalAnalysisEnum);
+ 		ResetConstraintsx(femmodel);
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 18068)
+@@ -85,7 +85,7 @@
+ 			InputDuplicatex(femmodel,QmuVyMeshEnum,VyMeshEnum);
+ 			InputDuplicatex(femmodel,QmuVzMeshEnum,VzMeshEnum);
+ 			InputDuplicatex(femmodel,QmuTemperatureEnum,TemperatureEnum);
+-			InputDuplicatex(femmodel,QmuMeltingEnum,BasalforcingsMeltingRateEnum);
++			InputDuplicatex(femmodel,QmuMeltingEnum,BasalforcingsGroundediceMeltingRateEnum);
+ 			InputDuplicatex(femmodel,QmuMaterialsRheologyBEnum,MaterialsRheologyBEnum);
+ 			//Reset Thermal Constraints
+ 			femmodel->SetCurrentConfiguration(ThermalAnalysisEnum);
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18068)
+@@ -1131,7 +1131,7 @@
+ 	IssmDouble J_sum;
+ 
+ 	IssmDouble  weight,vx,vy,H,dvx[2],dvy[2],dH[2];
+-	IssmDouble  temp,Jdet,dhdt,basal_melting,surface_mass_balance;
++	IssmDouble  temp,Jdet,dhdt,groundedice_melting,surface_mass_balance;
+ 	IssmDouble* xyz_list = NULL;
+ 	IssmDouble  dp[3];
+ 
+@@ -1144,13 +1144,13 @@
+ 
+ 		/* Get node coordinates*/
+ 		element->GetVerticesCoordinates(&xyz_list);
+-		Input* weights_input              = element->GetInput(InversionCostFunctionsCoefficientsEnum);   _assert_(weights_input);
+-		Input* thickness_input            = element->GetInput(ThicknessEnum); _assert_(thickness_input);
+-		Input* vx_input                   = element->GetInput(VxEnum);                                 _assert_(vx_input);
+-		Input* vy_input                   = element->GetInput(VyEnum);                                 _assert_(vy_input);
+-		Input* surface_mass_balance_input = element->GetInput(SurfaceforcingsMassBalanceEnum);         _assert_(surface_mass_balance_input);
+-		Input* basal_melting_input        = element->GetInput(BasalforcingsMeltingRateEnum);           _assert_(basal_melting_input);
+-		Input* dhdt_input                 = element->GetInput(BalancethicknessThickeningRateEnum);     _assert_(dhdt_input);
++		Input* weights_input                   = element->GetInput(InversionCostFunctionsCoefficientsEnum);   _assert_(weights_input);
++		Input* thickness_input                 = element->GetInput(ThicknessEnum); _assert_(thickness_input);
++		Input* vx_input                        = element->GetInput(VxEnum);                                  _assert_(vx_input);
++		Input* vy_input                        = element->GetInput(VyEnum);                                  _assert_(vy_input);
++		Input* surface_mass_balance_input      = element->GetInput(SurfaceforcingsMassBalanceEnum);          _assert_(surface_mass_balance_input);
++		Input* groundedice_melting_input       = element->GetInput(BasalforcingsGroundediceMeltingRateEnum); _assert_(groundedice_melting_input);
++		Input* dhdt_input                      = element->GetInput(BalancethicknessThickeningRateEnum);      _assert_(dhdt_input);
+ 
+ 		/* Start  looping on the number of gaussian points: */
+ 		Gauss* gauss=element->NewGauss(2);
+@@ -1166,7 +1166,7 @@
+ 			thickness_input->GetInputValue(&H, gauss);
+ 			thickness_input->GetInputDerivativeValue(&dH[0],xyz_list,gauss);
+ 			surface_mass_balance_input->GetInputValue(&surface_mass_balance,gauss);
+-			basal_melting_input->GetInputValue(&basal_melting,gauss);
++			groundedice_melting_input->GetInputValue(&groundedice_melting,gauss);
+ 			dhdt_input->GetInputValue(&dhdt,gauss);
+ 			vx_input->GetInputValue(&vx,gauss);
+ 			vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
+@@ -1174,7 +1174,7 @@
+ 			vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
+ 
+ 			/*Balance thickness soft constraint J = 1/2 (div(Hv)-a)^2*/
+-			temp  = vx*dH[0]+vy*dH[1]+H*(dvx[0]+dvy[1]) - (surface_mass_balance-basal_melting-dhdt);
++			temp  = vx*dH[0]+vy*dH[1]+H*(dvx[0]+dvy[1]) - (surface_mass_balance-groundedice_melting-dhdt);
+ 			J    +=weight*1/2*temp*temp*Jdet*gauss->weight;
+ 		}
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18068)
+@@ -2989,17 +2989,14 @@
+ void       Tria::MigrateGroundingLine(IssmDouble* phi_ungrounding){/*{{{*/
+ 
+ 	int        i,migration_style;
+-	bool       oldfloating;
+-	bool       floatingelement = false;
+ 	bool       groundedelement = false;
+-	IssmDouble bed_hydro,yts,gl_melting_rate;
++	IssmDouble bed_hydro,yts;
+ 	IssmDouble rho_water,rho_ice,density;
+ 	IssmDouble melting[NUMVERTICES],phi[NUMVERTICES];;
+ 	IssmDouble h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],r[NUMVERTICES];
+ 
+ 	/*Recover info at the vertices: */
+ 	parameters->FindParam(&migration_style,GroundinglineMigrationEnum);
+-	parameters->FindParam(&gl_melting_rate,GroundinglineMeltingRateEnum);
+ 	parameters->FindParam(&yts,ConstantsYtsEnum);
+ 	GetInputListOnVertices(&h[0],ThicknessEnum);
+ 	GetInputListOnVertices(&s[0],SurfaceEnum);
+@@ -3009,7 +3006,6 @@
+ 	rho_water   = matpar->GetRhoWater();
+ 	rho_ice     = matpar->GetRhoIce();
+ 	density     = rho_ice/rho_water;
+-	oldfloating = this->IsFloating(); //figure out if element is floating before we start to change everything
+ 
+ 	if(migration_style == ContactEnum){
+ 		for(i = 0;i < NUMVERTICES;i++) phi[i] = phi_ungrounding[vertices[i]->Pid()];
+@@ -3023,18 +3019,6 @@
+ 			}
+ 		}
+ 
+-		/*Add basal melting rate if element just ungrounded*/
+-		for(i=0;i<NUMVERTICES;i++){
+-			if(phi[i]<0.){
+-				floatingelement=true;
+-				break;
+-			}
+-		}
+-		if(!oldfloating && floatingelement==true){
+-			for(i=0;i<NUMVERTICES;i++) melting[i]=gl_melting_rate/yts;
+-			this->inputs->AddInput(new TriaInput(BasalforcingsMeltingRateEnum,&melting[0],P1Enum));
+-		} 
+-
+ 		/*Update inputs*/
+ 		this->inputs->AddInput(new TriaInput(BaseEnum,&b[0],P1Enum));
+ 		return;
+@@ -3084,32 +3068,6 @@
+ 	}
+ 	this->inputs->AddInput(new TriaInput(MaskGroundediceLevelsetEnum,&phi[0],P1Enum));
+ 
+-	/*SubelementMigrationEnum: if one grounded, all grounded*/
+-	if(migration_style==SubelementMigrationEnum || migration_style==SubelementMigration2Enum){
+-		for(i=0;i<NUMVERTICES;i++){
+-			if(phi[i]>0.){
+-				groundedelement=true;
+-				break;
+-			}
+-		}
+-		floatingelement=!groundedelement;
+-	}
+-	else{
+-		/*Otherwise: if one floating, all floating*/
+-		for(i=0;i<NUMVERTICES;i++){
+-			if(phi[i]<=0.){
+-				floatingelement=true;
+-				break;
+-			}
+-		}
+-	}
+-
+-	/*Add basal melting rate if element just ungrounded*/
+-	if(!oldfloating && floatingelement==true){
+-		for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts;
+-		this->inputs->AddInput(new TriaInput(BasalforcingsMeltingRateEnum,&melting[0],P1Enum));
+-	} 
+-
+ 	/*Update inputs*/
+ 	this->inputs->AddInput(new TriaInput(SurfaceEnum,&s[0],P1Enum));
+ 	this->inputs->AddInput(new TriaInput(BaseEnum,&b[0],P1Enum));
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18068)
+@@ -3160,10 +3160,7 @@
+ void       Penta::MigrateGroundingLine(IssmDouble* phi_ungrounding){/*{{{*/
+ 
+ 	int        i,migration_style;
+-	bool       oldfloating;
+-	bool       floatingelement = false;
+-	bool       groundedelement = false;
+-	IssmDouble bed_hydro,yts,gl_melting_rate;
++	IssmDouble bed_hydro,yts;
+ 	IssmDouble rho_water,rho_ice,density;
+ 	IssmDouble h[NUMVERTICES],s[NUMVERTICES],b[NUMVERTICES],r[NUMVERTICES];
+ 	IssmDouble melting[NUMVERTICES],phi[NUMVERTICES];
+@@ -3172,7 +3169,6 @@
+ 
+ 	/*Recover info at the vertices: */
+ 	parameters->FindParam(&migration_style,GroundinglineMigrationEnum);
+-	parameters->FindParam(&gl_melting_rate,GroundinglineMeltingRateEnum);
+ 	parameters->FindParam(&yts,ConstantsYtsEnum);
+ 	GetInputListOnVertices(&h[0],ThicknessEnum);
+ 	GetInputListOnVertices(&s[0],SurfaceEnum);
+@@ -3182,7 +3178,6 @@
+ 	rho_water   = matpar->GetRhoWater();
+ 	rho_ice     = matpar->GetRhoIce();
+ 	density     = rho_ice/rho_water;
+-	oldfloating = this->IsFloating(); //figure out if the element is floating before starting to change everything
+ 
+ 	/*go through vertices, and update inputs, considering them to be PentaVertex type: */
+ 	for(i=0;i<NUMVERTICES;i++){
+@@ -3227,31 +3222,6 @@
+ 	this->inputs->AddInput(new PentaInput(MaskGroundediceLevelsetEnum,&phi[0],P1Enum));
+ 	this->InputExtrude(MaskGroundediceLevelsetEnum);
+ 
+-	/*SubelementMigrationEnum: if one grounded, all grounded*/
+-	if(migration_style==SubelementMigrationEnum || migration_style==SubelementMigration2Enum){
+-		for(i=0;i<NUMVERTICES;i++){
+-			if(phi[i]>0.){
+-				groundedelement=true;
+-				break;
+-			}
+-		}
+-		floatingelement=!groundedelement;
+-	}
+-	else{
+-		for(i=0;i<NUMVERTICES;i++){
+-			if(phi[i]<=0.){
+-				floatingelement=true;
+-				break;
+-			}
+-		}
+-	}
+-
+-   /*Add basal melting rate if element just ungrounded*/
+-	if(!oldfloating && floatingelement==true){
+-		for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts;
+-		this->inputs->AddInput(new PentaInput(BasalforcingsMeltingRateEnum,&melting[0],P1Enum));
+-	} 
+-
+ 	/*Update inputs*/
+ 	this->inputs->AddInput(new PentaInput(SurfaceEnum,&s[0],P1Enum));
+ 	this->inputs->AddInput(new PentaInput(BaseEnum,&b[0],P1Enum));
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18067)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18068)
+@@ -821,7 +821,8 @@
+ 				name==SurfaceSlopeXEnum ||
+ 				name==SurfaceSlopeYEnum ||
+ 				name==SurfaceforcingsMassBalanceEnum ||
+-				name==BasalforcingsMeltingRateEnum ||
++				name==BasalforcingsGroundediceMeltingRateEnum ||
++				name==BasalforcingsFloatingiceMeltingRateEnum ||
+ 				name==BasalforcingsGeothermalfluxEnum ||
+ 				name==SurfaceAreaEnum||
+ 				name==DamageDEnum ||
+Index: ../trunk-jpl/src/m/mech/steadystateiceshelftemp.py
+===================================================================
+--- ../trunk-jpl/src/m/mech/steadystateiceshelftemp.py	(revision 18067)
++++ ../trunk-jpl/src/m/mech/steadystateiceshelftemp.py	(revision 18068)
+@@ -12,7 +12,7 @@
+ 
+ 	The model md must also contain the fields: 
+ 	md.geometry.thickness
+-	md.basalforcings.melting_rate (positive for melting, negative for freezing)
++	md.basalforcings.floatingice_melting_rate (positive for melting, negative for freezing)
+ 
+    Usage:
+       temperature=steadystateiceshelftemp(md,surfacetemp,basaltemp)
+@@ -36,7 +36,7 @@
+ 	ki=1.14e-6*md.constants.yts # ice shelf thermal diffusivity from Holland and Jenkins (1999) converted to m^2/yr 
+ 	
+ 	#vertical velocity of ice shelf, calculated from melting rate 
+-	wi=md.materials.rho_water/md.materials.rho_ice*md.basalforcings.melting_rate 
++	wi=md.materials.rho_water/md.materials.rho_ice*md.basalforcings.floatingice_melting_rate 
+ 	
+ 	#temperature profile is linear if melting rate is zero, depth-averaged temp is simple average in this case
+ 	temperature=(Ts+Tb)/2  # where wi~=0
+Index: ../trunk-jpl/src/m/mech/steadystateiceshelftemp.m
+===================================================================
+--- ../trunk-jpl/src/m/mech/steadystateiceshelftemp.m	(revision 18067)
++++ ../trunk-jpl/src/m/mech/steadystateiceshelftemp.m	(revision 18068)
+@@ -11,7 +11,7 @@
+ %
+ %	 The model md must also contain the fields: 
+ %	 md.geometry.thickness
+-%	 md.basalforcings.melting_rate (positive for melting, negative for freezing)
++%	 md.basalforcings.floatingice_melting_rate (positive for melting, negative for freezing)
+ 
+ %   Usage:
+ %      temperature=steadystateiceshelftemp(md,surfacetemp,basaltemp)
+@@ -37,7 +37,7 @@
+ ki=1.14e-6*md.constants.yts; % ice shelf thermal diffusivity from Holland and Jenkins (1999) converted to m^2/yr 
+ 
+ %vertical velocity of ice shelf, calculated from melting rate 
+-wi=md.materials.rho_water/md.materials.rho_ice.*md.basalforcings.melting_rate; 
++wi=md.materials.rho_water/md.materials.rho_ice.*md.basalforcings.floatingice_melting_rate; 
+ 
+ %temperature profile is linear if melting rate is zero, depth-averaged temp is simple average in this case
+ temperature=(Ts+Tb)/2;  % where wi~=0
+Index: ../trunk-jpl/src/m/classes/thermal.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/thermal.py	(revision 18067)
++++ ../trunk-jpl/src/m/classes/thermal.py	(revision 18068)
+@@ -43,9 +43,9 @@
+ 	def defaultoutputs(self,md): # {{{
+ 
+ 		if self.isenthalpy:
+-			return ['Enthalpy','Temperature','Waterfraction','Watercolumn','BasalforcingsMeltingRate']
++			return ['Enthalpy','Temperature','Waterfraction','Watercolumn','BasalforcingsGroundediceMeltingRate']
+ 		else:
+-			return ['Temperature','BasalforcingsMeltingRate']
++			return ['Temperature','BasalforcingsGroundediceMeltingRate']
+ 
+ 	#}}}
+ 	def setdefaultparameters(self): # {{{
+Index: ../trunk-jpl/src/m/classes/mask.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/mask.m	(revision 18067)
++++ ../trunk-jpl/src/m/classes/mask.m	(revision 18068)
+@@ -42,10 +42,13 @@
+ 
+ 			md = checkfield(md,'fieldname','mask.groundedice_levelset','size',[md.mesh.numberofvertices 1]);
+ 			md = checkfield(md,'fieldname','mask.ice_levelset'        ,'size',[md.mesh.numberofvertices 1]);
+-			%isice=(md.mask.ice_levelset>0);
+-			%if any(sum(isice(md.mesh.elements),2)==0),
+-		%		warning('elements with no ice not implemented yet, each element should have at least one vertex with md.mask.ice_levelset > 0');
+-		%	end
++			isice=(md.mask.ice_levelset<=0);
++			if sum(isice)==0,
++				warning('no ice present in the domain');
++			end
++			if max(md.mask.ice_levelset)<0,
++				warning('no ice front provided');
++			end
+ 		end % }}}
+ 		function disp(obj) % {{{
+ 			disp(sprintf('   masks:'));
+Index: ../trunk-jpl/src/m/classes/groundingline.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/groundingline.py	(revision 18067)
++++ ../trunk-jpl/src/m/classes/groundingline.py	(revision 18068)
+@@ -16,7 +16,6 @@
+ 
+ 	def __init__(self): # {{{
+ 		self.migration=''
+-		self.melting_rate=float('NaN')
+ 
+ 		#set defaults
+ 		self.setdefaultparameters()
+@@ -26,7 +25,6 @@
+ 		string='   grounding line migration parameters:'
+ 
+ 		string="%s\n%s"%(string,fielddisplay(self,'migration','type of grounding line migration: ''SoftMigration'',''AggressiveMigration'',''SubelementMigration'',''SubelementMigration2'',''Contact'',''None'''))
+-		string="%s\n%s"%(string,fielddisplay(self,'melting_rate','melting rate applied when previously grounded parts start floating [m/yr]'))
+ 		return string
+ 		#}}}	
+ 	def setdefaultparameters(self): # {{{
+@@ -34,9 +32,6 @@
+ 		#Type of migration
+ 		self.migration='None'
+ 
+-		#basal melting rate correction: 
+-		self.melting_rate=0;
+-
+ 		return self
+ 	#}}}
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+@@ -56,5 +51,4 @@
+ 	# }}}
+ 	def marshall(self,md,fid):    # {{{
+ 		WriteData(fid,'data',StringToEnum(self.migration)[0],'enum',GroundinglineMigrationEnum(),'format','Integer')
+-		WriteData(fid,'object',self,'fieldname','melting_rate','format','Double')
+ 	# }}}
+Index: ../trunk-jpl/src/m/classes/thermal.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/thermal.m	(revision 18067)
++++ ../trunk-jpl/src/m/classes/thermal.m	(revision 18068)
+@@ -50,9 +50,9 @@
+ 		function list = defaultoutputs(self,md) % {{{
+ 
+ 			if self.isenthalpy,
+-				list = {'Enthalpy','Temperature','Waterfraction','Watercolumn','BasalforcingsMeltingRate'};
++				list = {'Enthalpy','Temperature','Waterfraction','Watercolumn','BasalforcingsGroundediceMeltingRate'};
+ 			else
+-				list = {'Temperature','BasalforcingsMeltingRate'};
++				list = {'Temperature','BasalforcingsGroundediceMeltingRate'};
+ 			end
+ 
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/groundingline.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/groundingline.m	(revision 18067)
++++ ../trunk-jpl/src/m/classes/groundingline.m	(revision 18068)
+@@ -6,7 +6,6 @@
+ classdef groundingline
+ 	properties (SetAccess=public) 
+ 		migration    = '';
+-		melting_rate = NaN;
+ 	end
+ 	methods
+          function createxml(obj,fid) % {{{
+@@ -22,7 +21,6 @@
+             fprintf(fid,'%s\n','       <option value="AggressiveMigration" type="string" default="false"> </option>');
+             fprintf(fid, '%s\n%s\n','       <option value="None" type="string" default="false"></option>','</parameter>');
+ 
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n',    '<parameter key ="melting_rate" type="',          class(obj.melting_rate),'" default="',            convert2str(obj.melting_rate),'">',     '     <section name="groundingline" />','     <help> melting rate applied when previously grounded parts start floating [m/yr] </help>','</parameter>');
+             fprintf(fid,'%s\n%s\n','</frame>');
+         end % }}}
+ 		function obj = groundingline(varargin) % {{{
+@@ -38,9 +36,6 @@
+ 			%Type of migration
+ 			obj.migration='None';
+ 
+-			%basal melting rate correction: 
+-			obj.melting_rate=0; 
+-
+ 		end % }}}
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
+@@ -63,12 +58,10 @@
+ 		function disp(obj) % {{{
+ 			disp(sprintf('   grounding line migration parameters:'));
+ 			fielddisplay(obj,'migration','type of grounding line migration: ''SoftMigration'',''AggressiveMigration'' or ''None''');
+-			fielddisplay(obj,'melting_rate','melting rate applied when previously grounded parts start floating [m/yr]');
+ 
+ 		end % }}}
+ 		function marshall(obj,md,fid) % {{{
+ 			WriteData(fid,'data',StringToEnum(obj.migration),'enum',GroundinglineMigrationEnum(),'format','Integer');
+-			WriteData(fid,'object',obj,'fieldname','melting_rate','format','Double');
+ 		end % }}}
+ 	end
+ end
+Index: ../trunk-jpl/src/m/classes/mask.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/mask.py	(revision 18067)
++++ ../trunk-jpl/src/m/classes/mask.py	(revision 18068)
+@@ -33,10 +33,9 @@
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+ 
+ 		md = checkfield(md,'fieldname','mask.ice_levelset'        ,'size',[md.mesh.numberofvertices])
+-		#isice=numpy.array(md.mask.ice_levelset<0,int)
+-		#totallyicefree=(numpy.sum(isice[md.mesh.elements-1],axis=1)==0).astype(int)
+-		#if any(totallyicefree):
+-		#	raise TypeError("elements with no ice not implemented yet, each element should have at least one vertex with md.mask.ice_levelset > 0")
++		isice=numpy.array(md.mask.ice_levelset<=0,int)
++		if numpy.sum(isice)==0:
++			raise TypeError("no ice present in the domain")
+ 
+ 		return md
+ 	# }}}
+Index: ../trunk-jpl/src/m/classes/model.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.py	(revision 18067)
++++ ../trunk-jpl/src/m/classes/model.py	(revision 18068)
+@@ -696,7 +696,8 @@
+ 			md.initialization.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.z.reshape(-1,1))
+ 
+ 		#special for thermal modeling:
+-		md.basalforcings.melting_rate=project3d(md,'vector',md.basalforcings.melting_rate,'type','node','layer',1)
++		md.basalforcings.groundedice_melting_rate=project3d(md,'vector',md.basalforcings.groundedice_melting_rate,'type','node','layer',1)
++		md.basalforcings.floatingice_melting_rate=project3d(md,'vector',md.basalforcings.floatingice_melting_rate,'type','node','layer',1)
+ 		if not numpy.any(numpy.isnan(md.basalforcings.geothermalflux)):
+ 			md.basalforcings.geothermalflux=project3d(md,'vector',md.basalforcings.geothermalflux,'type','node','layer',1)    #bedrock only gets geothermal flux
+ 
+@@ -778,7 +779,8 @@
+ 			md.damage.D=DepthAverage(md,md.damage.D)
+ 
+ 		#special for thermal modeling:
+-		md.basalforcings.melting_rate=project2d(md,md.basalforcings.melting_rate,1) 
++		md.basalforcings.groundedice_melting_rate=project2d(md,md.basalforcings.groundedice_melting_rate,1) 
++		md.basalforcings.floatingice_melting_rate=project2d(md,md.basalforcings.floatingice_melting_rate,1) 
+ 		md.basalforcings.geothermalflux=project2d(md,md.basalforcings.geothermalflux,1) #bedrock only gets geothermal flux
+ 
+ 		#update of connectivity matrix
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 18067)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 18068)
+@@ -220,7 +220,8 @@
+ 			end
+ 
+ 			%special for thermal modeling:
+-			md.basalforcings.melting_rate=project2d(md,md.basalforcings.melting_rate,1); 
++			md.basalforcings.groundedice_melting_rate=project2d(md,md.basalforcings.melting_rate,1); 
++			md.basalforcings.floatingice_melting_rate=project2d(md,md.basalforcings.melting_rate,1); 
+ 			md.basalforcings.geothermalflux=project2d(md,md.basalforcings.geothermalflux,1); %bedrock only gets geothermal flux
+ 
+ 			%update of connectivity matrix
+@@ -799,7 +800,8 @@
+ 			end
+ 
+ 			%special for thermal modeling:
+-			md.basalforcings.melting_rate=project3d(md,'vector',md.basalforcings.melting_rate,'type','node','layer',1); 
++			md.basalforcings.groundedice_melting_rate=project3d(md,'vector',md.basalforcings.groundedice_melting_rate,'type','node','layer',1); 
++			md.basalforcings.floatingice_melting_rate=project3d(md,'vector',md.basalforcings.floatingice_melting_rate,'type','node','layer',1); 
+ 			if ~isnan(md.basalforcings.geothermalflux)
+ 				md.basalforcings.geothermalflux=project3d(md,'vector',md.basalforcings.geothermalflux,'type','node','layer',1); %bedrock only gets geothermal flux
+ 			end
+@@ -825,7 +827,7 @@
+ 			if isfield(structmd,'p'), md.friction.p=structmd.p; end
+ 			if isfield(structmd,'q'), md.friction.q=structmd.p; end
+ 			if isfield(structmd,'melting'), md.basalforcings.melting_rate=structmd.melting; end
+-			if isfield(structmd,'melting_rate'), md.basalforcings.melting_rate=structmd.melting_rate; end
++			if isfield(structmd,'melting_rate'), md.basalforcings.floatingice_melting_rate=structmd.melting_rate; end
+ 			if isfield(structmd,'accumulation'), md.surfaceforcings.mass_balance=structmd.accumulation; end
+ 			if isfield(structmd,'numberofgrids'), md.mesh.numberofvertices=structmd.numberofgrids; end
+ 			if isfield(structmd,'numberofgrids2d'), md.mesh.numberofvertices2d=structmd.numberofgrids2d; end
+@@ -839,8 +841,7 @@
+ 			if isfield(structmd,'g'), md.constants.g=structmd.g; end
+ 			if isfield(structmd,'yts'), md.constants.yts=structmd.yts; end
+ 			if isfield(structmd,'surface_mass_balance'), md.surfaceforcings.mass_balance=structmd.surface_mass_balance; end
+-			if isfield(structmd,'basal_melting_rate'), md.basalforcings.melting_rate=structmd.basal_melting_rate; end
+-			if isfield(structmd,'basal_melting_rate_correction'), md.basalforcings.melting_rate_correction=structmd.basal_melting_rate_correction; end
++			if isfield(structmd,'basal_melting_rate'), md.basalforcings.floatingice_melting_rate=structmd.basal_melting_rate; end
+ 			if isfield(structmd,'geothermalflux'), md.basalforcings.geothermalflux=structmd.geothermalflux; end
+ 			if isfield(structmd,'drag'), md.friction.coefficient=structmd.drag; end
+ 			if isfield(structmd,'drag_coefficient'), md.friction.coefficient=structmd.drag_coefficient; end
+Index: ../trunk-jpl/src/m/classes/basalforcings.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/basalforcings.py	(revision 18067)
++++ ../trunk-jpl/src/m/classes/basalforcings.py	(revision 18068)
+@@ -13,9 +13,9 @@
+ 	"""
+ 
+ 	def __init__(self): # {{{
+-		self.melting_rate             = float('NaN')
+-		self.melting_rate_correction  = float('NaN')
+-		self.geothermalflux           = float('NaN')
++		self.groundedice_melting_rate  = float('NaN')
++		self.floatingice_melting_rate  = float('NaN')
++		self.geothermalflux            = float('NaN')
+ 
+ 		#set defaults
+ 		self.setdefaultparameters()
+@@ -24,17 +24,21 @@
+ 	def __repr__(self): # {{{
+ 		string="   basal forcings parameters:"
+ 
+-		string="%s\n%s"%(string,fielddisplay(self,"melting_rate","basal melting rate (positive if melting) [m/yr]"))
+-		string="%s\n%s"%(string,fielddisplay(self,"melting_rate_correction","additional melting applied to compensate for dh/dt [m/yr]"))
++		string="%s\n%s"%(string,fielddisplay(self,"groundedice_melting_rate","basal melting rate (positive if melting) [m/yr]"))
++		string="%s\n%s"%(string,fielddisplay(self,"floatingice_melting_rate","basal melting rate (positive if melting) [m/yr]"))
+ 		string="%s\n%s"%(string,fielddisplay(self,"geothermalflux","geothermal heat flux [W/m^2]"))
+ 		return string
+ 		#}}}
+ 	def initialize(self,md): # {{{
+ 
+-		if numpy.all(numpy.isnan(self.melting_rate)):
+-			self.melting_rate=numpy.zeros((md.mesh.numberofvertices,1))
+-			print "      no basalforcings.melting_rate specified: values set as zero"
++		if numpy.all(numpy.isnan(self.groundedice_melting_rate)):
++			self.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices,1))
++			print "      no basalforcings.groundedice_melting_rate specified: values set as zero"
+ 
++		if numpy.all(numpy.isnan(self.floatingice_melting_rate)):
++			self.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices,1))
++			print "      no basalforcings.floatingice_melting_rate specified: values set as zero"
++
+ 		return self
+ 	#}}}
+ 	def setdefaultparameters(self): # {{{
+@@ -43,13 +47,16 @@
+ 	def checkconsistency(self,md,solution,analyses):    # {{{
+ 
+ 		if MasstransportAnalysisEnum() in analyses and not (solution==TransientSolutionEnum() and not md.transient.ismasstransport):
+-			md = checkfield(md,'fieldname','basalforcings.melting_rate','NaN',1,'forcing',1)
++			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'forcing',1)
++			md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'forcing',1)
+ 
+ 		if BalancethicknessAnalysisEnum() in analyses:
+-			md = checkfield(md,'fieldname','basalforcings.melting_rate','NaN',1,'size',[md.mesh.numberofvertices])
++			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'size',[md.mesh.numberofvertices])
++			md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'size',[md.mesh.numberofvertices])
+ 
+ 		if ThermalAnalysisEnum() in analyses and not (solution==TransientSolutionEnum() and not md.transient.isthermal):
+-			md = checkfield(md,'fieldname','basalforcings.melting_rate','NaN',1,'forcing',1)
++			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'forcing',1)
++			md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'forcing',1)
+ 			md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'forcing',1,'>=',0)
+ 
+ 		return md
+@@ -58,7 +65,7 @@
+ 
+ 		yts=365.0*24.0*3600.0
+ 
+-		WriteData(fid,'object',self,'fieldname','melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
+-		WriteData(fid,'object',self,'fieldname','melting_rate_correction','format','DoubleMat','mattype',1,'scale',1./yts)
++		WriteData(fid,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
++		WriteData(fid,'object',self,'fieldname','floatingice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
+ 		WriteData(fid,'object',self,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1)
+ 	# }}}
+Index: ../trunk-jpl/src/m/classes/basalforcings.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/basalforcings.m	(revision 18067)
++++ ../trunk-jpl/src/m/classes/basalforcings.m	(revision 18068)
+@@ -5,16 +5,15 @@
+ 
+ classdef basalforcings
+ 	properties (SetAccess=public) 
+-		melting_rate             = NaN;
+-		melting_rate_correction  = NaN;
+-		geothermalflux           = NaN;
++		groundedice_melting_rate  = NaN;
++		floatingice_melting_rate  = NaN;
++		geothermalflux            = NaN;
+ 	end
+ 	methods
+         function createxml(obj,fid) % {{{
+             fprintf(fid, '\n\n');
+             fprintf(fid, '%s\n', '<!-- basalforcings -->');
+ 			 fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="melting_rate" type="',            class(obj.melting_rate),'" default="',              num2str(obj.melting_rate),'">',              '     <section name="basalforcings" />','     <help> basal melting rate (positive if melting) [m/yr] </help>','</parameter>');
+-             fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="melting_rate_correction" type="', class(obj.melting_rate_correction),'" default="',   num2str(obj.melting_rate_correction),'">',   '     <section name="basalforcings" />','     <help> additional melting applied to compensate for dh/dt [m/yr] </help>','</parameter>');
+              fprintf(fid,'%s%s%s%s%s\n%s\n%s\n',        '<parameter key ="geothermalflux" type="',          class(obj.geothermalflux),'" default="',            num2str(obj.geothermalflux),'">',            '     <section name="basalforcings" />','     <help> geothermal heat flux [W/m^2] </help>','</parameter>');
+              
+         end % }}}
+@@ -28,11 +27,16 @@
+ 		end % }}}
+ 		function self = initialize(self,md) % {{{
+ 
+-			if isnan(self.melting_rate),
+-				self.melting_rate=zeros(md.mesh.numberofvertices,1);
+-				disp('      no basalforcings.melting_rate specified: values set as zero');
++			if isnan(self.groundedice_melting_rate),
++				self.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
++				disp('      no basalforcings.groundedice_melting_rate specified: values set as zero');
+ 			end
+ 
++			if isnan(self.floatingice_melting_rate),
++				self.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
++				disp('      no basalforcings.floatingice_melting_rate specified: values set as zero');
++			end
++
+ 		end % }}}
+ 		function obj = setdefaultparameters(obj) % {{{
+ 
+@@ -40,21 +44,24 @@
+ 		function md = checkconsistency(obj,md,solution,analyses) % {{{
+ 
+ 			if ismember(MasstransportAnalysisEnum(),analyses) & ~(solution==TransientSolutionEnum() & md.transient.ismasstransport==0),
+-				md = checkfield(md,'fieldname','basalforcings.melting_rate','NaN',1,'forcing',1);
++				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'forcing',1);
++				md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'forcing',1);
+ 			end
+ 			if ismember(BalancethicknessAnalysisEnum(),analyses),
+-				md = checkfield(md,'fieldname','basalforcings.melting_rate','NaN',1,'size',[md.mesh.numberofvertices 1]);
++				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'size',[md.mesh.numberofvertices 1]);
++				md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'size',[md.mesh.numberofvertices 1]);
+ 			end
+ 			if ismember(ThermalAnalysisEnum(),analyses) & ~(solution==TransientSolutionEnum() & md.transient.isthermal==0),
+-				md = checkfield(md,'fieldname','basalforcings.melting_rate','NaN',1,'forcing',1);
++				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'forcing',1);
++				md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'forcing',1);
+ 				md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'forcing',1,'>=',0);
+ 			end
+ 		end % }}}
+ 		function disp(obj) % {{{
+ 			disp(sprintf('   basal forcings parameters:'));
+ 
+-			fielddisplay(obj,'melting_rate','basal melting rate (positive if melting) [m/yr]');
+-			fielddisplay(obj,'melting_rate_correction','additional melting applied to compensate for dh/dt [m/yr]');
++			fielddisplay(obj,'groundedice_melting_rate','basal melting rate (positive if melting) [m/yr]');
++			fielddisplay(obj,'floatingice_melting_rate','basal melting rate (positive if melting) [m/yr]');
+ 			fielddisplay(obj,'geothermalflux','geothermal heat flux [W/m^2]');
+ 
+ 		end % }}}
+@@ -62,8 +69,8 @@
+ 
+ 			yts=365.0*24.0*3600.0;
+ 
+-			WriteData(fid,'object',obj,'fieldname','melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
+-			WriteData(fid,'object',obj,'fieldname','melting_rate_correction','format','DoubleMat','mattype',1,'scale',1./yts);
++			WriteData(fid,'object',obj,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
++			WriteData(fid,'object',obj,'fieldname','floatingice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
+ 			WriteData(fid,'object',obj,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
+ 		end % }}}
+ 	end
+Index: ../trunk-jpl/src/m/contrib/hack/tres.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/hack/tres.m	(revision 18067)
++++ ../trunk-jpl/src/m/contrib/hack/tres.m	(revision 18068)
+@@ -66,7 +66,7 @@
+ 	md.initialization.vel=md.results.SteadystateSolution.Vel;
+ 	md.initialization.pressure=md.results.SteadystateSolution.Pressure;
+ 	md.initialization.temperature=md.results.SteadystateSolution.Temperature;
+-	md.basalforcings.melting_rate=md.results.SteadystateSolution.BasalforcingsMeltingRate;
++	md.basalforcings.groundedice_melting_rate=md.results.SteadystateSolution.BasalforcingsGroundediceMeltingRate;
+ 
+ 	if md.inversion.iscontrol==1,
+ 		for control_parameters=md.inversion.control_parameters
+@@ -76,7 +76,7 @@
+ 
+ elseif strcmpi(string,'thermal'),
+ 	md.initialization.temperature=md.results.ThermalSolution.Temperature;
+-	md.basalforcings.melting_rate=md.results.ThermalSolution.BasalMeltingRate;
++	md.basalforcings.groundedice_melting_rate=md.results.ThermalSolution.BasalGroundediceMeltingRate;
+ elseif strcmpi(string,'hydrology'),
+ 	md.initialization.watercolumn=md.results.HydrologySolution.Watercolumn;
+ 
+Index: ../trunk-jpl/src/m/enum/BasalforcingsGroundediceMeltingRateEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/BasalforcingsGroundediceMeltingRateEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/BasalforcingsGroundediceMeltingRateEnum.m	(revision 18068)
+@@ -0,0 +1,11 @@
++function macro=BasalforcingsGroundediceMeltingRateEnum()
++%BASALFORCINGSGROUNDEDICEMELTINGRATEENUM - Enum of BasalforcingsGroundediceMeltingRate
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=BasalforcingsGroundediceMeltingRateEnum()
++
++macro=StringToEnum('BasalforcingsGroundediceMeltingRate');
+Index: ../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- ../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 18067)
++++ ../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 18068)
+@@ -38,8 +38,11 @@
+ def BalancethicknessStabilizationEnum(): return StringToEnum("BalancethicknessStabilization")[0]
+ def BalancethicknessThickeningRateEnum(): return StringToEnum("BalancethicknessThickeningRate")[0]
+ def BasalforcingsGeothermalfluxEnum(): return StringToEnum("BasalforcingsGeothermalflux")[0]
+-def BasalforcingsMeltingRateCorrectionEnum(): return StringToEnum("BasalforcingsMeltingRateCorrection")[0]
+-def BasalforcingsMeltingRateEnum(): return StringToEnum("BasalforcingsMeltingRate")[0]
++def BasalforcingsGroundediceMeltingRateEnum(): return StringToEnum("BasalforcingsGroundediceMeltingRate")[0]
++def BasalforcingsFloatingiceMeltingRateEnum(): return StringToEnum("BasalforcingsFloatingiceMeltingRate")[0]
++def BasalforcingsDeepwaterMeltingRateEnum(): return StringToEnum("BasalforcingsDeepwaterMeltingRate")[0]
++def BasalforcingsDeepwaterElevationEnum(): return StringToEnum("BasalforcingsDeepwaterElevation")[0]
++def BasalforcingsUpperwaterElevationEnum(): return StringToEnum("BasalforcingsUpperwaterElevation")[0]
+ def BedEnum(): return StringToEnum("Bed")[0]
+ def BaseEnum(): return StringToEnum("Base")[0]
+ def ConstantsGEnum(): return StringToEnum("ConstantsG")[0]
+@@ -481,7 +484,6 @@
+ def FillEnum(): return StringToEnum("Fill")[0]
+ def FractionIncrementEnum(): return StringToEnum("FractionIncrement")[0]
+ def FrictionEnum(): return StringToEnum("Friction")[0]
+-def GroundinglineMeltingRateEnum(): return StringToEnum("GroundinglineMeltingRate")[0]
+ def InternalEnum(): return StringToEnum("Internal")[0]
+ def MassFluxEnum(): return StringToEnum("MassFlux")[0]
+ def MeltingOffsetEnum(): return StringToEnum("MeltingOffset")[0]
+Index: ../trunk-jpl/src/m/enum/BasalforcingsFloatingiceMeltingRateEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/BasalforcingsFloatingiceMeltingRateEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/BasalforcingsFloatingiceMeltingRateEnum.m	(revision 18068)
+@@ -0,0 +1,11 @@
++function macro=BasalforcingsFloatingiceMeltingRateEnum()
++%BASALFORCINGSFLOATINGICEMELTINGRATEENUM - Enum of BasalforcingsFloatingiceMeltingRate
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=BasalforcingsFloatingiceMeltingRateEnum()
++
++macro=StringToEnum('BasalforcingsFloatingiceMeltingRate');
Index: /issm/oecreview/Archive/17984-18295/ISSM-18068-18069.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18068-18069.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18068-18069.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/Par/RoundSheetShelf.py
+===================================================================
+--- ../trunk-jpl/test/Par/RoundSheetShelf.py	(revision 18068)
++++ ../trunk-jpl/test/Par/RoundSheetShelf.py	(revision 18069)
+@@ -71,7 +71,7 @@
+ md.surfaceforcings.mass_balance=-10.*numpy.ones((md.mesh.numberofvertices,1))
+ md.basalforcings.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices,1))
+ pos=numpy.nonzero(md.mask.groundedice_levelset>0.)[0]
+-md.basalforcings.groudedice_melting_rate[pos]=10.
++md.basalforcings.groundedice_melting_rate[pos]=10.
+ md.basalforcings.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices,1))
+ md.basalforcings.geothermalflux=numpy.ones((md.mesh.numberofvertices,1))
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18069-18070.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18069-18070.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18069-18070.diff	(revision 18296)
@@ -0,0 +1,36 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 18069)
++++ ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 18070)
+@@ -323,6 +323,7 @@
+ 		dbdy=slope[1];
+ 		if(phi>0.) basalmeltingvalue=gmb;
+ 		else basalmeltingvalue=fmb;
++		basalmeltingvalue=gmb;
+ 
+ 		element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
+ 		element->NodalFunctions(basis,gauss);
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 18069)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 18070)
+@@ -557,6 +557,7 @@
+ 		thickness_input->GetInputValue(&thickness,gauss);
+ 		if(phi>0.) mb=gmb;
+ 		else mb=fmb;
++		mb=gmb;
+ 
+ 		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*(thickness+dt*(ms-mb))*basis[i];
+ 	}
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 18069)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 18070)
+@@ -291,6 +291,7 @@
+ 		groundedice_input->GetInputValue(&phi,gauss);
+ 		if(phi>0) mb=gmb;
+ 		else mb=fmb;
++		mb=gmb;
+ 
+ 		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*(bed+dt*(mb) + dt*vz)*basis[i];
+ 	}
Index: /issm/oecreview/Archive/17984-18295/ISSM-18070-18071.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18070-18071.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18070-18071.diff	(revision 18296)
@@ -0,0 +1,8 @@
+Index: ../trunk-jpl/test/Archives/Archive424.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive425.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/17984-18295/ISSM-18071-18072.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18071-18072.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18071-18072.diff	(revision 18296)
@@ -0,0 +1,8 @@
+Index: ../trunk-jpl/test/Archives/Archive805.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive803.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/17984-18295/ISSM-18072-18073.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18072-18073.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18072-18073.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/solve/parseresultsfromdisk.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/parseresultsfromdisk.m	(revision 18072)
++++ ../trunk-jpl/src/m/solve/parseresultsfromdisk.m	(revision 18073)
+@@ -177,7 +177,7 @@
+ 		field = field*yts;
+ 	elseif strcmp(fieldname,'Vel'),
+ 		field = field*yts;
+-	elseif strcmp(fieldname,'BasalforcingsMeltingRate'),
++	elseif strcmp(fieldname,'BasalforcingsGroundediceMeltingRate'),
+ 		field = field*yts;
+ 	elseif strcmp(fieldname,'TotalSmb'),
+ 		field = field/10.^12*yts; %(GigaTon/year)
Index: /issm/oecreview/Archive/17984-18295/ISSM-18073-18074.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18073-18074.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18073-18074.diff	(revision 18296)
@@ -0,0 +1,36 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 18073)
++++ ../trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp	(revision 18074)
+@@ -323,7 +323,6 @@
+ 		dbdy=slope[1];
+ 		if(phi>0.) basalmeltingvalue=gmb;
+ 		else basalmeltingvalue=fmb;
+-		basalmeltingvalue=gmb;
+ 
+ 		element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
+ 		element->NodalFunctions(basis,gauss);
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 18073)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 18074)
+@@ -557,7 +557,6 @@
+ 		thickness_input->GetInputValue(&thickness,gauss);
+ 		if(phi>0.) mb=gmb;
+ 		else mb=fmb;
+-		mb=gmb;
+ 
+ 		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*(thickness+dt*(ms-mb))*basis[i];
+ 	}
+Index: ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 18073)
++++ ../trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp	(revision 18074)
+@@ -291,7 +291,6 @@
+ 		groundedice_input->GetInputValue(&phi,gauss);
+ 		if(phi>0) mb=gmb;
+ 		else mb=fmb;
+-		mb=gmb;
+ 
+ 		for(int i=0;i<numnodes;i++) pe->values[i]+=Jdet*gauss->weight*(bed+dt*(mb) + dt*vz)*basis[i];
+ 	}
Index: /issm/oecreview/Archive/17984-18295/ISSM-18074-18075.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18074-18075.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18074-18075.diff	(revision 18296)
@@ -0,0 +1,216 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18074)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18075)
+@@ -5813,35 +5813,35 @@
+ 	 */
+ 
+ 	int num_dof=2;
+-	IssmDouble L1L2l3[3];
++	IssmDouble basis[3];
+ 
+ 	/*Cast gauss to GaussPenta*/
+ 	_assert_(gauss_in->Enum()==GaussPentaEnum);
+ 	GaussPenta* gauss = dynamic_cast<GaussPenta*>(gauss_in);
+ 
+-	/*Get L1L2l3 in actual coordinate system: */
+-	L1L2l3[0]=gauss->coord1*(1-gauss->coord4)/2.0;
+-	L1L2l3[1]=gauss->coord2*(1-gauss->coord4)/2.0;
+-	L1L2l3[2]=gauss->coord3*(1-gauss->coord4)/2.0;
++	/*Get basis in actual coordinate system: */
++	basis[0]=gauss->coord1*(1-gauss->coord4)/2.0;
++	basis[1]=gauss->coord2*(1-gauss->coord4)/2.0;
++	basis[2]=gauss->coord3*(1-gauss->coord4)/2.0;
+ 
+ 	/*Build LFS: */
+ 	for(int i=0;i<3;i++){
+-		LFS[num_dof*3*0+num_dof*i+0] = L1L2l3[i];
++		LFS[num_dof*3*0+num_dof*i+0] = basis[i];
+ 		LFS[num_dof*3*0+num_dof*i+1] = 0;
+ 		LFS[num_dof*3*1+num_dof*i+0] = 0;
+-		LFS[num_dof*3*1+num_dof*i+1] = L1L2l3[i];
+-		LFS[num_dof*3*2+num_dof*i+0] = L1L2l3[i];
++		LFS[num_dof*3*1+num_dof*i+1] = basis[i];
++		LFS[num_dof*3*2+num_dof*i+0] = basis[i];
+ 		LFS[num_dof*3*2+num_dof*i+1] = 0;
+ 		LFS[num_dof*3*3+num_dof*i+0] = 0;
+-		LFS[num_dof*3*3+num_dof*i+1] = L1L2l3[i];
+-		LFS[num_dof*3*4+num_dof*i+0] = L1L2l3[i];
++		LFS[num_dof*3*3+num_dof*i+1] = basis[i];
++		LFS[num_dof*3*4+num_dof*i+0] = basis[i];
+ 		LFS[num_dof*3*4+num_dof*i+1] = 0;
+ 		LFS[num_dof*3*5+num_dof*i+0] = 0;
+-		LFS[num_dof*3*5+num_dof*i+1] = L1L2l3[i];
+-		LFS[num_dof*3*6+num_dof*i+0] = L1L2l3[i];
++		LFS[num_dof*3*5+num_dof*i+1] = basis[i];
++		LFS[num_dof*3*6+num_dof*i+0] = basis[i];
+ 		LFS[num_dof*3*6+num_dof*i+1] = 0;
+ 		LFS[num_dof*3*7+num_dof*i+0] = 0;
+-		LFS[num_dof*3*7+num_dof*i+1] = L1L2l3[i];
++		LFS[num_dof*3*7+num_dof*i+1] = basis[i];
+ 	}
+ }/*}}}*/
+ void StressbalanceAnalysis::GetLprimeSSAFS(IssmDouble* LprimeFS,Element* element,IssmDouble* xyz_list,Gauss* gauss_in){/*{{{*/
+@@ -5861,34 +5861,34 @@
+ 	int num_dof=3;
+ 	int num_dof_vel=3*7;
+ 	int num_dof_total=3*7+1*6;
+-	IssmDouble L1L2l3[3];
++	IssmDouble basis[3];
+ 	IssmDouble dbasis[3][6];
+ 
+ 	/*Cast gauss to GaussPenta*/
+ 	_assert_(gauss_in->Enum()==GaussPentaEnum);
+ 	GaussPenta* gauss = dynamic_cast<GaussPenta*>(gauss_in);
+ 
+-	/*Get L1L2l3 in actual coordinate system: */
+-	L1L2l3[0]=gauss->coord1*(1-gauss->coord4)/2.0;
+-	L1L2l3[1]=gauss->coord2*(1-gauss->coord4)/2.0;
+-	L1L2l3[2]=gauss->coord3*(1-gauss->coord4)/2.0;
++	/*Get basis in actual coordinate system: */
++	basis[0]=gauss->coord1*(1-gauss->coord4)/2.0;
++	basis[1]=gauss->coord2*(1-gauss->coord4)/2.0;
++	basis[2]=gauss->coord3*(1-gauss->coord4)/2.0;
+ 
+ 	element->NodalFunctionsP1Derivatives(&dbasis[0][0],xyz_list,gauss);
+ 
+ 	/*Build LprimeFS: */
+ 	for(int i=0;i<3;i++){
+-		LprimeFS[num_dof_total*0+num_dof*i+0] = L1L2l3[i];
++		LprimeFS[num_dof_total*0+num_dof*i+0] = basis[i];
+ 		LprimeFS[num_dof_total*0+num_dof*i+1] = 0.;
+ 		LprimeFS[num_dof_total*0+num_dof*i+2] = 0.;
+ 		LprimeFS[num_dof_total*1+num_dof*i+0] = 0.;
+-		LprimeFS[num_dof_total*1+num_dof*i+1] = L1L2l3[i];
++		LprimeFS[num_dof_total*1+num_dof*i+1] = basis[i];
+ 		LprimeFS[num_dof_total*1+num_dof*i+2] = 0.;
+ 		LprimeFS[num_dof_total*2+num_dof*i+0] = 0.;
+ 		LprimeFS[num_dof_total*2+num_dof*i+1] = 0.;
+-		LprimeFS[num_dof_total*2+num_dof*i+2] = L1L2l3[i];
++		LprimeFS[num_dof_total*2+num_dof*i+2] = basis[i];
+ 		LprimeFS[num_dof_total*3+num_dof*i+0] = 0.;
+ 		LprimeFS[num_dof_total*3+num_dof*i+1] = 0.;
+-		LprimeFS[num_dof_total*3+num_dof*i+2] = L1L2l3[i];
++		LprimeFS[num_dof_total*3+num_dof*i+2] = basis[i];
+ 		LprimeFS[num_dof_total*4+num_dof*i+0] = 0.;
+ 		LprimeFS[num_dof_total*4+num_dof*i+1] = 0.;
+ 		LprimeFS[num_dof_total*4+num_dof*i+2] = dbasis[2][i];
+@@ -5935,8 +5935,8 @@
+ 		LprimeFS[num_dof_total*3+num_dof_vel+i] = 0.;
+ 		LprimeFS[num_dof_total*4+num_dof_vel+i] = 0.;
+ 		LprimeFS[num_dof_total*5+num_dof_vel+i] = 0.;
+-		LprimeFS[num_dof_total*6+num_dof_vel+i] = L1L2l3[i];
+-		LprimeFS[num_dof_total*7+num_dof_vel+i] = L1L2l3[i];
++		LprimeFS[num_dof_total*6+num_dof_vel+i] = basis[i];
++		LprimeFS[num_dof_total*7+num_dof_vel+i] = basis[i];
+ 	}
+ 	for(int i=3;i<6;i++){
+ 		LprimeFS[num_dof_total*0+num_dof_vel+i] = 0.;
+@@ -5961,31 +5961,31 @@
+ 	 */
+ 
+ 	int num_dof=3;
+-	IssmDouble L1L2l3[3];
++	IssmDouble basis[3];
+ 
+ 	/*Cast gauss to GaussPenta*/
+ 	_assert_(gauss_in->Enum()==GaussPentaEnum);
+ 	GaussPenta* gauss = dynamic_cast<GaussPenta*>(gauss_in);
+ 
+-	/*Get L1L2l3 in actual coordinate system: */
+-	L1L2l3[0]=gauss->coord1*(1-gauss->coord4)/2.0;
+-	L1L2l3[1]=gauss->coord2*(1-gauss->coord4)/2.0;
+-	L1L2l3[2]=gauss->coord3*(1-gauss->coord4)/2.0;
++	/*Get basis in actual coordinate system: */
++	basis[0]=gauss->coord1*(1-gauss->coord4)/2.0;
++	basis[1]=gauss->coord2*(1-gauss->coord4)/2.0;
++	basis[2]=gauss->coord3*(1-gauss->coord4)/2.0;
+ 
+ 	/*Build LFS: */
+ 	for(int i=0;i<3;i++){
+-		LFS[num_dof*3*0+num_dof*i+0] = L1L2l3[i];
++		LFS[num_dof*3*0+num_dof*i+0] = basis[i];
+ 		LFS[num_dof*3*0+num_dof*i+1] = 0.;
+ 		LFS[num_dof*3*0+num_dof*i+2] = 0.;
+ 		LFS[num_dof*3*1+num_dof*i+0] = 0.;
+-		LFS[num_dof*3*1+num_dof*i+1] = L1L2l3[i];
++		LFS[num_dof*3*1+num_dof*i+1] = basis[i];
+ 		LFS[num_dof*3*1+num_dof*i+2] = 0.;
+ 		LFS[num_dof*3*2+num_dof*i+0] = 0.;
+ 		LFS[num_dof*3*2+num_dof*i+1] = 0.;
+-		LFS[num_dof*3*2+num_dof*i+2] = L1L2l3[i];
++		LFS[num_dof*3*2+num_dof*i+2] = basis[i];
+ 		LFS[num_dof*3*3+num_dof*i+0] = 0.;
+ 		LFS[num_dof*3*3+num_dof*i+1] = 0.;
+-		LFS[num_dof*3*3+num_dof*i+2] = L1L2l3[i];
++		LFS[num_dof*3*3+num_dof*i+2] = basis[i];
+ 	}
+ }/*}}}*/
+ void StressbalanceAnalysis::GetLprimeFSSSA(IssmDouble* LprimeFS,Element* element,IssmDouble* xyz_list,Gauss* gauss_in){/*{{{*/
+@@ -5999,27 +5999,27 @@
+ 	 * where h is the interpolation function for node i.
+ 	 */
+ 	int num_dof=2;
+-	IssmDouble L1L2l3[3];
++	IssmDouble basis[3];
+ 
+ 	/*Cast gauss to GaussPenta*/
+ 	_assert_(gauss_in->Enum()==GaussPentaEnum);
+ 	GaussPenta* gauss = dynamic_cast<GaussPenta*>(gauss_in);
+ 
+-	/*Get L1L2l3 in actual coordinate system: */
+-	L1L2l3[0]=gauss->coord1*(1-gauss->coord4)/2.0;
+-	L1L2l3[1]=gauss->coord2*(1-gauss->coord4)/2.0;
+-	L1L2l3[2]=gauss->coord3*(1-gauss->coord4)/2.0;
++	/*Get basis in actual coordinate system: */
++	basis[0]=gauss->coord1*(1-gauss->coord4)/2.0;
++	basis[1]=gauss->coord2*(1-gauss->coord4)/2.0;
++	basis[2]=gauss->coord3*(1-gauss->coord4)/2.0;
+ 
+ 	/*Build LprimeFS: */
+ 	for(int i=0;i<3;i++){
+-		LprimeFS[num_dof*3*0+num_dof*i+0] = L1L2l3[i];
++		LprimeFS[num_dof*3*0+num_dof*i+0] = basis[i];
+ 		LprimeFS[num_dof*3*0+num_dof*i+1] = 0.;
+ 		LprimeFS[num_dof*3*1+num_dof*i+0] = 0.;
+-		LprimeFS[num_dof*3*1+num_dof*i+1] = L1L2l3[i];
+-		LprimeFS[num_dof*3*2+num_dof*i+0] = L1L2l3[i];
++		LprimeFS[num_dof*3*1+num_dof*i+1] = basis[i];
++		LprimeFS[num_dof*3*2+num_dof*i+0] = basis[i];
+ 		LprimeFS[num_dof*3*2+num_dof*i+1] = 0.;
+ 		LprimeFS[num_dof*3*3+num_dof*i+0] = 0.;
+-		LprimeFS[num_dof*3*3+num_dof*i+1] = L1L2l3[i];
++		LprimeFS[num_dof*3*3+num_dof*i+1] = basis[i];
+ 	}
+ }/*}}}*/
+ void StressbalanceAnalysis::InputUpdateFromSolutionHOFS(IssmDouble* solution,Element* element){/*{{{*/
+Index: ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp	(revision 18074)
++++ ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp	(revision 18075)
+@@ -882,7 +882,7 @@
+ 	/*Get Jacobian invert: */
+ 	GetJacobianInvert(&Jinv[0][0], xyz_list, gauss);
+ 
+-	/*Build dh1dh3: 
++	/*Build basis function derivatives: 
+ 	 *
+ 	 * [dhi/dx]= Jinv*[dhi/dr]
+ 	 * [dhi/dy]       [dhi/ds]
+Index: ../trunk-jpl/src/c/classes/Elements/PentaRef.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/PentaRef.h	(revision 18074)
++++ ../trunk-jpl/src/c/classes/Elements/PentaRef.h	(revision 18075)
+@@ -27,9 +27,9 @@
+ 		void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss,int finiteelement);
+ 		void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss);
+ 		void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss,int finiteelement);
+-		void GetNodalFunctionsP1(IssmDouble* l1l6, Gauss* gauss);
+-		void GetNodalFunctionsP1Derivatives(IssmDouble* dh1dh6,IssmDouble* xyz_list, Gauss* gauss);
+-		void GetNodalFunctionsMINIDerivatives(IssmDouble* dh1dh7,IssmDouble* xyz_list, Gauss* gauss);
++		void GetNodalFunctionsP1(IssmDouble* basis, Gauss* gauss);
++		void GetNodalFunctionsP1Derivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss);
++		void GetNodalFunctionsMINIDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss);
+ 		void GetNodalFunctionsP1DerivativesReference(IssmDouble* dl1dl6,Gauss* gauss);
+ 		void GetNodalFunctionsMINIDerivativesReference(IssmDouble* dl1dl7,Gauss* gauss);
+ 		void GetQuadJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,Gauss* gauss);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18075-18076.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18075-18076.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18075-18076.diff	(revision 18296)
@@ -0,0 +1,489 @@
+Index: ../trunk-jpl/src/m/plot/plot_elementstype.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/plot_elementstype.m	(revision 18075)
++++ ../trunk-jpl/src/m/plot/plot_elementstype.m	(revision 18076)
+@@ -17,48 +17,56 @@
+ subplot(width,width,i);
+ 
+ if is2d
++	%None elements
++	posNONE=find(data==0);
++	A=elements(posNONE,1); B=elements(posNONE,2); C=elements(posNONE,3); 
++	p1=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',0,'FaceColor','flat','EdgeColor',edgecolor);
+ 	%SIA elements
+ 	posH=find(data==1);
+ 	A=elements(posH,1); B=elements(posH,2); C=elements(posH,3); 
+-	p1=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',1,'FaceColor','flat','EdgeColor',edgecolor);
++	p2=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',1,'FaceColor','flat','EdgeColor',edgecolor);
+ 	%SSA element
+ 	posM=find(data==2);
+ 	A=elements(posM,1); B=elements(posM,2); C=elements(posM,3); 
+-	p2=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',2,'FaceColor','flat','EdgeColor',edgecolor);
++	p3=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',2,'FaceColor','flat','EdgeColor',edgecolor);
++	%L1L2 element
++	posM=find(data==3);
++	A=elements(posM,1); B=elements(posM,2); C=elements(posM,3); 
++	p4=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',2,'FaceColor','flat','EdgeColor',edgecolor);
+ 	%HO element
+-	posP=find(data==3);
++	posP=find(data==4);
+ 	A=elements(posP,1); B=elements(posP,2); C=elements(posP,3); 
+-	p3=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',3,'FaceColor','flat','EdgeColor',edgecolor);
+-	%SSAHO element
+-	posMP=find(data==5);
+-	A=elements(posMP,1); B=elements(posMP,2); C=elements(posMP,3); 
+-	p5=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',5,'FaceColor','flat','EdgeColor',edgecolor);
++	p5=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',3,'FaceColor','flat','EdgeColor',edgecolor);
+ 	%FS elements
+-	posS=find(data==4);
++	posS=find(data==5);
+ 	A=elements(posS,1); B=elements(posS,2); C=elements(posS,3); 
+ 	p6=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',4,'FaceColor','flat','EdgeColor',edgecolor);
+-	%SSAFS elements
+-	posMS=find(data==6);
+-	A=elements(posMS,1); B=elements(posMS,2); C=elements(posMS,3); 
+-	p7=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',6,'FaceColor','flat','EdgeColor',edgecolor);
++	%SSAHO element
++	posMP=find(data==6);
++	A=elements(posMP,1); B=elements(posMP,2); C=elements(posMP,3); 
++	p7=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',5,'FaceColor','flat','EdgeColor',edgecolor);
+ 	%HOFS elements
+ 	posPS=find(data==7);
+ 	A=elements(posPS,1); B=elements(posPS,2); C=elements(posPS,3); 
+ 	p8=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',7,'FaceColor','flat','EdgeColor',edgecolor);
+-	%None elements
+-	posNONE=find(data==0);
+-	A=elements(posNONE,1); B=elements(posNONE,2); C=elements(posNONE,3); 
+-	p9=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',0,'FaceColor','flat','EdgeColor',edgecolor);
++	%SSAFS elements
++	posMS=find(data==8);
++	A=elements(posMS,1); B=elements(posMS,2); C=elements(posMS,3); 
++	p9=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',6,'FaceColor','flat','EdgeColor',edgecolor);
+ 
+-	legend([p1 p2 p3 p5 p6 p7 p8 p9],...
+-		'SIA''s elements','SSA''s elements','HO''s elements',...
+-		'SSAHO''s elements','FS''s elements','SSAFS''s elements','HOFS''s elements','None element');
+-
+ else
++	%None elements
++	PosNONE=find(data==0);
++	A=elements(PosNONE,1); B=elements(PosNONE,2); C=elements(PosNONE,3); D=elements(PosNONE,4); E=elements(PosNONE,5); F=elements(PosNONE,6);
++	p1=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
++	patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
++	patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
++	patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
++	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
+ 	%SIA elements
+ 	posH=find(data==1);
+ 	A=elements(posH,1); B=elements(posH,2); C=elements(posH,3); D=elements(posH,4); E=elements(posH,5); F=elements(posH,6);
+-	p1=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor);
++	p2=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor);
+@@ -66,15 +74,23 @@
+ 	%SSA elements
+ 	posM=find(data==2);
+ 	A=elements(posM,1); B=elements(posM,2); C=elements(posM,3); D=elements(posM,4); E=elements(posM,5); F=elements(posM,6);
+-	p2=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor);
++	p3=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor);
++	%L1L2 elements
++	posP=find(data==3);
++	A=elements(posP,1); B=elements(posP,2); C=elements(posP,3); D=elements(posP,4); E=elements(posP,5); F=elements(posP,6);
++	p4=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
++	patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
++	patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
++	patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
++	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
+ 	%HO elements
+ 	posP=find(data==3);
+ 	A=elements(posP,1); B=elements(posP,2); C=elements(posP,3); D=elements(posP,4); E=elements(posP,5); F=elements(posP,6);
+-	p3=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
++	p5=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
+@@ -82,7 +98,7 @@
+ 	%FS elements
+ 	posS=find(data==4);
+ 	A=elements(posS,1); B=elements(posS,2); C=elements(posS,3); D=elements(posS,4); E=elements(posS,5); F=elements(posS,6);
+-	p4=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 4,'FaceColor','flat','EdgeColor',edgecolor);
++	p6=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 4,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 4,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 4,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 4,'FaceColor','flat','EdgeColor',edgecolor);
+@@ -90,7 +106,7 @@
+ 	%SSAHO elements
+ 	posP=find(data==5);
+ 	A=elements(posP,1); B=elements(posP,2); C=elements(posP,3); D=elements(posP,4); E=elements(posP,5); F=elements(posP,6);
+-	p5=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 5,'FaceColor','flat','EdgeColor',edgecolor);
++	p7=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 5,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 5,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 5,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 5,'FaceColor','flat','EdgeColor',edgecolor);
+@@ -98,7 +114,7 @@
+ 	%HOFS elements
+ 	PosPS=find(data==7);
+ 	A=elements(PosPS,1); B=elements(PosPS,2); C=elements(PosPS,3); D=elements(PosPS,4); E=elements(PosPS,5); F=elements(PosPS,6);
+-	p6=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor);
++	p8=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor);
+@@ -106,24 +122,16 @@
+ 	%SSAFS elements
+ 	PosMS=find(data==6);
+ 	A=elements(PosMS,1); B=elements(PosMS,2); C=elements(PosMS,3); D=elements(PosMS,4); E=elements(PosMS,5); F=elements(PosMS,6);
+-	p7=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 6,'FaceColor','flat','EdgeColor',edgecolor);
++	p9=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 6,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 6,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 6,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 6,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 6,'FaceColor','flat','EdgeColor',edgecolor);
+-	%None elements
+-	PosNONE=find(data==0);
+-	A=elements(PosNONE,1); B=elements(PosNONE,2); C=elements(PosNONE,3); D=elements(PosNONE,4); E=elements(PosNONE,5); F=elements(PosNONE,6);
+-	p8=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
+-	patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
+-	patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
+-	patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
+-	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
+ 
+-	legend([p1 p2 p3 p4 p5 p6 p7 p8],...
+-		'SIA''s elements','SSA''s elements','HO''s elements','FS''s elements',...
+-		'SSAHO''s elements','HOFS''s elements','SSAFS''s elements','None elements');
+ end
++legend([p1 p2 p3 p4 p5 p6 p7 p8 p9],...
++		'None','SIA','SSA','L1L2','HO',...
++		'SSAHO','FS','SSAFS','HOFS');
+ 
+ %apply options
+ options=addfielddefault(options,'title','Elements type');
+Index: ../trunk-jpl/src/m/classes/m1qn3inversion.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/m1qn3inversion.m	(revision 18075)
++++ ../trunk-jpl/src/m/classes/m1qn3inversion.m	(revision 18076)
+@@ -70,12 +70,12 @@
+ 			md = checkfield(md,'fieldname','inversion.iscontrol','values',[0 1]);
+ 			md = checkfield(md,'fieldname','inversion.incomplete_adjoint','values',[0 1]);
+ 			md = checkfield(md,'fieldname','inversion.control_parameters','cell',1,'values',...
+-				{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'MaterialsRheologyZbar' 'Vx' 'Vy' 'Thickness'});
++				{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'MaterialsRheologyZbar' 'Vx' 'Vy' 'Thickness' 'BalancethicknessApparentMassbalance'});
+ 			md = checkfield(md,'fieldname','inversion.maxsteps','numel',1,'>=',0);
+ 			md = checkfield(md,'fieldname','inversion.maxiter','numel',1,'>=',0);
+ 			md = checkfield(md,'fieldname','inversion.dxmin','numel',1,'>',0);
+ 			md = checkfield(md,'fieldname','inversion.gttol','numel',1,'>',0);
+-			md = checkfield(md,'fieldname','inversion.cost_functions','size',[1 num_costfunc],'values',[101:105 201 501:506]);
++			md = checkfield(md,'fieldname','inversion.cost_functions','size',[1 num_costfunc],'values',[101:105 201 501:507]);
+ 			md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
+ 			md = checkfield(md,'fieldname','inversion.min_parameters','size',[md.mesh.numberofvertices num_controls]);
+ 			md = checkfield(md,'fieldname','inversion.max_parameters','size',[md.mesh.numberofvertices num_controls]);
+@@ -137,7 +137,12 @@
+ 			WriteData(fid,'object',obj,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);
+ 			WriteData(fid,'object',obj,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);
+ 			WriteData(fid,'object',obj,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);
+-			WriteData(fid,'object',obj,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',1);
++			if(numel(obj.thickness_obs)==md.mesh.numberofelements),
++				mattype=2;
++			else
++				mattype=1;
++			end
++			WriteData(fid,'object',obj,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype);
+ 
+ 			%process control parameters
+ 			num_control_parameters=numel(obj.control_parameters);
+@@ -163,6 +168,7 @@
+ 			pos=find(obj.cost_functions==504); data(pos)=ThicknessAlongGradientEnum();
+ 			pos=find(obj.cost_functions==505); data(pos)=ThicknessAcrossGradientEnum();
+ 			pos=find(obj.cost_functions==506); data(pos)=BalancethicknessMisfitEnum();
++			pos=find(obj.cost_functions==507); data(pos)=Balancethickness2MisfitEnum();
+ 			WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3);
+ 			WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer');
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/inversionvalidation.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/inversionvalidation.m	(revision 18075)
++++ ../trunk-jpl/src/m/classes/inversionvalidation.m	(revision 18076)
+@@ -52,8 +52,8 @@
+ 			md = checkfield(md,'fieldname','inversion.iscontrol','values',[0 1]);
+ 			md = checkfield(md,'fieldname','inversion.incomplete_adjoint','values',[0 1]);
+ 			md = checkfield(md,'fieldname','inversion.control_parameters','cell',1,'values',...
+-				{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'MaterialsRheologyZbar' 'Vx' 'Vy' 'Thickness'});
+-			md = checkfield(md,'fieldname','inversion.cost_functions','size',[1 num_costfunc],'values',[101:105 201 501:506]);
++				{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'MaterialsRheologyZbar' 'Vx' 'Vy' 'Thickness' 'BalancethicknessApparentMassbalance'});
++			md = checkfield(md,'fieldname','inversion.cost_functions','size',[1 num_costfunc],'values',[101:105 201 501:507]);
+ 			md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
+ 			md = checkfield(md,'fieldname','inversion.min_parameters','size',[md.mesh.numberofvertices num_controls]);
+ 			md = checkfield(md,'fieldname','inversion.max_parameters','size',[md.mesh.numberofvertices num_controls]);
+@@ -107,7 +107,12 @@
+ 			WriteData(fid,'object',obj,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);
+ 			WriteData(fid,'object',obj,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);
+ 			WriteData(fid,'object',obj,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);
+-			WriteData(fid,'object',obj,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',1);
++			if(numel(obj.thickness_obs)==md.mesh.numberofelements),
++				mattype=2; 
++			else
++				mattype=1;
++			end
++			WriteData(fid,'object',obj,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype);
+ 
+ 			%process control parameters
+ 			num_control_parameters=numel(obj.control_parameters);
+@@ -133,6 +138,7 @@
+ 			pos=find(obj.cost_functions==504); data(pos)=ThicknessAlongGradientEnum();
+ 			pos=find(obj.cost_functions==505); data(pos)=ThicknessAcrossGradientEnum();
+ 			pos=find(obj.cost_functions==506); data(pos)=BalancethicknessMisfitEnum();
++			pos=find(obj.cost_functions==507); data(pos)=Balancethickness2MisfitEnum();
+ 			WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3);
+ 			WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer');
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/flowequation.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.py	(revision 18075)
++++ ../trunk-jpl/src/m/classes/flowequation.py	(revision 18076)
+@@ -120,22 +120,22 @@
+ 		data[numpy.nonzero(data==0)]=NoneApproximationEnum()
+ 		data[numpy.nonzero(data==1)]=SIAApproximationEnum()
+ 		data[numpy.nonzero(data==2)]=SSAApproximationEnum()
+-		data[numpy.nonzero(data==3)]=HOApproximationEnum()
+-		data[numpy.nonzero(data==4)]=FSApproximationEnum()
+-		data[numpy.nonzero(data==5)]=SSAHOApproximationEnum()
+-		data[numpy.nonzero(data==6)]=SSAFSApproximationEnum()
++		data[numpy.nonzero(data==3)]=L1L2ApproximationEnum()
++		data[numpy.nonzero(data==4)]=HOApproximationEnum()
++		data[numpy.nonzero(data==5)]=FSApproximationEnum()
++		data[numpy.nonzero(data==6)]=SSAHOApproximationEnum()
+ 		data[numpy.nonzero(data==7)]=HOFSApproximationEnum()
+-		data[numpy.nonzero(data==8)]=L1L2ApproximationEnum()
++		data[numpy.nonzero(data==8)]=SSAFSApproximationEnum()
+ 		WriteData(fid,'data',data,'enum',FlowequationVertexEquationEnum(),'format','DoubleMat','mattype',1)
+ 		data=copy.deepcopy(self.element_equation)
+ 		data[numpy.nonzero(data==0)]=NoneApproximationEnum()
+ 		data[numpy.nonzero(data==1)]=SIAApproximationEnum()
+ 		data[numpy.nonzero(data==2)]=SSAApproximationEnum()
+-		data[numpy.nonzero(data==3)]=HOApproximationEnum()
+-		data[numpy.nonzero(data==4)]=FSApproximationEnum()
+-		data[numpy.nonzero(data==5)]=SSAHOApproximationEnum()
+-		data[numpy.nonzero(data==6)]=SSAFSApproximationEnum()
+-		data[numpy.nonzero(data==7)]=HOFSApproximationEnum()
+-		data[numpy.nonzero(data==8)]=L1L2ApproximationEnum()
++		data[numpy.nonzero(data==3)]=L1L2ApproximationEnum()
++		data[numpy.nonzero(data==4)]=HOApproximationEnum()
++		data[numpy.nonzero(data==5)]=FSApproximationEnum()
++		data[numpy.nonzero(data==6)]=SSAHOApproximationEnum()
++		data[numpy.nonzero(data==7)]=SSAFSApproximationEnum()
++		data[numpy.nonzero(data==8)]=HOFSApproximationEnum()
+ 		WriteData(fid,'data',data,'enum',FlowequationElementEquationEnum(),'format','DoubleMat','mattype',2)
+ 	# }}}
+Index: ../trunk-jpl/src/m/classes/flowequation.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.m	(revision 18075)
++++ ../trunk-jpl/src/m/classes/flowequation.m	(revision 18076)
+@@ -143,8 +143,8 @@
+ 					md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[1:2]);
+ 					md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[1:2]);
+ 				elseif strcmp(domaintype(md.mesh),'2Dvertical')
+-					md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[2:4]);
+-					md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[2:4]);
++					md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[2,4,5]);
++					md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[2,4,5]);
+ 				elseif strcmp(domaintype(md.mesh),'3D'),
+ 					md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices 1],'values',[0:8]);
+ 					md = checkfield(md,'fieldname','flowequation.element_equation','size',[md.mesh.numberofelements 1],'values',[0:8]);
+@@ -201,23 +201,25 @@
+ 			pos=find(data==0); data(pos,end)=NoneApproximationEnum();
+ 			pos=find(data==1); data(pos,end)=SIAApproximationEnum();
+ 			pos=find(data==2); data(pos,end)=SSAApproximationEnum();
+-			pos=find(data==3); data(pos,end)=HOApproximationEnum();
+-			pos=find(data==4); data(pos,end)=FSApproximationEnum();
+-			pos=find(data==5); data(pos,end)=SSAHOApproximationEnum();
+-			pos=find(data==6); data(pos,end)=SSAFSApproximationEnum();
++			pos=find(data==3); data(pos,end)=L1L2ApproximationEnum();
++			pos=find(data==4); data(pos,end)=HOApproximationEnum();
++			pos=find(data==5); data(pos,end)=FSApproximationEnum();
++
++			pos=find(data==6); data(pos,end)=SSAHOApproximationEnum();
+ 			pos=find(data==7); data(pos,end)=HOFSApproximationEnum();
+-			pos=find(data==8); data(pos,end)=L1L2ApproximationEnum();
++			pos=find(data==8); data(pos,end)=SSAFSApproximationEnum();
+ 			WriteData(fid,'data',data,'enum',FlowequationVertexEquationEnum(),'format','DoubleMat','mattype',1);
+ 			data=obj.element_equation;
+ 			pos=find(data==0); data(pos,end)=NoneApproximationEnum();
+ 			pos=find(data==1); data(pos,end)=SIAApproximationEnum();
+ 			pos=find(data==2); data(pos,end)=SSAApproximationEnum();
+-			pos=find(data==3); data(pos,end)=HOApproximationEnum();
+-			pos=find(data==4); data(pos,end)=FSApproximationEnum();
+-			pos=find(data==5); data(pos,end)=SSAHOApproximationEnum();
+-			pos=find(data==6); data(pos,end)=SSAFSApproximationEnum();
+-			pos=find(data==7); data(pos,end)=HOFSApproximationEnum();
+-			pos=find(data==8); data(pos,end)=L1L2ApproximationEnum();
++			pos=find(data==3); data(pos,end)=L1L2ApproximationEnum();
++			pos=find(data==4); data(pos,end)=HOApproximationEnum();
++			pos=find(data==5); data(pos,end)=FSApproximationEnum();
++
++			pos=find(data==6); data(pos,end)=SSAHOApproximationEnum();
++			pos=find(data==7); data(pos,end)=SSAFSApproximationEnum();
++			pos=find(data==8); data(pos,end)=HOFSApproximationEnum();
+ 			WriteData(fid,'data',data,'enum',FlowequationElementEquationEnum(),'format','DoubleMat','mattype',2);
+ 		end % }}}
+ 	end
+Index: ../trunk-jpl/src/m/parameterization/setflowequation.py
+===================================================================
+--- ../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 18075)
++++ ../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 18076)
+@@ -231,12 +231,12 @@
+ 	md.flowequation.element_equation[numpy.nonzero(noneflag)]=0
+ 	md.flowequation.element_equation[numpy.nonzero(SIAflag)]=1
+ 	md.flowequation.element_equation[numpy.nonzero(SSAflag)]=2
+-	md.flowequation.element_equation[numpy.nonzero(L1L2flag)]=8
+-	md.flowequation.element_equation[numpy.nonzero(HOflag)]=3
+-	md.flowequation.element_equation[numpy.nonzero(FSflag)]=4
+-	md.flowequation.element_equation[numpy.nonzero(SSAHOflag)]=5
+-	md.flowequation.element_equation[numpy.nonzero(SSAFSflag)]=6
+-	md.flowequation.element_equation[numpy.nonzero(HOFSflag)]=7
++	md.flowequation.element_equation[numpy.nonzero(L1L2flag)]=3
++	md.flowequation.element_equation[numpy.nonzero(HOflag)]=4
++	md.flowequation.element_equation[numpy.nonzero(FSflag)]=5
++	md.flowequation.element_equation[numpy.nonzero(SSAHOflag)]=6
++	md.flowequation.element_equation[numpy.nonzero(SSAFSflag)]=7
++	md.flowequation.element_equation[numpy.nonzero(HOFSflag)]=8
+ 
+ 	#border
+ 	md.flowequation.borderHO=nodeonHO
+@@ -245,33 +245,33 @@
+ 
+ 	#Create vertices_type
+ 	md.flowequation.vertex_equation=numpy.zeros(md.mesh.numberofvertices,int)
++	pos=numpy.nonzero(nodeonSIA)
++	md.flowequation.vertex_equation[pos]=1
+ 	pos=numpy.nonzero(nodeonSSA)
+ 	md.flowequation.vertex_equation[pos]=2
+ 	pos=numpy.nonzero(nodeonL1L2)
+-	md.flowequation.vertex_equation[pos]=8
++	md.flowequation.vertex_equation[pos]=3
+ 	pos=numpy.nonzero(nodeonHO)
+-	md.flowequation.vertex_equation[pos]=3
+-	pos=numpy.nonzero(nodeonSIA)
+-	md.flowequation.vertex_equation[pos]=1
+-	pos=numpy.nonzero(nodeonSSAHO)
++	md.flowequation.vertex_equation[pos]=4
++	pos=numpy.nonzero(nodeonFS)
+ 	md.flowequation.vertex_equation[pos]=5
+-	pos=numpy.nonzero(nodeonFS)
+-	md.flowequation.vertex_equation[pos]=4
+ 	if any(FSflag):
+ 		pos=numpy.nonzero(numpy.logical_not(nodeonFS))
+ 		if not (any(HOflag) or any(SSAflag)):
+ 			md.flowequation.vertex_equation[pos]=0
++	pos=numpy.nonzero(nodeonSSAHO)
++	md.flowequation.vertex_equation[pos]=6
+ 	pos=numpy.nonzero(nodeonHOFS)
+ 	md.flowequation.vertex_equation[pos]=7
+ 	pos=numpy.nonzero(nodeonSSAFS)
+-	md.flowequation.vertex_equation[pos]=6
++	md.flowequation.vertex_equation[pos]=8
+ 
+ 	#figure out solution types
+ 	md.flowequation.isSIA=any(md.flowequation.element_equation==1)
+ 	md.flowequation.isSSA=any(md.flowequation.element_equation==2)
+-	md.flowequation.isL1L2=any(md.flowequation.element_equation==8)
+-	md.flowequation.isHO=any(md.flowequation.element_equation==3)
+-	md.flowequation.isFS=any(md.flowequation.element_equation==4)
++	md.flowequation.isL1L2=any(md.flowequation.element_equation==3)
++	md.flowequation.isHO=any(md.flowequation.element_equation==4)
++	md.flowequation.isFS=any(md.flowequation.element_equation==5)
+ 
+ 	return md
+ 
+Index: ../trunk-jpl/src/m/parameterization/setflowequation.m
+===================================================================
+--- ../trunk-jpl/src/m/parameterization/setflowequation.m	(revision 18075)
++++ ../trunk-jpl/src/m/parameterization/setflowequation.m	(revision 18076)
+@@ -69,9 +69,9 @@
+ 	error('L1L2 cannot be coupled to any other model');
+ end
+ 
+-%Check that no L1L2 or HO or FS for 2d mesh
++%Check that no HO or FS for 2d mesh
+ if strcmp(domaintype(md.mesh),'2Dhorizontal')
+-	if any(L1L2flag | FSflag | HOflag)
++	if any(FSflag | HOflag)
+ 		error('FS and HO elements not allowed in 2d mesh, extrude it first')
+ 	end
+ end
+@@ -238,17 +238,17 @@
+ 	end
+ end
+ 
+-%Create MacaAyealHOApproximation where needed
++%Create element equations
+ md.flowequation.element_equation=zeros(md.mesh.numberofelements,1);
+ md.flowequation.element_equation(find(noneflag))=0;
+ md.flowequation.element_equation(find(SIAflag))=1;
+ md.flowequation.element_equation(find(SSAflag))=2;
+-md.flowequation.element_equation(find(L1L2flag))=8;
+-md.flowequation.element_equation(find(HOflag))=3;
+-md.flowequation.element_equation(find(FSflag))=4;
+-md.flowequation.element_equation(find(SSAHOflag))=5;
+-md.flowequation.element_equation(find(SSAFSflag))=6;
+-md.flowequation.element_equation(find(HOFSflag))=7;
++md.flowequation.element_equation(find(L1L2flag))=3;
++md.flowequation.element_equation(find(HOflag))=4;
++md.flowequation.element_equation(find(FSflag))=5;
++md.flowequation.element_equation(find(SSAHOflag))=6;
++md.flowequation.element_equation(find(SSAFSflag))=7;
++md.flowequation.element_equation(find(HOFSflag))=8;
+ 
+ %border
+ md.flowequation.borderHO=nodeonHO;
+@@ -257,35 +257,35 @@
+ 
+ %Create vertices_type
+ md.flowequation.vertex_equation=zeros(md.mesh.numberofvertices,1);
++pos=find(nodeonSIA);
++md.flowequation.vertex_equation(pos)=1;
+ pos=find(nodeonSSA);
+ md.flowequation.vertex_equation(pos)=2;
+ pos=find(nodeonL1L2);
+-md.flowequation.vertex_equation(pos)=8;
++md.flowequation.vertex_equation(pos)=3;
+ pos=find(nodeonHO);
+-md.flowequation.vertex_equation(pos)=3;
+-pos=find(nodeonSIA);
+-md.flowequation.vertex_equation(pos)=1;
+-pos=find(nodeonSSAHO);
++md.flowequation.vertex_equation(pos)=4;
++pos=find(nodeonFS);
+ md.flowequation.vertex_equation(pos)=5;
+-pos=find(nodeonFS);
+-md.flowequation.vertex_equation(pos)=4;
+ if any(FSflag),
+ 	pos=find(~nodeonFS);
+ 	if(~any(HOflag) & ~any(SSAflag)),
+ 		md.flowequation.vertex_equation(pos)=0;
+ 	end
+ end
++pos=find(nodeonSSAHO);
++md.flowequation.vertex_equation(pos)=6;
+ pos=find(nodeonHOFS);
+ md.flowequation.vertex_equation(pos)=7;
+ pos=find(nodeonSSAFS);
+-md.flowequation.vertex_equation(pos)=6;
++md.flowequation.vertex_equation(pos)=8;
+ 
+ %figure out solution types
+ md.flowequation.isSIA  = double(any(md.flowequation.element_equation == 1));
+ md.flowequation.isSSA  = double(any(md.flowequation.element_equation == 2));
+-md.flowequation.isHO   = double(any(md.flowequation.element_equation == 3));
+-md.flowequation.isL1L2 = double(any(md.flowequation.element_equation == 8));
+-md.flowequation.isFS   = double(any(md.flowequation.element_equation == 4));
++md.flowequation.isL1L2 = double(any(md.flowequation.element_equation == 3));
++md.flowequation.isHO   = double(any(md.flowequation.element_equation == 4));
++md.flowequation.isFS   = double(any(md.flowequation.element_equation == 5));
+ 
+ return
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18076-18077.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18076-18077.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18076-18077.diff	(revision 18296)
@@ -0,0 +1,122 @@
+Index: ../trunk-jpl/src/m/consistency/checkfield.py
+===================================================================
+--- ../trunk-jpl/src/m/consistency/checkfield.py	(revision 18076)
++++ ../trunk-jpl/src/m/consistency/checkfield.py	(revision 18077)
+@@ -29,9 +29,6 @@
+ 
+ 	   Usage:
+ 	      md = checkfield(md,fieldname,options);
+-
+-	   Example:
+-	      md = checkfield(md,'mesh.elementonbase','size',[md.mesh.numberofelements 1],'values',[0 1]);
+ 	"""
+ 
+ 	#get options
+Index: ../trunk-jpl/src/m/consistency/checkfield.m
+===================================================================
+--- ../trunk-jpl/src/m/consistency/checkfield.m	(revision 18076)
++++ ../trunk-jpl/src/m/consistency/checkfield.m	(revision 18077)
+@@ -22,9 +22,6 @@
+ %
+ %   Usage:
+ %      md = checkfield(md,fieldname,options);
+-%
+-%   Example:
+-%      md = checkfield(md,'mesh.elementonbase','size',[md.mesh.numberofelements 1],'values',[0 1]);
+ 
+ %get options
+ options=pairoptions(varargin{:});
+Index: ../trunk-jpl/src/m/classes/mesh3dprisms.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/mesh3dprisms.py	(revision 18076)
++++ ../trunk-jpl/src/m/classes/mesh3dprisms.py	(revision 18077)
+@@ -26,8 +26,6 @@
+ 		self.long                        = float('NaN');
+ 		self.hemisphere                  = float('NaN');
+ 
+-		self.elementonbase                = float('NaN');
+-		self.elementonsurface            = float('NaN');
+ 		self.vertexonbase                 = float('NaN');
+ 		self.vertexonsurface             = float('NaN');
+ 		self.lowerelements               = float('NaN');
+@@ -74,9 +72,7 @@
+ 		string="%s%s"%(string,"\n\n      Properties:")
+ 		string="%s\n%s"%(string,fielddisplay(self,"numberoflayers","number of extrusion layers"))
+ 		string="%s\n%s"%(string,fielddisplay(self,"vertexonbase","lower vertices flags list"))
+-		string="%s\n%s"%(string,fielddisplay(self,"elementonbase","lower elements flags list"))
+ 		string="%s\n%s"%(string,fielddisplay(self,"vertexonsurface","upper vertices flags list"))
+-		string="%s\n%s"%(string,fielddisplay(self,"elementonsurface","upper elements flags list"))
+ 		string="%s\n%s"%(string,fielddisplay(self,"uppervertex","upper vertex list (-1 for vertex on the upper surface)"))
+ 		string="%s\n%s"%(string,fielddisplay(self,"upperelements","upper element list (-1 for element on the upper layer)"))
+ 		string="%s\n%s"%(string,fielddisplay(self,"lowervertex","lower vertex list (-1 for vertex on the lower surface)"))
+Index: ../trunk-jpl/src/m/classes/mesh3dprisms.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/mesh3dprisms.m	(revision 18076)
++++ ../trunk-jpl/src/m/classes/mesh3dprisms.m	(revision 18077)
+@@ -17,8 +17,6 @@
+ 		long                        = NaN
+ 		hemisphere                  = NaN
+ 
+-		elementonbase                = NaN
+-		elementonsurface            = NaN
+ 		vertexonbase                 = NaN
+ 		vertexonsurface             = NaN
+ 		lowerelements               = NaN
+@@ -162,9 +160,7 @@
+ 			disp(sprintf('\n      Properties:'));
+ 			fielddisplay(obj,'numberoflayers','number of extrusion layers');
+ 			fielddisplay(obj,'vertexonbase','lower vertices flags list');
+-			fielddisplay(obj,'elementonbase','lower elements flags list');
+ 			fielddisplay(obj,'vertexonsurface','upper vertices flags list');
+-			fielddisplay(obj,'elementonsurface','upper elements flags list');
+ 			fielddisplay(obj,'uppervertex','upper vertex list (NaN for vertex on the upper surface)');
+ 			fielddisplay(obj,'upperelements','upper element list (NaN for element on the upper layer)');
+ 			fielddisplay(obj,'lowervertex','lower vertex list (NaN for vertex on the lower surface)');
+Index: ../trunk-jpl/src/m/classes/model.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.py	(revision 18076)
++++ ../trunk-jpl/src/m/classes/model.py	(revision 18077)
+@@ -617,8 +617,6 @@
+ 
+ 
+ 		#bedinfo and surface info
+-		md.mesh.elementonbase=project3d(md,'vector',numpy.ones(md.mesh.numberofelements2d,bool),'type','element','layer',1)
+-		md.mesh.elementonsurface=project3d(md,'vector',numpy.ones(md.mesh.numberofelements2d,bool),'type','element','layer',md.mesh.numberoflayers-1)
+ 		md.mesh.vertexonbase=project3d(md,'vector',numpy.ones(md.mesh.numberofvertices2d,bool),'type','node','layer',1)
+ 		md.mesh.vertexonsurface=project3d(md,'vector',numpy.ones(md.mesh.numberofvertices2d,bool),'type','node','layer',md.mesh.numberoflayers)
+ 
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 18076)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 18077)
+@@ -710,8 +710,6 @@
+       if ~isnan(md.initialization.epl_thickness),md.initialization.epl_thickness=project3d(md,'vector',md.initialization.epl_thickness,'type','node','layer',1);end;
+ 
+ 			%bedinfo and surface info
+-			md.mesh.elementonbase=project3d(md,'vector',ones(md.mesh.numberofelements2d,1),'type','element','layer',1);
+-			md.mesh.elementonsurface=project3d(md,'vector',ones(md.mesh.numberofelements2d,1),'type','element','layer',md.mesh.numberoflayers-1);
+ 			md.mesh.vertexonbase=project3d(md,'vector',ones(md.mesh.numberofvertices2d,1),'type','node','layer',1);
+ 			md.mesh.vertexonsurface=project3d(md,'vector',ones(md.mesh.numberofvertices2d,1),'type','node','layer',md.mesh.numberoflayers);
+ 
+@@ -942,8 +940,6 @@
+ 			if isfield(structmd,'lowernodes'), md.mesh.lowervertex=structmd.lowernodes; end
+ 			if isfield(structmd,'upperelements'), md.mesh.upperelements=structmd.upperelements; end
+ 			if isfield(structmd,'lowerelements'), md.mesh.lowerelements=structmd.lowerelements; end
+-			if isfield(structmd,'elementonbase'), md.mesh.elementonbase=structmd.elementonbase; end
+-			if isfield(structmd,'elementonsurface'), md.mesh.elementonsurface=structmd.elementonsurface; end
+ 			if isfield(structmd,'nodeonsurface'), md.mesh.vertexonsurface=structmd.nodeonsurface; end
+ 			if isfield(structmd,'nodeonbase'), md.mesh.vertexonbase=structmd.nodeonbase; end
+ 			if isfield(structmd,'elements2d'), md.mesh.elements2d=structmd.elements2d; end
+Index: ../trunk-jpl/src/m/contrib/bamg/yams.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/bamg/yams.m	(revision 18076)
++++ ../trunk-jpl/src/m/contrib/bamg/yams.m	(revision 18077)
+@@ -107,8 +107,6 @@
+ md.mesh.z=zeros(md.mesh.numberofvertices,1);
+ md.mesh.vertexonbase=ones(md.mesh.numberofvertices,1);
+ md.mesh.vertexonsurface=ones(md.mesh.numberofvertices,1);
+-md.mesh.elementonbase=ones(md.mesh.numberofelements,1);
+-md.mesh.elementonsurface=ones(md.mesh.numberofelements,1);
+ if strcmpi(Names.interp,'node'),
+ 	md.inversion.vx_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vxname),md.mesh.x,md.mesh.y,0);
+ 	md.inversion.vy_obs=InterpFromGridToMesh(Vel.(Names.xname),Vel.(Names.yname),Vel.(Names.vyname),md.mesh.x,md.mesh.y,0);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18077-18078.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18077-18078.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18077-18078.diff	(revision 18296)
@@ -0,0 +1,2687 @@
+Index: ../trunk-jpl/src/c/classes/Loads/Numericalflux.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Numericalflux.cpp	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Loads/Numericalflux.cpp	(revision 18078)
+@@ -450,8 +450,8 @@
+ 
+ 		gauss->GaussPoint(ig);
+ 
+-		tria->GetSegmentBFlux(&B[0],gauss,index1,index2);
+-		tria->GetSegmentBprimeFlux(&Bprime[0],gauss,index1,index2);
++		tria->GetSegmentBFlux(&B[0],gauss,index1,index2,tria->FiniteElement());
++		tria->GetSegmentBprimeFlux(&Bprime[0],gauss,index1,index2,tria->FiniteElement());
+ 
+ 		vxaverage_input->GetInputValue(&vx,gauss);
+ 		vyaverage_input->GetInputValue(&vy,gauss);
+@@ -528,7 +528,7 @@
+ 
+ 		gauss->GaussPoint(ig);
+ 
+-		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2);
++		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2,tria->FiniteElement());
+ 
+ 		vxaverage_input->GetInputValue(&vx,gauss);
+ 		vyaverage_input->GetInputValue(&vy,gauss);
+@@ -596,8 +596,8 @@
+ 
+ 		gauss->GaussPoint(ig);
+ 
+-		tria->GetSegmentBFlux(&B[0],gauss,index1,index2);
+-		tria->GetSegmentBprimeFlux(&Bprime[0],gauss,index1,index2);
++		tria->GetSegmentBFlux(&B[0],gauss,index1,index2,tria->FiniteElement());
++		tria->GetSegmentBprimeFlux(&Bprime[0],gauss,index1,index2,tria->FiniteElement());
+ 
+ 		vxaverage_input->GetInputValue(&vx,gauss);
+ 		vyaverage_input->GetInputValue(&vy,gauss);
+@@ -673,7 +673,7 @@
+ 
+ 		gauss->GaussPoint(ig);
+ 
+-		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2);
++		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2,tria->FiniteElement());
+ 
+ 		vxaverage_input->GetInputValue(&vx,gauss);
+ 		vyaverage_input->GetInputValue(&vy,gauss);
+@@ -789,7 +789,7 @@
+ 
+ 		gauss->GaussPoint(ig);
+ 
+-		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2);
++		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2,tria->FiniteElement());
+ 
+ 		vxaverage_input->GetInputValue(&vx,gauss);
+ 		vyaverage_input->GetInputValue(&vy,gauss);
+@@ -875,7 +875,7 @@
+ 
+ 		gauss->GaussPoint(ig);
+ 
+-		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2);
++		tria->GetSegmentNodalFunctions(&L[0],gauss,index1,index2,tria->FiniteElement());
+ 
+ 		vxaverage_input->GetInputValue(&vx,gauss);
+ 		vyaverage_input->GetInputValue(&vy,gauss);
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18078)
+@@ -46,6 +46,9 @@
+ 		Matpar      *matpar;
+ 		Parameters  *parameters;
+ 
++		int* element_type_list;
++		int  element_type;
++
+ 	public: 
+ 		/*Constructors/Destructores*/
+ 		Element();
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18078)
+@@ -24,7 +24,7 @@
+ 
+ /*Constructors/destructor/copy*/
+ Tria::Tria(int tria_id, int tria_sid, int index, IoModel* iomodel,int nummodels)/*{{{*/
+-	:TriaRef(nummodels),ElementHook(nummodels,index+1,NUMVERTICES,iomodel){
++	:ElementHook(nummodels,index+1,NUMVERTICES,iomodel){
+ 
+ 		/*id: */
+ 		this->id  = tria_id;
+@@ -41,6 +41,7 @@
+ 		this->vertices = NULL;
+ 		this->material = NULL;
+ 		this->matpar   = NULL;
++		this->element_type_list=xNew<int>(nummodels);
+ }
+ /*}}}*/
+ Tria::~Tria(){/*{{{*/
+@@ -899,7 +900,7 @@
+ }
+ /*}}}*/
+ int        Tria::GetNumberOfNodes(void){/*{{{*/
+-	return this->NumberofNodes();
++	return this->NumberofNodes(this->element_type);
+ }
+ /*}}}*/
+ int        Tria::GetNumberOfVertices(void){/*{{{*/
+@@ -920,7 +921,7 @@
+ /*}}}*/
+ Node*      Tria::GetNode(int node_number){/*{{{*/
+ 	_assert_(node_number>=0); 
+-	_assert_(node_number<this->NumberofNodes()); 
++	_assert_(node_number<this->NumberofNodes(this->element_type)); 
+ 	return this->nodes[node_number];
+ 
+ }/*}}}*/
+@@ -1058,7 +1059,7 @@
+ 	int* doflist = NULL;
+ 
+ 	/*Fetch number of nodes for this finite element*/
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(this->element_type);
+ 
+ 	/*Fetch dof list and allocate solution vector*/
+ 	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+@@ -1109,7 +1110,7 @@
+ 	case NodesEnum:
+ 
+ 		/*Get number of nodes and dof list: */
+-		numnodes = this->NumberofNodes();
++		numnodes = this->NumberofNodes(this->element_type);
+ 		values   = xNew<IssmDouble>(numnodes);
+ 		GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+ 
+@@ -1123,7 +1124,7 @@
+ 	case NodeSIdEnum:
+ 
+ 		/*Get number of nodes and dof list: */
+-		numnodes = this->NumberofNodes();
++		numnodes = this->NumberofNodes(this->element_type);
+ 		values   = xNew<IssmDouble>(numnodes);
+ 
+ 		for(int i=0;i<numnodes;i++){
+@@ -1452,7 +1453,7 @@
+ void       Tria::NodalFunctions(IssmDouble* basis, Gauss* gauss){/*{{{*/
+ 
+ 	_assert_(gauss->Enum()==GaussTriaEnum);
+-	this->GetNodalFunctions(basis,(GaussTria*)gauss);
++	this->GetNodalFunctions(basis,(GaussTria*)gauss,this->element_type);
+ 
+ }
+ /*}}}*/
+@@ -1466,7 +1467,7 @@
+ void       Tria::NodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+ 
+ 	_assert_(gauss->Enum()==GaussTriaEnum);
+-	this->GetNodalFunctionsDerivatives(dbasis,xyz_list,(GaussTria*)gauss);
++	this->GetNodalFunctionsDerivatives(dbasis,xyz_list,(GaussTria*)gauss,this->element_type);
+ 
+ }
+ /*}}}*/
+@@ -1572,15 +1573,15 @@
+ }
+ /*}}}*/
+ int        Tria::VelocityInterpolation(void){/*{{{*/
+-	return TriaRef::VelocityInterpolation();
++	return TriaRef::VelocityInterpolation(this->element_type);
+ }
+ /*}}}*/
+ int        Tria::PressureInterpolation(void){/*{{{*/
+-	return TriaRef::PressureInterpolation();
++	return TriaRef::PressureInterpolation(this->element_type);
+ }
+ /*}}}*/
+ int        Tria::TensorInterpolation(void){/*{{{*/
+-	return TriaRef::TensorInterpolation();
++	return TriaRef::TensorInterpolation(this->element_type);
+ }
+ /*}}}*/
+ int        Tria::NumberofNodesPressure(void){/*{{{*/
+@@ -1889,7 +1890,7 @@
+ 	_assert_(iomodel->elements);
+ 
+ 	/*Recover element type*/
+-	this->SetElementType(finiteelement_type,analysis_counter);
++	this->element_type_list[analysis_counter]=finiteelement_type;
+ 
+ 	/*Recover nodes ids needed to initialize the node hook.*/
+ 	switch(finiteelement_type){
+@@ -1987,7 +1988,7 @@
+ 	Input* onbase = inputs->GetInput(MeshVertexonbaseEnum); _assert_(onbase);
+ 
+ 	GaussTria* gauss=new GaussTria();
+-	for(int iv=0;iv<this->NumberofNodes();iv++){
++	for(int iv=0;iv<this->NumberofNodes(this->element_type);iv++){
+ 		gauss->GaussNode(this->element_type,iv);
+ 		onbase->GetInputValue(&isonbase,gauss);
+ 		if(isonbase==1.){
+@@ -2026,7 +2027,7 @@
+ }
+ /*}}}*/
+ void       Tria::ValueP1DerivativesOnGauss(IssmDouble* dvalue,IssmDouble* values,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+-	TriaRef::GetInputDerivativeValue(dvalue,values,xyz_list,gauss);
++	TriaRef::GetInputDerivativeValue(dvalue,values,xyz_list,gauss,P1Enum);
+ }
+ /*}}}*/
+ int        Tria::VertexConnectivity(int vertexindex){/*{{{*/
+@@ -2827,7 +2828,7 @@
+ 	IssmDouble  value;
+ 
+ 	/*Fetch number of nodes for this finite element*/
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(this->element_type);
+ 
+ 	/*Fetch dof list and allocate solution vector*/
+ 	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+Index: ../trunk-jpl/src/c/classes/Elements/TriaRef.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/TriaRef.h	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Elements/TriaRef.h	(revision 18078)
+@@ -11,39 +11,27 @@
+ class TriaRef{
+ 
+ 	public: 
+-		int* element_type_list; //P1CG, P1DG, MINI, P2...
+-		int  element_type;
+-
+ 		TriaRef();
+-		TriaRef(const int nummodels);
+ 		~TriaRef();
+ 
+-		/*Management*/
+-		void SetElementType(int type,int type_counter);
+-
+ 		/*Numerics*/
+ 		void GetJacobian(IssmDouble* J, IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSegmentJacobianDeterminant(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetJacobianDeterminant(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetJacobianInvert(IssmDouble*  Jinv, IssmDouble* xyz_list,Gauss* gauss);
+-		void GetNodalFunctions(IssmDouble* basis,Gauss* gauss);
+ 		void GetNodalFunctions(IssmDouble* basis,Gauss* gauss,int finiteelement);
+-		void GetSegmentNodalFunctions(IssmDouble* basis,Gauss* gauss, int index1,int index2);
+-		void GetSegmentBFlux(IssmDouble* B,Gauss* gauss, int index1,int index2);
+-		void GetSegmentBprimeFlux(IssmDouble* Bprime,Gauss* gauss, int index1,int index2);
+-		void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss);
++		void GetSegmentNodalFunctions(IssmDouble* basis,Gauss* gauss, int index1,int index2,int finiteelement);
++		void GetSegmentBFlux(IssmDouble* B,Gauss* gauss, int index1,int index2,int finiteelement);
++		void GetSegmentBprimeFlux(IssmDouble* Bprime,Gauss* gauss, int index1,int index2,int finiteelement);
+ 		void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss,int finiteelement);
+-		void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss);
+ 		void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss,int finiteelement);
+-		void GetInputValue(IssmDouble* pp, IssmDouble* plist, Gauss* gauss);
+ 		void GetInputValue(IssmDouble* pp, IssmDouble* plist, Gauss* gauss,int finiteelement);
+-		void GetInputDerivativeValue(IssmDouble* pp, IssmDouble* plist,IssmDouble* xyz_list, Gauss* gauss);
++		void GetInputDerivativeValue(IssmDouble* pp, IssmDouble* plist,IssmDouble* xyz_list, Gauss* gauss,int finiteelement);
+ 
+ 		void NodeOnEdgeIndices(int* pnumindices,int** pindices,int index,int finiteelement);
+-		int  NumberofNodes(void);
+ 		int  NumberofNodes(int finiteelement);
+-		int  VelocityInterpolation(void);
+-		int  PressureInterpolation(void);
+-		int  TensorInterpolation(void);
++		int  VelocityInterpolation(int fe_stokes);
++		int  PressureInterpolation(int fe_stokes);
++		int  TensorInterpolation(int fe_stokes);
+ };
+ #endif
+Index: ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp	(revision 18078)
+@@ -27,29 +27,12 @@
+ 
+ /*Object constructors and destructor*/
+ PentaRef::PentaRef(){/*{{{*/
+-	this->element_type_list=NULL;
+ }
+ /*}}}*/
+-PentaRef::PentaRef(const int nummodels){/*{{{*/
+-
+-	/*Only allocate pointer*/
+-	element_type_list=xNew<int>(nummodels);
+-
+-}
+-/*}}}*/
+ PentaRef::~PentaRef(){/*{{{*/
+-	xDelete<int>(element_type_list);
+ }
+ /*}}}*/
+ 
+-/*Management*/
+-void PentaRef::SetElementType(int type,int type_counter){/*{{{*/
+-
+-	/*initialize element type*/
+-	this->element_type_list[type_counter]=type;
+-}
+-/*}}}*/
+-
+ /*Reference Element numerics*/
+ void PentaRef::GetJacobian(IssmDouble* J, IssmDouble* xyz_list,Gauss* gauss_in){/*{{{*/
+ 	/*The Jacobian is constant over the element, discard the gaussian points. 
+@@ -168,14 +151,6 @@
+ 	Matrix3x3Invert(Jinv,&J[0][0]);
+ }
+ /*}}}*/
+-void PentaRef::GetNodalFunctions(IssmDouble* basis,Gauss* gauss){/*{{{*/
+-	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+-
+-	_assert_(basis);
+-	GetNodalFunctions(basis,gauss,this->element_type);
+-
+-}
+-/*}}}*/
+ void PentaRef::GetNodalFunctions(IssmDouble* basis,Gauss* gauss_in,int finiteelement){/*{{{*/
+ 	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+ 
+@@ -320,10 +295,6 @@
+ 	}
+ }
+ /*}}}*/
+-void PentaRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss){/*{{{*/
+-	GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss,this->element_type);
+-}
+-/*}}}*/
+ void PentaRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss,int finiteelement){/*{{{*/
+ 
+ 	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+@@ -357,10 +328,6 @@
+ 	xDelete<IssmDouble>(dbasis_ref);
+ }
+ /*}}}*/
+-void PentaRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss){/*{{{*/
+-	GetNodalFunctionsDerivativesReference(dbasis,gauss,this->element_type);
+-}
+-/*}}}*/
+ void PentaRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss_in,int finiteelement){/*{{{*/
+ 
+ 	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+@@ -783,157 +750,6 @@
+ 
+ }
+ /*}}}*/
+-void PentaRef::GetNodalFunctionsMINIDerivatives(IssmDouble* dbasismini,IssmDouble* xyz_list, Gauss* gauss){/*{{{*/
+-
+-	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+-	 * actual coordinate system): */
+-
+-	IssmDouble    dbasismini_ref[3][NUMNODESP1b];
+-	IssmDouble    Jinv[3][3];
+-
+-	/*Get derivative values with respect to parametric coordinate system: */
+-	GetNodalFunctionsMINIDerivativesReference(&dbasismini_ref[0][0], gauss); 
+-
+-	/*Get Jacobian invert: */
+-	GetJacobianInvert(&Jinv[0][0], xyz_list, gauss);
+-
+-	/*Build dbasis: 
+-	 *
+-	 * [dhi/dx]= Jinv'*[dhi/dr]
+-	 * [dhi/dy]        [dhi/ds]
+-	 * [dhi/dz]        [dhi/dzeta]
+-	 */
+-
+-	for(int i=0;i<NUMNODESP1b;i++){
+-		*(dbasismini+NUMNODESP1b*0+i)=Jinv[0][0]*dbasismini_ref[0][i]+Jinv[0][1]*dbasismini_ref[1][i]+Jinv[0][2]*dbasismini_ref[2][i];
+-		*(dbasismini+NUMNODESP1b*1+i)=Jinv[1][0]*dbasismini_ref[0][i]+Jinv[1][1]*dbasismini_ref[1][i]+Jinv[1][2]*dbasismini_ref[2][i];
+-		*(dbasismini+NUMNODESP1b*2+i)=Jinv[2][0]*dbasismini_ref[0][i]+Jinv[2][1]*dbasismini_ref[1][i]+Jinv[2][2]*dbasismini_ref[2][i];
+-	}
+-
+-}
+-/*}}}*/
+-void PentaRef::GetNodalFunctionsMINIDerivativesReference(IssmDouble* dbasis,Gauss* gauss_in){/*{{{*/
+-	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+-	 * natural coordinate system) at the gaussian point. */
+-
+-	/*Cast gauss to GaussPenta*/
+-	_assert_(gauss_in->Enum()==GaussPentaEnum);
+-	GaussPenta* gauss = dynamic_cast<GaussPenta*>(gauss_in);
+-
+-
+-	IssmDouble zeta=gauss->coord4;
+-
+-	/*Nodal function 1*/
+-	dbasis[NUMNODESP1b*0+0]=-0.5*(1.0-zeta)/2.0;
+-	dbasis[NUMNODESP1b*1+0]=-SQRT3/6.0*(1.0-zeta)/2.0;
+-	dbasis[NUMNODESP1b*2+0]=-0.5*gauss->coord1;
+-	/*Nodal function 2*/
+-	dbasis[NUMNODESP1b*0+1]=0.5*(1.0-zeta)/2.0;
+-	dbasis[NUMNODESP1b*1+1]=-SQRT3/6.0*(1.0-zeta)/2.0;
+-	dbasis[NUMNODESP1b*2+1]=-0.5*gauss->coord2;
+-	/*Nodal function 3*/
+-	dbasis[NUMNODESP1b*0+2]=0.;
+-	dbasis[NUMNODESP1b*1+2]=SQRT3/3.0*(1.0-zeta)/2.0;
+-	dbasis[NUMNODESP1b*2+2]=-0.5*gauss->coord3;
+-	/*Nodal function 4*/
+-	dbasis[NUMNODESP1b*0+3]=-0.5*(1.0+zeta)/2.0;
+-	dbasis[NUMNODESP1b*1+3]=-SQRT3/6.0*(1.0+zeta)/2.0;
+-	dbasis[NUMNODESP1b*2+3]=0.5*gauss->coord1;
+-	/*Nodal function 5*/
+-	dbasis[NUMNODESP1b*0+4]=0.5*(1.0+zeta)/2.0;
+-	dbasis[NUMNODESP1b*1+4]=-SQRT3/6.0*(1.0+zeta)/2.0;
+-	dbasis[NUMNODESP1b*2+4]=0.5*gauss->coord2;
+-	/*Nodal function 6*/
+-	dbasis[NUMNODESP1b*0+5]=0.;
+-	dbasis[NUMNODESP1b*1+5]=SQRT3/3.0*(1.0+zeta)/2.0;
+-	dbasis[NUMNODESP1b*2+5]=0.5*gauss->coord3;
+-	/*Nodal function 7*/
+-	dbasis[NUMNODESP1b*0+6]=27.*(1.+zeta)*(1.-zeta)*(-.5*gauss->coord2*gauss->coord3 + .5*gauss->coord1*gauss->coord3);
+-	dbasis[NUMNODESP1b*1+6]=27.*(1.+zeta)*(1.-zeta)*SQRT3*(-1./6.*gauss->coord2*gauss->coord3 - 1./6.*gauss->coord1*gauss->coord3 +1./3.*gauss->coord1*gauss->coord2);
+-	dbasis[NUMNODESP1b*2+6]=27*gauss->coord1*gauss->coord2*gauss->coord3*(-2.0*zeta);
+-}
+-/*}}}*/
+-void PentaRef::GetNodalFunctionsP1(IssmDouble* basis, Gauss* gauss_in){/*{{{*/
+-	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+-
+-	/*Cast gauss to GaussPenta*/
+-	_assert_(gauss_in->Enum()==GaussPentaEnum);
+-	GaussPenta* gauss = dynamic_cast<GaussPenta*>(gauss_in);
+-
+-	basis[0]=gauss->coord1*(1-gauss->coord4)/2.0;
+-	basis[1]=gauss->coord2*(1-gauss->coord4)/2.0;
+-	basis[2]=gauss->coord3*(1-gauss->coord4)/2.0;
+-	basis[3]=gauss->coord1*(1+gauss->coord4)/2.0;
+-	basis[4]=gauss->coord2*(1+gauss->coord4)/2.0;
+-	basis[5]=gauss->coord3*(1+gauss->coord4)/2.0;
+-
+-}
+-/*}}}*/
+-void PentaRef::GetNodalFunctionsP1Derivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss){/*{{{*/
+-
+-	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+-	 * actual coordinate system): */
+-	IssmDouble    dbasis_ref[NDOF3][NUMNODESP1];
+-	IssmDouble    Jinv[NDOF3][NDOF3];
+-
+-	/*Get derivative values with respect to parametric coordinate system: */
+-	GetNodalFunctionsP1DerivativesReference(&dbasis_ref[0][0], gauss); 
+-
+-	/*Get Jacobian invert: */
+-	GetJacobianInvert(&Jinv[0][0], xyz_list, gauss);
+-
+-	/*Build basis function derivatives: 
+-	 *
+-	 * [dhi/dx]= Jinv*[dhi/dr]
+-	 * [dhi/dy]       [dhi/ds]
+-	 * [dhi/dz]       [dhi/dn]
+-	 */
+-
+-	for (int i=0;i<NUMNODESP1;i++){
+-		*(dbasis+NUMNODESP1*0+i)=Jinv[0][0]*dbasis_ref[0][i]+Jinv[0][1]*dbasis_ref[1][i]+Jinv[0][2]*dbasis_ref[2][i];
+-		*(dbasis+NUMNODESP1*1+i)=Jinv[1][0]*dbasis_ref[0][i]+Jinv[1][1]*dbasis_ref[1][i]+Jinv[1][2]*dbasis_ref[2][i];
+-		*(dbasis+NUMNODESP1*2+i)=Jinv[2][0]*dbasis_ref[0][i]+Jinv[2][1]*dbasis_ref[1][i]+Jinv[2][2]*dbasis_ref[2][i];
+-	}
+-
+-}
+-/*}}}*/
+-void PentaRef::GetNodalFunctionsP1DerivativesReference(IssmDouble* dbasis,Gauss* gauss_in){/*{{{*/
+-
+-	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+-	 * natural coordinate system) at the gaussian point. Those values vary along xi,eta,z */
+-
+-	/*Cast gauss to GaussPenta*/
+-	_assert_(gauss_in->Enum()==GaussPentaEnum);
+-	GaussPenta* gauss = dynamic_cast<GaussPenta*>(gauss_in);
+-
+-	IssmDouble zeta=gauss->coord4;
+-
+-	/*Nodal function 1*/
+-	dbasis[NUMNODESP1*0+0]=-0.5*(1.0-zeta)/2.0;
+-	dbasis[NUMNODESP1*1+0]=-SQRT3/6.0*(1.0-zeta)/2.0;
+-	dbasis[NUMNODESP1*2+0]=-0.5*gauss->coord1;
+-	/*Nodal function 2*/
+-	dbasis[NUMNODESP1*0+1]=0.5*(1.0-zeta)/2.0;
+-	dbasis[NUMNODESP1*1+1]=-SQRT3/6.0*(1.0-zeta)/2.0;
+-	dbasis[NUMNODESP1*2+1]=-0.5*gauss->coord2;
+-	/*Nodal function 3*/
+-	dbasis[NUMNODESP1*0+2]=0.;
+-	dbasis[NUMNODESP1*1+2]=SQRT3/3.0*(1.0-zeta)/2.0;
+-	dbasis[NUMNODESP1*2+2]=-0.5*gauss->coord3;
+-	/*Nodal function 4*/
+-	dbasis[NUMNODESP1*0+3]=-0.5*(1.0+zeta)/2.0;
+-	dbasis[NUMNODESP1*1+3]=-SQRT3/6.0*(1.0+zeta)/2.0;
+-	dbasis[NUMNODESP1*2+3]=0.5*gauss->coord1;
+-	/*Nodal function 5*/
+-	dbasis[NUMNODESP1*0+4]=0.5*(1.0+zeta)/2.0;
+-	dbasis[NUMNODESP1*1+4]=-SQRT3/6.0*(1.0+zeta)/2.0;
+-	dbasis[NUMNODESP1*2+4]=0.5*gauss->coord2;
+-	/*Nodal function 6*/
+-	dbasis[NUMNODESP1*0+5]=0.;
+-	dbasis[NUMNODESP1*1+5]=SQRT3/3.0*(1.0+zeta)/2.0;
+-	dbasis[NUMNODESP1*2+5]=0.5*gauss->coord3;
+-}
+-/*}}}*/
+ void PentaRef::GetQuadJacobianDeterminant(IssmDouble* Jdet,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+ 	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+ 
+@@ -959,12 +775,6 @@
+ 
+ }
+ /*}}}*/
+-void PentaRef::GetInputValue(IssmDouble* pvalue,IssmDouble* plist,Gauss* gauss){/*{{{*/
+-
+-	GetInputValue(pvalue,plist,gauss,this->element_type);
+-
+-}
+-/*}}}*/
+ void PentaRef::GetInputValue(IssmDouble* pvalue,IssmDouble* plist,Gauss* gauss,int finiteelement){/*{{{*/
+ 
+ 	/*Output*/
+@@ -986,7 +796,7 @@
+ 
+ }
+ /*}}}*/
+-void PentaRef::GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, Gauss* gauss){/*{{{*/
++void PentaRef::GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, Gauss* gauss,int finiteelement){/*{{{*/
+ 	/*From node values of parameter p (p_list[0], p_list[1], p_list[2],
+ 	 * p_list[3], p_list[4] and p_list[4]), return parameter derivative value at
+ 	 * gaussian point specified by gauss_coord:
+@@ -1003,11 +813,11 @@
+ 	IssmDouble dpz=0.;
+ 
+ 	/*Fetch number of nodes for this finite element*/
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(finiteelement);
+ 
+ 	/*Get nodal functions derivatives*/
+ 	IssmDouble* dbasis=xNew<IssmDouble>(3*numnodes);
+-	GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
++	GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss,finiteelement);
+ 
+ 	/*Calculate parameter for this Gauss point*/
+ 	for(int i=0;i<numnodes;i++) dpx += dbasis[0*numnodes+i]*plist[i];
+@@ -1022,11 +832,6 @@
+ 
+ }
+ /*}}}*/
+-int  PentaRef::NumberofNodes(void){/*{{{*/
+-
+-	return this->NumberofNodes(this->element_type);
+-}
+-/*}}}*/
+ int  PentaRef::NumberofNodes(int finiteelement){/*{{{*/
+ 
+ 	switch(finiteelement){
+@@ -1045,47 +850,47 @@
+ 		case OneLayerP4zEnum:       return NUMNODESP2xP4+NUMNODESP1;
+ 		case P2xP4Enum:             return NUMNODESP2xP4;
+ 		case P1xP3Enum:             return NUMNODESP1xP3;
+-		default:       _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
++		default:       _error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
+ 	}
+ 
+ 	return -1;
+ }
+ /*}}}*/
+-int  PentaRef::VelocityInterpolation(void){/*{{{*/
++int  PentaRef::VelocityInterpolation(int fe_stokes){/*{{{*/
+ 
+-	switch(this->element_type){
++	switch(fe_stokes){
+ 		case P1P1Enum:          return P1Enum;
+ 		case P1P1GLSEnum:       return P1Enum;
+ 		case MINIcondensedEnum: return P1bubbleEnum;
+ 		case MINIEnum:          return P1bubbleEnum;
+ 		case TaylorHoodEnum:    return P2Enum;
+ 		case OneLayerP4zEnum:   return P2xP4Enum;
+-		default:       _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
++		default:       _error_("Element type "<<EnumToStringx(fe_stokes)<<" not supported yet");
+ 	}
+ 
+ 	return -1;
+ }
+ /*}}}*/
+-int  PentaRef::PressureInterpolation(void){/*{{{*/
++int  PentaRef::PressureInterpolation(int fe_stokes){/*{{{*/
+ 
+-	switch(this->element_type){
++	switch(fe_stokes){
+ 		case P1P1Enum:          return P1Enum;
+ 		case P1P1GLSEnum:       return P1Enum;
+ 		case MINIcondensedEnum: return P1Enum;
+ 		case MINIEnum:          return P1Enum;
+ 		case TaylorHoodEnum:    return P1Enum;
+ 		case OneLayerP4zEnum:   return P1Enum;
+-		default:       _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
++		default:       _error_("Element type "<<EnumToStringx(fe_stokes)<<" not supported yet");
+ 	}
+ 
+ 	return -1;
+ }
+ /*}}}*/
+-int  PentaRef::TensorInterpolation(void){/*{{{*/
++int  PentaRef::TensorInterpolation(int fe_stokes){/*{{{*/
+ 
+-	switch(this->element_type){
++	switch(fe_stokes){
+ 		case XTaylorHoodEnum:    return P1DGEnum;
+-		default: _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
++		default: _error_("Element type "<<EnumToStringx(fe_stokes)<<" not supported yet");
+ 	}
+ 
+ 	return -1;
+@@ -1157,7 +962,7 @@
+ 			indices[5] = 11;
+ 			break;
+ 		default:
+-			_error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
++			_error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
+ 	}
+ 
+ 	/*Assign output pointer*/
+@@ -1214,7 +1019,7 @@
+ 			indices[5] = 14;
+ 			break;
+ 		default:
+-			_error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
++			_error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
+ 	}
+ 
+ 	/*Assign output pointer*/
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18078)
+@@ -24,8 +24,7 @@
+ }
+ /*}}}*/
+ Penta::Penta(int penta_id, int penta_sid, int index, IoModel* iomodel,int nummodels)/*{{{*/
+-	:PentaRef(nummodels)
+-	,ElementHook(nummodels,index+1,NUMVERTICES,iomodel){
++	:ElementHook(nummodels,index+1,NUMVERTICES,iomodel){
+ 
+ 	int penta_elements_ids[2];
+ 
+@@ -34,8 +33,8 @@
+ 	_assert_(iomodel->Data(MeshLowerelementsEnum));
+ 
+ 	/*id: */
+-	this->id=penta_id;
+-	this->sid=penta_sid;
++	this->id  = penta_id;
++	this->sid = penta_sid;
+ 
+ 	/*Build neighbors list*/
+ 	if (xIsNan<IssmDouble>(iomodel->Data(MeshUpperelementsEnum)[index]) || iomodel->Data(MeshUpperelementsEnum)[index]==-1.) penta_elements_ids[1]=this->id; //upper penta is the same penta
+@@ -56,6 +55,9 @@
+ 	this->material          = NULL;
+ 	this->matpar            = NULL;
+ 	this->verticalneighbors = NULL;
++
++	/*Only allocate pointer*/
++	this->element_type_list=xNew<int>(nummodels);
+ }
+ /*}}}*/
+ Object* Penta::copy() {/*{{{*/
+@@ -868,7 +870,7 @@
+ int        Penta::GetNodeIndex(Node* node){/*{{{*/
+ 
+ 	_assert_(nodes);
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(this->element_type);
+ 
+ 	for(int i=0;i<numnodes;i++){
+ 		if(node==nodes[i]) return i;
+@@ -878,7 +880,7 @@
+ }
+ /*}}}*/
+ int        Penta::GetNumberOfNodes(void){/*{{{*/
+-	return this->NumberofNodes();
++	return this->NumberofNodes(this->element_type);
+ }
+ /*}}}*/
+ int        Penta::GetNumberOfVertices(void){/*{{{*/
+@@ -887,7 +889,7 @@
+ /*}}}*/
+ Node* Penta::GetNode(int node_number){/*{{{*/
+ 	_assert_(node_number>=0); 
+-	_assert_(node_number<this->NumberofNodes()); 
++	_assert_(node_number<this->NumberofNodes(this->element_type)); 
+ 	return this->nodes[node_number];
+ }
+ /*}}}*/
+@@ -1168,7 +1170,7 @@
+ 
+ 		/*Step3: Vertically integrate A COPY of the original*/
+ 		if(original_input->ObjectEnum()==PentaInputEnum){
+-			if(((PentaInput*)original_input)->element_type==P0Enum){
++			if(((PentaInput*)original_input)->interpolation_type==P0Enum){
+ 				original_input->GetInputValue(&p0top1_list[i]);
+ 				element_integrated_input= new  PentaInput(original_input->InstanceEnum(),p0top1_list,P1Enum);
+ 				element_integrated_input->VerticallyIntegrate(element_thickness_input);
+@@ -1357,7 +1359,7 @@
+ 	int* doflist = NULL;
+ 
+ 	/*Fetch number of nodes for this finite element*/
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(this->element_type);
+ 
+ 	/*Fetch dof list and allocate solution vector*/
+ 	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+@@ -1644,35 +1646,35 @@
+ void       Penta::NodalFunctions(IssmDouble* basis, Gauss* gauss){/*{{{*/
+ 
+ 	_assert_(gauss->Enum()==GaussPentaEnum);
+-	this->GetNodalFunctions(basis,(GaussPenta*)gauss);
++	this->GetNodalFunctions(basis,(GaussPenta*)gauss,this->element_type);
+ 
+ }
+ /*}}}*/
+ void       Penta::NodalFunctionsP1(IssmDouble* basis, Gauss* gauss){/*{{{*/
+ 
+ 	_assert_(gauss->Enum()==GaussPentaEnum);
+-	this->GetNodalFunctionsP1(basis,(GaussPenta*)gauss);
++	this->GetNodalFunctions(basis,(GaussPenta*)gauss,P1Enum);
+ 
+ }
+ /*}}}*/
+ void       Penta::NodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+ 
+ 	_assert_(gauss->Enum()==GaussPentaEnum);
+-	this->GetNodalFunctionsDerivatives(dbasis,xyz_list,(GaussPenta*)gauss);
++	this->GetNodalFunctionsDerivatives(dbasis,xyz_list,(GaussPenta*)gauss,this->element_type);
+ 
+ }
+ /*}}}*/
+ void       Penta::NodalFunctionsP1Derivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+ 
+ 	_assert_(gauss->Enum()==GaussPentaEnum);
+-	this->GetNodalFunctionsP1Derivatives(dbasis,xyz_list,(GaussPenta*)gauss);
++	this->GetNodalFunctionsDerivatives(dbasis,xyz_list,(GaussPenta*)gauss,P1Enum);
+ 
+ }
+ /*}}}*/
+ void       Penta::NodalFunctionsMINIDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+ 
+ 	_assert_(gauss->Enum()==GaussPentaEnum);
+-	this->GetNodalFunctionsMINIDerivatives(dbasis,xyz_list,(GaussPenta*)gauss);
++	this->GetNodalFunctionsDerivatives(dbasis,xyz_list,(GaussPenta*)gauss,P1bubbleEnum);
+ 
+ }
+ /*}}}*/
+@@ -2102,7 +2104,7 @@
+ 	_assert_(iomodel->elements);
+ 
+ 	/*Recover element type*/
+-	this->SetElementType(finiteelement_type,analysis_counter);
++	this->element_type_list[analysis_counter]=finiteelement_type;
+ 
+ 	/*Recover vertices ids needed to initialize inputs*/
+ 	for(i=0;i<6;i++) penta_vertex_ids[i]=iomodel->elements[6*index+i]; //ids for vertices are in the elements array from Matlab
+@@ -2399,7 +2401,7 @@
+ 	Input* onbase = inputs->GetInput(MeshVertexonbaseEnum); _assert_(onbase);
+ 
+ 	GaussPenta* gauss=new GaussPenta();
+-	for(int iv=0;iv<this->NumberofNodes();iv++){
++	for(int iv=0;iv<this->NumberofNodes(this->element_type);iv++){
+ 		gauss->GaussNode(this->element_type,iv);
+ 		onbase->GetInputValue(&isonbase,gauss);
+ 		if(isonbase==1.){
+@@ -2437,7 +2439,7 @@
+ }
+ /*}}}*/
+ void       Penta::ValueP1DerivativesOnGauss(IssmDouble* dvalue,IssmDouble* values,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+-	PentaRef::GetInputDerivativeValue(dvalue,values,xyz_list,gauss);
++	PentaRef::GetInputDerivativeValue(dvalue,values,xyz_list,gauss,P1Enum);
+ }
+ /*}}}*/
+ int        Penta::VertexConnectivity(int vertexindex){/*{{{*/
+@@ -2475,11 +2477,11 @@
+ }
+ /*}}}*/
+ int        Penta::VelocityInterpolation(void){/*{{{*/
+-	return PentaRef::VelocityInterpolation();
++	return PentaRef::VelocityInterpolation(this->element_type);
+ }
+ /*}}}*/
+ int        Penta::PressureInterpolation(void){/*{{{*/
+-	return PentaRef::PressureInterpolation();
++	return PentaRef::PressureInterpolation(this->element_type);
+ }
+ /*}}}*/
+ bool       Penta::IsZeroLevelset(int levelset_enum){/*{{{*/
+Index: ../trunk-jpl/src/c/classes/Elements/PentaRef.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/PentaRef.h	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Elements/PentaRef.h	(revision 18078)
+@@ -10,28 +10,13 @@
+ class PentaRef{
+ 
+ 	public: 
+-		int* element_type_list; //P1CG, P1DG, MINI, P2...
+-		int  element_type;
+-
+ 		PentaRef();
+-		PentaRef(const int nummodels);
+ 		~PentaRef();
+ 
+-		/*Management*/
+-		void SetElementType(int type,int type_counter);
+-
+ 		/*Numerics*/
+-		void GetNodalFunctions(IssmDouble* basis, Gauss* gauss);
+ 		void GetNodalFunctions(IssmDouble* basis, Gauss* gauss,int finiteelement);
+-		void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss,int finiteelement);
+-		void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss);
+ 		void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss,int finiteelement);
+-		void GetNodalFunctionsP1(IssmDouble* basis, Gauss* gauss);
+-		void GetNodalFunctionsP1Derivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss);
+-		void GetNodalFunctionsMINIDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss);
+-		void GetNodalFunctionsP1DerivativesReference(IssmDouble* dl1dl6,Gauss* gauss);
+-		void GetNodalFunctionsMINIDerivativesReference(IssmDouble* dl1dl7,Gauss* gauss);
+ 		void GetQuadJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetJacobian(IssmDouble* J, IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,Gauss* gauss);
+@@ -39,16 +24,14 @@
+ 		void GetSegmentJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetJacobianInvert(IssmDouble*  Jinv, IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetLprimeFSSSA(IssmDouble* LprimeFSSSA, IssmDouble* xyz_list, Gauss* gauss);
+-		void GetInputValue(IssmDouble* pvalue,IssmDouble* plist, Gauss* gauss);
+ 		void GetInputValue(IssmDouble* pvalue,IssmDouble* plist, Gauss* gauss,int finiteelement);
+-		void GetInputDerivativeValue(IssmDouble* pvalues, IssmDouble* plist,IssmDouble* xyz_list, Gauss* gauss);
++		void GetInputDerivativeValue(IssmDouble* pvalues, IssmDouble* plist,IssmDouble* xyz_list, Gauss* gauss,int finiteelement);
+ 
+ 		void BasalNodeIndices(int* pnumindices,int** pindices,int finiteelement);
+ 		void SurfaceNodeIndices(int* pnumindices,int** pindices,int finiteelement);
+-		int  NumberofNodes(void);
+ 		int  NumberofNodes(int finiteelement);
+-		int  VelocityInterpolation(void);
+-		int  PressureInterpolation(void);
+-		int  TensorInterpolation(void);
++		int  VelocityInterpolation(int fe_stokes);
++		int  PressureInterpolation(int fe_stokes);
++		int  TensorInterpolation(int fe_stokes);
+ };
+ #endif
+Index: ../trunk-jpl/src/c/classes/Elements/SegRef.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/SegRef.cpp	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Elements/SegRef.cpp	(revision 18078)
+@@ -20,38 +20,13 @@
+ 
+ /*Object constructors and destructor*/
+ SegRef::SegRef(){/*{{{*/
+-	this->element_type_list=NULL;
+ }
+ /*}}}*/
+-SegRef::SegRef(const int nummodels){/*{{{*/
+-
+-	/*Only allocate pointer*/
+-	element_type_list=xNew<int>(nummodels);
+-
+-}
+-/*}}}*/
+ SegRef::~SegRef(){/*{{{*/
+-	xDelete<int>(element_type_list);
+ }
+ /*}}}*/
+ 
+-/*Management*/
+-void SegRef::SetElementType(int type,int type_counter){/*{{{*/
+-
+-	/*initialize element type*/
+-	this->element_type_list[type_counter]=type;
+-}
+-/*}}}*/
+-
+ /*Reference Element numerics*/
+-void SegRef::GetNodalFunctions(IssmDouble* basis,GaussSeg* gauss){/*{{{*/
+-	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+-
+-	_assert_(basis);
+-
+-	GetNodalFunctions(basis,gauss,this->element_type);
+-}
+-/*}}}*/
+ void SegRef::GetNodalFunctions(IssmDouble* basis,GaussSeg* gauss,int finiteelement){/*{{{*/
+ 	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+ 
+@@ -75,12 +50,6 @@
+ 	}
+ }
+ /*}}}*/
+-void SegRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussSeg* gauss){/*{{{*/
+-
+-	GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss,this->element_type);
+-
+-}
+-/*}}}*/
+ void SegRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussSeg* gauss,int finiteelement){/*{{{*/
+ 
+ 	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+@@ -109,14 +78,6 @@
+ 
+ }
+ /*}}}*/
+-void SegRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussSeg* gauss){/*{{{*/
+-	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+-	 * natural coordinate system) at the gaussian point. */
+-
+-	GetNodalFunctionsDerivativesReference(dbasis,gauss,this->element_type);
+-
+-}
+-/*}}}*/
+ void SegRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussSeg* gauss,int finiteelement){/*{{{*/
+ 	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+ 	 * natural coordinate system) at the gaussian point. */
+@@ -146,7 +107,7 @@
+ 
+ }
+ /*}}}*/
+-void SegRef::GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, GaussSeg* gauss){/*{{{*/
++void SegRef::GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, GaussSeg* gauss,int finiteelement){/*{{{*/
+ 
+ 	/*From node values of parameter p (plist[0],plist[1]), return parameter derivative value at gaussian 
+ 	 * point specified by gauss_basis:
+@@ -159,11 +120,11 @@
+ 	IssmDouble dpx = 0.;
+ 
+ 	/*Fetch number of nodes for this finite element*/
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(finiteelement);
+ 
+ 	/*Get nodal functions derivatives*/
+ 	IssmDouble* dbasis=xNew<IssmDouble>(1*numnodes);
+-	GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
++	GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss,finiteelement);
+ 
+ 	/*Calculate parameter for this Gauss point*/
+ 	for(int i=0;i<numnodes;i++) dpx += dbasis[i]*plist[i];
+@@ -174,11 +135,6 @@
+ 
+ }
+ /*}}}*/
+-void SegRef::GetInputValue(IssmDouble* p, IssmDouble* plist, GaussSeg* gauss){/*{{{*/
+-
+-	GetInputValue(p,plist,gauss,this->element_type);
+-}
+-/*}}}*/
+ void SegRef::GetInputValue(IssmDouble* p, IssmDouble* plist, GaussSeg* gauss,int finiteelement){/*{{{*/
+ 
+ 	/*Output*/
+@@ -231,18 +187,13 @@
+ 	*Jinv = 1./J;
+ }
+ /*}}}*/
+-int  SegRef::NumberofNodes(void){/*{{{*/
+-
+-	return this->NumberofNodes(this->element_type);
+-}
+-/*}}}*/
+ int  SegRef::NumberofNodes(int finiteelement){/*{{{*/
+ 
+ 	switch(finiteelement){
+ 		case P0Enum:                return NUMNODESP0;
+ 		case P1Enum:                return NUMNODESP1;
+ 		case P1DGEnum:              return NUMNODESP1;
+-		default: _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
++		default: _error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
+ 	}
+ 
+ 	return -1;
+Index: ../trunk-jpl/src/c/classes/Elements/TetraRef.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/TetraRef.cpp	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Elements/TetraRef.cpp	(revision 18078)
+@@ -3,7 +3,7 @@
+  */
+ 
+ /*Headers:*/
+-/*{{{*//*{{{*/
++/*{{{*/
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+ #else
+@@ -22,36 +22,13 @@
+ 
+ /*Object constructors and destructor*/
+ TetraRef::TetraRef(){/*{{{*/
+-	this->element_type_list=NULL;
+ }
+ /*}}}*/
+-TetraRef::TetraRef(const int nummodels){/*{{{*/
+-
+-	/*Only allocate pointer*/
+-	element_type_list=xNew<int>(nummodels);
+-
+-}
+-/*}}}*/
+ TetraRef::~TetraRef(){/*{{{*/
+-	xDelete<int>(element_type_list);
+ }
+ /*}}}*/
+ 
+-/*Management*/
+-void TetraRef::SetElementType(int type,int type_counter){/*{{{*/
+-
+-	/*initialize element type*/
+-	this->element_type_list[type_counter]=type;
+-}
+-/*}}}*/
+-
+ /*Reference Element numerics*/
+-void TetraRef::GetNodalFunctions(IssmDouble* basis,GaussTetra* gauss){/*{{{*/
+-	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+-	_assert_(basis);
+-	GetNodalFunctions(basis,gauss,this->element_type);
+-}
+-/*}}}*/
+ void TetraRef::GetNodalFunctions(IssmDouble* basis,GaussTetra* gauss,int finiteelement){/*{{{*/
+ 	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+ 
+@@ -95,10 +72,6 @@
+ 	}
+ }
+ /*}}}*/
+-void TetraRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussTetra* gauss){/*{{{*/
+-	GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss,this->element_type);
+-}
+-/*}}}*/
+ void TetraRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussTetra* gauss,int finiteelement){/*{{{*/
+ 
+ 	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+@@ -132,14 +105,6 @@
+ 	xDelete<IssmDouble>(dbasis_ref);
+ }
+ /*}}}*/
+-void TetraRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussTetra* gauss){/*{{{*/
+-	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+-	 * natural coordinate system) at the gaussian point. */
+-
+-	GetNodalFunctionsDerivativesReference(dbasis,gauss,this->element_type);
+-
+-}
+-/*}}}*/
+ void TetraRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussTetra* gauss,int finiteelement){/*{{{*/
+ 	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+ 	 * natural coordinate system) at the gaussian point. */
+@@ -238,7 +203,7 @@
+ 
+ }
+ /*}}}*/
+-void TetraRef::GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, GaussTetra* gauss){/*{{{*/
++void TetraRef::GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, GaussTetra* gauss,int finiteelement){/*{{{*/
+ 	/*From node values of parameter p (p_list[0], p_list[1], p_list[2],
+ 	 * p_list[3], p_list[4] and p_list[4]), return parameter derivative value at
+ 	 * gaussian point specified by gauss_coord:
+@@ -255,11 +220,11 @@
+ 	IssmDouble dpz=0.;
+ 
+ 	/*Fetch number of nodes for this finite element*/
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(finiteelement);
+ 
+ 	/*Get nodal functions derivatives*/
+ 	IssmDouble* dbasis=xNew<IssmDouble>(3*numnodes);
+-	GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
++	GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss,finiteelement);
+ 
+ 	/*Calculate parameter for this Gauss point*/
+ 	for(int i=0;i<numnodes;i++) dpx += dbasis[0*numnodes+i]*plist[i];
+@@ -273,11 +238,6 @@
+ 	p[2]=dpz;
+ }
+ /*}}}*/
+-void TetraRef::GetInputValue(IssmDouble* p, IssmDouble* plist, GaussTetra* gauss){/*{{{*/
+-
+-	GetInputValue(p,plist,gauss,this->element_type);
+-}
+-/*}}}*/
+ void TetraRef::GetInputValue(IssmDouble* p, IssmDouble* plist, GaussTetra* gauss,int finiteelement){/*{{{*/
+ 
+ 	/*Output*/
+@@ -375,11 +335,6 @@
+ 	Matrix3x3Invert(Jinv,&J[0][0]);
+ }
+ /*}}}*/
+-int  TetraRef::NumberofNodes(void){/*{{{*/
+-
+-	return this->NumberofNodes(this->element_type);
+-}
+-/*}}}*/
+ int  TetraRef::NumberofNodes(int finiteelement){/*{{{*/
+ 
+ 	switch(finiteelement){
+@@ -394,45 +349,45 @@
+ 		case MINIcondensedEnum:     return NUMNODESP1b+NUMNODESP1;
+ 		case MINIEnum:              return NUMNODESP1b+NUMNODESP1;
+ 		case TaylorHoodEnum:        return NUMNODESP2+NUMNODESP1;
+-		default: _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
++		default: _error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
+ 	}
+ 
+ 	return -1;
+ }
+ /*}}}*/
+-int  TetraRef::VelocityInterpolation(void){/*{{{*/
++int  TetraRef::VelocityInterpolation(int fe_stokes){/*{{{*/
+ 
+-	switch(this->element_type){
++	switch(fe_stokes){
+ 		case P1P1Enum:          return P1Enum;
+ 		case P1P1GLSEnum:       return P1Enum;
+ 		case MINIcondensedEnum: return P1bubbleEnum;
+ 		case MINIEnum:          return P1bubbleEnum;
+ 		case TaylorHoodEnum:    return P2Enum;
+-		default:       _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
++		default:       _error_("Element type "<<EnumToStringx(fe_stokes)<<" not supported yet");
+ 	}
+ 
+ 	return -1;
+ }
+ /*}}}*/
+-int TetraRef::PressureInterpolation(void){/*{{{*/
++int TetraRef::PressureInterpolation(int fe_stokes){/*{{{*/
+ 
+-	switch(this->element_type){
++	switch(fe_stokes){
+ 		case P1P1Enum:          return P1Enum;
+ 		case P1P1GLSEnum:       return P1Enum;
+ 		case MINIcondensedEnum: return P1Enum;
+ 		case MINIEnum:          return P1Enum;
+ 		case TaylorHoodEnum:    return P1Enum;
+-		default:       _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
++		default:       _error_("Element type "<<EnumToStringx(fe_stokes)<<" not supported yet");
+ 	}
+ 
+ 	return -1;
+ }/*}}}*/
+-int  TetraRef::TensorInterpolation(void){/*{{{*/
++int  TetraRef::TensorInterpolation(int fe_stokes){/*{{{*/
+ 	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+ 
+-	switch(this->element_type){
++	switch(fe_stokes){
+ 		case XTaylorHoodEnum: return P1DGEnum;
+-		default: _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
++		default: _error_("Element type "<<EnumToStringx(fe_stokes)<<" not supported yet");
+ 	}
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.cpp	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.cpp	(revision 18078)
+@@ -19,7 +19,7 @@
+ #define NUMVERTICES 2
+ /*Constructors/destructor/copy*/
+ Seg::Seg(int seg_id, int seg_sid, int index, IoModel* iomodel,int nummodels)/*{{{*/
+-		:SegRef(nummodels),ElementHook(nummodels,index+1,NUMVERTICES,iomodel){
++		:ElementHook(nummodels,index+1,NUMVERTICES,iomodel){
+ 
+ 			/*id: */
+ 			this->id  = seg_id;
+@@ -36,6 +36,9 @@
+ 			this->vertices = NULL;
+ 			this->material = NULL;
+ 			this->matpar   = NULL;
++
++			/*Only allocate pointer*/
++			this->element_type_list=xNew<int>(nummodels);
+ 		}
+ /*}}}*/
+ Seg::~Seg(){/*{{{*/
+@@ -99,7 +102,7 @@
+ 	*pxyz_front=xyz_front;
+ }/*}}}*/
+ int        Seg::GetNumberOfNodes(void){/*{{{*/
+-	return this->NumberofNodes();
++	return this->NumberofNodes(this->element_type);
+ }
+ /*}}}*/
+ int        Seg::GetNumberOfVertices(void){/*{{{*/
+@@ -176,14 +179,14 @@
+ void       Seg::NodalFunctions(IssmDouble* basis, Gauss* gauss){/*{{{*/
+ 
+ 	_assert_(gauss->Enum()==GaussSegEnum);
+-	this->GetNodalFunctions(basis,(GaussSeg*)gauss);
++	this->GetNodalFunctions(basis,(GaussSeg*)gauss,this->element_type);
+ 
+ }
+ /*}}}*/
+ void       Seg::NodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+ 
+ 	_assert_(gauss->Enum()==GaussSegEnum);
+-	this->GetNodalFunctionsDerivatives(dbasis,xyz_list,(GaussSeg*)gauss);
++	this->GetNodalFunctionsDerivatives(dbasis,xyz_list,(GaussSeg*)gauss,this->element_type);
+ 
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.cpp	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.cpp	(revision 18078)
+@@ -20,7 +20,7 @@
+ 
+ /*Constructors/destructor/copy*/
+ Tetra::Tetra(int seg_id, int seg_sid, int index, IoModel* iomodel,int nummodels)/*{{{*/
+-		:TetraRef(nummodels),ElementHook(nummodels,index+1,NUMVERTICES,iomodel){
++		:ElementHook(nummodels,index+1,NUMVERTICES,iomodel){
+ 
+ 			/*id: */
+ 			this->id  = seg_id;
+@@ -37,6 +37,9 @@
+ 			this->vertices = NULL;
+ 			this->material = NULL;
+ 			this->matpar   = NULL;
++
++			/*Only allocate pointer*/
++			this->element_type_list=xNew<int>(nummodels);
+ 		}
+ /*}}}*/
+ Tetra::~Tetra(){/*{{{*/
+@@ -201,7 +204,7 @@
+ int      Tetra::GetNodeIndex(Node* node){/*{{{*/
+ 
+ 	_assert_(nodes);
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(this->element_type);
+ 
+ 	for(int i=0;i<numnodes;i++){
+ 		if(node==nodes[i]) return i;
+@@ -211,7 +214,7 @@
+ }
+ /*}}}*/
+ int      Tetra::GetNumberOfNodes(void){/*{{{*/
+-	return this->NumberofNodes();
++	return this->NumberofNodes(this->element_type);
+ }
+ /*}}}*/
+ int      Tetra::GetNumberOfVertices(void){/*{{{*/
+@@ -399,7 +402,7 @@
+ 	int* doflist = NULL;
+ 
+ 	/*Fetch number of nodes for this finite element*/
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(this->element_type);
+ 
+ 	/*Fetch dof list and allocate solution vector*/
+ 	GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+@@ -501,7 +504,7 @@
+ void     Tetra::NodalFunctions(IssmDouble* basis, Gauss* gauss){/*{{{*/
+ 
+ 	_assert_(gauss->Enum()==GaussTetraEnum);
+-	this->GetNodalFunctions(basis,(GaussTetra*)gauss);
++	this->GetNodalFunctions(basis,(GaussTetra*)gauss,this->element_type);
+ 
+ }
+ /*}}}*/
+@@ -529,7 +532,7 @@
+ void     Tetra::NodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+ 
+ 	_assert_(gauss->Enum()==GaussTetraEnum);
+-	this->GetNodalFunctionsDerivatives(dbasis,xyz_list,(GaussTetra*)gauss);
++	this->GetNodalFunctionsDerivatives(dbasis,xyz_list,(GaussTetra*)gauss,this->element_type);
+ 
+ }
+ /*}}}*/
+@@ -787,7 +790,7 @@
+ 	_assert_(iomodel->elements);
+ 
+ 	/*Recover element type*/
+-	this->SetElementType(finiteelement_type,analysis_counter);
++	this->element_type_list[analysis_counter]=finiteelement_type;
+ 
+ 	/*Recover vertices ids needed to initialize inputs*/
+ 	for(i=0;i<4;i++) tetra_vertex_ids[i]=iomodel->elements[4*index+i]; //ids for vertices are in the elements array from Matlab
+@@ -871,7 +874,7 @@
+ }
+ /*}}}*/
+ int      Tetra::VelocityInterpolation(void){/*{{{*/
+-	return TetraRef::VelocityInterpolation();
++	return TetraRef::VelocityInterpolation(this->element_type);
+ }
+ /*}}}*/
+ void     Tetra::ViscousHeating(IssmDouble* pphi,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input){/*{{{*/
+@@ -891,11 +894,11 @@
+ }
+ /*}}}*/
+ int      Tetra::PressureInterpolation(void){/*{{{*/
+-	return TetraRef::PressureInterpolation();
++	return TetraRef::PressureInterpolation(this->element_type);
+ }
+ /*}}}*/
+ int      Tetra::TensorInterpolation(void){/*{{{*/
+-	return TetraRef::TensorInterpolation();
++	return TetraRef::TensorInterpolation(this->element_type);
+ }
+ /*}}}*/
+ void     Tetra::ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum){/*{{{*/
+Index: ../trunk-jpl/src/c/classes/Elements/SegRef.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/SegRef.h	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Elements/SegRef.h	(revision 18078)
+@@ -12,29 +12,17 @@
+ class SegRef{
+ 
+ 	public: 
+-		int* element_type_list;
+-		int  element_type;
+-
+ 		SegRef();
+-		SegRef(const int nummodels);
+ 		~SegRef();
+ 
+-		/*Management*/
+-		void SetElementType(int type,int type_counter);
+ 		void GetJacobian(IssmDouble* J, IssmDouble* xyz_list,GaussSeg* gauss);
+ 		void GetJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussSeg* gauss);
+ 		void GetJacobianInvert(IssmDouble* Jinv, IssmDouble* xyz_list,GaussSeg* gauss);
+-		void GetNodalFunctions(IssmDouble* basis,GaussSeg* gauss);
+ 		void GetNodalFunctions(IssmDouble* basis,GaussSeg* gauss,int finiteelement);
+-		void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussSeg* gauss);
+ 		void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussSeg* gauss,int finiteelement);
+-		void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussSeg* gauss);
+ 		void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussSeg* gauss,int finiteelement);
+-		void GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, GaussSeg* gauss);
+-		void GetInputValue(IssmDouble* p, IssmDouble* plist, GaussSeg* gauss);
++		void GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, GaussSeg* gauss,int finiteelement);
+ 		void GetInputValue(IssmDouble* p, IssmDouble* plist, GaussSeg* gauss,int finiteelement);
+-
+-		int  NumberofNodes(void);
+ 		int  NumberofNodes(int finiteelement);
+ };
+ #endif
+Index: ../trunk-jpl/src/c/classes/Elements/TetraRef.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/TetraRef.h	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Elements/TetraRef.h	(revision 18078)
+@@ -12,33 +12,22 @@
+ class TetraRef{
+ 
+ 	public: 
+-		int* element_type_list;
+-		int  element_type;
+-
+ 		TetraRef();
+-		TetraRef(const int nummodels);
+ 		~TetraRef();
+ 
+-		/*Management*/
+-		void SetElementType(int type,int type_counter);
+ 		void GetJacobian(IssmDouble* J, IssmDouble* xyz_list,GaussTetra* gauss);
+ 		void GetJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussTetra* gauss);
+ 		void GetJacobianDeterminantFace(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussTetra* gauss);
+ 		void GetJacobianInvert(IssmDouble* Jinv, IssmDouble* xyz_list,GaussTetra* gauss);
+-		void GetNodalFunctions(IssmDouble* basis,GaussTetra* gauss);
+ 		void GetNodalFunctions(IssmDouble* basis,GaussTetra* gauss,int finiteelement);
+-		void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussTetra* gauss);
+ 		void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussTetra* gauss,int finiteelement);
+-		void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussTetra* gauss);
+ 		void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussTetra* gauss,int finiteelement);
+-		void GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, GaussTetra* gauss);
+-		void GetInputValue(IssmDouble* p, IssmDouble* plist, GaussTetra* gauss);
++		void GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, GaussTetra* gauss,int finiteelement);
+ 		void GetInputValue(IssmDouble* p, IssmDouble* plist, GaussTetra* gauss,int finiteelement);
+ 
+-		int  NumberofNodes(void);
+ 		int  NumberofNodes(int finiteelement);
+-		int  VelocityInterpolation(void);
+-		int  PressureInterpolation(void);
+-		int  TensorInterpolation(void);
++		int  VelocityInterpolation(int fe_stokes);
++		int  PressureInterpolation(int fe_stokes);
++		int  TensorInterpolation(int fe_stokes);
+ };
+ #endif
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18078)
+@@ -25,8 +25,10 @@
+ 	this->matpar     = NULL;
+ 	this->inputs     = NULL;
+ 	this->parameters = NULL;
++	this->element_type_list=NULL;
+ }/*}}}*/
+ Element::~Element(){/*{{{*/
++	xDelete<int>(element_type_list);
+ 	delete inputs;
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Elements/TriaRef.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/TriaRef.cpp	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Elements/TriaRef.cpp	(revision 18078)
+@@ -22,31 +22,14 @@
+ 
+ /*Object constructors and destructor*/
+ TriaRef::TriaRef(){/*{{{*/
+-	this->element_type_list=NULL;
+ }
+ /*}}}*/
+-TriaRef::TriaRef(const int nummodels){/*{{{*/
+-
+-	/*Only allocate pointer*/
+-	element_type_list=xNew<int>(nummodels);
+-
+-}
+-/*}}}*/
+ TriaRef::~TriaRef(){/*{{{*/
+-	xDelete<int>(element_type_list);
+ }
+ /*}}}*/
+ 
+-/*Management*/
+-void TriaRef::SetElementType(int type,int type_counter){/*{{{*/
+-
+-	/*initialize element type*/
+-	this->element_type_list[type_counter]=type;
+-}
+-/*}}}*/
+-
+ /*Reference Element numerics*/
+-void TriaRef::GetSegmentBFlux(IssmDouble* B,Gauss* gauss, int index1,int index2){/*{{{*/
++void TriaRef::GetSegmentBFlux(IssmDouble* B,Gauss* gauss, int index1,int index2,int finiteelement){/*{{{*/
+ 	/*Compute B  matrix. B=[phi1 phi2 -phi3 -phi4]
+ 	 *
+ 	 * and phi1=phi3 phi2=phi4
+@@ -55,11 +38,11 @@
+ 	 */
+ 
+ 	/*Fetch number of nodes for this finite element*/
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(finiteelement);
+ 
+ 	/*Get nodal functions*/
+ 	IssmDouble* basis=xNew<IssmDouble>(numnodes);
+-	GetNodalFunctions(basis,gauss);
++	GetNodalFunctions(basis,gauss,finiteelement);
+ 
+ 	/*Build B for this segment*/
+ 	B[0] = +basis[index1];
+@@ -71,7 +54,7 @@
+ 	xDelete<IssmDouble>(basis);
+ }
+ /*}}}*/
+-void TriaRef::GetSegmentBprimeFlux(IssmDouble* Bprime,Gauss* gauss, int index1,int index2){/*{{{*/
++void TriaRef::GetSegmentBprimeFlux(IssmDouble* Bprime,Gauss* gauss, int index1,int index2,int finiteelement){/*{{{*/
+ 	/*Compute Bprime  matrix. Bprime=[phi1 phi2 phi3 phi4]
+ 	 *
+ 	 * and phi1=phi3 phi2=phi4
+@@ -80,11 +63,11 @@
+ 	 */
+ 
+ 	/*Fetch number of nodes for this finite element*/
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(finiteelement);
+ 
+ 	/*Get nodal functions*/
+ 	IssmDouble* basis=xNew<IssmDouble>(numnodes);
+-	GetNodalFunctions(basis,gauss);
++	GetNodalFunctions(basis,gauss,finiteelement);
+ 
+ 	/*Build B'*/
+ 	Bprime[0] = basis[index1];
+@@ -154,14 +137,6 @@
+ 
+ }
+ /*}}}*/
+-void TriaRef::GetNodalFunctions(IssmDouble* basis,Gauss* gauss){/*{{{*/
+-	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+-
+-	_assert_(basis);
+-	GetNodalFunctions(basis,gauss,this->element_type);
+-
+-}
+-/*}}}*/
+ void TriaRef::GetNodalFunctions(IssmDouble* basis,Gauss* gauss_in,int finiteelement){/*{{{*/
+ 	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+ 
+@@ -203,20 +178,20 @@
+ 	}
+ }
+ /*}}}*/
+-void TriaRef::GetSegmentNodalFunctions(IssmDouble* basis,Gauss* gauss,int index1,int index2){/*{{{*/
++void TriaRef::GetSegmentNodalFunctions(IssmDouble* basis,Gauss* gauss,int index1,int index2,int finiteelement){/*{{{*/
+ 	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+ 
+ 	_assert_(index1>=0 && index1<3);
+ 	_assert_(index2>=0 && index2<3);
+ 
+ 	/*Fetch number of nodes for this finite element*/
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(finiteelement);
+ 
+ 	/*Get nodal functions*/
+ 	IssmDouble* triabasis=xNew<IssmDouble>(numnodes);
+-	GetNodalFunctions(triabasis,gauss);
++	GetNodalFunctions(triabasis,gauss,finiteelement);
+ 
+-	switch(this->element_type){
++	switch(finiteelement){
+ 		case P1Enum: case P1DGEnum:
+ 			basis[0]=triabasis[index1];
+ 			basis[1]=triabasis[index2];
+@@ -235,19 +210,13 @@
+ 			xDelete<IssmDouble>(triabasis);
+ 			return;
+ 		default:
+-			_error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
++			_error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
+ 	}
+ 
+ 	/*Clean up*/
+ 	xDelete<IssmDouble>(triabasis);
+ }
+ /*}}}*/
+-void TriaRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss){/*{{{*/
+-
+-	GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss,this->element_type);
+-
+-}
+-/*}}}*/
+ void TriaRef::GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, Gauss* gauss,int finiteelement){/*{{{*/
+ 
+ 	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+@@ -278,14 +247,6 @@
+ 
+ }
+ /*}}}*/
+-void TriaRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss){/*{{{*/
+-	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+-	 * natural coordinate system) at the gaussian point. */
+-
+-	GetNodalFunctionsDerivativesReference(dbasis,gauss,this->element_type);
+-
+-}
+-/*}}}*/
+ void TriaRef::GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,Gauss* gauss_in,int finiteelement){/*{{{*/
+ 	/*This routine returns the values of the nodal functions derivatives  (with respect to the 
+ 	 * natural coordinate system) at the gaussian point. */
+@@ -353,7 +314,7 @@
+ 
+ }
+ /*}}}*/
+-void TriaRef::GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, Gauss* gauss){/*{{{*/
++void TriaRef::GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, Gauss* gauss,int finiteelement){/*{{{*/
+ 
+ 	/*From node values of parameter p (plist[0],plist[1],plist[2]), return parameter derivative value at gaussian 
+ 	 * point specified by gauss_basis:
+@@ -368,11 +329,11 @@
+ 	IssmDouble dpy=0.;
+ 
+ 	/*Fetch number of nodes for this finite element*/
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(finiteelement);
+ 
+ 	/*Get nodal functions derivatives*/
+ 	IssmDouble* dbasis=xNew<IssmDouble>(2*numnodes);
+-	GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss);
++	GetNodalFunctionsDerivatives(dbasis,xyz_list,gauss,finiteelement);
+ 
+ 	/*Calculate parameter for this Gauss point*/
+ 	for(int i=0;i<numnodes;i++) dpx += dbasis[0*numnodes+i]*plist[i];
+@@ -385,11 +346,6 @@
+ 
+ }
+ /*}}}*/
+-void TriaRef::GetInputValue(IssmDouble* p, IssmDouble* plist, Gauss* gauss){/*{{{*/
+-
+-	GetInputValue(p,plist,gauss,this->element_type);
+-}
+-/*}}}*/
+ void TriaRef::GetInputValue(IssmDouble* p, IssmDouble* plist, Gauss* gauss,int finiteelement){/*{{{*/
+ 
+ 	/*Output*/
+@@ -410,11 +366,6 @@
+ 	*p = value;
+ }
+ /*}}}*/
+-int  TriaRef::NumberofNodes(void){/*{{{*/
+-
+-	return this->NumberofNodes(this->element_type);
+-}
+-/*}}}*/
+ int  TriaRef::NumberofNodes(int finiteelement){/*{{{*/
+ 
+ 	switch(finiteelement){
+@@ -430,48 +381,48 @@
+ 		case MINIEnum:              return NUMNODESP1b+NUMNODESP1;
+ 		case TaylorHoodEnum:        return NUMNODESP2+NUMNODESP1;
+ 		case XTaylorHoodEnum:       return NUMNODESP2+NUMNODESP1;
+-		default: _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
++		default: _error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
+ 	}
+ 
+ 	return -1;
+ }
+ /*}}}*/
+-int  TriaRef::VelocityInterpolation(void){/*{{{*/
++int  TriaRef::VelocityInterpolation(int fe_stokes){/*{{{*/
+ 
+-	switch(this->element_type){
++	switch(fe_stokes){
+ 		case P1P1Enum:          return P1Enum;
+ 		case P1P1GLSEnum:       return P1Enum;
+ 		case MINIcondensedEnum: return P1bubbleEnum;
+ 		case MINIEnum:          return P1bubbleEnum;
+ 		case TaylorHoodEnum:    return P2Enum;
+ 		case XTaylorHoodEnum:   return P2Enum;
+-		default:       _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
++		default:       _error_("Element type "<<EnumToStringx(fe_stokes)<<" not supported yet");
+ 	}
+ 
+ 	return -1;
+ }
+ /*}}}*/
+-int  TriaRef::PressureInterpolation(void){/*{{{*/
++int  TriaRef::PressureInterpolation(int fe_stokes){/*{{{*/
+ 
+-	switch(this->element_type){
++	switch(fe_stokes){
+ 		case P1P1Enum:          return P1Enum;
+ 		case P1P1GLSEnum:       return P1Enum;
+ 		case MINIcondensedEnum: return P1Enum;
+ 		case MINIEnum:          return P1Enum;
+ 		case TaylorHoodEnum:    return P1Enum;
+ 		case XTaylorHoodEnum:   return P1Enum;
+-		default:       _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
++		default:       _error_("Element type "<<EnumToStringx(fe_stokes)<<" not supported yet");
+ 	}
+ 
+ 	return -1;
+ }
+ /*}}}*/
+-int  TriaRef::TensorInterpolation(void){/*{{{*/
++int  TriaRef::TensorInterpolation(int fe_stokes){/*{{{*/
+ 	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+ 
+-	switch(this->element_type){
++	switch(fe_stokes){
+ 		case XTaylorHoodEnum: return P1DGEnum;
+-		default: _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
++		default: _error_("Element type "<<EnumToStringx(fe_stokes)<<" not supported yet");
+ 	}
+ }
+ /*}}}*/
+@@ -526,7 +477,7 @@
+ 			}
+ 			break;
+ 		default:
+-			_error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
++			_error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
+ 	}
+ 
+ 	/*Assign output pointer*/
+Index: ../trunk-jpl/src/c/classes/Inputs/SegInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/SegInput.cpp	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Inputs/SegInput.cpp	(revision 18078)
+@@ -16,20 +16,15 @@
+ 	values = NULL;
+ }
+ /*}}}*/
+-SegInput::SegInput(int in_enum_type,IssmDouble* in_values,int element_type_in)/*{{{*/
+-	:SegRef(1)
+-{
++SegInput::SegInput(int in_enum_type,IssmDouble* in_values,int interpolation_type_in){/*{{{*/
+ 
+-	/*Set SegRef*/
+-	this->SetElementType(element_type_in,0);
+-	this->element_type=element_type_in;
+-
+ 	/*Set Enum*/
+ 	enum_type=in_enum_type;
++	this->interpolation_type=interpolation_type_in;
+ 
+ 	/*Set values*/
+-	this->values=xNew<IssmDouble>(this->NumberofNodes());
+-	for(int i=0;i<this->NumberofNodes();i++) values[i]=in_values[i];
++	this->values=xNew<IssmDouble>(this->NumberofNodes(this->interpolation_type));
++	for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i];
+ }
+ /*}}}*/
+ SegInput::~SegInput(){/*{{{*/
+@@ -45,7 +40,7 @@
+ void SegInput::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_(setw(15)<<"   SegInput "<<setw(25)<<left<<EnumToStringx(this->enum_type)<<" [");
+-	for(int i=0;i<this->NumberofNodes();i++) _printf_(" "<<this->values[i]);
++	for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) _printf_(" "<<this->values[i]);
+ 	_printf_("]\n");
+ }
+ /*}}}*/
+@@ -59,7 +54,7 @@
+ /*}}}*/
+ Object* SegInput::copy() {/*{{{*/
+ 
+-	return new SegInput(this->enum_type,this->values,this->element_type);
++	return new SegInput(this->enum_type,this->values,this->interpolation_type);
+ 
+ }
+ /*}}}*/
+@@ -75,7 +70,7 @@
+ /*Object functions*/
+ void SegInput::GetInputAverage(IssmDouble* pvalue){/*{{{*/
+ 
+-	int        numnodes  = this->NumberofNodes();
++	int        numnodes  = this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble numnodesd = reCast<int,IssmDouble>(numnodes);
+ 	IssmDouble value     = 0.;
+ 
+@@ -89,7 +84,7 @@
+ 
+ 	/*Call SegRef function*/
+ 	_assert_(gauss->Enum()==GaussSegEnum);
+-	SegRef::GetInputValue(pvalue,&values[0],(GaussSeg*)gauss);
++	SegRef::GetInputValue(pvalue,&values[0],(GaussSeg*)gauss,this->interpolation_type);
+ 
+ }
+ /*}}}*/
+@@ -97,7 +92,7 @@
+ 
+ 	/*Call SegRef function*/
+ 	_assert_(gauss->Enum()==GaussSegEnum);
+-	SegRef::GetInputDerivativeValue(p,&values[0],xyz_list,(GaussSeg*)gauss);
++	SegRef::GetInputDerivativeValue(p,&values[0],xyz_list,(GaussSeg*)gauss,this->interpolation_type);
+ }
+ /*}}}*/
+ void SegInput::Configure(Parameters* parameters){/*{{{*/
+@@ -106,7 +101,7 @@
+ /*}}}*/
+ IssmDouble SegInput::Min(void){/*{{{*/
+ 
+-	const int  numnodes=this->NumberofNodes();
++	const int  numnodes=this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble min=values[0];
+ 
+ 	for(int i=1;i<numnodes;i++){
+Index: ../trunk-jpl/src/c/classes/Inputs/TetraInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TetraInput.cpp	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Inputs/TetraInput.cpp	(revision 18078)
+@@ -16,20 +16,15 @@
+ 	values = NULL;
+ }
+ /*}}}*/
+-TetraInput::TetraInput(int in_enum_type,IssmDouble* in_values,int element_type_in)/*{{{*/
+-	:TetraRef(1)
+-{
++TetraInput::TetraInput(int in_enum_type,IssmDouble* in_values,int interpolation_type_in){/*{{{*/
+ 
+-	/*Set TetraRef*/
+-	this->SetElementType(element_type_in,0);
+-	this->element_type=element_type_in;
+-
+ 	/*Set Enum*/
+ 	enum_type=in_enum_type;
++	this->interpolation_type=interpolation_type_in;
+ 
+ 	/*Set values*/
+-	this->values=xNew<IssmDouble>(this->NumberofNodes());
+-	for(int i=0;i<this->NumberofNodes();i++) values[i]=in_values[i];
++	this->values=xNew<IssmDouble>(this->NumberofNodes(this->interpolation_type));
++	for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i];
+ }
+ /*}}}*/
+ TetraInput::~TetraInput(){/*{{{*/
+@@ -45,8 +40,8 @@
+ void TetraInput::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_(setw(15)<<"   TetraInput "<<setw(25)<<left<<EnumToStringx(this->enum_type)<<" [");
+-	for(int i=0;i<this->NumberofNodes();i++) _printf_(" "<<this->values[i]);
+-	_printf_("] ("<<EnumToStringx(this->element_type)<<")\n");
++	for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) _printf_(" "<<this->values[i]);
++	_printf_("] ("<<EnumToStringx(this->interpolation_type)<<")\n");
+ }
+ /*}}}*/
+ int    TetraInput::Id(void){ return -1; }/*{{{*/
+@@ -59,7 +54,7 @@
+ /*}}}*/
+ Object* TetraInput::copy() {/*{{{*/
+ 
+-	return new TetraInput(this->enum_type,this->values,this->element_type);
++	return new TetraInput(this->enum_type,this->values,this->interpolation_type);
+ 
+ }
+ /*}}}*/
+@@ -73,7 +68,7 @@
+ /*}}}*/
+ int  TetraInput::GetResultInterpolation(void){/*{{{*/
+ 
+-	if(this->element_type==P0Enum){
++	if(this->interpolation_type==P0Enum){
+ 		return P0Enum;
+ 	}
+ 	return P1Enum;
+@@ -82,13 +77,13 @@
+ /*}}}*/
+ int  TetraInput::GetResultNumberOfNodes(void){/*{{{*/
+ 
+-	return this->NumberofNodes();
++	return this->NumberofNodes(this->interpolation_type);
+ 
+ }
+ /*}}}*/
+ void TetraInput::ResultToPatch(IssmDouble* values,int nodesperelement,int sid){/*{{{*/
+ 
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(this->interpolation_type);
+ 
+ 	/*Some checks*/
+ 	_assert_(values);
+@@ -104,7 +99,7 @@
+ 
+ 	/*Call TetraRef function*/
+ 	_assert_(gauss->Enum()==GaussTetraEnum);
+-	TetraRef::GetInputValue(pvalue,&values[0],(GaussTetra*)gauss);
++	TetraRef::GetInputValue(pvalue,&values[0],(GaussTetra*)gauss,this->interpolation_type);
+ 
+ }
+ /*}}}*/
+@@ -112,7 +107,7 @@
+ 
+ 	/*Call TetraRef function*/
+ 	_assert_(gauss->Enum()==GaussTetraEnum);
+-	TetraRef::GetInputDerivativeValue(p,&values[0],xyz_list,(GaussTetra*)gauss);
++	TetraRef::GetInputDerivativeValue(p,&values[0],xyz_list,(GaussTetra*)gauss,this->interpolation_type);
+ }
+ /*}}}*/
+ void TetraInput::ChangeEnum(int newenumtype){/*{{{*/
+@@ -121,7 +116,7 @@
+ /*}}}*/
+ void TetraInput::GetInputAverage(IssmDouble* pvalue){/*{{{*/
+ 
+-	int        numnodes  = this->NumberofNodes();
++	int        numnodes  = this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble numnodesd = reCast<int,IssmDouble>(numnodes);
+ 	IssmDouble value     = 0.;
+ 
+@@ -174,7 +169,7 @@
+ 	/*output*/
+ 	TriaInput* outinput=NULL;
+ 
+-	if(this->element_type==P0Enum){ 
++	if(this->interpolation_type==P0Enum){ 
+ 		outinput=new TriaInput(this->enum_type,&this->values[0],P0Enum);
+ 	}
+ 	else{
+@@ -203,7 +198,7 @@
+ /*Intermediary*/
+ void TetraInput::SquareMin(IssmDouble* psquaremin,Parameters* parameters){/*{{{*/
+ 
+-	int        numnodes=this->NumberofNodes();
++	int        numnodes=this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble squaremin;
+ 
+ 	/*Now, figure out minimum of valuescopy: */
+@@ -217,7 +212,7 @@
+ /*}}}*/
+ void TetraInput::ConstrainMin(IssmDouble minimum){/*{{{*/
+ 
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(this->interpolation_type);
+ 	for(int i=0;i<numnodes;i++) if (values[i]<minimum) values[i]=minimum;
+ }
+ /*}}}*/
+@@ -225,7 +220,7 @@
+ 
+ 	/*Output*/
+ 	IssmDouble norm=0.;
+-	int numnodes=this->NumberofNodes();
++	int numnodes=this->NumberofNodes(this->interpolation_type);
+ 
+ 	for(int i=0;i<numnodes;i++) if(fabs(values[i])>norm) norm=fabs(values[i]);
+ 	return norm;
+@@ -233,7 +228,7 @@
+ /*}}}*/
+ IssmDouble TetraInput::Max(void){/*{{{*/
+ 
+-	int  numnodes=this->NumberofNodes();
++	int  numnodes=this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble max=values[0];
+ 
+ 	for(int i=1;i<numnodes;i++){
+@@ -244,7 +239,7 @@
+ /*}}}*/
+ IssmDouble TetraInput::MaxAbs(void){/*{{{*/
+ 
+-	int  numnodes=this->NumberofNodes();
++	int  numnodes=this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble max=fabs(values[0]);
+ 
+ 	for(int i=1;i<numnodes;i++){
+@@ -255,7 +250,7 @@
+ /*}}}*/
+ IssmDouble TetraInput::Min(void){/*{{{*/
+ 
+-	const int  numnodes=this->NumberofNodes();
++	const int  numnodes=this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble min=values[0];
+ 
+ 	for(int i=1;i<numnodes;i++){
+@@ -266,7 +261,7 @@
+ /*}}}*/
+ IssmDouble TetraInput::MinAbs(void){/*{{{*/
+ 
+-	const int  numnodes=this->NumberofNodes();
++	const int  numnodes=this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble min=fabs(values[0]);
+ 
+ 	for(int i=1;i<numnodes;i++){
+@@ -277,25 +272,25 @@
+ /*}}}*/
+ void TetraInput::Scale(IssmDouble scale_factor){/*{{{*/
+ 
+-	const int numnodes=this->NumberofNodes();
++	const int numnodes=this->NumberofNodes(this->interpolation_type);
+ 	for(int i=0;i<numnodes;i++)values[i]=values[i]*scale_factor;
+ }
+ /*}}}*/
+ void TetraInput::Set(IssmDouble setvalue){/*{{{*/
+ 
+-	const int numnodes=this->NumberofNodes();
++	const int numnodes=this->NumberofNodes(this->interpolation_type);
+ 	for(int i=0;i<numnodes;i++)values[i]=setvalue;
+ }
+ /*}}}*/
+ void TetraInput::AXPY(Input* xinput,IssmDouble scalar){/*{{{*/
+ 
+-	const int numnodes=this->NumberofNodes();
++	const int numnodes=this->NumberofNodes(this->interpolation_type);
+ 	TetraInput*  xtriainput=NULL;
+ 
+ 	/*xinput is of the same type, so cast it: */
+ 	if(xinput->ObjectEnum()!=TetraInputEnum) _error_("Operation not permitted because xinput is of type " << EnumToStringx(xinput->ObjectEnum()));
+ 	xtriainput=(TetraInput*)xinput;
+-	if(xtriainput->element_type!=this->element_type) _error_("Operation not permitted because xinput is of type " << EnumToStringx(xinput->ObjectEnum()));
++	if(xtriainput->interpolation_type!=this->interpolation_type) _error_("Operation not permitted because xinput is of type " << EnumToStringx(xinput->ObjectEnum()));
+ 
+ 	/*Carry out the AXPY operation depending on type:*/
+ 	for(int i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*xtriainput->values[i];
+@@ -305,7 +300,7 @@
+ void TetraInput::Constrain(IssmDouble cm_min, IssmDouble cm_max){/*{{{*/
+ 
+ 	int i;
+-	const int numnodes=this->NumberofNodes();
++	const int numnodes=this->NumberofNodes(this->interpolation_type);
+ 
+ 	if(!xIsNan<IssmDouble>(cm_min)) for(i=0;i<numnodes;i++)if (this->values[i]<cm_min)this->values[i]=cm_min;
+ 	if(!xIsNan<IssmDouble>(cm_max)) for(i=0;i<numnodes;i++)if (this->values[i]>cm_max)this->values[i]=cm_max;
+@@ -324,13 +319,13 @@
+ 	/*Intermediaries*/
+ 	int         i;
+ 	TetraInput  *xinputB   = NULL;
+-	const int   numnodes  = this->NumberofNodes();
++	const int   numnodes  = this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble *minvalues = xNew<IssmDouble>(numnodes);
+ 
+ 	/*Check that inputB is of the same type*/
+ 	if(inputB->ObjectEnum()!=TetraInputEnum)       _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(TetraInput*)inputB;
+-	if(xinputB->element_type!=this->element_type) _error_("Operation not permitted because inputB is of type " << EnumToStringx(xinputB->element_type));
++	if(xinputB->interpolation_type!=this->interpolation_type) _error_("Operation not permitted because inputB is of type " << EnumToStringx(xinputB->interpolation_type));
+ 
+ 	/*Create point wise min*/
+ 	for(i=0;i<numnodes;i++){
+@@ -339,7 +334,7 @@
+ 	}
+ 
+ 	/*Create new Tetra vertex input (copy of current input)*/
+-	outinput=new TetraInput(this->enum_type,&minvalues[0],this->element_type);
++	outinput=new TetraInput(this->enum_type,&minvalues[0],this->interpolation_type);
+ 
+ 	/*Return output pointer*/
+ 	xDelete<IssmDouble>(minvalues);
+@@ -355,13 +350,13 @@
+ 	/*Intermediaries*/
+ 	int         i;
+ 	TetraInput  *xinputB   = NULL;
+-	const int   numnodes  = this->NumberofNodes();
++	const int   numnodes  = this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble *maxvalues = xNew<IssmDouble>(numnodes);
+ 
+ 	/*Check that inputB is of the same type*/
+ 	if(inputB->ObjectEnum()!=TetraInputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(TetraInput*)inputB;
+-	if(xinputB->element_type!=this->element_type) _error_("Operation not permitted because inputB is of type " << EnumToStringx(xinputB->element_type));
++	if(xinputB->interpolation_type!=this->interpolation_type) _error_("Operation not permitted because inputB is of type " << EnumToStringx(xinputB->interpolation_type));
+ 
+ 	/*Create point wise max*/
+ 	for(i=0;i<numnodes;i++){
+@@ -370,7 +365,7 @@
+ 	}
+ 
+ 	/*Create new Tetra vertex input (copy of current input)*/
+-	outinput=new TetraInput(this->enum_type,&maxvalues[0],this->element_type);
++	outinput=new TetraInput(this->enum_type,&maxvalues[0],this->interpolation_type);
+ 
+ 	/*Return output pointer*/
+ 	xDelete<IssmDouble>(maxvalues);
+@@ -385,12 +380,12 @@
+ 
+ 	/*Intermediaries*/
+ 	TetraInput *xinputB  = NULL;
+-	const int   numnodes = this->NumberofNodes();
++	const int   numnodes = this->NumberofNodes(this->interpolation_type);
+ 
+ 	/*Check that inputB is of the same type*/
+ 	if(inputB->ObjectEnum()!=TetraInputEnum)     _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(TetraInput*)inputB;
+-	if(xinputB->element_type!=this->element_type) _error_("Operation not permitted because inputB is of type " << EnumToStringx(xinputB->element_type));
++	if(xinputB->interpolation_type!=this->interpolation_type) _error_("Operation not permitted because inputB is of type " << EnumToStringx(xinputB->interpolation_type));
+ 
+ 	/*Allocate intermediary*/
+ 	IssmDouble* AdotBvalues=xNew<IssmDouble>(numnodes);
+@@ -402,7 +397,7 @@
+ 	}
+ 
+ 	/*Create new Tetra vertex input (copy of current input)*/
+-	outinput=new TetraInput(this->enum_type,AdotBvalues,this->element_type);
++	outinput=new TetraInput(this->enum_type,AdotBvalues,this->interpolation_type);
+ 
+ 	/*Return output pointer*/
+ 	xDelete<IssmDouble>(AdotBvalues);
+Index: ../trunk-jpl/src/c/classes/Inputs/SegInput.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/SegInput.h	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Inputs/SegInput.h	(revision 18078)
+@@ -17,6 +17,7 @@
+ 
+ 	public:
+ 		int         enum_type;
++		int         interpolation_type;
+ 		IssmDouble* values;
+ 
+ 		/*SegInput constructors, destructors*/
+Index: ../trunk-jpl/src/c/classes/Inputs/TetraInput.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TetraInput.h	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Inputs/TetraInput.h	(revision 18078)
+@@ -17,6 +17,7 @@
+ 
+ 	public:
+ 		int         enum_type;
++		int         interpolation_type;
+ 		IssmDouble* values;
+ 
+ 		/*TetraInput constructors, destructors*/
+Index: ../trunk-jpl/src/c/classes/Inputs/TriaInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TriaInput.cpp	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Inputs/TriaInput.cpp	(revision 18078)
+@@ -16,20 +16,15 @@
+ 	values = NULL;
+ }
+ /*}}}*/
+-TriaInput::TriaInput(int in_enum_type,IssmDouble* in_values,int element_type_in)/*{{{*/
+-	:TriaRef(1)
+-{
++TriaInput::TriaInput(int in_enum_type,IssmDouble* in_values,int interpolation_type_in){/*{{{*/
+ 
+-	/*Set TriaRef*/
+-	this->SetElementType(element_type_in,0);
+-	this->element_type=element_type_in;
+-
+ 	/*Set Enum*/
+ 	enum_type=in_enum_type;
++	this->interpolation_type=interpolation_type_in;
+ 
+ 	/*Set values*/
+-	this->values=xNew<IssmDouble>(this->NumberofNodes());
+-	for(int i=0;i<this->NumberofNodes();i++) values[i]=in_values[i];
++	this->values=xNew<IssmDouble>(this->NumberofNodes(this->interpolation_type));
++	for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i];
+ }
+ /*}}}*/
+ TriaInput::~TriaInput(){/*{{{*/
+@@ -45,8 +40,8 @@
+ void TriaInput::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_(setw(15)<<"   TriaInput "<<setw(25)<<left<<EnumToStringx(this->enum_type)<<" [");
+-	for(int i=0;i<this->NumberofNodes();i++) _printf_(" "<<this->values[i]);
+-	_printf_("] ("<<EnumToStringx(this->element_type)<<")\n");
++	for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) _printf_(" "<<this->values[i]);
++	_printf_("] ("<<EnumToStringx(this->interpolation_type)<<")\n");
+ }
+ /*}}}*/
+ int    TriaInput::Id(void){ return -1; }/*{{{*/
+@@ -59,7 +54,7 @@
+ /*}}}*/
+ Object* TriaInput::copy() {/*{{{*/
+ 
+-	return new TriaInput(this->enum_type,this->values,this->element_type);
++	return new TriaInput(this->enum_type,this->values,this->interpolation_type);
+ 
+ }
+ /*}}}*/
+@@ -77,7 +72,7 @@
+ 	TriaInput* outinput=NULL;
+ 
+ 	/*Create new Tria input (copy of current input)*/
+-	outinput=new TriaInput(this->enum_type,&this->values[0],this->element_type);
++	outinput=new TriaInput(this->enum_type,&this->values[0],this->interpolation_type);
+ 
+ 	/*Assign output*/
+ 	return outinput;
+@@ -89,7 +84,7 @@
+ 	/*output*/
+ 	SegInput* outinput=NULL;
+ 
+-	if(this->element_type==P0Enum){ 
++	if(this->interpolation_type==P0Enum){ 
+ 		outinput=new SegInput(this->enum_type,&this->values[0],P0Enum);
+ 	}
+ 	else{
+@@ -111,7 +106,7 @@
+ /*}}}*/
+ int  TriaInput::GetResultInterpolation(void){/*{{{*/
+ 
+-	if(this->element_type==P0Enum){
++	if(this->interpolation_type==P0Enum){
+ 		return P0Enum;
+ 	}
+ 	return P1Enum;
+@@ -120,13 +115,13 @@
+ /*}}}*/
+ int  TriaInput::GetResultNumberOfNodes(void){/*{{{*/
+ 
+-	return this->NumberofNodes();
++	return this->NumberofNodes(this->interpolation_type);
+ 
+ }
+ /*}}}*/
+ void TriaInput::ResultToPatch(IssmDouble* values,int nodesperelement,int sid){/*{{{*/
+ 
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(this->interpolation_type);
+ 
+ 	/*Some checks*/
+ 	_assert_(values);
+@@ -142,7 +137,7 @@
+ 
+ 	/*Call TriaRef function*/
+ 	_assert_(gauss->Enum()==GaussTriaEnum);
+-	TriaRef::GetInputValue(pvalue,&values[0],(GaussTria*)gauss);
++	TriaRef::GetInputValue(pvalue,&values[0],(GaussTria*)gauss,this->interpolation_type);
+ 
+ }
+ /*}}}*/
+@@ -150,7 +145,7 @@
+ 
+ 	/*Call TriaRef function*/
+ 	_assert_(gauss->Enum()==GaussTriaEnum);
+-	TriaRef::GetInputDerivativeValue(p,&values[0],xyz_list,(GaussTria*)gauss);
++	TriaRef::GetInputDerivativeValue(p,&values[0],xyz_list,(GaussTria*)gauss,this->interpolation_type);
+ }
+ /*}}}*/
+ void TriaInput::ChangeEnum(int newenumtype){/*{{{*/
+@@ -159,7 +154,7 @@
+ /*}}}*/
+ void TriaInput::GetInputAverage(IssmDouble* pvalue){/*{{{*/
+ 
+-	int        numnodes  = this->NumberofNodes();
++	int        numnodes  = this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble numnodesd = reCast<int,IssmDouble>(numnodes);
+ 	IssmDouble value     = 0.;
+ 
+@@ -211,7 +206,7 @@
+ /*Intermediary*/
+ void TriaInput::SquareMin(IssmDouble* psquaremin,Parameters* parameters){/*{{{*/
+ 
+-	int        numnodes=this->NumberofNodes();
++	int        numnodes=this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble squaremin;
+ 
+ 	/*Now, figure out minimum of valuescopy: */
+@@ -225,7 +220,7 @@
+ /*}}}*/
+ void TriaInput::ConstrainMin(IssmDouble minimum){/*{{{*/
+ 
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(this->interpolation_type);
+ 	for(int i=0;i<numnodes;i++) if (values[i]<minimum) values[i]=minimum;
+ }
+ /*}}}*/
+@@ -233,7 +228,7 @@
+ 
+ 	/*Output*/
+ 	IssmDouble norm=0.;
+-	int numnodes=this->NumberofNodes();
++	int numnodes=this->NumberofNodes(this->interpolation_type);
+ 
+ 	for(int i=0;i<numnodes;i++) if(fabs(values[i])>norm) norm=fabs(values[i]);
+ 	return norm;
+@@ -241,7 +236,7 @@
+ /*}}}*/
+ IssmDouble TriaInput::Max(void){/*{{{*/
+ 
+-	int  numnodes=this->NumberofNodes();
++	int  numnodes=this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble max=values[0];
+ 
+ 	for(int i=1;i<numnodes;i++){
+@@ -252,7 +247,7 @@
+ /*}}}*/
+ IssmDouble TriaInput::MaxAbs(void){/*{{{*/
+ 
+-	int  numnodes=this->NumberofNodes();
++	int  numnodes=this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble max=fabs(values[0]);
+ 
+ 	for(int i=1;i<numnodes;i++){
+@@ -263,7 +258,7 @@
+ /*}}}*/
+ IssmDouble TriaInput::Min(void){/*{{{*/
+ 
+-	const int  numnodes=this->NumberofNodes();
++	const int  numnodes=this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble min=values[0];
+ 
+ 	for(int i=1;i<numnodes;i++){
+@@ -274,7 +269,7 @@
+ /*}}}*/
+ IssmDouble TriaInput::MinAbs(void){/*{{{*/
+ 
+-	const int  numnodes=this->NumberofNodes();
++	const int  numnodes=this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble min=fabs(values[0]);
+ 
+ 	for(int i=1;i<numnodes;i++){
+@@ -285,25 +280,25 @@
+ /*}}}*/
+ void TriaInput::Scale(IssmDouble scale_factor){/*{{{*/
+ 
+-	const int numnodes=this->NumberofNodes();
++	const int numnodes=this->NumberofNodes(this->interpolation_type);
+ 	for(int i=0;i<numnodes;i++)values[i]=values[i]*scale_factor;
+ }
+ /*}}}*/
+ void TriaInput::Set(IssmDouble setvalue){/*{{{*/
+ 
+-	const int numnodes=this->NumberofNodes();
++	const int numnodes=this->NumberofNodes(this->interpolation_type);
+ 	for(int i=0;i<numnodes;i++)values[i]=setvalue;
+ }
+ /*}}}*/
+ void TriaInput::AXPY(Input* xinput,IssmDouble scalar){/*{{{*/
+ 
+-	const int numnodes=this->NumberofNodes();
++	const int numnodes=this->NumberofNodes(this->interpolation_type);
+ 	TriaInput*  xtriainput=NULL;
+ 
+ 	/*xinput is of the same type, so cast it: */
+ 	if(xinput->ObjectEnum()!=TriaInputEnum) _error_("Operation not permitted because xinput is of type " << EnumToStringx(xinput->ObjectEnum()));
+ 	xtriainput=(TriaInput*)xinput;
+-	if(xtriainput->element_type!=this->element_type) _error_("Operation not permitted because xinput is of type " << EnumToStringx(xinput->ObjectEnum()));
++	if(xtriainput->interpolation_type!=this->interpolation_type) _error_("Operation not permitted because xinput is of type " << EnumToStringx(xinput->ObjectEnum()));
+ 
+ 	/*Carry out the AXPY operation depending on type:*/
+ 	for(int i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*xtriainput->values[i];
+@@ -313,7 +308,7 @@
+ void TriaInput::Constrain(IssmDouble cm_min, IssmDouble cm_max){/*{{{*/
+ 
+ 	int i;
+-	const int numnodes=this->NumberofNodes();
++	const int numnodes=this->NumberofNodes(this->interpolation_type);
+ 
+ 	if(!xIsNan<IssmDouble>(cm_min)) for(i=0;i<numnodes;i++)if (this->values[i]<cm_min)this->values[i]=cm_min;
+ 	if(!xIsNan<IssmDouble>(cm_max)) for(i=0;i<numnodes;i++)if (this->values[i]>cm_max)this->values[i]=cm_max;
+@@ -332,13 +327,13 @@
+ 	/*Intermediaries*/
+ 	int         i;
+ 	TriaInput  *xinputB   = NULL;
+-	const int   numnodes  = this->NumberofNodes();
++	const int   numnodes  = this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble *minvalues = xNew<IssmDouble>(numnodes);
+ 
+ 	/*Check that inputB is of the same type*/
+ 	if(inputB->ObjectEnum()!=TriaInputEnum)       _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(TriaInput*)inputB;
+-	if(xinputB->element_type!=this->element_type) _error_("Operation not permitted because inputB is of type " << EnumToStringx(xinputB->element_type));
++	if(xinputB->interpolation_type!=this->interpolation_type) _error_("Operation not permitted because inputB is of type " << EnumToStringx(xinputB->interpolation_type));
+ 
+ 	/*Create point wise min*/
+ 	for(i=0;i<numnodes;i++){
+@@ -347,7 +342,7 @@
+ 	}
+ 
+ 	/*Create new Tria vertex input (copy of current input)*/
+-	outinput=new TriaInput(this->enum_type,&minvalues[0],this->element_type);
++	outinput=new TriaInput(this->enum_type,&minvalues[0],this->interpolation_type);
+ 
+ 	/*Return output pointer*/
+ 	xDelete<IssmDouble>(minvalues);
+@@ -363,13 +358,13 @@
+ 	/*Intermediaries*/
+ 	int         i;
+ 	TriaInput  *xinputB   = NULL;
+-	const int   numnodes  = this->NumberofNodes();
++	const int   numnodes  = this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble *maxvalues = xNew<IssmDouble>(numnodes);
+ 
+ 	/*Check that inputB is of the same type*/
+ 	if(inputB->ObjectEnum()!=TriaInputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(TriaInput*)inputB;
+-	if(xinputB->element_type!=this->element_type) _error_("Operation not permitted because inputB is of type " << EnumToStringx(xinputB->element_type));
++	if(xinputB->interpolation_type!=this->interpolation_type) _error_("Operation not permitted because inputB is of type " << EnumToStringx(xinputB->interpolation_type));
+ 
+ 	/*Create point wise max*/
+ 	for(i=0;i<numnodes;i++){
+@@ -378,7 +373,7 @@
+ 	}
+ 
+ 	/*Create new Tria vertex input (copy of current input)*/
+-	outinput=new TriaInput(this->enum_type,&maxvalues[0],this->element_type);
++	outinput=new TriaInput(this->enum_type,&maxvalues[0],this->interpolation_type);
+ 
+ 	/*Return output pointer*/
+ 	xDelete<IssmDouble>(maxvalues);
+@@ -393,12 +388,12 @@
+ 
+ 	/*Intermediaries*/
+ 	TriaInput *xinputB  = NULL;
+-	const int   numnodes = this->NumberofNodes();
++	const int   numnodes = this->NumberofNodes(this->interpolation_type);
+ 
+ 	/*Check that inputB is of the same type*/
+ 	if(inputB->ObjectEnum()!=TriaInputEnum)     _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(TriaInput*)inputB;
+-	if(xinputB->element_type!=this->element_type) _error_("Operation not permitted because inputB is of type " << EnumToStringx(xinputB->element_type));
++	if(xinputB->interpolation_type!=this->interpolation_type) _error_("Operation not permitted because inputB is of type " << EnumToStringx(xinputB->interpolation_type));
+ 
+ 	/*Allocate intermediary*/
+ 	IssmDouble* AdotBvalues=xNew<IssmDouble>(numnodes);
+@@ -410,7 +405,7 @@
+ 	}
+ 
+ 	/*Create new Tria vertex input (copy of current input)*/
+-	outinput=new TriaInput(this->enum_type,AdotBvalues,this->element_type);
++	outinput=new TriaInput(this->enum_type,AdotBvalues,this->interpolation_type);
+ 
+ 	/*Return output pointer*/
+ 	xDelete<IssmDouble>(AdotBvalues);
+Index: ../trunk-jpl/src/c/classes/Inputs/TriaInput.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TriaInput.h	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Inputs/TriaInput.h	(revision 18078)
+@@ -17,6 +17,7 @@
+ 
+ 	public:
+ 		int         enum_type;
++		int         interpolation_type;
+ 		IssmDouble* values;
+ 
+ 		/*TriaInput constructors, destructors*/
+Index: ../trunk-jpl/src/c/classes/Inputs/PentaInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/PentaInput.cpp	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Inputs/PentaInput.cpp	(revision 18078)
+@@ -16,20 +16,15 @@
+ 	values = NULL;
+ }
+ /*}}}*/
+-PentaInput::PentaInput(int in_enum_type,IssmDouble* in_values,int element_type_in)/*{{{*/
+-		:PentaRef(1)
+-{
++PentaInput::PentaInput(int in_enum_type,IssmDouble* in_values,int interpolation_type_in){/*{{{*/
+ 
+-	/*Set PentaRef*/
+-	this->SetElementType(element_type_in,0);
+-	this->element_type=element_type_in;
+-
+ 	/*Set Enum*/
+ 	enum_type=in_enum_type;
++	this->interpolation_type=interpolation_type_in;
+ 
+ 	/*Set values*/
+-	this->values=xNew<IssmDouble>(this->NumberofNodes());
+-	for(int i=0;i<this->NumberofNodes();i++) values[i]=in_values[i];
++	this->values=xNew<IssmDouble>(this->NumberofNodes(this->interpolation_type));
++	for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i];
+ }
+ /*}}}*/
+ PentaInput::~PentaInput(){/*{{{*/
+@@ -45,7 +40,7 @@
+ void PentaInput::DeepEcho(void){/*{{{*/
+ 
+ 	_printf_(setw(15)<<"   PentaInput "<<setw(25)<<left<<EnumToStringx(this->enum_type)<<" [");
+-	for(int i=0;i<this->NumberofNodes();i++) _printf_(" "<<this->values[i]);
++	for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) _printf_(" "<<this->values[i]);
+ 	_printf_("]\n");
+ }
+ /*}}}*/
+@@ -59,7 +54,7 @@
+ /*}}}*/
+ Object* PentaInput::copy() {/*{{{*/
+ 
+-	return new PentaInput(this->enum_type,this->values,this->element_type);
++	return new PentaInput(this->enum_type,this->values,this->interpolation_type);
+ 
+ }
+ /*}}}*/
+@@ -76,7 +71,7 @@
+ 	/*output*/
+ 	TriaInput* outinput=NULL;
+ 
+-	if(this->element_type==P0Enum){ 
++	if(this->interpolation_type==P0Enum){ 
+ 		outinput=new TriaInput(this->enum_type,&this->values[0],P0Enum);
+ 	}
+ 	else{
+@@ -108,7 +103,7 @@
+ /*}}}*/
+ int  PentaInput::GetResultInterpolation(void){/*{{{*/
+ 
+-	if(this->element_type==P0Enum){
++	if(this->interpolation_type==P0Enum){
+ 		return P0Enum;
+ 	}
+ 	return P1Enum;
+@@ -117,13 +112,13 @@
+ /*}}}*/
+ int  PentaInput::GetResultNumberOfNodes(void){/*{{{*/
+ 
+-	return this->NumberofNodes();;
++	return this->NumberofNodes(this->interpolation_type);;
+ 
+ }
+ /*}}}*/
+ void PentaInput::ResultToPatch(IssmDouble* values,int nodesperelement,int sid){/*{{{*/
+ 
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(this->interpolation_type);
+ 
+ 	/*Some checks*/
+ 	_assert_(values);
+@@ -137,7 +132,7 @@
+ /*Object functions*/
+ void PentaInput::GetInputValue(IssmDouble* pvalue){/*{{{*/
+ 
+-	if(this->element_type==P0Enum){
++	if(this->interpolation_type==P0Enum){
+ 		pvalue=&values[0];
+ 	}
+ 	else _error_("not implemented yet");
+@@ -147,7 +142,7 @@
+ 
+ 	/*Call PentaRef function*/
+ 	_assert_(gauss->Enum()==GaussPentaEnum);
+-	PentaRef::GetInputValue(pvalue,&values[0],(GaussPenta*)gauss);
++	PentaRef::GetInputValue(pvalue,&values[0],(GaussPenta*)gauss,this->interpolation_type);
+ 
+ }
+ /*}}}*/
+@@ -155,7 +150,7 @@
+ 
+ 	/*Call PentaRef function*/
+ 	_assert_(gauss->Enum()==GaussPentaEnum);
+-	PentaRef::GetInputDerivativeValue(p,&values[0],xyz_list,(GaussPenta*)gauss);
++	PentaRef::GetInputDerivativeValue(p,&values[0],xyz_list,(GaussPenta*)gauss,this->interpolation_type);
+ }
+ /*}}}*/
+ void PentaInput::ChangeEnum(int newenumtype){/*{{{*/
+@@ -164,7 +159,7 @@
+ /*}}}*/
+ void PentaInput::GetInputAverage(IssmDouble* pvalue){/*{{{*/
+ 
+-	int        numnodes  = this->NumberofNodes();
++	int        numnodes  = this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble numnodesd = reCast<int,IssmDouble>(numnodes);
+ 	IssmDouble value     = 0.;
+ 
+@@ -178,7 +173,7 @@
+ /*Intermediary*/
+ void PentaInput::SquareMin(IssmDouble* psquaremin,Parameters* parameters){/*{{{*/
+ 
+-	int        numnodes=this->NumberofNodes();
++	int        numnodes=this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble squaremin;
+ 
+ 	/*Now, figure out minimum of valuescopy: */
+@@ -192,7 +187,7 @@
+ /*}}}*/
+ void PentaInput::ConstrainMin(IssmDouble minimum){/*{{{*/
+ 
+-	int numnodes = this->NumberofNodes();
++	int numnodes = this->NumberofNodes(this->interpolation_type);
+ 	for(int i=0;i<numnodes;i++) if (values[i]<minimum) values[i]=minimum;
+ }
+ /*}}}*/
+@@ -200,7 +195,7 @@
+ 
+ 	/*Output*/
+ 	IssmDouble norm=0.;
+-	int numnodes=this->NumberofNodes();
++	int numnodes=this->NumberofNodes(this->interpolation_type);
+ 
+ 	for(int i=0;i<numnodes;i++) if(fabs(values[i])>norm) norm=fabs(values[i]);
+ 	return norm;
+@@ -208,7 +203,7 @@
+ /*}}}*/
+ IssmDouble PentaInput::Max(void){/*{{{*/
+ 
+-	int  numnodes=this->NumberofNodes();
++	int  numnodes=this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble max=values[0];
+ 
+ 	for(int i=1;i<numnodes;i++){
+@@ -219,7 +214,7 @@
+ /*}}}*/
+ IssmDouble PentaInput::MaxAbs(void){/*{{{*/
+ 
+-	int  numnodes=this->NumberofNodes();
++	int  numnodes=this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble max=fabs(values[0]);
+ 
+ 	for(int i=1;i<numnodes;i++){
+@@ -230,7 +225,7 @@
+ /*}}}*/
+ IssmDouble PentaInput::Min(void){/*{{{*/
+ 
+-	const int  numnodes=this->NumberofNodes();
++	const int  numnodes=this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble min=values[0];
+ 
+ 	for(int i=1;i<numnodes;i++){
+@@ -241,7 +236,7 @@
+ /*}}}*/
+ IssmDouble PentaInput::MinAbs(void){/*{{{*/
+ 
+-	const int  numnodes=this->NumberofNodes();
++	const int  numnodes=this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble min=fabs(values[0]);
+ 
+ 	for(int i=1;i<numnodes;i++){
+@@ -252,13 +247,13 @@
+ /*}}}*/
+ void PentaInput::Scale(IssmDouble scale_factor){/*{{{*/
+ 
+-	const int numnodes=this->NumberofNodes();
++	const int numnodes=this->NumberofNodes(this->interpolation_type);
+ 	for(int i=0;i<numnodes;i++)values[i]=values[i]*scale_factor;
+ }
+ /*}}}*/
+ void PentaInput::AXPY(Input* xinput,IssmDouble scalar){/*{{{*/
+ 
+-	const int numnodes=this->NumberofNodes();
++	const int numnodes=this->NumberofNodes(this->interpolation_type);
+ 	PentaInput* xpentainput=NULL;
+ 
+ 	/*If xinput is a ControlInput, take its values directly*/
+@@ -270,7 +265,7 @@
+ 	if(xinput->ObjectEnum()!=PentaInputEnum)
+ 	  _error_("Operation not permitted because xinput is of type " << EnumToStringx(xinput->ObjectEnum()));
+ 	xpentainput=(PentaInput*)xinput;
+-	if(xpentainput->element_type!=this->element_type) _error_("Operation not permitted because xinput is of type " << EnumToStringx(xpentainput->element_type));
++	if(xpentainput->interpolation_type!=this->interpolation_type) _error_("Operation not permitted because xinput is of type " << EnumToStringx(xpentainput->interpolation_type));
+ 
+ 	/*Carry out the AXPY operation depending on type:*/
+ 	for(int i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*xpentainput->values[i];
+@@ -280,7 +275,7 @@
+ void PentaInput::Constrain(IssmDouble cm_min, IssmDouble cm_max){/*{{{*/
+ 
+ 	int i;
+-	const int numnodes=this->NumberofNodes();
++	const int numnodes=this->NumberofNodes(this->interpolation_type);
+ 
+ 	if(!xIsNan<IssmDouble>(cm_min)) for(i=0;i<numnodes;i++)if (this->values[i]<cm_min)this->values[i]=cm_min;
+ 	if(!xIsNan<IssmDouble>(cm_max)) for(i=0;i<numnodes;i++)if (this->values[i]>cm_max)this->values[i]=cm_max;
+@@ -289,12 +284,12 @@
+ /*}}}*/
+ void PentaInput::Extrude(void){/*{{{*/
+ 
+-	switch(this->element_type){
++	switch(this->interpolation_type){
+ 		case P1Enum:
+ 			for(int i=0;i<3;i++) this->values[3+i]=this->values[i];
+ 			break;
+ 		default:
+-			_error_("not supported yet for type "<<EnumToStringx(this->element_type));
++			_error_("not supported yet for type "<<EnumToStringx(this->interpolation_type));
+ 	}
+ }
+ /*}}}*/
+@@ -307,12 +302,12 @@
+ 	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error_("Input provided is not a Thickness (enum_type is " << EnumToStringx(thickness_input->InstanceEnum()) << ")");
+ 
+ 	/*vertically integrate depending on type (and use P1 interpolation from now on)*/
+-	switch(this->element_type){
++	switch(this->interpolation_type){
+ 		case P1Enum:
+ 		case P1bubbleEnum:
+ 		case P2Enum:
+ 			  {
+-				this->element_type=P1Enum;
++				this->interpolation_type=P1Enum;
+ 				GaussPenta *gauss=new GaussPenta();
+ 				for(int iv=0;iv<3;iv++){
+ 					gauss->GaussVertex(iv);
+@@ -324,7 +319,7 @@
+ 				return; 
+ 			  }
+ 		default:
+-			_error_("not supported yet for type "<<EnumToStringx(this->element_type));
++			_error_("not supported yet for type "<<EnumToStringx(this->interpolation_type));
+ 	}
+ }
+ /*}}}*/
+@@ -335,12 +330,12 @@
+ 
+ 	/*Intermediaries*/
+ 	PentaInput *xinputB  = NULL;
+-	const int   numnodes = this->NumberofNodes();
++	const int   numnodes = this->NumberofNodes(this->interpolation_type);
+ 
+ 	/*Check that inputB is of the same type*/
+ 	if(inputB->ObjectEnum()!=PentaInputEnum)     _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(PentaInput*)inputB;
+-	if(xinputB->element_type!=this->element_type) _error_("Operation not permitted because inputB is of type " << EnumToStringx(xinputB->element_type));
++	if(xinputB->interpolation_type!=this->interpolation_type) _error_("Operation not permitted because inputB is of type " << EnumToStringx(xinputB->interpolation_type));
+ 
+ 	/*Allocate intermediary*/
+ 	IssmDouble* AdotBvalues=xNew<IssmDouble>(numnodes);
+@@ -352,7 +347,7 @@
+ 	}
+ 
+ 	/*Create new Penta vertex input (copy of current input)*/
+-	outinput=new PentaInput(this->enum_type,AdotBvalues,this->element_type);
++	outinput=new PentaInput(this->enum_type,AdotBvalues,this->interpolation_type);
+ 
+ 	/*Return output pointer*/
+ 	xDelete<IssmDouble>(AdotBvalues);
+@@ -368,13 +363,13 @@
+ 	/*Intermediaries*/
+ 	int         i;
+ 	PentaInput  *xinputB   = NULL;
+-	const int   numnodes  = this->NumberofNodes();
++	const int   numnodes  = this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble *minvalues = xNew<IssmDouble>(numnodes);
+ 
+ 	/*Check that inputB is of the same type*/
+ 	if(inputB->ObjectEnum()!=PentaInputEnum)       _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(PentaInput*)inputB;
+-	if(xinputB->element_type!=this->element_type) _error_("Operation not permitted because inputB is of type " << EnumToStringx(xinputB->element_type));
++	if(xinputB->interpolation_type!=this->interpolation_type) _error_("Operation not permitted because inputB is of type " << EnumToStringx(xinputB->interpolation_type));
+ 
+ 	/*Create point wise min*/
+ 	for(i=0;i<numnodes;i++){
+@@ -383,7 +378,7 @@
+ 	}
+ 
+ 	/*Create new Penta vertex input (copy of current input)*/
+-	outinput=new PentaInput(this->enum_type,&minvalues[0],this->element_type);
++	outinput=new PentaInput(this->enum_type,&minvalues[0],this->interpolation_type);
+ 
+ 	/*Return output pointer*/
+ 	xDelete<IssmDouble>(minvalues);
+@@ -398,13 +393,13 @@
+ 	/*Intermediaries*/
+ 	int         i;
+ 	PentaInput  *xinputB   = NULL;
+-	const int   numnodes  = this->NumberofNodes();
++	const int   numnodes  = this->NumberofNodes(this->interpolation_type);
+ 	IssmDouble *maxvalues = xNew<IssmDouble>(numnodes);
+ 
+ 	/*Check that inputB is of the same type*/
+ 	if(inputB->ObjectEnum()!=PentaInputEnum) _error_("Operation not permitted because inputB is of type " << EnumToStringx(inputB->ObjectEnum()));
+ 	xinputB=(PentaInput*)inputB;
+-	if(xinputB->element_type!=this->element_type) _error_("Operation not permitted because inputB is of type " << EnumToStringx(xinputB->element_type));
++	if(xinputB->interpolation_type!=this->interpolation_type) _error_("Operation not permitted because inputB is of type " << EnumToStringx(xinputB->interpolation_type));
+ 
+ 	/*Create point wise max*/
+ 	for(i=0;i<numnodes;i++){
+@@ -413,7 +408,7 @@
+ 	}
+ 
+ 	/*Create new Penta vertex input (copy of current input)*/
+-	outinput=new PentaInput(this->enum_type,&maxvalues[0],this->element_type);
++	outinput=new PentaInput(this->enum_type,&maxvalues[0],this->interpolation_type);
+ 
+ 	/*Return output pointer*/
+ 	xDelete<IssmDouble>(maxvalues);
+Index: ../trunk-jpl/src/c/classes/Inputs/PentaInput.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/PentaInput.h	(revision 18077)
++++ ../trunk-jpl/src/c/classes/Inputs/PentaInput.h	(revision 18078)
+@@ -16,7 +16,8 @@
+ class PentaInput: public Input, public PentaRef{
+ 
+ 	public:
+-		int        enum_type;
++		int         enum_type;
++		int         interpolation_type;
+ 		IssmDouble* values;
+ 
+ 		/*PentaInput constructors, destructors*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18078-18079.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18078-18079.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18078-18079.diff	(revision 18296)
@@ -0,0 +1,69 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18078)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18079)
+@@ -887,7 +887,7 @@
+ 	return NUMVERTICES; 
+ }
+ /*}}}*/
+-Node* Penta::GetNode(int node_number){/*{{{*/
++Node*      Penta::GetNode(int node_number){/*{{{*/
+ 	_assert_(node_number>=0); 
+ 	_assert_(node_number<this->NumberofNodes(this->element_type)); 
+ 	return this->nodes[node_number];
+@@ -1513,7 +1513,7 @@
+ 	}
+ }
+ /*}}}*/
+-bool   Penta::IsNodeOnShelfFromFlags(IssmDouble* flags){/*{{{*/
++bool       Penta::IsNodeOnShelfFromFlags(IssmDouble* flags){/*{{{*/
+ 
+ 	int  i;
+ 	bool shelf=false;
+@@ -1583,7 +1583,7 @@
+ 	return minlength;
+ }
+ /*}}}*/
+-int    Penta::NodalValue(IssmDouble* pvalue, int index, int natureofdataenum){/*{{{*/
++int        Penta::NodalValue(IssmDouble* pvalue, int index, int natureofdataenum){/*{{{*/
+ 
+ 	int i;
+ 	int found=0;
+@@ -1614,15 +1614,15 @@
+ 	return found;
+ }
+ /*}}}*/
+-Gauss* Penta::NewGauss(void){/*{{{*/
++Gauss*     Penta::NewGauss(void){/*{{{*/
+ 	return new GaussPenta();
+ }
+ /*}}}*/
+-Gauss* Penta::NewGauss(int order){/*{{{*/
++Gauss*     Penta::NewGauss(int order){/*{{{*/
+ 	return new GaussPenta(order,order);
+ }
+ /*}}}*/
+-Gauss* Penta::NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz,int order_vert){/*{{{*/
++Gauss*     Penta::NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz,int order_vert){/*{{{*/
+ 
+ 	IssmDouble  area_coordinates[4][3];
+ 
+@@ -1631,15 +1631,15 @@
+ 	return new GaussPenta(area_coordinates,order_horiz,order_vert);
+ }
+ /*}}}*/
+-Gauss* Penta::NewGaussBase(int order){/*{{{*/
++Gauss*     Penta::NewGaussBase(int order){/*{{{*/
+ 	return new GaussPenta(0,1,2,order);
+ }
+ /*}}}*/
+-Gauss* Penta::NewGaussLine(int vertex1,int vertex2,int order){/*{{{*/
++Gauss*     Penta::NewGaussLine(int vertex1,int vertex2,int order){/*{{{*/
+ 	return new GaussPenta(vertex1,vertex2,order);
+ }
+ /*}}}*/
+-Gauss* Penta::NewGaussTop(int order){/*{{{*/
++Gauss*     Penta::NewGaussTop(int order){/*{{{*/
+ 	return new GaussPenta(3,4,5,order);
+ }
+ /*}}}*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18082-18083.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18082-18083.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18082-18083.diff	(revision 18296)
@@ -0,0 +1,35 @@
+Index: ../trunk-jpl/test/NightlyRun/test508.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test508.py	(revision 18082)
++++ ../trunk-jpl/test/NightlyRun/test508.py	(revision 18083)
+@@ -7,10 +7,10 @@
+ from solve import *
+ from MatlabFuncs import *
+ 
+-md=triangle(model(),'../Exp/Pig.exp',30000.)
++md=triangle(model(),'../Exp/Pig.exp',35000.)
+ md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp')
+ md=parameterize(md,'../Par/Pig.py')
+-md.extrude(4,1.1)
++md.extrude(3,1.1)
+ md=setflowequation(md,'SSA','all')
+ md.cluster=generic('name',oshostname(),'np',3)
+ md.timestepping.time_step=0.
+Index: ../trunk-jpl/test/NightlyRun/test508.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test508.m	(revision 18082)
++++ ../trunk-jpl/test/NightlyRun/test508.m	(revision 18083)
+@@ -1,7 +1,7 @@
+-md=triangle(model(),'../Exp/Pig.exp',30000.);
++md=triangle(model(),'../Exp/Pig.exp',35000.);
+ md=setmask(md,'../Exp/PigShelves.exp','../Exp/PigIslands.exp');
+ md=parameterize(md,'../Par/Pig.par');
+-md=extrude(md,4,1.1);
++md=extrude(md,3,1.1);
+ md=setflowequation(md,'SSA','all');
+ md.cluster=generic('name',oshostname(),'np',3);
+ md.timestepping.time_step=0.;
+Index: ../trunk-jpl/test/Archives/Archive508.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/17984-18295/ISSM-18083-18084.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18083-18084.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18083-18084.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/jenkins/windows
+===================================================================
+--- ../trunk-jpl/jenkins/windows	(revision 18083)
++++ ../trunk-jpl/jenkins/windows	(revision 18084)
+@@ -25,7 +25,7 @@
+ 	--with-mpi-libdir="$ISSM_DIR/externalpackages/petsc/install/lib" \
+ 	--with-mpi-libflags="-Wl,libpetsc.lib" \
+ 	--with-mpi-include="$ISSM_DIR/externalpackages/petsc/install/include/mpiuni" \
+-	--enable-development'
++	--enable-debugging '
+ 
+ #MATLAB path
+ MATLAB_PATH="C:/MATLAB/R2013a/"
Index: /issm/oecreview/Archive/17984-18295/ISSM-18084-18085.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18084-18085.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18084-18085.diff	(revision 18296)
@@ -0,0 +1,34 @@
+Index: ../trunk-jpl/test/NightlyRun/test513.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test513.py	(revision 18084)
++++ ../trunk-jpl/test/NightlyRun/test513.py	(revision 18085)
+@@ -35,7 +35,7 @@
+ 
+ # Fields and tolerances to track changes
+ field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsGroundediceMeltingRate']
+-field_tolerances=[2e-10,2e-10,1e-10,1e-10,3e-6,3e-6,3e-6,3e-6,2e-6,2e-06]
++field_tolerances=[4e-10,2e-10,1e-10,1e-10,3e-6,3e-6,3e-6,3e-6,2e-6,2e-06]
+ field_values=[\
+ 	md.results.SteadystateSolution.Gradient1,\
+ 	md.results.SteadystateSolution.J,\
+Index: ../trunk-jpl/test/NightlyRun/test513.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test513.m	(revision 18084)
++++ ../trunk-jpl/test/NightlyRun/test513.m	(revision 18085)
+@@ -24,7 +24,7 @@
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsGroundediceMeltingRate'};
+-field_tolerances={2e-10,2e-10,1e-10,1e-10,3e-6,3e-6,3e-6,3e-6,2e-6,2e-06};
++field_tolerances={4e-10,2e-10,1e-10,1e-10,3e-6,3e-6,3e-6,3e-6,2e-6,2e-06};
+ field_values={...
+ 	(md.results.SteadystateSolution.Gradient1),...
+ 	md.results.SteadystateSolution.J,...
+Index: ../trunk-jpl/test/Archives/Archive303.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive306.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/17984-18295/ISSM-18089-18090.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18089-18090.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18089-18090.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/NightlyRun/test513.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test513.py	(revision 18089)
++++ ../trunk-jpl/test/NightlyRun/test513.py	(revision 18090)
+@@ -35,7 +35,7 @@
+ 
+ # Fields and tolerances to track changes
+ field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsGroundediceMeltingRate']
+-field_tolerances=[4e-10,2e-10,1e-10,1e-10,3e-6,3e-6,3e-6,3e-6,2e-6,2e-06]
++field_tolerances=[7e-10,2e-10,1e-10,1e-10,3e-6,3e-6,3e-6,3e-6,2e-6,2e-06]
+ field_values=[\
+ 	md.results.SteadystateSolution.Gradient1,\
+ 	md.results.SteadystateSolution.J,\
Index: /issm/oecreview/Archive/17984-18295/ISSM-18090-18091.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18090-18091.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18090-18091.diff	(revision 18296)
@@ -0,0 +1,96 @@
+Index: ../trunk-jpl/test/NightlyRun/temp291.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/temp291.m	(revision 18090)
++++ ../trunk-jpl/test/NightlyRun/temp291.m	(revision 18091)
+@@ -1,8 +0,0 @@
+-md=triangle(model(),'../Exp/Square.exp',150000.);
+-md=setmask(md,'all','');
+-md=parameterize(md,'../Par/SquareShelf.par');
+-md=extrude(md,2,1.);
+-md=setflowequation(md,'FS','all');
+-md.flowequation.fe_FS='OneLayerP4z';
+-md.cluster=generic('name',oshostname(),'np',1);
+-md=solve(md,StressbalanceSolutionEnum());
+Index: ../trunk-jpl/test/NightlyRun/temp291.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/temp291.py	(revision 18090)
++++ ../trunk-jpl/test/NightlyRun/temp291.py	(revision 18091)
+@@ -1,18 +0,0 @@
+-from model import *
+-from triangle import *
+-from setmask import *
+-from parameterize import *
+-from setflowequation import *
+-from EnumDefinitions import *
+-from solve import *
+-from MatlabFuncs import *
+-from ContourToMesh import *
+-
+-md=triangle(model(),'../Exp/Square.exp',150000.)
+-md=setmask(md,'all','')
+-md=parameterize(md,'../Par/SquareShelf.py')
+-md.extrude(2,1.)
+-md=setflowequation(md,'FS','all')
+-md.flowequation.fe_FS='OneLayerP4z'
+-md.cluster=generic('name',oshostname(),'np',1)
+-md=solve(md,StressbalanceSolutionEnum())
+Index: ../trunk-jpl/test/NightlyRun/test291.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test291.py	(revision 0)
++++ ../trunk-jpl/test/NightlyRun/test291.py	(revision 18091)
+@@ -0,0 +1,18 @@
++from model import *
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from EnumDefinitions import *
++from solve import *
++from MatlabFuncs import *
++from ContourToMesh import *
++
++md=triangle(model(),'../Exp/Square.exp',150000.)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelf.py')
++md.extrude(2,1.)
++md=setflowequation(md,'FS','all')
++md.flowequation.fe_FS='OneLayerP4z'
++md.cluster=generic('name',oshostname(),'np',1)
++md=solve(md,StressbalanceSolutionEnum())
+Index: ../trunk-jpl/test/NightlyRun/test291.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test291.m	(revision 0)
++++ ../trunk-jpl/test/NightlyRun/test291.m	(revision 18091)
+@@ -0,0 +1,8 @@
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=extrude(md,2,1.);
++md=setflowequation(md,'FS','all');
++md.flowequation.fe_FS='OneLayerP4z';
++md.cluster=generic('name',oshostname(),'np',1);
++md=solve(md,StressbalanceSolutionEnum());
+Index: ../trunk-jpl/test/NightlyRun/IdToName.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/IdToName.m	(revision 18090)
++++ ../trunk-jpl/test/NightlyRun/IdToName.m	(revision 18091)
+@@ -77,6 +77,7 @@
+ 	case 280, name='SquareShelfStressSSA2dHigherOrder';
+ 	case 285, name='SquareShelfStressHOHigherOrder';
+ 	case 290, name='SquareShelfStressFSP2P1';
++	case 291, name='SquareShelfStressFSP4z';
+ 	case 301, name='SquareSheetConstrainedStressSSA2d';
+ 	case 302, name='SquareSheetConstrainedStressSIA2d';
+ 	case 303, name='SquareSheetConstrainedStressSIASSA2d';
+Index: ../trunk-jpl/test/NightlyRun/IdToName.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/IdToName.py	(revision 18090)
++++ ../trunk-jpl/test/NightlyRun/IdToName.py	(revision 18091)
+@@ -76,6 +76,7 @@
+ 	280  : 'SquareShelfStressSSA2dHigherOrder',
+ 	285  : 'SquareShelfStressHOHigherOrder',
+ 	290  : 'SquareShelfStressFSP2P1',
++	291  : 'SquareShelfStressFSP4z',
+ 	301  : 'SquareSheetConstrainedStressSSA2d',
+ 	302  : 'SquareSheetConstrainedStressSIA2d',
+ 	303  : 'SquareSheetConstrainedStressSIASSA2d',
Index: /issm/oecreview/Archive/17984-18295/ISSM-18091-18092.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18091-18092.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18091-18092.diff	(revision 18296)
@@ -0,0 +1,53 @@
+Index: ../trunk-jpl/test/NightlyRun/test291.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test291.py	(revision 18091)
++++ ../trunk-jpl/test/NightlyRun/test291.py	(revision 18092)
+@@ -16,3 +16,14 @@
+ md.flowequation.fe_FS='OneLayerP4z'
+ md.cluster=generic('name',oshostname(),'np',1)
+ md=solve(md,StressbalanceSolutionEnum())
++
++#Fields and tolerances to track changes
++field_names     =['Vx', 'Vy', 'Vz', 'Vel','Pressure'];
++field_tolerances=[5e-5,5e-5,8e-5,5e-5,1e-7]
++field_values=[\
++	md.results.StressbalanceSolution.Vx,\
++	md.results.StressbalanceSolution.Vy,\
++	md.results.StressbalanceSolution.Vz,\
++	md.results.StressbalanceSolution.Vel,\
++	md.results.StressbalanceSolution.Pressure,\
++	];
+Index: ../trunk-jpl/test/NightlyRun/test291.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test291.m	(revision 18091)
++++ ../trunk-jpl/test/NightlyRun/test291.m	(revision 18092)
+@@ -6,3 +6,14 @@
+ md.flowequation.fe_FS='OneLayerP4z';
+ md.cluster=generic('name',oshostname(),'np',1);
+ md=solve(md,StressbalanceSolutionEnum());
++
++%Fields and tolerances to track changes
++field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
++field_tolerances={5e-5,5e-5,8e-5,5e-5,1e-7};
++field_values={...
++	(md.results.StressbalanceSolution.Vx),...
++	(md.results.StressbalanceSolution.Vy),...
++	(md.results.StressbalanceSolution.Vz),...
++	(md.results.StressbalanceSolution.Vel),...
++	(md.results.StressbalanceSolution.Pressure),...
++	};
+Index: ../trunk-jpl/test/Archives/Archive291.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive291.nc
+===================================================================
+--- ../trunk-jpl/test/Archives/Archive291.nc	(revision 18091)
++++ ../trunk-jpl/test/Archives/Archive291.nc	(revision 18092)
+
+Property changes on: ../trunk-jpl/test/Archives/Archive291.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
Index: /issm/oecreview/Archive/17984-18295/ISSM-18092-18093.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18092-18093.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18092-18093.diff	(revision 18296)
@@ -0,0 +1,1980 @@
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18092)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18093)
+@@ -37,12 +37,15 @@
+ 	BalancethicknessSpcthicknessEnum,
+ 	BalancethicknessStabilizationEnum,
+ 	BalancethicknessThickeningRateEnum,
++	BasalforcingsEnum,
+ 	BasalforcingsGeothermalfluxEnum,
+ 	BasalforcingsGroundediceMeltingRateEnum,
+ 	BasalforcingsFloatingiceMeltingRateEnum,
+ 	BasalforcingsDeepwaterMeltingRateEnum,
+ 	BasalforcingsDeepwaterElevationEnum,
+ 	BasalforcingsUpperwaterElevationEnum,
++	FloatingMeltRateEnum,
++	LinearFloatingMeltRateEnum,
+ 	BedEnum,
+ 	BaseEnum,
+ 	ConstantsGEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18092)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18093)
+@@ -45,12 +45,15 @@
+ 		case BalancethicknessSpcthicknessEnum : return "BalancethicknessSpcthickness";
+ 		case BalancethicknessStabilizationEnum : return "BalancethicknessStabilization";
+ 		case BalancethicknessThickeningRateEnum : return "BalancethicknessThickeningRate";
++		case BasalforcingsEnum : return "Basalforcings";
+ 		case BasalforcingsGeothermalfluxEnum : return "BasalforcingsGeothermalflux";
+ 		case BasalforcingsGroundediceMeltingRateEnum : return "BasalforcingsGroundediceMeltingRate";
+ 		case BasalforcingsFloatingiceMeltingRateEnum : return "BasalforcingsFloatingiceMeltingRate";
+ 		case BasalforcingsDeepwaterMeltingRateEnum : return "BasalforcingsDeepwaterMeltingRate";
+ 		case BasalforcingsDeepwaterElevationEnum : return "BasalforcingsDeepwaterElevation";
+ 		case BasalforcingsUpperwaterElevationEnum : return "BasalforcingsUpperwaterElevation";
++		case FloatingMeltRateEnum : return "FloatingMeltRate";
++		case LinearFloatingMeltRateEnum : return "LinearFloatingMeltRate";
+ 		case BedEnum : return "Bed";
+ 		case BaseEnum : return "Base";
+ 		case ConstantsGEnum : return "ConstantsG";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18092)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18093)
+@@ -45,12 +45,15 @@
+ 	      else if (strcmp(name,"BalancethicknessSpcthickness")==0) return BalancethicknessSpcthicknessEnum;
+ 	      else if (strcmp(name,"BalancethicknessStabilization")==0) return BalancethicknessStabilizationEnum;
+ 	      else if (strcmp(name,"BalancethicknessThickeningRate")==0) return BalancethicknessThickeningRateEnum;
++	      else if (strcmp(name,"Basalforcings")==0) return BasalforcingsEnum;
+ 	      else if (strcmp(name,"BasalforcingsGeothermalflux")==0) return BasalforcingsGeothermalfluxEnum;
+ 	      else if (strcmp(name,"BasalforcingsGroundediceMeltingRate")==0) return BasalforcingsGroundediceMeltingRateEnum;
+ 	      else if (strcmp(name,"BasalforcingsFloatingiceMeltingRate")==0) return BasalforcingsFloatingiceMeltingRateEnum;
+ 	      else if (strcmp(name,"BasalforcingsDeepwaterMeltingRate")==0) return BasalforcingsDeepwaterMeltingRateEnum;
+ 	      else if (strcmp(name,"BasalforcingsDeepwaterElevation")==0) return BasalforcingsDeepwaterElevationEnum;
+ 	      else if (strcmp(name,"BasalforcingsUpperwaterElevation")==0) return BasalforcingsUpperwaterElevationEnum;
++	      else if (strcmp(name,"FloatingMeltRate")==0) return FloatingMeltRateEnum;
++	      else if (strcmp(name,"LinearFloatingMeltRate")==0) return LinearFloatingMeltRateEnum;
+ 	      else if (strcmp(name,"Bed")==0) return BedEnum;
+ 	      else if (strcmp(name,"Base")==0) return BaseEnum;
+ 	      else if (strcmp(name,"ConstantsG")==0) return ConstantsGEnum;
+@@ -133,13 +136,13 @@
+ 	      else if (strcmp(name,"HydrologydcSedimentlimitFlag")==0) return HydrologydcSedimentlimitFlagEnum;
+ 	      else if (strcmp(name,"HydrologydcSedimentlimit")==0) return HydrologydcSedimentlimitEnum;
+ 	      else if (strcmp(name,"HydrologydcTransferFlag")==0) return HydrologydcTransferFlagEnum;
+-	      else if (strcmp(name,"HydrologydcLeakageFactor")==0) return HydrologydcLeakageFactorEnum;
+-	      else if (strcmp(name,"HydrologydcPenaltyFactor")==0) return HydrologydcPenaltyFactorEnum;
+-	      else if (strcmp(name,"HydrologydcPenaltyLock")==0) return HydrologydcPenaltyLockEnum;
+          else stage=2;
+    }
+    if(stage==2){
+-	      if (strcmp(name,"HydrologydcBasalMoulinInput")==0) return HydrologydcBasalMoulinInputEnum;
++	      if (strcmp(name,"HydrologydcLeakageFactor")==0) return HydrologydcLeakageFactorEnum;
++	      else if (strcmp(name,"HydrologydcPenaltyFactor")==0) return HydrologydcPenaltyFactorEnum;
++	      else if (strcmp(name,"HydrologydcPenaltyLock")==0) return HydrologydcPenaltyLockEnum;
++	      else if (strcmp(name,"HydrologydcBasalMoulinInput")==0) return HydrologydcBasalMoulinInputEnum;
+ 	      else if (strcmp(name,"HydrologyLayer")==0) return HydrologyLayerEnum;
+ 	      else if (strcmp(name,"HydrologySediment")==0) return HydrologySedimentEnum;
+ 	      else if (strcmp(name,"HydrologyEfficient")==0) return HydrologyEfficientEnum;
+@@ -256,13 +259,13 @@
+ 	      else if (strcmp(name,"MassFluxSegmentsPresent")==0) return MassFluxSegmentsPresentEnum;
+ 	      else if (strcmp(name,"QmuMassFluxSegmentsPresent")==0) return QmuMassFluxSegmentsPresentEnum;
+ 	      else if (strcmp(name,"QmuNumberofpartitions")==0) return QmuNumberofpartitionsEnum;
+-	      else if (strcmp(name,"QmuNumberofresponses")==0) return QmuNumberofresponsesEnum;
+-	      else if (strcmp(name,"QmuPartition")==0) return QmuPartitionEnum;
+-	      else if (strcmp(name,"QmuResponsedescriptors")==0) return QmuResponsedescriptorsEnum;
+          else stage=3;
+    }
+    if(stage==3){
+-	      if (strcmp(name,"QmuVariabledescriptors")==0) return QmuVariabledescriptorsEnum;
++	      if (strcmp(name,"QmuNumberofresponses")==0) return QmuNumberofresponsesEnum;
++	      else if (strcmp(name,"QmuPartition")==0) return QmuPartitionEnum;
++	      else if (strcmp(name,"QmuResponsedescriptors")==0) return QmuResponsedescriptorsEnum;
++	      else if (strcmp(name,"QmuVariabledescriptors")==0) return QmuVariabledescriptorsEnum;
+ 	      else if (strcmp(name,"QmuMaterialsRheologyB")==0) return QmuMaterialsRheologyBEnum;
+ 	      else if (strcmp(name,"RiftsNumrifts")==0) return RiftsNumriftsEnum;
+ 	      else if (strcmp(name,"RiftsRiftstruct")==0) return RiftsRiftstructEnum;
+@@ -379,13 +382,13 @@
+ 	      else if (strcmp(name,"HydrologyDCInefficientAnalysis")==0) return HydrologyDCInefficientAnalysisEnum;
+ 	      else if (strcmp(name,"HydrologyDCEfficientAnalysis")==0) return HydrologyDCEfficientAnalysisEnum;
+ 	      else if (strcmp(name,"HydrologySolution")==0) return HydrologySolutionEnum;
+-	      else if (strcmp(name,"MeltingAnalysis")==0) return MeltingAnalysisEnum;
+-	      else if (strcmp(name,"MasstransportAnalysis")==0) return MasstransportAnalysisEnum;
+-	      else if (strcmp(name,"MasstransportSolution")==0) return MasstransportSolutionEnum;
+          else stage=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"FreeSurfaceBaseAnalysis")==0) return FreeSurfaceBaseAnalysisEnum;
++	      if (strcmp(name,"MeltingAnalysis")==0) return MeltingAnalysisEnum;
++	      else if (strcmp(name,"MasstransportAnalysis")==0) return MasstransportAnalysisEnum;
++	      else if (strcmp(name,"MasstransportSolution")==0) return MasstransportSolutionEnum;
++	      else if (strcmp(name,"FreeSurfaceBaseAnalysis")==0) return FreeSurfaceBaseAnalysisEnum;
+ 	      else if (strcmp(name,"FreeSurfaceTopAnalysis")==0) return FreeSurfaceTopAnalysisEnum;
+ 	      else if (strcmp(name,"SurfaceNormalVelocity")==0) return SurfaceNormalVelocityEnum;
+ 	      else if (strcmp(name,"ExtrudeFromBaseAnalysis")==0) return ExtrudeFromBaseAnalysisEnum;
+@@ -502,13 +505,13 @@
+ 	      else if (strcmp(name,"FractionIncrement")==0) return FractionIncrementEnum;
+ 	      else if (strcmp(name,"Friction")==0) return FrictionEnum;
+ 	      else if (strcmp(name,"Internal")==0) return InternalEnum;
+-	      else if (strcmp(name,"MassFlux")==0) return MassFluxEnum;
+-	      else if (strcmp(name,"MeltingOffset")==0) return MeltingOffsetEnum;
+-	      else if (strcmp(name,"Misfit")==0) return MisfitEnum;
+          else stage=5;
+    }
+    if(stage==5){
+-	      if (strcmp(name,"Pressure")==0) return PressureEnum;
++	      if (strcmp(name,"MassFlux")==0) return MassFluxEnum;
++	      else if (strcmp(name,"MeltingOffset")==0) return MeltingOffsetEnum;
++	      else if (strcmp(name,"Misfit")==0) return MisfitEnum;
++	      else if (strcmp(name,"Pressure")==0) return PressureEnum;
+ 	      else if (strcmp(name,"PressurePicard")==0) return PressurePicardEnum;
+ 	      else if (strcmp(name,"QmuPressure")==0) return QmuPressureEnum;
+ 	      else if (strcmp(name,"QmuVx")==0) return QmuVxEnum;
+@@ -625,13 +628,13 @@
+ 	      else if (strcmp(name,"Massfluxatgate")==0) return MassfluxatgateEnum;
+ 	      else if (strcmp(name,"MassfluxatgateName")==0) return MassfluxatgateNameEnum;
+ 	      else if (strcmp(name,"MassfluxatgateSegments")==0) return MassfluxatgateSegmentsEnum;
+-	      else if (strcmp(name,"MisfitName")==0) return MisfitNameEnum;
+-	      else if (strcmp(name,"MisfitModelEnum")==0) return MisfitModelEnumEnum;
+-	      else if (strcmp(name,"MisfitObservation")==0) return MisfitObservationEnum;
+          else stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"MisfitObservationEnum")==0) return MisfitObservationEnumEnum;
++	      if (strcmp(name,"MisfitName")==0) return MisfitNameEnum;
++	      else if (strcmp(name,"MisfitModelEnum")==0) return MisfitModelEnumEnum;
++	      else if (strcmp(name,"MisfitObservation")==0) return MisfitObservationEnum;
++	      else if (strcmp(name,"MisfitObservationEnum")==0) return MisfitObservationEnumEnum;
+ 	      else if (strcmp(name,"MisfitTimeinterpolation")==0) return MisfitTimeinterpolationEnum;
+ 	      else if (strcmp(name,"MisfitWeights")==0) return MisfitWeightsEnum;
+ 	      else if (strcmp(name,"MisfitWeightsEnum")==0) return MisfitWeightsEnumEnum;
+Index: ../trunk-jpl/src/c/modules/modules.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/modules.h	(revision 18092)
++++ ../trunk-jpl/src/c/modules/modules.h	(revision 18093)
+@@ -53,6 +53,7 @@
+ #include "./Exp2Kmlx/Exp2Kmlx.h"
+ #include "./Kml2Expx/Kml2Expx.h"
+ #include "./Krigingx/Krigingx.h"
++#include "./FloatingiceMeltingRatex/FloatingiceMeltingRatex.h"
+ #include "./Mergesolutionfromftogx/Mergesolutionfromftogx.h"
+ #include "./MeshPartitionx/MeshPartitionx.h"
+ #include "./MeshProfileIntersectionx/MeshProfileIntersectionx.h"
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 18092)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp	(revision 18093)
+@@ -18,7 +18,7 @@
+ void CreateParameters(Parameters* parameters,IoModel* iomodel,char* rootpath,FILE* toolkitsoptionsfid,const int solution_type){
+ 
+ 	int         i,j,m,k;
+-	int         numoutputs,materialtype,smb_model;
++	int         numoutputs,materialtype,smb_model,basalforcing_model;
+ 	char**      requestedoutputs = NULL;
+ 	IssmDouble  time;
+ 	bool        isdelta18o;
+@@ -132,6 +132,22 @@
+ 			_error_("Surface mass balance model "<<EnumToStringx(smb_model)<<" not supported yet");
+ 	}
+ 
++	/*Basal forcing parameters*/
++	parameters->AddObject(iomodel->CopyConstantObject(BasalforcingsEnum));
++	iomodel->Constant(&basalforcing_model,BasalforcingsEnum);
++	switch(basalforcing_model){
++		case FloatingMeltRateEnum:
++			/*Nothing to add to parameters*/
++			break;
++		case LinearFloatingMeltRateEnum:
++			parameters->AddObject(iomodel->CopyConstantObject(BasalforcingsDeepwaterMeltingRateEnum));
++			parameters->AddObject(iomodel->CopyConstantObject(BasalforcingsDeepwaterElevationEnum));
++			parameters->AddObject(iomodel->CopyConstantObject(BasalforcingsUpperwaterElevationEnum));
++			break;
++		default:
++			_error_("Basal forcing model "<<EnumToStringx(smb_model)<<" not supported yet");
++	}
++
+ 	/*some parameters that did not come with the iomodel: */
+ 	parameters->AddObject(new IntParam(SolutionTypeEnum,solution_type));
+ 
+Index: ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/.dirstamp
+===================================================================
+Index: ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/.deps/.dirstamp
+===================================================================
+Index: ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/.deps/FloatingiceMeltingRatex.Plo
+===================================================================
+--- ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/.deps/FloatingiceMeltingRatex.Plo	(revision 0)
++++ ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/.deps/FloatingiceMeltingRatex.Plo	(revision 18093)
+@@ -0,0 +1 @@
++# dummy
+Index: ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/.deps/libISSMRose_a-FloatingiceMeltingRatex.r2cpp.Po
+===================================================================
+--- ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/.deps/libISSMRose_a-FloatingiceMeltingRatex.r2cpp.Po	(revision 0)
++++ ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/.deps/libISSMRose_a-FloatingiceMeltingRatex.r2cpp.Po	(revision 18093)
+@@ -0,0 +1 @@
++# dummy
+Index: ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/.deps/libISSMCore_a-FloatingiceMeltingRatex.Po
+===================================================================
+--- ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/.deps/libISSMCore_a-FloatingiceMeltingRatex.Po	(revision 0)
++++ ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/.deps/libISSMCore_a-FloatingiceMeltingRatex.Po	(revision 18093)
+@@ -0,0 +1,1404 @@
++modules/FloatingiceMeltingRatex/libISSMCore_a-FloatingiceMeltingRatex.o \
++  modules/FloatingiceMeltingRatex/libISSMCore_a-FloatingiceMeltingRatex.o:  \
++ modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp \
++  modules/FloatingiceMeltingRatex/./FloatingiceMeltingRatex.h \
++  modules/FloatingiceMeltingRatex/./../../classes/classes.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Contour.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/shared.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./FSanalyticals/fsanalyticals.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./FSanalyticals/../Numerics/types.h \
++  ../.././config.h /usr/include/stdio.h /usr/include/sys/cdefs.h \
++  /usr/include/sys/_symbol_aliasing.h \
++  /usr/include/sys/_posix_availability.h /usr/include/Availability.h \
++  /usr/include/AvailabilityInternal.h /usr/include/_types.h \
++  /usr/include/sys/_types.h /usr/include/machine/_types.h \
++  /usr/include/i386/_types.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./MemOps/MemOps.h \
++  /usr/include/c++/4.2.1/cassert /usr/include/assert.h \
++  /usr/include/stdlib.h /usr/include/sys/wait.h /usr/include/sys/signal.h \
++  /usr/include/sys/appleapiopts.h /usr/include/machine/signal.h \
++  /usr/include/i386/signal.h /usr/include/i386/_structs.h \
++  /usr/include/sys/_structs.h /usr/include/machine/_structs.h \
++  /usr/include/mach/i386/_structs.h /usr/include/sys/resource.h \
++  /usr/include/machine/endian.h /usr/include/i386/endian.h \
++  /usr/include/sys/_endian.h /usr/include/libkern/_OSByteOrder.h \
++  /usr/include/libkern/i386/_OSByteOrder.h /usr/include/alloca.h \
++  /usr/include/machine/types.h /usr/include/i386/types.h \
++  /usr/include/i386/_types.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Bamg/shared.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Bamg/Abs.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Bamg/BigPrimeNumber.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Bamg/BinaryRand.h \
++  /usr/include/c++/4.2.1/cstdlib /usr/include/c++/4.2.1/bits/c++config.h \
++  /usr/include/c++/4.2.1/bits/os_defines.h /usr/include/unistd.h \
++  /usr/include/sys/unistd.h /usr/include/sys/select.h \
++  /usr/include/sys/_select.h /usr/include/c++/4.2.1/bits/cpu_defines.h \
++  /usr/include/c++/4.2.1/cstddef \
++  /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stddef.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Bamg/Exchange.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Bamg/extrema.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Bamg/HeapSort.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Bamg/OppositeAngle.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Bamg/../Numerics/constants.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Elements/elements.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Elements/../Numerics/types.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Enum/Enum.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Enum/./EnumDefinitions.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Exceptions/exceptions.h \
++  /usr/include/c++/4.2.1/exception /usr/include/c++/4.2.1/string \
++  /usr/include/c++/4.2.1/bits/stringfwd.h \
++  /usr/include/c++/4.2.1/bits/char_traits.h \
++  /usr/include/c++/4.2.1/cstring /usr/include/string.h \
++  /usr/include/strings.h /usr/include/c++/4.2.1/bits/stl_algobase.h \
++  /usr/include/c++/4.2.1/climits \
++  /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h \
++  /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/syslimits.h \
++  /Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h \
++  /Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include/syslimits.h \
++  /usr/include/limits.h /usr/include/machine/limits.h \
++  /usr/include/i386/limits.h /usr/include/i386/_limits.h \
++  /usr/include/sys/syslimits.h /usr/include/c++/4.2.1/iosfwd \
++  /usr/include/c++/4.2.1/bits/c++locale.h /usr/include/c++/4.2.1/clocale \
++  /usr/include/locale.h /usr/include/_locale.h \
++  /usr/include/c++/4.2.1/cstdio /usr/include/c++/4.2.1/cstdarg \
++  /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h \
++  /usr/include/c++/4.2.1/bits/c++io.h /usr/include/c++/4.2.1/bits/gthr.h \
++  /usr/include/c++/4.2.1/bits/gthr-default.h /usr/include/pthread.h \
++  /usr/include/pthread_impl.h /usr/include/sched.h /usr/include/time.h \
++  /usr/include/_structs.h /usr/include/c++/4.2.1/cctype \
++  /usr/include/ctype.h /usr/include/runetype.h \
++  /usr/include/c++/4.2.1/bits/postypes.h /usr/include/c++/4.2.1/cwchar \
++  /usr/include/c++/4.2.1/ctime /usr/include/wchar.h \
++  /usr/include/_wctype.h /usr/include/stdint.h \
++  /usr/include/c++/4.2.1/bits/functexcept.h \
++  /usr/include/c++/4.2.1/exception_defines.h \
++  /usr/include/c++/4.2.1/bits/stl_pair.h \
++  /usr/include/c++/4.2.1/bits/cpp_type_traits.h \
++  /usr/include/c++/4.2.1/ext/type_traits.h /usr/include/c++/4.2.1/utility \
++  /usr/include/c++/4.2.1/bits/stl_relops.h \
++  /usr/include/c++/4.2.1/bits/stl_iterator_base_types.h \
++  /usr/include/c++/4.2.1/bits/stl_iterator_base_funcs.h \
++  /usr/include/c++/4.2.1/bits/concept_check.h \
++  /usr/include/c++/4.2.1/bits/stl_iterator.h \
++  /usr/include/c++/4.2.1/debug/debug.h /usr/include/c++/4.2.1/memory \
++  /usr/include/c++/4.2.1/bits/allocator.h \
++  /usr/include/c++/4.2.1/bits/c++allocator.h \
++  /usr/include/c++/4.2.1/ext/new_allocator.h /usr/include/c++/4.2.1/new \
++  /usr/include/c++/4.2.1/bits/stl_construct.h \
++  /usr/include/c++/4.2.1/bits/stl_uninitialized.h \
++  /usr/include/c++/4.2.1/bits/stl_raw_storage_iter.h \
++  /usr/include/c++/4.2.1/limits \
++  /usr/include/c++/4.2.1/bits/ostream_insert.h \
++  /usr/include/c++/4.2.1/bits/stl_function.h \
++  /usr/include/c++/4.2.1/bits/basic_string.h \
++  /usr/include/c++/4.2.1/ext/atomicity.h \
++  /usr/include/c++/4.2.1/bits/atomic_word.h \
++  /usr/include/c++/4.2.1/algorithm /usr/include/c++/4.2.1/bits/stl_algo.h \
++  /usr/include/c++/4.2.1/bits/stl_heap.h \
++  /usr/include/c++/4.2.1/bits/stl_tempbuf.h \
++  /usr/include/c++/4.2.1/bits/basic_string.tcc \
++  /usr/include/c++/4.2.1/iostream /usr/include/c++/4.2.1/ostream \
++  /usr/include/c++/4.2.1/ios /usr/include/c++/4.2.1/bits/localefwd.h \
++  /usr/include/c++/4.2.1/bits/ios_base.h \
++  /usr/include/c++/4.2.1/bits/locale_classes.h \
++  /usr/include/c++/4.2.1/streambuf \
++  /usr/include/c++/4.2.1/bits/streambuf.tcc \
++  /usr/include/c++/4.2.1/bits/basic_ios.h \
++  /usr/include/c++/4.2.1/bits/streambuf_iterator.h \
++  /usr/include/c++/4.2.1/bits/locale_facets.h \
++  /usr/include/c++/4.2.1/cwctype /usr/include/wctype.h \
++  /usr/include/c++/4.2.1/bits/ctype_base.h \
++  /usr/include/c++/4.2.1/bits/ctype_inline.h \
++  /usr/include/c++/4.2.1/bits/codecvt.h \
++  /usr/include/c++/4.2.1/bits/time_members.h \
++  /usr/include/c++/4.2.1/bits/messages_members.h \
++  /usr/include/c++/4.2.1/bits/basic_ios.tcc \
++  /usr/include/c++/4.2.1/bits/ostream.tcc /usr/include/c++/4.2.1/locale \
++  /usr/include/c++/4.2.1/bits/locale_facets.tcc \
++  /usr/include/c++/4.2.1/typeinfo /usr/include/c++/4.2.1/istream \
++  /usr/include/c++/4.2.1/bits/istream.tcc /usr/include/c++/4.2.1/sstream \
++  /usr/include/c++/4.2.1/bits/sstream.tcc /usr/include/c++/4.2.1/iomanip \
++  /usr/include/c++/4.2.1/functional \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/io.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/./Disk/diskio.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/./Print/Print.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/./Comm/IssmComm.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/./Comm/../../../toolkits/mpi/issmmpi.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/./Comm/../../../toolkits/mpi/../../shared/Numerics/types.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/mpich/install/include/mpi.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/mpich/install/include/mpio.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/mpich/install/include/mpi.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/mpich/install/include/mpicxx.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/./Comm/../../../toolkits/mpi/./commops/commops.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/./Comm/../../../toolkits/mpi/./commops/../../../shared/Numerics/types.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/./Comm/../../../toolkits/mpi/./commops/../../../shared/io/Comm/IssmComm.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/./Comm/../../../toolkits/mpi/./commops/../../mpi/issmmpi.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Exp/exp.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Exp/../Numerics/recast.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Exp/../Exceptions/exceptions.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Exp/../MemOps/MemOps.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Matrix/matrix.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Matrix/../Numerics/types.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/numerics.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/./Verbosity.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/./GaussPoints.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/./../../shared/Numerics/types.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/./isnan.h \
++  /usr/include/math.h /usr/include/architecture/i386/math.h \
++  /usr/include/AvailabilityMacros.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/./recast.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/./types.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/./constants.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/./OptPars.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/././types.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Sorting/sorting.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./String/sharedstring.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Threads/issm_threads.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./TriMesh/trimesh.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/./LatLong/latlong.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../datastructures/datastructures.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../datastructures/./DataSet.h \
++  /usr/include/c++/4.2.1/vector /usr/include/c++/4.2.1/bits/stl_vector.h \
++  /usr/include/c++/4.2.1/bits/stl_bvector.h \
++  /usr/include/c++/4.2.1/bits/vector.tcc \
++  modules/FloatingiceMeltingRatex/./../../classes/./../datastructures/./Object.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Vertices.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Vertex.h \
++  modules/FloatingiceMeltingRatex/./../../classes/././classes.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/Exceptions/exceptions.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/toolkits.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/petscincludes.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscmat.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscvec.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscis.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscsys.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscconf.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscfix.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscversion.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscmath.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscerror.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscviewertypes.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscoptions.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petsclog.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscsys.h \
++  /usr/include/memory.h \
++  /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/xmmintrin.h \
++  /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/mmintrin.h \
++  /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/mm_malloc.h \
++  /usr/include/errno.h /usr/include/sys/errno.h \
++  /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/emmintrin.h \
++  /usr/include/sys/param.h /usr/include/sys/types.h \
++  /usr/include/machine/param.h /usr/include/i386/param.h \
++  /usr/include/i386/_param.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscsftypes.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscviewer.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscksp.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscpc.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscdmtypes.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscdrawtypes.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/patches/petscpatches.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/patches/./SolverEnum.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/patches/../../toolkitsenums.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/patches/../../../shared/io/Comm/IssmComm.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/objects/petscobjects.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/objects/./PetscMat.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/objects/./../petscincludes.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/objects/./../../../shared/Numerics/types.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/objects/./PetscVec.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/objects/./PetscSolver.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./mpi/issmmpi.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./metis/metisincludes.h \
++  /Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/metis.h \
++  /usr/include/inttypes.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./metis/patches/metispatches.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./triangle/triangleincludes.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/toolkitobjects.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./Vector.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../../shared/Enum/Enum.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../petsc/petscincludes.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/issmtoolkit.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmAbsMat.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../toolkitsenums.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../../shared/Numerics/types.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmAbsVec.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmDenseMat.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././IssmSeqVec.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././../../shared/shared.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../../shared/shared.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../gsl/gslincludes.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../gsl/../../shared/Numerics/types.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmMat.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../ToolkitOptions.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././IssmToolkitUtils.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmSeqVec.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmVec.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../../shared/Enum/Enum.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../../shared/Exceptions/exceptions.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../../shared/MemOps/MemOps.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmSolver.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmMpiDenseMat.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../../datastructures/datastructures.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../mumps/mumpsincludes.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../mumps/../../shared/Numerics/types.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././Bucket.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././../../datastructures/datastructures.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././../toolkitsenums.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././IssmMpiVec.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././../../shared/Exceptions/exceptions.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././../../shared/MemOps/MemOps.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././../../shared/io/io.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././../mpi/issmmpi.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmMpiSparseMat.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././SparseRow.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmMpiVec.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./Matrix.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./Solver.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/././Matrix.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/././Vector.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./toolkitsenums.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./issm/issmtoolkit.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./ToolkitOptions.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Nodes.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Contours.h \
++  modules/FloatingiceMeltingRatex/./../../classes/././Contour.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Node.h \
++  modules/FloatingiceMeltingRatex/./../../classes/././DofIndexing.h \
++  modules/FloatingiceMeltingRatex/./../../classes/././../shared/Numerics/types.h \
++  modules/FloatingiceMeltingRatex/./../../classes/././Update.h \
++  modules/FloatingiceMeltingRatex/./../../classes/././../shared/shared.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Profiler.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./DependentObject.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./IndependentObject.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Segment.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/Numerics/constants.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Massfluxatgate.h \
++  modules/FloatingiceMeltingRatex/./../../classes/././Definition.h \
++  modules/FloatingiceMeltingRatex/./../../classes/././Elements/Element.h \
++  modules/FloatingiceMeltingRatex/./../../classes/././Elements/../../datastructures/datastructures.h \
++  modules/FloatingiceMeltingRatex/./../../classes/././Elements/../../toolkits/toolkits.h \
++  modules/FloatingiceMeltingRatex/./../../classes/././Elements/../Update.h \
++  modules/FloatingiceMeltingRatex/./../../classes/././Elements/Elements.h \
++  modules/FloatingiceMeltingRatex/./../../classes/././FemModel.h \
++  modules/FloatingiceMeltingRatex/./../../classes/././../toolkits/toolkits.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Misfit.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../modules/SurfaceAreax/SurfaceAreax.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../modules/SurfaceAreax/../../shared/shared.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../classes/Params/Parameters.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../classes/Params/../../datastructures/datastructures.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../classes/Params/../../shared/shared.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Constraints/Constraints.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Constraints/../../datastructures/datastructures.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Constraints/../../shared/shared.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Constraints/Constraint.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Constraints/../../toolkits/toolkits.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Constraints/SpcStatic.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Constraints/SpcTransient.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Constraints/SpcDynamic.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Loads/Loads.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Loads/../../datastructures/datastructures.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Loads/Load.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Loads/../Update.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Loads/Friction.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Loads/Numericalflux.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Loads/./Load.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Loads/Riftfront.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Loads/Penpair.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Loads/../Node.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Loads/../Elements/Element.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Loads/Pengrid.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/Elements.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/Element.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/Penta.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/./Element.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/./ElementHook.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/./PentaRef.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/../../shared/Exceptions/exceptions.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/../../shared/Enum/Enum.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/PentaRef.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/Seg.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/./SegRef.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/SegRef.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/Tria.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/./TriaRef.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/TriaRef.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/Tetra.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/./TetraRef.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/TetraRef.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Elements/ElementHook.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Options/Option.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Options/../../shared/shared.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Options/../../datastructures/datastructures.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Options/Options.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Options/./GenericOption.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Options/./../../shared/shared.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Options/./../../datastructures/datastructures.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Options/././OptionUtilities.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Options/././../../shared/Exceptions/exceptions.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Options/././../../shared/Enum/Enum.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Options/./././Option.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Options/GenericOption.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Options/OptionUtilities.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/Inputs.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/../../datastructures/datastructures.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/../../shared/shared.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/Input.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/BoolInput.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/./Input.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/DoubleInput.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/IntInput.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/TetraInput.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/../Elements/TetraRef.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/PentaInput.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/../Elements/PentaRef.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/TriaInput.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/../Elements/TriaRef.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/SegInput.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/../Elements/SegRef.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/ControlInput.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/DatasetInput.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Inputs/TransientInput.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./ExternalResults/Results.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./ExternalResults/../../datastructures/datastructures.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./ExternalResults/ExternalResult.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./ExternalResults/../Node.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./ExternalResults/GenericExternalResult.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./ExternalResults/./ExternalResult.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./ExternalResults/../../shared/shared.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Materials/Materials.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Materials/../../datastructures/datastructures.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Materials/Material.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Materials/../Update.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Materials/Matice.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Materials/./Material.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Materials/../Hook.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Materials/../../datastructures/datastructures.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Materials/Matpar.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/GenericParam.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/./Param.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/./../../datastructures/datastructures.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/./../Node.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/../../shared/shared.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/BoolParam.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/DoubleMatParam.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/DoubleTransientMatParam.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/DoubleMatArrayParam.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/DoubleParam.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/DoubleVecParam.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/IntParam.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/IntVecParam.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/IntMatParam.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/FileParam.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/Parameters.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/Param.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/MatrixParam.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/VectorParam.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/StringArrayParam.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/StringParam.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/TransientParam.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Params/DataSetParam.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./matrix/matrixobjects.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./matrix/./ElementMatrix.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./matrix/./../../datastructures/datastructures.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./matrix/./../../toolkits/toolkits.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./matrix/./../../shared/shared.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./matrix/./ElementVector.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./gauss/gaussobjects.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./gauss/./Gauss.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./gauss/./GaussSeg.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./gauss/./../../shared/Numerics/types.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./gauss/././Gauss.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./gauss/./GaussTria.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./gauss/./GaussTetra.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./gauss/./GaussPenta.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./kriging/krigingobjects.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./kriging/./Variogram.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./kriging/./../../datastructures/datastructures.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./kriging/./GaussianVariogram.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./kriging/././Variogram.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./kriging/./ExponentialVariogram.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./kriging/./SphericalVariogram.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./kriging/./PowerVariogram.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./kriging/./Quadtree.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./kriging/./Observation.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./kriging/./Observations.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./kriging/./../../shared/shared.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Hook.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./DofIndexing.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./IoModel.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./../shared/Enum/Enum.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./Update.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./FemModel.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./GiaDeflectionCoreArgs.h \
++  modules/FloatingiceMeltingRatex/./../../classes/./RiftStruct.h \
++  modules/FloatingiceMeltingRatex/../../shared/shared.h \
++  modules/FloatingiceMeltingRatex/../../toolkits/toolkits.h
++
++modules/FloatingiceMeltingRatex/./FloatingiceMeltingRatex.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/classes.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Contour.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/shared.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./FSanalyticals/fsanalyticals.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./FSanalyticals/../Numerics/types.h:
++
++../.././config.h:
++
++/usr/include/stdio.h:
++
++/usr/include/sys/cdefs.h:
++
++/usr/include/sys/_symbol_aliasing.h:
++
++/usr/include/sys/_posix_availability.h:
++
++/usr/include/Availability.h:
++
++/usr/include/AvailabilityInternal.h:
++
++/usr/include/_types.h:
++
++/usr/include/sys/_types.h:
++
++/usr/include/machine/_types.h:
++
++/usr/include/i386/_types.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./MemOps/MemOps.h:
++
++/usr/include/c++/4.2.1/cassert:
++
++/usr/include/assert.h:
++
++/usr/include/stdlib.h:
++
++/usr/include/sys/wait.h:
++
++/usr/include/sys/signal.h:
++
++/usr/include/sys/appleapiopts.h:
++
++/usr/include/machine/signal.h:
++
++/usr/include/i386/signal.h:
++
++/usr/include/i386/_structs.h:
++
++/usr/include/sys/_structs.h:
++
++/usr/include/machine/_structs.h:
++
++/usr/include/mach/i386/_structs.h:
++
++/usr/include/sys/resource.h:
++
++/usr/include/machine/endian.h:
++
++/usr/include/i386/endian.h:
++
++/usr/include/sys/_endian.h:
++
++/usr/include/libkern/_OSByteOrder.h:
++
++/usr/include/libkern/i386/_OSByteOrder.h:
++
++/usr/include/alloca.h:
++
++/usr/include/machine/types.h:
++
++/usr/include/i386/types.h:
++
++/usr/include/i386/_types.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Bamg/shared.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Bamg/Abs.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Bamg/BigPrimeNumber.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Bamg/BinaryRand.h:
++
++/usr/include/c++/4.2.1/cstdlib:
++
++/usr/include/c++/4.2.1/bits/c++config.h:
++
++/usr/include/c++/4.2.1/bits/os_defines.h:
++
++/usr/include/unistd.h:
++
++/usr/include/sys/unistd.h:
++
++/usr/include/sys/select.h:
++
++/usr/include/sys/_select.h:
++
++/usr/include/c++/4.2.1/bits/cpu_defines.h:
++
++/usr/include/c++/4.2.1/cstddef:
++
++/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stddef.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Bamg/Exchange.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Bamg/extrema.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Bamg/HeapSort.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Bamg/OppositeAngle.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Bamg/../Numerics/constants.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Elements/elements.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Elements/../Numerics/types.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Enum/Enum.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Enum/./EnumDefinitions.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Exceptions/exceptions.h:
++
++/usr/include/c++/4.2.1/exception:
++
++/usr/include/c++/4.2.1/string:
++
++/usr/include/c++/4.2.1/bits/stringfwd.h:
++
++/usr/include/c++/4.2.1/bits/char_traits.h:
++
++/usr/include/c++/4.2.1/cstring:
++
++/usr/include/string.h:
++
++/usr/include/strings.h:
++
++/usr/include/c++/4.2.1/bits/stl_algobase.h:
++
++/usr/include/c++/4.2.1/climits:
++
++/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h:
++
++/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/syslimits.h:
++
++/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h:
++
++/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include/syslimits.h:
++
++/usr/include/limits.h:
++
++/usr/include/machine/limits.h:
++
++/usr/include/i386/limits.h:
++
++/usr/include/i386/_limits.h:
++
++/usr/include/sys/syslimits.h:
++
++/usr/include/c++/4.2.1/iosfwd:
++
++/usr/include/c++/4.2.1/bits/c++locale.h:
++
++/usr/include/c++/4.2.1/clocale:
++
++/usr/include/locale.h:
++
++/usr/include/_locale.h:
++
++/usr/include/c++/4.2.1/cstdio:
++
++/usr/include/c++/4.2.1/cstdarg:
++
++/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stdarg.h:
++
++/usr/include/c++/4.2.1/bits/c++io.h:
++
++/usr/include/c++/4.2.1/bits/gthr.h:
++
++/usr/include/c++/4.2.1/bits/gthr-default.h:
++
++/usr/include/pthread.h:
++
++/usr/include/pthread_impl.h:
++
++/usr/include/sched.h:
++
++/usr/include/time.h:
++
++/usr/include/_structs.h:
++
++/usr/include/c++/4.2.1/cctype:
++
++/usr/include/ctype.h:
++
++/usr/include/runetype.h:
++
++/usr/include/c++/4.2.1/bits/postypes.h:
++
++/usr/include/c++/4.2.1/cwchar:
++
++/usr/include/c++/4.2.1/ctime:
++
++/usr/include/wchar.h:
++
++/usr/include/_wctype.h:
++
++/usr/include/stdint.h:
++
++/usr/include/c++/4.2.1/bits/functexcept.h:
++
++/usr/include/c++/4.2.1/exception_defines.h:
++
++/usr/include/c++/4.2.1/bits/stl_pair.h:
++
++/usr/include/c++/4.2.1/bits/cpp_type_traits.h:
++
++/usr/include/c++/4.2.1/ext/type_traits.h:
++
++/usr/include/c++/4.2.1/utility:
++
++/usr/include/c++/4.2.1/bits/stl_relops.h:
++
++/usr/include/c++/4.2.1/bits/stl_iterator_base_types.h:
++
++/usr/include/c++/4.2.1/bits/stl_iterator_base_funcs.h:
++
++/usr/include/c++/4.2.1/bits/concept_check.h:
++
++/usr/include/c++/4.2.1/bits/stl_iterator.h:
++
++/usr/include/c++/4.2.1/debug/debug.h:
++
++/usr/include/c++/4.2.1/memory:
++
++/usr/include/c++/4.2.1/bits/allocator.h:
++
++/usr/include/c++/4.2.1/bits/c++allocator.h:
++
++/usr/include/c++/4.2.1/ext/new_allocator.h:
++
++/usr/include/c++/4.2.1/new:
++
++/usr/include/c++/4.2.1/bits/stl_construct.h:
++
++/usr/include/c++/4.2.1/bits/stl_uninitialized.h:
++
++/usr/include/c++/4.2.1/bits/stl_raw_storage_iter.h:
++
++/usr/include/c++/4.2.1/limits:
++
++/usr/include/c++/4.2.1/bits/ostream_insert.h:
++
++/usr/include/c++/4.2.1/bits/stl_function.h:
++
++/usr/include/c++/4.2.1/bits/basic_string.h:
++
++/usr/include/c++/4.2.1/ext/atomicity.h:
++
++/usr/include/c++/4.2.1/bits/atomic_word.h:
++
++/usr/include/c++/4.2.1/algorithm:
++
++/usr/include/c++/4.2.1/bits/stl_algo.h:
++
++/usr/include/c++/4.2.1/bits/stl_heap.h:
++
++/usr/include/c++/4.2.1/bits/stl_tempbuf.h:
++
++/usr/include/c++/4.2.1/bits/basic_string.tcc:
++
++/usr/include/c++/4.2.1/iostream:
++
++/usr/include/c++/4.2.1/ostream:
++
++/usr/include/c++/4.2.1/ios:
++
++/usr/include/c++/4.2.1/bits/localefwd.h:
++
++/usr/include/c++/4.2.1/bits/ios_base.h:
++
++/usr/include/c++/4.2.1/bits/locale_classes.h:
++
++/usr/include/c++/4.2.1/streambuf:
++
++/usr/include/c++/4.2.1/bits/streambuf.tcc:
++
++/usr/include/c++/4.2.1/bits/basic_ios.h:
++
++/usr/include/c++/4.2.1/bits/streambuf_iterator.h:
++
++/usr/include/c++/4.2.1/bits/locale_facets.h:
++
++/usr/include/c++/4.2.1/cwctype:
++
++/usr/include/wctype.h:
++
++/usr/include/c++/4.2.1/bits/ctype_base.h:
++
++/usr/include/c++/4.2.1/bits/ctype_inline.h:
++
++/usr/include/c++/4.2.1/bits/codecvt.h:
++
++/usr/include/c++/4.2.1/bits/time_members.h:
++
++/usr/include/c++/4.2.1/bits/messages_members.h:
++
++/usr/include/c++/4.2.1/bits/basic_ios.tcc:
++
++/usr/include/c++/4.2.1/bits/ostream.tcc:
++
++/usr/include/c++/4.2.1/locale:
++
++/usr/include/c++/4.2.1/bits/locale_facets.tcc:
++
++/usr/include/c++/4.2.1/typeinfo:
++
++/usr/include/c++/4.2.1/istream:
++
++/usr/include/c++/4.2.1/bits/istream.tcc:
++
++/usr/include/c++/4.2.1/sstream:
++
++/usr/include/c++/4.2.1/bits/sstream.tcc:
++
++/usr/include/c++/4.2.1/iomanip:
++
++/usr/include/c++/4.2.1/functional:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/io.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/./Disk/diskio.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/./Print/Print.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/./Comm/IssmComm.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/./Comm/../../../toolkits/mpi/issmmpi.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/./Comm/../../../toolkits/mpi/../../shared/Numerics/types.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/mpich/install/include/mpi.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/mpich/install/include/mpio.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/mpich/install/include/mpi.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/mpich/install/include/mpicxx.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/./Comm/../../../toolkits/mpi/./commops/commops.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/./Comm/../../../toolkits/mpi/./commops/../../../shared/Numerics/types.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/./Comm/../../../toolkits/mpi/./commops/../../../shared/io/Comm/IssmComm.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./io/./Comm/../../../toolkits/mpi/./commops/../../mpi/issmmpi.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Exp/exp.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Exp/../Numerics/recast.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Exp/../Exceptions/exceptions.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Exp/../MemOps/MemOps.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Matrix/matrix.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Matrix/../Numerics/types.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/numerics.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/./Verbosity.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/./GaussPoints.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/./../../shared/Numerics/types.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/./isnan.h:
++
++/usr/include/math.h:
++
++/usr/include/architecture/i386/math.h:
++
++/usr/include/AvailabilityMacros.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/./recast.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/./types.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/./constants.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/./OptPars.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Numerics/././types.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Sorting/sorting.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./String/sharedstring.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./Threads/issm_threads.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./TriMesh/trimesh.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/./LatLong/latlong.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../datastructures/datastructures.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../datastructures/./DataSet.h:
++
++/usr/include/c++/4.2.1/vector:
++
++/usr/include/c++/4.2.1/bits/stl_vector.h:
++
++/usr/include/c++/4.2.1/bits/stl_bvector.h:
++
++/usr/include/c++/4.2.1/bits/vector.tcc:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../datastructures/./Object.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Vertices.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Vertex.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/././classes.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/Exceptions/exceptions.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/toolkits.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/petscincludes.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscmat.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscvec.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscis.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscsys.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscconf.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscfix.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscversion.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscmath.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscerror.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscviewertypes.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscoptions.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petsclog.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscsys.h:
++
++/usr/include/memory.h:
++
++/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/xmmintrin.h:
++
++/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/mmintrin.h:
++
++/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/mm_malloc.h:
++
++/usr/include/errno.h:
++
++/usr/include/sys/errno.h:
++
++/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/emmintrin.h:
++
++/usr/include/sys/param.h:
++
++/usr/include/sys/types.h:
++
++/usr/include/machine/param.h:
++
++/usr/include/i386/param.h:
++
++/usr/include/i386/_param.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscsftypes.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscviewer.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscksp.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscpc.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscdmtypes.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/petscdrawtypes.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/patches/petscpatches.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/patches/./SolverEnum.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/patches/../../toolkitsenums.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/patches/../../../shared/io/Comm/IssmComm.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/objects/petscobjects.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/objects/./PetscMat.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/objects/./../petscincludes.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/objects/./../../../shared/Numerics/types.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/objects/./PetscVec.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./petsc/objects/./PetscSolver.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./mpi/issmmpi.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./metis/metisincludes.h:
++
++/Users/seroussi/Desktop/issmuci/trunk-jpl//externalpackages/petsc/install/include/metis.h:
++
++/usr/include/inttypes.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./metis/patches/metispatches.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./triangle/triangleincludes.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/toolkitobjects.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./Vector.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../../shared/Enum/Enum.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../petsc/petscincludes.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/issmtoolkit.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmAbsMat.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../toolkitsenums.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../../shared/Numerics/types.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmAbsVec.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmDenseMat.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././IssmSeqVec.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././../../shared/shared.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../../shared/shared.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../gsl/gslincludes.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../gsl/../../shared/Numerics/types.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmMat.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../ToolkitOptions.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././IssmToolkitUtils.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmSeqVec.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmVec.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../../shared/Enum/Enum.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../../shared/Exceptions/exceptions.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../../shared/MemOps/MemOps.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmSolver.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmMpiDenseMat.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../../datastructures/datastructures.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../mumps/mumpsincludes.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./../mumps/../../shared/Numerics/types.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././Bucket.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././../../datastructures/datastructures.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././../toolkitsenums.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././IssmMpiVec.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././../../shared/Exceptions/exceptions.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././../../shared/MemOps/MemOps.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././../../shared/io/io.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././../mpi/issmmpi.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmMpiSparseMat.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/././SparseRow.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./../issm/./IssmMpiVec.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./Matrix.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/./Solver.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/././Matrix.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./objects/././Vector.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./toolkitsenums.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./issm/issmtoolkit.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../toolkits/./ToolkitOptions.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Nodes.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Contours.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/././Contour.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Node.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/././DofIndexing.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/././../shared/Numerics/types.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/././Update.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/././../shared/shared.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Profiler.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./DependentObject.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./IndependentObject.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Segment.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/Numerics/constants.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Massfluxatgate.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/././Definition.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/././Elements/Element.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/././Elements/../../datastructures/datastructures.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/././Elements/../../toolkits/toolkits.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/././Elements/../Update.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/././Elements/Elements.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/././FemModel.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/././../toolkits/toolkits.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Misfit.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../modules/SurfaceAreax/SurfaceAreax.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../modules/SurfaceAreax/../../shared/shared.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../classes/Params/Parameters.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../classes/Params/../../datastructures/datastructures.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../classes/Params/../../shared/shared.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Constraints/Constraints.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Constraints/../../datastructures/datastructures.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Constraints/../../shared/shared.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Constraints/Constraint.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Constraints/../../toolkits/toolkits.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Constraints/SpcStatic.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Constraints/SpcTransient.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Constraints/SpcDynamic.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Loads/Loads.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Loads/../../datastructures/datastructures.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Loads/Load.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Loads/../Update.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Loads/Friction.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Loads/Numericalflux.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Loads/./Load.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Loads/Riftfront.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Loads/Penpair.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Loads/../Node.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Loads/../Elements/Element.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Loads/Pengrid.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/Elements.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/Element.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/Penta.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/./Element.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/./ElementHook.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/./PentaRef.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/../../shared/Exceptions/exceptions.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/../../shared/Enum/Enum.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/PentaRef.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/Seg.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/./SegRef.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/SegRef.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/Tria.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/./TriaRef.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/TriaRef.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/Tetra.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/./TetraRef.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/TetraRef.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Elements/ElementHook.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Options/Option.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Options/../../shared/shared.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Options/../../datastructures/datastructures.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Options/Options.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Options/./GenericOption.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Options/./../../shared/shared.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Options/./../../datastructures/datastructures.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Options/././OptionUtilities.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Options/././../../shared/Exceptions/exceptions.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Options/././../../shared/Enum/Enum.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Options/./././Option.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Options/GenericOption.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Options/OptionUtilities.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/Inputs.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/../../datastructures/datastructures.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/../../shared/shared.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/Input.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/BoolInput.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/./Input.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/DoubleInput.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/IntInput.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/TetraInput.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/../Elements/TetraRef.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/PentaInput.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/../Elements/PentaRef.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/TriaInput.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/../Elements/TriaRef.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/SegInput.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/../Elements/SegRef.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/ControlInput.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/DatasetInput.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Inputs/TransientInput.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./ExternalResults/Results.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./ExternalResults/../../datastructures/datastructures.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./ExternalResults/ExternalResult.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./ExternalResults/../Node.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./ExternalResults/GenericExternalResult.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./ExternalResults/./ExternalResult.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./ExternalResults/../../shared/shared.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Materials/Materials.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Materials/../../datastructures/datastructures.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Materials/Material.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Materials/../Update.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Materials/Matice.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Materials/./Material.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Materials/../Hook.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Materials/../../datastructures/datastructures.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Materials/Matpar.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/GenericParam.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/./Param.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/./../../datastructures/datastructures.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/./../Node.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/../../shared/shared.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/BoolParam.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/DoubleMatParam.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/DoubleTransientMatParam.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/DoubleMatArrayParam.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/DoubleParam.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/DoubleVecParam.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/IntParam.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/IntVecParam.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/IntMatParam.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/FileParam.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/Parameters.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/Param.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/MatrixParam.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/VectorParam.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/StringArrayParam.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/StringParam.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/TransientParam.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Params/DataSetParam.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./matrix/matrixobjects.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./matrix/./ElementMatrix.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./matrix/./../../datastructures/datastructures.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./matrix/./../../toolkits/toolkits.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./matrix/./../../shared/shared.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./matrix/./ElementVector.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./gauss/gaussobjects.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./gauss/./Gauss.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./gauss/./GaussSeg.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./gauss/./../../shared/Numerics/types.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./gauss/././Gauss.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./gauss/./GaussTria.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./gauss/./GaussTetra.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./gauss/./GaussPenta.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./kriging/krigingobjects.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./kriging/./Variogram.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./kriging/./../../datastructures/datastructures.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./kriging/./GaussianVariogram.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./kriging/././Variogram.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./kriging/./ExponentialVariogram.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./kriging/./SphericalVariogram.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./kriging/./PowerVariogram.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./kriging/./Quadtree.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./kriging/./Observation.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./kriging/./Observations.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./kriging/./../../shared/shared.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Hook.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./DofIndexing.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./IoModel.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./../shared/Enum/Enum.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./Update.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./FemModel.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./GiaDeflectionCoreArgs.h:
++
++modules/FloatingiceMeltingRatex/./../../classes/./RiftStruct.h:
++
++modules/FloatingiceMeltingRatex/../../shared/shared.h:
++
++modules/FloatingiceMeltingRatex/../../toolkits/toolkits.h:
+Index: ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp	(revision 0)
++++ ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp	(revision 18093)
+@@ -0,0 +1,39 @@
++/*!\file FloatingiceMeltingRatex
++ * \brief: calculates Floating ice melting rate
++ */
++
++#include "./FloatingiceMeltingRatex.h"
++#include "../../shared/shared.h"
++#include "../../toolkits/toolkits.h"
++
++void FloatingiceMeltingRatex(FemModel* femmodel){/*{{{*/
++
++	/*Intermediaties*/
++	int  basalforcing_model;
++
++	/*First, get SMB model from parameters*/
++	femmodel->parameters->FindParam(&basalforcing_model,BasalforcingsEnum);
++
++	/*branch to correct module*/
++	switch(basalforcing_model){
++		case FloatingMeltRateEnum:
++			/*Nothing to be done*/
++			break;
++		case LinearFloatingMeltRateEnum:
++			if(VerboseSolution())_printf_("	call Linear Floating melting rate module\n");
++			LinearFloatingiceMeltingRatex(femmodel);
++			break;
++		default:
++			_error_("Basal forcing model "<<EnumToStringx(basalforcing_model)<<" not supported yet");
++	}
++
++}/*}}}*/
++
++void LinearFloatingiceMeltingRatex(FemModel* femmodel){/*{{{*/
++
++	for(int i=0;i<femmodel->elements->Size();i++){
++		Element* element=dynamic_cast<Element*>(femmodel->elements->GetObjectByOffset(i));
++		element->LinearFloatingiceMeltingRate();
++	}
++
++}/*}}}*/
+Index: ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.h	(revision 0)
++++ ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.h	(revision 18093)
+@@ -0,0 +1,14 @@
++/*!\file:  FloatingiceMeltingRatex.h
++ * \brief header file for Floatingice melting rate
++ */ 
++
++#ifndef _FloatingiceMeltingRatex_H
++#define _FloatingiceMeltingRatex_H
++
++#include "../../classes/classes.h"
++
++/* local prototypes: */
++void FloatingiceMeltingRatex(FemModel* femmodel);
++void LinearFloatingiceMeltingRatex(FemModel* femmodel);
++
++#endif  /* _FloatingiceMeltingRatex_H*/
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 18092)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 18093)
+@@ -316,6 +316,8 @@
+ 					./modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp\
+ 					./modules/InputUpdateFromVectorx/InputUpdateFromVectorx.h\
+ 					./modules/InputUpdateFromVectorx/InputUpdateFromVectorx.cpp\
++					./modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.h\
++					./modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp\
+ 					./modules/ConfigureObjectsx/ConfigureObjectsx.h\
+ 					./modules/ConfigureObjectsx/ConfigureObjectsx.cpp\
+ 					./modules/SpcNodesx/SpcNodesx.h\
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18092)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18093)
+@@ -112,6 +112,7 @@
+ 		bool       IsIceInElement();
+ 		bool	     IsInput(int name);
+ 		bool       IsFloating(); 
++		void       LinearFloatingiceMeltingRate(); 
+ 		ElementVector*  NewElementVector(int approximation_enum=NoneApproximationEnum);
+ 		ElementMatrix*  NewElementMatrix(int approximation_enum=NoneApproximationEnum);
+ 		ElementMatrix*  NewElementMatrixCoupling(int number_nodes,int approximation_enum=NoneApproximationEnum);
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18092)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18093)
+@@ -891,6 +891,27 @@
+ 	else return false;
+ }
+ /*}}}*/
++void       Element::LinearFloatingiceMeltingRate(){/*{{{*/
++
++	int numvertices      = this->GetNumberOfVertices();
++	IssmDouble  deepwaterel,upperwaterel,deepwatermelt;
++	IssmDouble* base     = xNew<IssmDouble>(numvertices);
++	IssmDouble* values   = xNew<IssmDouble>(numvertices);
++
++	parameters->FindParam(&deepwaterel,BasalforcingsDeepwaterElevationEnum);
++	parameters->FindParam(&upperwaterel,BasalforcingsUpperwaterElevationEnum);
++	parameters->FindParam(&deepwatermelt,BasalforcingsDeepwaterMeltingRateEnum);
++
++	this->GetInputListOnVertices(base,BaseEnum);
++	for(int i=0;i<numvertices;i++){
++		if(base[i]>upperwaterel)      values[i]=0;
++		else if (base[i]<deepwaterel) values[i]=deepwatermelt;
++		else values[i]=deepwatermelt*(base[i]-upperwaterel)/(deepwaterel-upperwaterel);
++	}
++
++	this->AddInput(BasalforcingsFloatingiceMeltingRateEnum,values,P1Enum);
++
++}/*}}}*/
+ ElementVector* Element::NewElementVector(int approximation_enum){/*{{{*/
+ 	return new ElementVector(nodes,this->GetNumberOfNodes(),this->parameters,approximation_enum);
+ }
+Index: ../trunk-jpl/src/m/classes/linearbasalforcings.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/linearbasalforcings.m	(revision 0)
++++ ../trunk-jpl/src/m/classes/linearbasalforcings.m	(revision 18093)
+@@ -0,0 +1,92 @@
++%LINEAR BASAL FORCINGS class definition
++%
++%   Usage:
++%      linearbasalforcings=linearbasalforcings();
++
++classdef basalforcings
++	properties (SetAccess=public) 
++		groundedice_melting_rate  = NaN;
++		deepwater_melting_rate    = NaN;
++		deepwater_elevation       = NaN;
++		upperwater_elevation      = NaN;
++		geothermalflux            = NaN;
++	end
++	methods
++     function createxml(obj,fid) % {{{
++            fprintf(fid, '\n\n');
++            fprintf(fid, '%s\n', '<!-- basalforcings -->');
++			 fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="melting_rate" type="',            class(obj.melting_rate),'" default="',              num2str(obj.melting_rate),'">',              '     <section name="basalforcings" />','     <help> basal melting rate (positive if melting) [m/yr] </help>','</parameter>');
++             fprintf(fid,'%s%s%s%s%s\n%s\n%s\n',        '<parameter key ="geothermalflux" type="',          class(obj.geothermalflux),'" default="',            num2str(obj.geothermalflux),'">',            '     <section name="basalforcings" />','     <help> geothermal heat flux [W/m^2] </help>','</parameter>');
++             
++        end % }}}
++		function obj = linearbasalforcings(varargin) % {{{
++			switch nargin
++				case 0
++					obj=setdefaultparameters(obj);
++				case 1
++					obj=structtoobj(linearbasalforcings(),varargin{1});
++				otherwise
++					error('constructor not supported');
++			end
++		end % }}}
++		function self = initialize(self,md) % {{{
++
++			if isnan(self.groundedice_melting_rate),
++				self.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
++				disp('      no basalforcings.groundedice_melting_rate specified: values set as zero');
++			end
++
++		end % }}}
++		function obj = setdefaultparameters(obj) % {{{
++
++			%default values for melting parameterization
++			obj.deepwater_melting_rate = 50;
++			obj.deepwater_elevation    = -800;
++			obj.upperwater_elevation   = -400;
++
++		end % }}}
++		function md = checkconsistency(obj,md,solution,analyses) % {{{
++
++			if ismember(MasstransportAnalysisEnum(),analyses) & ~(solution==TransientSolutionEnum() & md.transient.ismasstransport==0),
++				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'forcing',1);
++				md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'forcing',1);
++			end
++			if ismember(BalancethicknessAnalysisEnum(),analyses),
++				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'size',[md.mesh.numberofvertices 1]);
++				md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'size',[md.mesh.numberofvertices 1]);
++			end
++			if ismember(ThermalAnalysisEnum(),analyses) & ~(solution==TransientSolutionEnum() & md.transient.isthermal==0),
++				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'forcing',1);
++				md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'numel',1);
++				md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','numel',1);
++				md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<',0,'numel',1);
++				md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'forcing',1,'>=',0);
++			end
++		end % }}}
++		function disp(obj) % {{{
++			disp(sprintf('   basal forcings parameters:'));
++
++			fielddisplay(obj,'groundedice_melting_rate','basal melting rate (positive if melting) [m/yr]');
++			fielddisplay(obj,'deepwater_melting_rate','basal melting rate (positive if melting applied for floating ice whith base < deepwater_elevation) [m/yr]');
++			fielddisplay(obj,'deepwater_elevation','elevation of ocean deepwater [m]');
++			fielddisplay(obj,'upperwater_elevation','elevation of ocean upperwater [m]');
++			fielddisplay(obj,'geothermalflux','geothermal heat flux [W/m^2]');
++
++		end % }}}
++		function marshall(obj,md,fid) % {{{
++
++			yts=365.0*24.0*3600.0;
++
++			floatingice_melting_rate=zeros(size(groundedice_melting_rate));
++			floatingice_melting_rate(find(md.geometry.base<=deepwater_elevation))=deepwater_melting_rate;
++			pos=find(md.geometry.base>deepwater_elevation & md.geometry.base<upperwater_elevation);
++			floatingice_melting_rate(pos)=deepwater_melting_rate*(md.geometry.base(pos)-upperwater_elevation)/(deepwater_elevation-upperwater_elevation);
++			WriteData(fid,'enum',BasalforcingsEnum(),'data',LinearFloatingMeltRateEnum(),'format','Integer');
++			WriteData(fid,'object',obj,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
++			WriteData(fid,'object',obj,'fieldname','deepwater_melting_rate','format','Double','enum',BasalforcingsDeepwaterMeltingRateEnum(),'scale',1./yts)
++			WriteData(fid,'object',obj,'fieldname','deepwater_elevation','format','Double','enum',BasalforcingsDeepwaterElevationEnum())
++			WriteData(fid,'object',obj,'fieldname','upperwater_elevation','format','Double','enum',BasalforcingsUpperwaterElevationEnum())
++			WriteData(fid,'object',obj,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
++		end % }}}
++	end
++end
+Index: ../trunk-jpl/src/m/classes/basalforcings.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/basalforcings.py	(revision 18092)
++++ ../trunk-jpl/src/m/classes/basalforcings.py	(revision 18093)
+@@ -65,6 +65,7 @@
+ 
+ 		yts=365.0*24.0*3600.0
+ 
++		WriteData(fid,'enum',BasalforcingsEnum(),'data',FloatingMeltRateEnum(),'format','Integer');
+ 		WriteData(fid,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
+ 		WriteData(fid,'object',self,'fieldname','floatingice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
+ 		WriteData(fid,'object',self,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1)
+Index: ../trunk-jpl/src/m/classes/basalforcings.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/basalforcings.m	(revision 18092)
++++ ../trunk-jpl/src/m/classes/basalforcings.m	(revision 18093)
+@@ -69,6 +69,7 @@
+ 
+ 			yts=365.0*24.0*3600.0;
+ 
++			WriteData(fid,'enum',BasalforcingsEnum(),'data',FloatingMeltRateEnum(),'format','Integer');
+ 			WriteData(fid,'object',obj,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
+ 			WriteData(fid,'object',obj,'fieldname','floatingice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
+ 			WriteData(fid,'object',obj,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
+Index: ../trunk-jpl/src/m/enum/BasalforcingsDeepwaterMeltingRateEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/BasalforcingsDeepwaterMeltingRateEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/BasalforcingsDeepwaterMeltingRateEnum.m	(revision 18093)
+@@ -0,0 +1,11 @@
++function macro=BasalforcingsDeepwaterMeltingRateEnum()
++%BASALFORCINGSDEEPWATERMELTINGRATEENUM - Enum of BasalforcingsDeepwaterMeltingRate
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=BasalforcingsDeepwaterMeltingRateEnum()
++
++macro=StringToEnum('BasalforcingsDeepwaterMeltingRate');
+Index: ../trunk-jpl/src/m/enum/BasalforcingsDeepwaterElevationEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/BasalforcingsDeepwaterElevationEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/BasalforcingsDeepwaterElevationEnum.m	(revision 18093)
+@@ -0,0 +1,11 @@
++function macro=BasalforcingsDeepwaterElevationEnum()
++%BASALFORCINGSDEEPWATERELEVATIONENUM - Enum of BasalforcingsDeepwaterElevation
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=BasalforcingsDeepwaterElevationEnum()
++
++macro=StringToEnum('BasalforcingsDeepwaterElevation');
+Index: ../trunk-jpl/src/m/enum/LinearFloatingMeltRateEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/LinearFloatingMeltRateEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/LinearFloatingMeltRateEnum.m	(revision 18093)
+@@ -0,0 +1,11 @@
++function macro=LinearFloatingMeltRateEnum()
++%LINEARFLOATINGMELTRATEENUM - Enum of LinearFloatingMeltRate
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=LinearFloatingMeltRateEnum()
++
++macro=StringToEnum('LinearFloatingMeltRate');
+Index: ../trunk-jpl/src/m/enum/FloatingMeltRateEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/FloatingMeltRateEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/FloatingMeltRateEnum.m	(revision 18093)
+@@ -0,0 +1,11 @@
++function macro=FloatingMeltRateEnum()
++%FLOATINGMELTRATEENUM - Enum of FloatingMeltRate
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=FloatingMeltRateEnum()
++
++macro=StringToEnum('FloatingMeltRate');
+Index: ../trunk-jpl/src/m/enum/BasalforcingsUpperwaterElevationEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/BasalforcingsUpperwaterElevationEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/BasalforcingsUpperwaterElevationEnum.m	(revision 18093)
+@@ -0,0 +1,11 @@
++function macro=BasalforcingsUpperwaterElevationEnum()
++%BASALFORCINGSUPPERWATERELEVATIONENUM - Enum of BasalforcingsUpperwaterElevation
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=BasalforcingsUpperwaterElevationEnum()
++
++macro=StringToEnum('BasalforcingsUpperwaterElevation');
+Index: ../trunk-jpl/src/m/enum/BasalforcingsEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/BasalforcingsEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/BasalforcingsEnum.m	(revision 18093)
+@@ -0,0 +1,11 @@
++function macro=BasalforcingsEnum()
++%BASALFORCINGSENUM - Enum of Basalforcings
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=BasalforcingsEnum()
++
++macro=StringToEnum('Basalforcings');
+Index: ../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- ../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 18092)
++++ ../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 18093)
+@@ -37,12 +37,15 @@
+ def BalancethicknessSpcthicknessEnum(): return StringToEnum("BalancethicknessSpcthickness")[0]
+ def BalancethicknessStabilizationEnum(): return StringToEnum("BalancethicknessStabilization")[0]
+ def BalancethicknessThickeningRateEnum(): return StringToEnum("BalancethicknessThickeningRate")[0]
++def BasalforcingsEnum(): return StringToEnum("Basalforcings")[0]
+ def BasalforcingsGeothermalfluxEnum(): return StringToEnum("BasalforcingsGeothermalflux")[0]
+ def BasalforcingsGroundediceMeltingRateEnum(): return StringToEnum("BasalforcingsGroundediceMeltingRate")[0]
+ def BasalforcingsFloatingiceMeltingRateEnum(): return StringToEnum("BasalforcingsFloatingiceMeltingRate")[0]
+ def BasalforcingsDeepwaterMeltingRateEnum(): return StringToEnum("BasalforcingsDeepwaterMeltingRate")[0]
+ def BasalforcingsDeepwaterElevationEnum(): return StringToEnum("BasalforcingsDeepwaterElevation")[0]
+ def BasalforcingsUpperwaterElevationEnum(): return StringToEnum("BasalforcingsUpperwaterElevation")[0]
++def FloatingMeltRateEnum(): return StringToEnum("FloatingMeltRate")[0]
++def LinearFloatingMeltRateEnum(): return StringToEnum("LinearFloatingMeltRate")[0]
+ def BedEnum(): return StringToEnum("Bed")[0]
+ def BaseEnum(): return StringToEnum("Base")[0]
+ def ConstantsGEnum(): return StringToEnum("ConstantsG")[0]
Index: /issm/oecreview/Archive/17984-18295/ISSM-18093-18094.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18093-18094.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18093-18094.diff	(revision 18296)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 18093)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 18094)
+@@ -182,6 +182,10 @@
+ 				femmodel->RequestedOutputsx(&femmodel->results,&outputs[0],3);
+ 			}
+ 		}
++
++		/*Calculate new Basal melting on Floating ice*/
++		FloatingiceMeltingRatex(femmodel);
++		
+ 		if(isgia){
+ 			if(VerboseSolution()) _printf0_("   computing glacial isostatic adjustment\n");
+ 			#ifdef _HAVE_GIA_
Index: /issm/oecreview/Archive/17984-18295/ISSM-18094-18095.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18094-18095.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18094-18095.diff	(revision 18296)
@@ -0,0 +1,51 @@
+Index: ../trunk-jpl/test/NightlyRun/test292.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test292.m	(revision 0)
++++ ../trunk-jpl/test/NightlyRun/test292.m	(revision 18095)
+@@ -0,0 +1,34 @@
++md=triangle(model(),'../Exp/Square.exp',150000.);
++md=setmask(md,'all','');
++md=parameterize(md,'../Par/SquareShelf.par');
++md=setflowequation(md,'SSA','all');
++md.cluster=generic('name',oshostname(),'np',3);
++md.basalforcings=linearbasalforcings(md.basalforcings);
++md=solve(md,TransientSolutionEnum());
++
++%Fields and tolerances to track changes
++field_names     ={'Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3'};
++field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
++field_values={...
++	(md.results.TransientSolution(1).Vx),...
++	(md.results.TransientSolution(1).Vy),...
++	(md.results.TransientSolution(1).Vel),...
++	(md.results.TransientSolution(1).Pressure),...
++	(md.results.TransientSolution(1).Base),...
++	(md.results.TransientSolution(1).Surface),...
++	(md.results.TransientSolution(1).Thickness),...
++	(md.results.TransientSolution(2).Vx),...
++	(md.results.TransientSolution(2).Vy),...
++	(md.results.TransientSolution(2).Vel),...
++	(md.results.TransientSolution(2).Pressure),...
++	(md.results.TransientSolution(2).Base),...
++	(md.results.TransientSolution(2).Surface),...
++	(md.results.TransientSolution(2).Thickness),...
++	(md.results.TransientSolution(3).Vx),...
++	(md.results.TransientSolution(3).Vy),...
++	(md.results.TransientSolution(3).Vel),...
++	(md.results.TransientSolution(3).Pressure),...
++	(md.results.TransientSolution(3).Base),...
++	(md.results.TransientSolution(3).Surface),...
++	(md.results.TransientSolution(3).Thickness),...
++	};
+Index: ../trunk-jpl/test/NightlyRun/IdToName.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/IdToName.m	(revision 18094)
++++ ../trunk-jpl/test/NightlyRun/IdToName.m	(revision 18095)
+@@ -78,6 +78,7 @@
+ 	case 285, name='SquareShelfStressHOHigherOrder';
+ 	case 290, name='SquareShelfStressFSP2P1';
+ 	case 291, name='SquareShelfStressFSP4z';
++	case 292, name='SquareShelfTranSSA2dFloatingMeltParam';
+ 	case 301, name='SquareSheetConstrainedStressSSA2d';
+ 	case 302, name='SquareSheetConstrainedStressSIA2d';
+ 	case 303, name='SquareSheetConstrainedStressSIASSA2d';
Index: /issm/oecreview/Archive/17984-18295/ISSM-18095-18096.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18095-18096.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18095-18096.diff	(revision 18296)
@@ -0,0 +1,55 @@
+Index: ../trunk-jpl/src/m/classes/linearbasalforcings.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/linearbasalforcings.m	(revision 18095)
++++ ../trunk-jpl/src/m/classes/linearbasalforcings.m	(revision 18096)
+@@ -3,7 +3,7 @@
+ %   Usage:
+ %      linearbasalforcings=linearbasalforcings();
+ 
+-classdef basalforcings
++classdef linearbasalforcings
+ 	properties (SetAccess=public) 
+ 		groundedice_melting_rate  = NaN;
+ 		deepwater_melting_rate    = NaN;
+@@ -49,11 +49,15 @@
+ 
+ 			if ismember(MasstransportAnalysisEnum(),analyses) & ~(solution==TransientSolutionEnum() & md.transient.ismasstransport==0),
+ 				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'forcing',1);
+-				md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'forcing',1);
++				md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'numel',1);
++				md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','numel',1);
++				md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<',0,'numel',1);
+ 			end
+ 			if ismember(BalancethicknessAnalysisEnum(),analyses),
+ 				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'size',[md.mesh.numberofvertices 1]);
+-				md = checkfield(md,'fieldname','basalforcings.floatingice_melting_rate','NaN',1,'size',[md.mesh.numberofvertices 1]);
++				md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'numel',1);
++				md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','numel',1);
++				md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<',0,'numel',1);
+ 			end
+ 			if ismember(ThermalAnalysisEnum(),analyses) & ~(solution==TransientSolutionEnum() & md.transient.isthermal==0),
+ 				md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'forcing',1);
+@@ -77,16 +81,17 @@
+ 
+ 			yts=365.0*24.0*3600.0;
+ 
+-			floatingice_melting_rate=zeros(size(groundedice_melting_rate));
+-			floatingice_melting_rate(find(md.geometry.base<=deepwater_elevation))=deepwater_melting_rate;
+-			pos=find(md.geometry.base>deepwater_elevation & md.geometry.base<upperwater_elevation);
+-			floatingice_melting_rate(pos)=deepwater_melting_rate*(md.geometry.base(pos)-upperwater_elevation)/(deepwater_elevation-upperwater_elevation);
++			floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
++			floatingice_melting_rate(find(md.geometry.base<=md.basalforcings.deepwater_elevation))=md.basalforcings.deepwater_melting_rate;
++			pos=find(md.geometry.base>md.basalforcings.deepwater_elevation & md.geometry.base<md.basalforcings.upperwater_elevation);
++			floatingice_melting_rate(pos)=md.basalforcings.deepwater_melting_rate*(md.geometry.base(pos)-md.basalforcings.upperwater_elevation)/(md.basalforcings.deepwater_elevation-md.basalforcings.upperwater_elevation);
+ 			WriteData(fid,'enum',BasalforcingsEnum(),'data',LinearFloatingMeltRateEnum(),'format','Integer');
+-			WriteData(fid,'object',obj,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
++			WriteData(fid,'data',floatingice_melting_rate,'format','DoubleMat','enum',BasalforcingsFloatingiceMeltingRateEnum(),'mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
++			WriteData(fid,'object',obj,'fieldname','groundedice_melting_rate','format','DoubleMat','enum',BasalforcingsGroundediceMeltingRateEnum(),'mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
++			WriteData(fid,'object',obj,'fieldname','geothermalflux','enum',BasalforcingsGeothermalfluxEnum(),'format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
+ 			WriteData(fid,'object',obj,'fieldname','deepwater_melting_rate','format','Double','enum',BasalforcingsDeepwaterMeltingRateEnum(),'scale',1./yts)
+ 			WriteData(fid,'object',obj,'fieldname','deepwater_elevation','format','Double','enum',BasalforcingsDeepwaterElevationEnum())
+ 			WriteData(fid,'object',obj,'fieldname','upperwater_elevation','format','Double','enum',BasalforcingsUpperwaterElevationEnum())
+-			WriteData(fid,'object',obj,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1);
+ 		end % }}}
+ 	end
+ end
Index: /issm/oecreview/Archive/17984-18295/ISSM-18096-18097.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18096-18097.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18096-18097.diff	(revision 18296)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/test/Archives/Archive292.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive292.nc
+===================================================================
+--- ../trunk-jpl/test/Archives/Archive292.nc	(revision 18096)
++++ ../trunk-jpl/test/Archives/Archive292.nc	(revision 18097)
+
+Property changes on: ../trunk-jpl/test/Archives/Archive292.nc
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
Index: /issm/oecreview/Archive/17984-18295/ISSM-18099-18100.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18099-18100.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18099-18100.diff	(revision 18296)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 18099)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 18100)
+@@ -439,7 +439,6 @@
+ 					./cores/meshdeformation_core.cpp\
+ 					./cores/damage_core.cpp\
+ 					./cores/levelsetfunctionslope_core.cpp\
+-					./analyses/DamageEvolutionAnalysis.cpp\
+ 					./modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp\
+ 					./classes/Loads/Riftfront.cpp\
+ 					./modules/ConstraintsStatex/RiftConstraintsState.cpp\
Index: /issm/oecreview/Archive/17984-18295/ISSM-18100-18101.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18100-18101.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18100-18101.diff	(revision 18296)
@@ -0,0 +1,82 @@
+Index: ../trunk-jpl/src/m/solve/solve.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.py	(revision 18100)
++++ ../trunk-jpl/src/m/solve/solve.py	(revision 18101)
+@@ -32,6 +32,7 @@
+  
+ 	   extra options:
+ 	      - loadonly : does not solve. only load results
++		  - checkconsistency : 'yes' or 'no' (default is 'yes'), ensures checks on consistency of model
+  
+ 	   Examples:
+ 	      md=solve(md,StressbalanceSolutionEnum);
+@@ -47,15 +48,16 @@
+ 	cluster=md.cluster
+ 
+ 	#check model consistency
+-	print "checking model consistency"
+-	if solutionenum == FlaimSolutionEnum():
+-		md.private.isconsistent=True
+-		md.mesh.checkconsistency(md,solutionenum)
+-		md.flaim.checkconsistency(md,solutionenum)
+-		if not md.private.isconsistent:
+-			raise RuntimeError("Model not consistent, see messages above.")
+-	else:
+-		ismodelselfconsistent(md)
++	if m.strcmpi(options.getfieldvalue('checkconsistency','yes'),'no'):
++		print "checking model consistency"
++		if solutionenum == FlaimSolutionEnum():
++			md.private.isconsistent=True
++			md.mesh.checkconsistency(md,solutionenum)
++			md.flaim.checkconsistency(md,solutionenum)
++			if not md.private.isconsistent:
++				raise RuntimeError("Model not consistent, see messages above.")
++		else:
++			ismodelselfconsistent(md)
+ 
+ 	#First, build a runtime name that is unique
+ 	c=datetime.datetime.now()
+Index: ../trunk-jpl/src/m/solve/solve.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.m	(revision 18100)
++++ ../trunk-jpl/src/m/solve/solve.m	(revision 18101)
+@@ -20,6 +20,7 @@
+ %  extra options:
+ %      - loadonly    : does not solve. only load results
+ %      - runtimename : true or false (default is true), makes name unique
++%      - checkconsistency : 'yes' or 'no' (default is 'yes'), ensures checks on consistency of model
+ %
+ %   Examples:
+ %      md=solve(md,StressbalanceSolutionEnum);
+@@ -35,18 +36,20 @@
+ cluster=md.cluster;
+ 
+ %check model consistency
+-if md.verbose.solution,
+-	disp('checking model consistency');
+-end
+-if (solutionenum == FlaimSolutionEnum())
+-	md.private.isconsistent=true;
+-	md=checkconsistency(md.mesh,md,solutionenum);
+-	md=checkconsistency(md.flaim,md,solutionenum);
+-	if md.private.isconsistent==false,
+-		error('Model not consistent, see messages above');
++if strcmpi(getfieldvalue(options,'checkconsistency','yes'),'no'),
++	if md.verbose.solution,
++		disp('checking model consistency');
+ 	end
+-else
+-	ismodelselfconsistent(md),
++	if (solutionenum == FlaimSolutionEnum())
++		md.private.isconsistent=true;
++		md=checkconsistency(md.mesh,md,solutionenum);
++		md=checkconsistency(md.flaim,md,solutionenum);
++		if md.private.isconsistent==false,
++			error('Model not consistent, see messages above');
++		end
++	else
++		ismodelselfconsistent(md),
++	end
+ end
+ 
+ %First, build a runtime name that is unique
Index: /issm/oecreview/Archive/17984-18295/ISSM-18101-18102.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18101-18102.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18101-18102.diff	(revision 18296)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/src/wrappers/python/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/python/Makefile.am	(revision 18101)
++++ ../trunk-jpl/src/wrappers/python/Makefile.am	(revision 18102)
+@@ -1,5 +1,5 @@
+ AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ @AMPIINCL@
+-#AUTOMAKE_OPTIONS = subdir-objects
++AUTOMAKE_OPTIONS = subdir-objects
+ 
+ EXEEXT=$(PYTHONWRAPPEREXT)
+ 
+Index: ../trunk-jpl/src/wrappers/matlab/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 18101)
++++ ../trunk-jpl/src/wrappers/matlab/Makefile.am	(revision 18102)
+@@ -1,5 +1,5 @@
+ AM_CPPFLAGS = @DAKOTAINCL@ @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @AMPIINCL@
+-#AUTOMAKE_OPTIONS = subdir-objects
++AUTOMAKE_OPTIONS = subdir-objects
+ 
+ EXEEXT=$(MATLABWRAPPEREXT)
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18102-18103.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18102-18103.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18102-18103.diff	(revision 18296)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/m/solve/solve.py
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.py	(revision 18102)
++++ ../trunk-jpl/src/m/solve/solve.py	(revision 18103)
+@@ -48,7 +48,7 @@
+ 	cluster=md.cluster
+ 
+ 	#check model consistency
+-	if m.strcmpi(options.getfieldvalue('checkconsistency','yes'),'no'):
++	if m.strcmpi(options.getfieldvalue('checkconsistency','yes'),'yes'):
+ 		print "checking model consistency"
+ 		if solutionenum == FlaimSolutionEnum():
+ 			md.private.isconsistent=True
+Index: ../trunk-jpl/src/m/solve/solve.m
+===================================================================
+--- ../trunk-jpl/src/m/solve/solve.m	(revision 18102)
++++ ../trunk-jpl/src/m/solve/solve.m	(revision 18103)
+@@ -36,7 +36,7 @@
+ cluster=md.cluster;
+ 
+ %check model consistency
+-if strcmpi(getfieldvalue(options,'checkconsistency','yes'),'no'),
++if strcmpi(getfieldvalue(options,'checkconsistency','yes'),'yes'),
+ 	if md.verbose.solution,
+ 		disp('checking model consistency');
+ 	end
Index: /issm/oecreview/Archive/17984-18295/ISSM-18103-18104.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18103-18104.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18103-18104.diff	(revision 18296)
@@ -0,0 +1,500 @@
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18103)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18104)
+@@ -766,8 +766,8 @@
+ 	/*Go through elements, and request velocity: */
+ 	maxabsvx=-INFINITY;
+ 	for(i=0;i<this->elements->Size();i++){
+-		Element* element=(Element*)this->elements->GetObjectByOffset(i);
+-		element->MaxAbsVx(&element_maxabsvx);
++		Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i));
++		element_maxabsvx=element->inputs->MaxAbs(VxEnum);
+ 		if(element_maxabsvx>maxabsvx) maxabsvx=element_maxabsvx;
+ 	}
+ 
+@@ -790,8 +790,8 @@
+ 	/*Go through elements, and request velocity: */
+ 	maxabsvy=-INFINITY;
+ 	for(i=0;i<this->elements->Size();i++){
+-		Element* element=(Element*)this->elements->GetObjectByOffset(i);
+-		element->MaxAbsVy(&element_maxabsvy);
++		Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i));
++		element_maxabsvy=element->inputs->MaxAbs(VyEnum);
+ 		if(element_maxabsvy>maxabsvy) maxabsvy=element_maxabsvy;
+ 	}
+ 
+@@ -814,8 +814,8 @@
+ 	/*Go through elements, and request velocity: */
+ 	maxabsvz=-INFINITY;
+ 	for(i=0;i<this->elements->Size();i++){
+-		Element* element=(Element*)this->elements->GetObjectByOffset(i);
+-		element->MaxAbsVz(&element_maxabsvz);
++		Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i));
++		element_maxabsvz=element->inputs->MaxAbs(VzEnum);
+ 		if(element_maxabsvz>maxabsvz) maxabsvz=element_maxabsvz;
+ 	}
+ 
+@@ -838,8 +838,8 @@
+ 	/*Go through elements, and request velocity: */
+ 	maxvel=-INFINITY;
+ 	for(i=0;i<this->elements->Size();i++){
+-		Element* element=(Element*)this->elements->GetObjectByOffset(i);
+-		element->MaxVel(&element_maxvel);
++		Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i));
++		element_maxvel = element->inputs->Max(VelEnum);
+ 		if(element_maxvel>maxvel) maxvel=element_maxvel;
+ 	}
+ 
+@@ -862,8 +862,8 @@
+ 	/*Go through elements, and request velocity: */
+ 	maxvx=-INFINITY;
+ 	for(i=0;i<this->elements->Size();i++){
+-		Element* element=(Element*)this->elements->GetObjectByOffset(i);
+-		element->MaxVx(&element_maxvx);
++		Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i));
++		element_maxvx = element->inputs->Max(VxEnum);
+ 		if(element_maxvx>maxvx) maxvx=element_maxvx;
+ 	}
+ 
+@@ -886,8 +886,8 @@
+ 	/*Go through elements, and request velocity: */
+ 	maxvy=-INFINITY;
+ 	for(i=0;i<this->elements->Size();i++){
+-		Element* element=(Element*)this->elements->GetObjectByOffset(i);
+-		element->MaxVy(&element_maxvy);
++		Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i));
++		element_maxvy = element->inputs->Max(VyEnum);
+ 		if(element_maxvy>maxvy) maxvy=element_maxvy;
+ 	}
+ 
+@@ -910,8 +910,8 @@
+ 	/*Go through elements, and request velocity: */
+ 	maxvz=-INFINITY;
+ 	for(i=0;i<this->elements->Size();i++){
+-		Element* element=(Element*)this->elements->GetObjectByOffset(i);
+-		element->MaxVz(&element_maxvz);
++		Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i));
++		element_maxvz = element->inputs->Max(VzEnum);
+ 		if(element_maxvz>maxvz) maxvz=element_maxvz;
+ 	}
+ 
+@@ -934,8 +934,8 @@
+ 	/*Go through elements, and request velocity: */
+ 	minvel=INFINITY;
+ 	for(i=0;i<this->elements->Size();i++){
+-		Element* element=(Element*)this->elements->GetObjectByOffset(i);
+-		element->MinVel(&element_minvel);
++		Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i));
++		element_minvel = element->inputs->Min(VelEnum);
+ 		if(element_minvel<minvel) minvel=element_minvel;
+ 	}
+ 
+@@ -958,8 +958,8 @@
+ 	/*Go through elements, and request velocity: */
+ 	minvx=INFINITY;
+ 	for(i=0;i<this->elements->Size();i++){
+-		Element* element=(Element*)this->elements->GetObjectByOffset(i);
+-		element->MinVx(&element_minvx);
++		Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i));
++		element_minvx = element->inputs->Min(VxEnum);
+ 		if(element_minvx<minvx) minvx=element_minvx;
+ 	}
+ 
+@@ -982,8 +982,8 @@
+ 	/*Go through elements, and request velocity: */
+ 	minvy=INFINITY;
+ 	for(i=0;i<this->elements->Size();i++){
+-		Element* element=(Element*)this->elements->GetObjectByOffset(i);
+-		element->MinVy(&element_minvy);
++		Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i));
++		element_minvy = element->inputs->Min(VyEnum);
+ 		if(element_minvy<minvy) minvy=element_minvy;
+ 	}
+ 
+@@ -1006,8 +1006,8 @@
+ 	/*Go through elements, and request velocity: */
+ 	minvz=INFINITY;
+ 	for(i=0;i<this->elements->Size();i++){
+-		Element* element=(Element*)this->elements->GetObjectByOffset(i);
+-		element->MinVz(&element_minvz);
++		Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i));
++		element_minvz = element->inputs->Min(VzEnum);
+ 		if(element_minvz<minvz) minvz=element_minvz;
+ 	}
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18103)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18104)
+@@ -254,17 +254,6 @@
+ 		virtual void   GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum)=0;
+ 
+ 		virtual void   AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part)=0;
+-		virtual void   MinVel(IssmDouble* pminvel)=0;
+-		virtual void   MaxVel(IssmDouble* pmaxvel)=0;
+-		virtual void   MinVx(IssmDouble* pminvx)=0;
+-		virtual void   MaxVx(IssmDouble* pmaxvx)=0;
+-		virtual void   MaxAbsVx(IssmDouble* pmaxabsvx)=0;
+-		virtual void   MinVy(IssmDouble* pminvy)=0;
+-		virtual void   MaxVy(IssmDouble* pmaxvy)=0;
+-		virtual void   MaxAbsVy(IssmDouble* pmaxabsvy)=0;
+-		virtual void   MinVz(IssmDouble* pminvz)=0;
+-		virtual void   MaxVz(IssmDouble* pmaxvz)=0;
+-		virtual void   MaxAbsVz(IssmDouble* pmaxabsvz)=0;
+ 		virtual IssmDouble MassFlux(IssmDouble* segment)=0;
+ 		virtual IssmDouble MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id)=0;
+ 		virtual void   ElementResponse(IssmDouble* presponse,int response_enum)=0;
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18103)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18104)
+@@ -1854,8 +1854,8 @@
+ 	this->parameters->FindParam(&C,TimesteppingCflCoefficientEnum);
+ 
+ 	/*Get for Vx and Vy, the max of abs value: */
+-	this->MaxAbsVx(&maxabsvx);
+-	this->MaxAbsVy(&maxabsvy);
++	maxabsvx = this->inputs->MaxAbs(VxEnum);
++	maxabsvy = this->inputs->MaxAbs(VyEnum);
+ 
+ 	/* Get node coordinates and dof list: */
+ 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+@@ -2318,106 +2318,6 @@
+ 	return mass_flux;
+ }
+ /*}}}*/
+-void       Tria::MaxAbsVx(IssmDouble* pmaxabsvx){/*{{{*/
+-
+-	/*Get maximum:*/
+-	IssmDouble maxabsvx=this->inputs->MaxAbs(VxEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxabsvx=maxabsvx;
+-}
+-/*}}}*/
+-void       Tria::MaxAbsVy(IssmDouble* pmaxabsvy){/*{{{*/
+-
+-	/*Get maximum:*/
+-	IssmDouble maxabsvy=this->inputs->MaxAbs(VyEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxabsvy=maxabsvy;
+-}
+-/*}}}*/
+-void       Tria::MaxAbsVz(IssmDouble* pmaxabsvz){/*{{{*/
+-
+-	/*Get maximum:*/
+-	IssmDouble maxabsvz=this->inputs->MaxAbs(VzEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxabsvz=maxabsvz;
+-}
+-/*}}}*/
+-void       Tria::MaxVel(IssmDouble* pmaxvel){/*{{{*/
+-
+-	/*Get maximum:*/
+-	IssmDouble maxvel=this->inputs->Max(VelEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxvel=maxvel;
+-}
+-/*}}}*/
+-void       Tria::MaxVx(IssmDouble* pmaxvx){/*{{{*/
+-
+-	/*Get maximum:*/
+-	IssmDouble maxvx=this->inputs->Max(VxEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxvx=maxvx;
+-}
+-/*}}}*/
+-void       Tria::MaxVy(IssmDouble* pmaxvy){/*{{{*/
+-
+-	/*Get maximum:*/
+-	IssmDouble maxvy=this->inputs->Max(VyEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxvy=maxvy;
+-
+-}
+-/*}}}*/
+-void       Tria::MaxVz(IssmDouble* pmaxvz){/*{{{*/
+-
+-	/*Get maximum:*/
+-	IssmDouble maxvz=this->inputs->Max(VzEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxvz=maxvz;
+-}
+-/*}}}*/
+-void       Tria::MinVel(IssmDouble* pminvel){/*{{{*/
+-
+-	/*Get minimum:*/
+-	IssmDouble minvel=this->inputs->Min(VelEnum);
+-
+-	/*Assign output pointers:*/
+-	*pminvel=minvel;
+-}
+-/*}}}*/
+-void       Tria::MinVx(IssmDouble* pminvx){/*{{{*/
+-
+-	/*Get minimum:*/
+-	IssmDouble minvx=this->inputs->Min(VxEnum);
+-
+-	/*Assign output pointers:*/
+-	*pminvx=minvx;
+-}
+-/*}}}*/
+-void       Tria::MinVy(IssmDouble* pminvy){/*{{{*/
+-
+-	/*Get minimum:*/
+-	IssmDouble minvy=this->inputs->Min(VyEnum);
+-
+-	/*Assign output pointers:*/
+-	*pminvy=minvy;
+-}
+-/*}}}*/
+-void       Tria::MinVz(IssmDouble* pminvz){/*{{{*/
+-
+-	/*Get minimum:*/
+-	IssmDouble minvz=this->inputs->Min(VzEnum);
+-
+-	/*Assign output pointers:*/
+-	*pminvz=minvz;
+-}
+-/*}}}*/
+ void       Tria::ElementResponse(IssmDouble* presponse,int response_enum){/*{{{*/
+ 
+ 	switch(response_enum){
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18103)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18104)
+@@ -114,20 +114,9 @@
+ 		IssmDouble IceVolume(void);
+ 		IssmDouble IceVolumeAboveFloatation(void);
+ 		IssmDouble TotalSmb(void);
+-		void       MinVel(IssmDouble* pminvel);
+-		void       MinVx(IssmDouble* pminvx);
+-		void       MinVy(IssmDouble* pminvy);
+-		void       MinVz(IssmDouble* pminvz);
+ 		IssmDouble MassFlux(IssmDouble* segment);
+ 		IssmDouble MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id);
+-		void       MaxAbsVx(IssmDouble* pmaxabsvx);
+-		void       MaxAbsVy(IssmDouble* pmaxabsvy);
+-		void       MaxAbsVz(IssmDouble* pmaxabsvz);
+ 		void       ElementResponse(IssmDouble* presponse,int response_enum);
+-		void       MaxVel(IssmDouble* pmaxvel);
+-		void       MaxVx(IssmDouble* pmaxvx);
+-		void       MaxVy(IssmDouble* pmaxvy);
+-		void       MaxVz(IssmDouble* pmaxvz);
+ 		IssmDouble Misfit(int modelenum,int observationenum,int weightsenum);
+ 		IssmDouble MisfitArea(int weightsenum);
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18103)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18104)
+@@ -2052,9 +2052,9 @@
+ 	this->parameters->FindParam(&C,TimesteppingCflCoefficientEnum);
+ 
+ 	/*Get for Vx and Vy, the max of abs value: */
+-	this->MaxAbsVx(&maxabsvx);
+-	this->MaxAbsVy(&maxabsvy);
+-	this->MaxAbsVz(&maxabsvz);
++	maxabsvx = this->inputs->MaxAbs(VxEnum);
++	maxabsvy = this->inputs->MaxAbs(VyEnum);
++	maxabsvz = this->inputs->MaxAbs(VzEnum);
+ 
+ 	/* Get node coordinates and dof list: */
+ 	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+@@ -2577,42 +2577,6 @@
+ 	return base*(surface - bed + min( rho_water/rho_ice * bathymetry, 0.) );
+ }
+ /*}}}*/
+-void       Penta::MinVel(IssmDouble* pminvel){/*{{{*/
+-
+-	/*Get minimum:*/
+-	IssmDouble minvel=this->inputs->Min(VelEnum);
+-
+-	/*Assign output pointers:*/
+-	*pminvel=minvel;
+-}
+-/*}}}*/
+-void       Penta::MinVx(IssmDouble* pminvx){/*{{{*/
+-
+-	/*Get minimum:*/
+-	IssmDouble minvx=this->inputs->Min(VxEnum);
+-
+-	/*Assign output pointers:*/
+-	*pminvx=minvx;
+-}
+-/*}}}*/
+-void       Penta::MinVy(IssmDouble* pminvy){/*{{{*/
+-
+-	/*Get minimum:*/
+-	IssmDouble minvy=this->inputs->Min(VyEnum);
+-
+-	/*Assign output pointers:*/
+-	*pminvy=minvy;
+-}
+-/*}}}*/
+-void       Penta::MinVz(IssmDouble* pminvz){/*{{{*/
+-
+-	/*Get minimum:*/
+-	IssmDouble minvz=this->inputs->Min(VzEnum);
+-
+-	/*Assign output pointers:*/
+-	*pminvz=minvz;
+-}
+-/*}}}*/
+ IssmDouble Penta::MassFlux( IssmDouble* segment){/*{{{*/
+ 
+ 	IssmDouble mass_flux=0;
+@@ -2659,70 +2623,6 @@
+ 	return mass_flux;
+ }
+ /*}}}*/
+-void       Penta::MaxAbsVx(IssmDouble* pmaxabsvx){/*{{{*/
+-
+-	/*Get maximum:*/
+-	IssmDouble maxabsvx=this->inputs->MaxAbs(VxEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxabsvx=maxabsvx;
+-}
+-/*}}}*/
+-void       Penta::MaxAbsVy(IssmDouble* pmaxabsvy){/*{{{*/
+-
+-	/*Get maximum:*/
+-	IssmDouble maxabsvy=this->inputs->MaxAbs(VyEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxabsvy=maxabsvy;
+-}
+-/*}}}*/
+-void       Penta::MaxAbsVz(IssmDouble* pmaxabsvz){/*{{{*/
+-
+-	/*Get maximum:*/
+-	IssmDouble maxabsvz=this->inputs->MaxAbs(VzEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxabsvz=maxabsvz;
+-}
+-/*}}}*/
+-void       Penta::MaxVel(IssmDouble* pmaxvel){/*{{{*/
+-
+-	/*Get maximum:*/
+-	IssmDouble maxvel=this->inputs->Max(VelEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxvel=maxvel;
+-
+-}
+-/*}}}*/
+-void       Penta::MaxVx(IssmDouble* pmaxvx){/*{{{*/
+-
+-	/*Get maximum:*/
+-	IssmDouble maxvx=this->inputs->Max(VxEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxvx=maxvx;
+-}
+-/*}}}*/
+-void       Penta::MaxVy(IssmDouble* pmaxvy){/*{{{*/
+-
+-	/*Get maximum:*/
+-	IssmDouble maxvy=this->inputs->Max(VyEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxvy=maxvy;
+-}
+-/*}}}*/
+-void       Penta::MaxVz(IssmDouble* pmaxvz){/*{{{*/
+-
+-	/*Get maximum:*/
+-	IssmDouble maxvz=this->inputs->Max(VzEnum);
+-
+-	/*Assign output pointers:*/
+-	*pmaxvz=maxvz;
+-}
+-/*}}}*/
+ void       Penta::ElementResponse(IssmDouble* presponse,int response_enum){/*{{{*/
+ 
+ 	switch(response_enum){
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 18103)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 18104)
+@@ -111,20 +111,9 @@
+ 		IssmDouble IceVolume(void);
+ 		IssmDouble IceVolumeAboveFloatation(void);
+ 		IssmDouble TotalSmb(void);
+-		void   MinVel(IssmDouble* pminvel);
+-		void   MinVx(IssmDouble* pminvx);
+-		void   MinVy(IssmDouble* pminvy);
+-		void   MinVz(IssmDouble* pminvz);
+ 		IssmDouble MassFlux(IssmDouble* segment);
+ 		IssmDouble MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id);
+-		void   MaxAbsVx(IssmDouble* pmaxabsvx);
+-		void   MaxAbsVy(IssmDouble* pmaxabsvy);
+-		void   MaxAbsVz(IssmDouble* pmaxabsvz);
+-		void   MaxVel(IssmDouble* pmaxvel);
+ 		void   ElementResponse(IssmDouble* presponse,int response_enum);
+-		void   MaxVx(IssmDouble* pmaxvx);
+-		void   MaxVy(IssmDouble* pmaxvy);
+-		void   MaxVz(IssmDouble* pmaxvz);
+ 
+ 		#ifdef _HAVE_GIA_
+ 		void   GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y);
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 18103)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 18104)
+@@ -145,20 +145,9 @@
+ 		IssmDouble IceVolume(void){_error_("not implemented yet");};
+ 		IssmDouble IceVolumeAboveFloatation(void){_error_("not implemented yet");};
+ 		IssmDouble TotalSmb(void){_error_("not implemented yet");};
+-		void       MinVel(IssmDouble* pminvel){_error_("not implemented yet");};
+-		void       MinVx(IssmDouble* pminvx){_error_("not implemented yet");};
+-		void       MinVy(IssmDouble* pminvy){_error_("not implemented yet");};
+-		void       MinVz(IssmDouble* pminvz){_error_("not implemented yet");};
+ 		IssmDouble MassFlux(IssmDouble* segment){_error_("not implemented yet");};
+ 		IssmDouble MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id){_error_("not implemented yet");}
+-		void       MaxAbsVx(IssmDouble* pmaxabsvx){_error_("not implemented yet");};
+-		void       MaxAbsVy(IssmDouble* pmaxabsvy){_error_("not implemented yet");};
+-		void       MaxAbsVz(IssmDouble* pmaxabsvz){_error_("not implemented yet");};
+ 		void       ElementResponse(IssmDouble* presponse,int response_enum){_error_("not implemented yet");};
+-		void       MaxVel(IssmDouble* pmaxvel){_error_("not implemented yet");};
+-		void       MaxVx(IssmDouble* pmaxvx){_error_("not implemented yet");};
+-		void       MaxVy(IssmDouble* pmaxvy){_error_("not implemented yet");};
+-		void       MaxVz(IssmDouble* pmaxvz){_error_("not implemented yet");};
+ 		IssmDouble Misfit(int modelenum,int observationenum,int weightsenum){_error_("not implemented yet");};
+ 		IssmDouble MisfitArea(int weightsenum){_error_("not implemented yet");};
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 18103)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 18104)
+@@ -149,20 +149,9 @@
+ 		IssmDouble IceVolume(void){_error_("not implemented yet");};
+ 		IssmDouble IceVolumeAboveFloatation(void){_error_("not implemented yet");};
+ 		IssmDouble TotalSmb(void){_error_("not implemented yet");};
+-		void       MinVel(IssmDouble* pminvel){_error_("not implemented yet");};
+-		void       MinVx(IssmDouble* pminvx){_error_("not implemented yet");};
+-		void       MinVy(IssmDouble* pminvy){_error_("not implemented yet");};
+-		void       MinVz(IssmDouble* pminvz){_error_("not implemented yet");};
+ 		IssmDouble MassFlux(IssmDouble* segment){_error_("not implemented yet");};
+ 		IssmDouble MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id){_error_("not implemented yet");}
+-		void       MaxAbsVx(IssmDouble* pmaxabsvx){_error_("not implemented yet");};
+-		void       MaxAbsVy(IssmDouble* pmaxabsvy){_error_("not implemented yet");};
+-		void       MaxAbsVz(IssmDouble* pmaxabsvz){_error_("not implemented yet");};
+ 		void       ElementResponse(IssmDouble* presponse,int response_enum){_error_("not implemented yet");};
+-		void       MaxVel(IssmDouble* pmaxvel){_error_("not implemented yet");};
+-		void       MaxVx(IssmDouble* pmaxvx){_error_("not implemented yet");};
+-		void       MaxVy(IssmDouble* pmaxvy){_error_("not implemented yet");};
+-		void       MaxVz(IssmDouble* pmaxvz){_error_("not implemented yet");};
+ 		IssmDouble Misfit(int modelenum,int observationenum,int weightsenum){_error_("not implemented yet");};
+ 		IssmDouble MisfitArea(int weightsenum){_error_("not implemented yet");};
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18104-18105.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18104-18105.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18104-18105.diff	(revision 18296)
@@ -0,0 +1,11 @@
+Index: ../trunk-jpl/src/wrappers/IssmConfig
+===================================================================
+--- ../trunk-jpl/src/wrappers/IssmConfig	(revision 18104)
++++ ../trunk-jpl/src/wrappers/IssmConfig	(revision 18105)
+
+Property changes on: ../trunk-jpl/src/wrappers/IssmConfig
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1,2 ##
++.deps
++.dirstamp
Index: /issm/oecreview/Archive/17984-18295/ISSM-18105-18106.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18105-18106.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18105-18106.diff	(revision 18296)
@@ -0,0 +1,4 @@
+Index: ../trunk-jpl/test/Archives/Archive292.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/17984-18295/ISSM-18106-18107.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18106-18107.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18106-18107.diff	(revision 18296)
@@ -0,0 +1,11 @@
+Index: ../trunk-jpl/src/wrappers/python/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/wrappers/python/Makefile.am	(revision 18106)
++++ ../trunk-jpl/src/wrappers/python/Makefile.am	(revision 18107)
+@@ -1,5 +1,5 @@
+ AM_CPPFLAGS = @DAKOTAINCL@ @PETSCINCL@ @MPIINCL@ @SPOOLESINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ @PYTHONINCL@ @PYTHON_NUMPYINCL@ @AMPIINCL@
+-AUTOMAKE_OPTIONS = subdir-objects
++#AUTOMAKE_OPTIONS = subdir-objects
+ 
+ EXEEXT=$(PYTHONWRAPPEREXT)
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18107-18108.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18107-18108.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18107-18108.diff	(revision 18296)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/test/NightlyRun/IdToName.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/IdToName.py	(revision 18107)
++++ ../trunk-jpl/test/NightlyRun/IdToName.py	(revision 18108)
+@@ -77,6 +77,7 @@
+ 	285  : 'SquareShelfStressHOHigherOrder',
+ 	290  : 'SquareShelfStressFSP2P1',
+ 	291  : 'SquareShelfStressFSP4z',
++	292  : 'SquareShelfTranSSA2dFloatingMeltParam',
+ 	301  : 'SquareSheetConstrainedStressSSA2d',
+ 	302  : 'SquareSheetConstrainedStressSIA2d',
+ 	303  : 'SquareSheetConstrainedStressSIASSA2d',
Index: /issm/oecreview/Archive/17984-18295/ISSM-18108-18109.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18108-18109.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18108-18109.diff	(revision 18296)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/m/interp/interp.py
+===================================================================
+--- ../trunk-jpl/src/m/interp/interp.py	(revision 18108)
++++ ../trunk-jpl/src/m/interp/interp.py	(revision 18109)
+@@ -44,8 +44,10 @@
+ 
+ 	# create sub-vectors that just cover the limits of xi and yi
+ 	# TODO x,y not necessarily a grid, so need a better definition of dx,dy (e.g. average element size)
+-	dx=x[1]-x[0]
+-	dy=y[1]-y[0]
++	dx=500
++	dy=500
++	#dx=x[1]-x[0]
++	#dy=y[1]-y[0]
+ 	xlim=[min(xi)-dx,max(xi)+dx]
+ 	ylim=[min(yi)-dy,max(yi)+dy]
+ 	xflag=npy.logical_and(x>xlim[0],x<xlim[1])
+@@ -75,7 +77,7 @@
+ 		# identify nan's in xi,yi using nearest neighbors
+ 		xyinterp=npy.dstack([xi,yi])[0]
+ 		xg,yg=npy.meshgrid(subx,suby)
+-		xydata=npy.dstack([xg.ravel(),yg.ravel()])[0]
++		xydata=npy.dstack([subx,suby])[0]
+ 		tree=cKDTree(xydata)
+ 		nearest=tree.query(xyinterp)[1]
+ 		pos=npy.nonzero(npy.isnan(subdata[nearest]))
Index: /issm/oecreview/Archive/17984-18295/ISSM-18109-18110.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18109-18110.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18109-18110.diff	(revision 18296)
@@ -0,0 +1,51 @@
+Index: ../trunk-jpl/test/NightlyRun/test292.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test292.py	(revision 0)
++++ ../trunk-jpl/test/NightlyRun/test292.py	(revision 18110)
+@@ -0,0 +1,46 @@
++from MatlabFuncs import *
++from model import *
++from EnumDefinitions import *
++from numpy import *
++from triangle import *
++from setmask import *
++from parameterize import *
++from setflowequation import *
++from solve import *
++from generic import generic
++
++md=triangle(model(),'../Exp/Square.exp',150000)
++md=setmask(md,'all','')
++md=parameterize(md,'../Par/SquareShelf.py')
++md=setflowequation(md,'SSA','all')
++md.cluster=generic('name',oshostname(),'np',3)
++md.basalforcings=linearbasalforcings(md.basalforcings)
++md=solve(md,TransientSolutionEnum())
++
++# Fields and tolerances to track changes
++
++field_names     =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3']
++field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13]
++field_values=[\
++	md.results.TransientSolution[0].Vx,\
++	md.results.TransientSolution[0].Vy,\
++	md.results.TransientSolution[0].Vel,\
++	md.results.TransientSolution[0].Pressure,\
++	md.results.TransientSolution[0].Base,\
++	md.results.TransientSolution[0].Surface,\
++	md.results.TransientSolution[0].Thickness,\
++	md.results.TransientSolution[1].Vx,\
++	md.results.TransientSolution[1].Vy,\
++	md.results.TransientSolution[1].Vel,\
++	md.results.TransientSolution[1].Pressure,\
++	md.results.TransientSolution[1].Base,\
++	md.results.TransientSolution[1].Surface,\
++	md.results.TransientSolution[1].Thickness,\
++	md.results.TransientSolution[2].Vx,\
++	md.results.TransientSolution[2].Vy,\
++	md.results.TransientSolution[2].Vel,\
++	md.results.TransientSolution[2].Pressure,\
++	md.results.TransientSolution[2].Base,\
++	md.results.TransientSolution[2].Surface,\
++	md.results.TransientSolution[2].Thickness,\
++	]
Index: /issm/oecreview/Archive/17984-18295/ISSM-18110-18111.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18110-18111.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18110-18111.diff	(revision 18296)
@@ -0,0 +1,96 @@
+Index: ../trunk-jpl/src/m/classes/linearbasalforcings.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/linearbasalforcings.py	(revision 0)
++++ ../trunk-jpl/src/m/classes/linearbasalforcings.py	(revision 18111)
+@@ -0,0 +1,91 @@
++from fielddisplay import fielddisplay
++from EnumDefinitions import *
++from checkfield import checkfield
++from WriteData import WriteData
++import numpy
++
++class linearbasalforcings(object):
++	"""
++	LINEAR BASAL FORCINGS class definition
++
++	   Usage:
++	      basalforcings=linearbasalforcings();
++	"""
++
++	def __init__(self): # {{{
++		self.floatingice_melting_rate  = float('NaN')
++		self.deepwater_melting_rate    = float('NaN')
++		self.deepwater_elevation       = float('NaN')
++		self.upperwater_elevation      = float('NaN')
++		self.geothermalflux            = float('NaN')
++
++		#set defaults
++		self.setdefaultparameters()
++
++		#}}}
++	def __repr__(self): # {{{
++		string="   linear basal forcings parameters:"
++
++		string="%s\n%s"%(string,fielddisplay(self,"groundedice_melting_rate","basal melting rate (positive if melting) [m/yr]"))
++		string="%s\n%s"%(string,fielddisplay(self,"deepwater_melting_rate","basal melting rate (positive if melting applied for floating ice whith base < deepwater_elevation) [m/yr]"))
++		string="%s\n%s"%(string,fielddisplay(self,"deepwater_elevation","elevation of ocean deepwater [m]"))
++		string="%s\n%s"%(string,fielddisplay(self,"upperwater_elevation","elevation of ocean upper water [m]"))
++		string="%s\n%s"%(string,fielddisplay(self,"geothermalflux","geothermal heat flux [W/m^2]"))
++		return string
++		#}}}
++	def initialize(self,md): # {{{
++
++		if numpy.all(numpy.isnan(self.groundedice_melting_rate)):
++			self.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices,1))
++			print "      no basalforcings.groundedice_melting_rate specified: values set as zero"
++
++		return self
++	#}}}
++	def setdefaultparameters(self): # {{{
++
++		self.deepwater_melting_rate   = 50
++		self.deepwater_elevation      = -800
++		self.upperwater_elevation     = -800
++
++		return self
++	#}}}
++	def checkconsistency(self,md,solution,analyses):    # {{{
++
++		if MasstransportAnalysisEnum() in analyses and not (solution==TransientSolutionEnum() and not md.transient.ismasstransport):
++			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'forcing',1)
++			md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'numel',1);
++			md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','numel',1);
++			md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<',0,'numel',1);
++
++		if BalancethicknessAnalysisEnum() in analyses:
++			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'size',[md.mesh.numberofvertices])
++			md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'numel',1);
++			md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','numel',1);
++			md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<',0,'numel',1);
++
++		if ThermalAnalysisEnum() in analyses and not (solution==TransientSolutionEnum() and not md.transient.isthermal):
++			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'forcing',1)
++			md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'numel',1);
++			md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','numel',1);
++			md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<',0,'numel',1);
++			md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'forcing',1,'>=',0)
++
++		return md
++	# }}}
++	def marshall(self,md,fid):    # {{{
++
++		yts=365.0*24.0*3600.0
++		floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices,1))
++
++		floatingice_melting_rate[numpy.nonzero(md.geometry.base<=md.basalforcings.deepwater_elevation))]=md.basalforcings.deepwater_melting_rate
++		pos=numpy.nonzero(md.geometry.base>md.basalforcings.deepwater_elevation and  md.geometry.base<md.basalforcings.upperwater_elevation)
++		floatingice_melting_rate[pos]=md.basalforcings.deepwater_melting_rate*(md.geometry.base[pos]-md.basalforcings.upperwater_elevation)/(md.basalforcings.deepwater_elevation-md.basalforcings.upperwater_elevation)
++
++		WriteData(fid,'enum',BasalforcingsEnum(),'data',LinearFloatingMeltRateEnum(),'format','Integer');
++		WriteData(fid,'object',self,'fieldname','groundedice_melting_rate','enum',BasalforcingsGroundediceMeltingRateEnum(),'format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
++		WriteData(fid,'data',floatingice_melting_rate,'enum',BasalforcingsFloatingiceMeltingRateEnum(),'format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
++		WriteData(fid,'object',self,'fieldname','geothermalflux','enum',BasalforcingsGeothermalfluxEnum(),'format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1)
++		WriteData(fid,'object',self,'fieldname','deepwater_melting_rate','enum',BasalforcingsDeelwaterMeltingRateEnum(),'format','Double','scale',1./yts)
++		WriteData(fid,'object',self,'fieldname','deepwater_elevation','enum',BasalforcingsDeepwaterElevationEnum(),'format','Double')
++		WriteData(fid,'object',self,'fieldname','upperwater_elevation','enum',BasalforcingsUpperwaterElevationEnum(),'format','Double')
++	# }}}
Index: /issm/oecreview/Archive/17984-18295/ISSM-18111-18112.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18111-18112.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18111-18112.diff	(revision 18296)
@@ -0,0 +1,4 @@
+Index: ../trunk-jpl/test/Archives/Archive801.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/17984-18295/ISSM-18112-18113.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18112-18113.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18112-18113.diff	(revision 18296)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/test/Par/ValleyGlacierShelf.py
+===================================================================
+--- ../trunk-jpl/test/Par/ValleyGlacierShelf.py	(revision 18112)
++++ ../trunk-jpl/test/Par/ValleyGlacierShelf.py	(revision 18113)
+@@ -56,7 +56,8 @@
+ 
+ #Surface mass balance and basal melting
+ md.surfaceforcings.mass_balance=0.3*numpy.ones((md.mesh.numberofvertices,1))
+-md.basalforcings.melting_rate=md.surfaceforcings.mass_balance
++md.basalforcings.groundedice_melting_rate=md.surfaceforcings.mass_balance
++md.basalforcings.floatingice_melting_rate=md.surfaceforcings.mass_balance
+ 
+ #Friction
+ md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices,1))
Index: /issm/oecreview/Archive/17984-18295/ISSM-18113-18114.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18113-18114.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18113-18114.diff	(revision 18296)
@@ -0,0 +1,4 @@
+Index: ../trunk-jpl/test/Archives/Archive801.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/17984-18295/ISSM-18114-18115.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18114-18115.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18114-18115.diff	(revision 18296)
@@ -0,0 +1,124 @@
+Index: ../trunk-jpl/test/NightlyRun/test292.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test292.py	(revision 18114)
++++ ../trunk-jpl/test/NightlyRun/test292.py	(revision 18115)
+@@ -8,6 +8,7 @@
+ from setflowequation import *
+ from solve import *
+ from generic import generic
++from linearbasalforcings import linearbasalforcings
+ 
+ md=triangle(model(),'../Exp/Square.exp',150000)
+ md=setmask(md,'all','')
+Index: ../trunk-jpl/src/m/classes/linearbasalforcings.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/linearbasalforcings.py	(revision 18114)
++++ ../trunk-jpl/src/m/classes/linearbasalforcings.py	(revision 18115)
+@@ -12,16 +12,32 @@
+ 	      basalforcings=linearbasalforcings();
+ 	"""
+ 
+-	def __init__(self): # {{{
+-		self.floatingice_melting_rate  = float('NaN')
+-		self.deepwater_melting_rate    = float('NaN')
+-		self.deepwater_elevation       = float('NaN')
+-		self.upperwater_elevation      = float('NaN')
+-		self.geothermalflux            = float('NaN')
++	def __init__(self,*args): # {{{
+ 
+-		#set defaults
+-		self.setdefaultparameters()
++		if not len(args):
++			print 'empty init'
++			self.groundedice_melting_rate  = float('NaN')
++			self.deepwater_melting_rate    = 0.
++			self.deepwater_elevation       = 0.
++			self.upperwater_elevation      = 0.
++			self.geothermalflux            = float('NaN')
+ 
++			#set defaults
++			self.setdefaultparameters()
++		elif len(args)==1 and args[0].__module__=='basalforcings':
++			print 'converting basalforings to linearbasalforcings'
++			inv=args[0]
++			self.groundedice_melting_rate  = inv.groundedice_melting_rate
++			self.geothermalflux            = inv.geothermalflux
++			self.deepwater_melting_rate    = 0.
++			self.deepwater_elevation       = 0.
++			self.upperwater_elevation      = 0.
++
++			#set defaults
++			self.setdefaultparameters()
++		else:
++			raise Exception('constructor not supported')
++
+ 		#}}}
+ 	def __repr__(self): # {{{
+ 		string="   linear basal forcings parameters:"
+@@ -43,9 +59,9 @@
+ 	#}}}
+ 	def setdefaultparameters(self): # {{{
+ 
+-		self.deepwater_melting_rate   = 50
+-		self.deepwater_elevation      = -800
+-		self.upperwater_elevation     = -800
++		self.deepwater_melting_rate   = 50.0
++		self.deepwater_elevation      = -800.0
++		self.upperwater_elevation     = -200.0
+ 
+ 		return self
+ 	#}}}
+@@ -53,21 +69,21 @@
+ 
+ 		if MasstransportAnalysisEnum() in analyses and not (solution==TransientSolutionEnum() and not md.transient.ismasstransport):
+ 			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'forcing',1)
+-			md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'numel',1);
+-			md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','numel',1);
+-			md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<',0,'numel',1);
++			md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0);
++			md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<',md.basalforcings.upperwater_elevation);
++			md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<',0);
+ 
+ 		if BalancethicknessAnalysisEnum() in analyses:
+ 			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'size',[md.mesh.numberofvertices])
+-			md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'numel',1);
+-			md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','numel',1);
+-			md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<',0,'numel',1);
++			md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0);
++			md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<',md.basalforcings.upperwater_elevation);
++			md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<',0);
+ 
+ 		if ThermalAnalysisEnum() in analyses and not (solution==TransientSolutionEnum() and not md.transient.isthermal):
+ 			md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'forcing',1)
+-			md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'numel',1);
+-			md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','numel',1);
+-			md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<',0,'numel',1);
++			md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0);
++			md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<',md.basalforcings.upperwater_elevation);
++			md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<',0);
+ 			md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'forcing',1,'>=',0)
+ 
+ 		return md
+@@ -75,17 +91,18 @@
+ 	def marshall(self,md,fid):    # {{{
+ 
+ 		yts=365.0*24.0*3600.0
+-		floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices,1))
+ 
+-		floatingice_melting_rate[numpy.nonzero(md.geometry.base<=md.basalforcings.deepwater_elevation))]=md.basalforcings.deepwater_melting_rate
+-		pos=numpy.nonzero(md.geometry.base>md.basalforcings.deepwater_elevation and  md.geometry.base<md.basalforcings.upperwater_elevation)
++		floatingice_melting_rate = numpy.zeros((md.mesh.numberofvertices,1))
++		pos=numpy.nonzero(md.geometry.base<=md.basalforcings.deepwater_elevation)
++		floatingice_melting_rate[pos]=md.basalforcings.deepwater_melting_rate
++		pos=numpy.nonzero(numpy.logical_and(md.geometry.base>md.basalforcings.deepwater_elevation,md.geometry.base<md.basalforcings.upperwater_elevation))
+ 		floatingice_melting_rate[pos]=md.basalforcings.deepwater_melting_rate*(md.geometry.base[pos]-md.basalforcings.upperwater_elevation)/(md.basalforcings.deepwater_elevation-md.basalforcings.upperwater_elevation)
+ 
+ 		WriteData(fid,'enum',BasalforcingsEnum(),'data',LinearFloatingMeltRateEnum(),'format','Integer');
+ 		WriteData(fid,'object',self,'fieldname','groundedice_melting_rate','enum',BasalforcingsGroundediceMeltingRateEnum(),'format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
+ 		WriteData(fid,'data',floatingice_melting_rate,'enum',BasalforcingsFloatingiceMeltingRateEnum(),'format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1)
+ 		WriteData(fid,'object',self,'fieldname','geothermalflux','enum',BasalforcingsGeothermalfluxEnum(),'format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1)
+-		WriteData(fid,'object',self,'fieldname','deepwater_melting_rate','enum',BasalforcingsDeelwaterMeltingRateEnum(),'format','Double','scale',1./yts)
++		WriteData(fid,'object',self,'fieldname','deepwater_melting_rate','enum',BasalforcingsDeepwaterMeltingRateEnum(),'format','Double','scale',1./yts)
+ 		WriteData(fid,'object',self,'fieldname','deepwater_elevation','enum',BasalforcingsDeepwaterElevationEnum(),'format','Double')
+ 		WriteData(fid,'object',self,'fieldname','upperwater_elevation','enum',BasalforcingsUpperwaterElevationEnum(),'format','Double')
+ 	# }}}
Index: /issm/oecreview/Archive/17984-18295/ISSM-18115-18116.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18115-18116.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18115-18116.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/linearbasalforcings.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/linearbasalforcings.py	(revision 18115)
++++ ../trunk-jpl/src/m/classes/linearbasalforcings.py	(revision 18116)
+@@ -61,7 +61,7 @@
+ 
+ 		self.deepwater_melting_rate   = 50.0
+ 		self.deepwater_elevation      = -800.0
+-		self.upperwater_elevation     = -200.0
++		self.upperwater_elevation     = -400.0
+ 
+ 		return self
+ 	#}}}
Index: /issm/oecreview/Archive/17984-18295/ISSM-18116-18117.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18116-18117.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18116-18117.diff	(revision 18296)
@@ -0,0 +1,16 @@
+Index: ../trunk-jpl/examples/SquareIceShelf/Front.exp
+===================================================================
+--- ../trunk-jpl/examples/SquareIceShelf/Front.exp	(revision 18116)
++++ ../trunk-jpl/examples/SquareIceShelf/Front.exp	(revision 18117)
+@@ -3,8 +3,8 @@
+ # Points Count  Value
+ 5 1.
+ # X pos Y pos
+--1000 900000
++-1000 999999
+ -1000 1100000
+ 1100000 1100000
+-1100000 900000
+--1000 900000
++1100000 999999
++-1000 999999
Index: /issm/oecreview/Archive/17984-18295/ISSM-18117-18118.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18117-18118.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18117-18118.diff	(revision 18296)
@@ -0,0 +1,30 @@
+Index: ../trunk-jpl/src/c/classes/Inputs/ControlInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/ControlInput.cpp	(revision 18117)
++++ ../trunk-jpl/src/c/classes/Inputs/ControlInput.cpp	(revision 18118)
+@@ -223,6 +223,12 @@
+ void ControlInput::GetInputDerivativeValue(IssmDouble* derivativevalues, IssmDouble* xyz_list, Gauss* gauss){/*{{{*/
+ 	values->GetInputDerivativeValue(derivativevalues,xyz_list,gauss);
+ }/*}}}*/
++IssmDouble ControlInput::Min(void){/*{{{*/
++
++	return values->Min();
++
++}
++/*}}}*/
+ void ControlInput::SaveValue(void){/*{{{*/
+ 	if(!values) _error_("Values of " << EnumToStringx(this->enum_type) << " not found");
+ 
+Index: ../trunk-jpl/src/c/classes/Inputs/ControlInput.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/ControlInput.h	(revision 18117)
++++ ../trunk-jpl/src/c/classes/Inputs/ControlInput.h	(revision 18118)
+@@ -69,7 +69,7 @@
+ 		IssmDouble InfinityNorm(void){_error_("not implemented yet");};
+ 		IssmDouble Max(void){_error_("not implemented yet");};
+ 		IssmDouble MaxAbs(void){_error_("not implemented yet");};
+-		IssmDouble Min(void){_error_("not implemented yet");};
++		IssmDouble Min(void);
+ 		IssmDouble MinAbs(void){_error_("not implemented yet");};
+ 		void Extrude(void);
+ 		void VerticallyIntegrate(Input* thickness_input);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18118-18119.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18118-18119.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18118-18119.diff	(revision 18296)
@@ -0,0 +1,41 @@
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 18118)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 18119)
+@@ -167,6 +167,7 @@
+   		MATLABINCL="-I$MATLAB_ROOT/extern/include/"
+ 		
+ 		dnl 4. get MEXLIB MEXLINK and MEXEXT (experimental) except for windows
++		AC_MSG_CHECKING([matlab's mex compilation flags])
+   		case "${host_os}" in
+   			*cygwin*) 
+   				if  test $VENDOR = intel-win7-32; then
+@@ -183,14 +184,27 @@
+ 		      MEXLINK=$($MATLAB_ROOT/bin/mex -v 2>&1 < /dev/null | grep LDFLAGS     | sed -e "s/         LDFLAGS            = //g")
+ 	         MEXLIB=$( $MATLAB_ROOT/bin/mex -v 2>&1 < /dev/null | grep CXXLIBS     | sed -e "s/         CXXLIBS            = //g")
+ 		      MEXEXT=$( $MATLAB_ROOT/bin/mex -v 2>&1 < /dev/null | grep LDEXTENSION | sed -e "s/         LDEXTENSION        = //g")
++
++				dnl version 2014 and up
++				if test "x$MEXEXT" = "x" ; then
++					 echo "#include <mex.h>" > conftest.cpp
++					 echo "void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){}" >> conftest.cpp
++					 $MATLAB_ROOT/bin/mex -v -lmex conftest.cpp > conftest.tmp 2>&1 
++					 rm -f conftest.cpp
++					 MEXLINK=$(cat conftest.tmp | grep LDFLAGS  | sed -e "s/LDFLAGS ://g")
++					 MEXLIB=$( cat conftest.tmp | grep LINKLIBS | sed -e "s/LINKLIBS ://g")
++					 MEXEXT=$( cat conftest.tmp | grep LDEXT    | sed -e "s/LDEXT ://g" | awk '{print $[1]}')
++					 rm -f conftest.tmp
++				fi
++
+   			;;
+       esac
++		AC_MSG_RESULT(done)
+ 	   if test "x$MEXEXT" = "x" ; then
+ 			AC_MSG_ERROR([Couldn't find mex... check your installation of matlab])
+ 	   fi
+ 
+ 		AC_SUBST([MATLABINCL])
+-		AC_SUBST([MEX])
+ 		MATLABWRAPPEREXT=$MEXEXT
+ 		AC_SUBST([MATLABWRAPPEREXT])
+ 	   AC_SUBST([MEXLIB]) 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18119-18120.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18119-18120.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18119-18120.diff	(revision 18296)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/jenkins/windows
+===================================================================
+--- ../trunk-jpl/jenkins/windows	(revision 18119)
++++ ../trunk-jpl/jenkins/windows	(revision 18120)
+@@ -99,8 +99,8 @@
+ #by Matlab and runme.m
+ #ex: "'id',[101 102 103]"
+ 
+-#In Windows, we don't yet have MUMPS, can't do full stokes, so exclude all FS runs. Also exclude all runs with Dakota. And exclude higher order runs that have penalties.
+-MATLAB_NROPTIONS="'exclude',[104, 124, 204, 211, 215, 220, 221, 285, 290, 308, 322, 404, 421, 422, 503, 507, 510, 511, 701, 702, 703, 218, 234, 235, 412, 413, 414, 417, 418, 420, 205, 274, 331, 405, 409, 455, 612, 514, 435 280]"
++#In Windows, we don't yet have MUMPS, can't do full stokes, so exclude all FS runs. Also exclude all runs with Dakota. And exclude higher order runs that have penalties. And 800+ tests because we don't want to have --with-development since we do the binaries with this version
++MATLAB_NROPTIONS="'exclude',[104, 124, 204, 211, 215, 220, 221, 285, 290, 308, 322, 404, 421, 422, 503, 507, 510, 511, 701, 702, 703, 218, 234, 235, 412, 413, 414, 417, 418, 420, 205, 274, 331, 405, 409, 455, 612, 514, 435, 280,801,802,803,804,805,291]"
+ PYTHON_NROPTIONS=""
+ 
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18120-18121.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18120-18121.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18120-18121.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/Par/RoundSheetShelf.par
+===================================================================
+--- ../trunk-jpl/test/Par/RoundSheetShelf.par	(revision 18120)
++++ ../trunk-jpl/test/Par/RoundSheetShelf.par	(revision 18121)
+@@ -94,7 +94,7 @@
+ md.timestepping.final_time=5.;
+ 
+ %bathymetry and grounding line migration:
+-md.groundingline.migration='AgressiveMigration';
++md.groundingline.migration='AggressiveMigration';
+ md.geometry.bed=md.geometry.base;
+ pos=find(md.mask.groundedice_levelset<0.); md.geometry.bed(pos)=md.geometry.base(pos)-900.;
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18121-18122.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18121-18122.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18121-18122.diff	(revision 18296)
@@ -0,0 +1,34 @@
+Index: ../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 18121)
++++ ../trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp	(revision 18122)
+@@ -64,7 +64,7 @@
+ 	else if(strcmp(output,"prediction")==0){
+ 
+ 		/*Process Variogram*/
+-		ProcessVariogram(&variogram,options);
++		ProcessVariogram2(&variogram,options);
+ 
+ 		/*partition loop across threads: */
+ 		for(int idx=my_rank;idx<n_interp;idx+=num_procs){
+@@ -155,7 +155,7 @@
+ 	_error_("MPI not available");
+ #endif
+ }/*}}}*/
+-void ProcessVariogram(Variogram **pvariogram,Options* options){/*{{{*/
++void ProcessVariogram2(Variogram **pvariogram,Options* options){/*{{{*/
+ 
+ 	/*Intermediaries*/
+ 	Variogram* variogram = NULL;
+Index: ../trunk-jpl/src/c/modules/Krigingx/Krigingx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/Krigingx/Krigingx.h	(revision 18121)
++++ ../trunk-jpl/src/c/modules/Krigingx/Krigingx.h	(revision 18122)
+@@ -14,6 +14,7 @@
+ int  Krigingx(double** ppredictions,double **perror,double* x, double* y, double* observations, int n_obs,double* x_interp,double* y_interp,int n_interp,Options* options);
+ int  pKrigingx(double** ppredictions,double **perror,double* x, double* y, double* observations, int n_obs,double* x_interp,double* y_interp,int n_interp,Options* options);
+ void ProcessVariogram(Variogram **pvariogram,Options* options);
++void ProcessVariogram2(Variogram **pvariogram,Options* options);
+ 
+ /*threading: */
+ typedef struct{
Index: /issm/oecreview/Archive/17984-18295/ISSM-18122-18123.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18122-18123.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18122-18123.diff	(revision 18296)
@@ -0,0 +1,10 @@
+Index: ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex
+===================================================================
+--- ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex	(revision 18122)
++++ ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex	(revision 18123)
+
+Property changes on: ../trunk-jpl/src/c/modules/FloatingiceMeltingRatex
+___________________________________________________________________
+Added: svn:ignore
+## -0,0 +1 ##
++.deps
Index: /issm/oecreview/Archive/17984-18295/ISSM-18123-18124.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18123-18124.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18123-18124.diff	(revision 18296)
@@ -0,0 +1,101 @@
+Index: ../trunk-jpl/src/c/shared/Numerics/isnan.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/isnan.cpp	(revision 18123)
++++ ../trunk-jpl/src/c/shared/Numerics/isnan.cpp	(revision 18124)
+@@ -1,15 +0,0 @@
+-/*This routine only used by Intel compler: */
+-
+-#ifdef HAVE_CONFIG_H
+-   #include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "isnan.h"
+-
+-#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
+-template <> int xIsNan<adouble> (const adouble& X){
+-  return isnan(X.getValue());
+-}
+-#endif
+Index: ../trunk-jpl/src/c/shared/Numerics/isnan.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/isnan.h	(revision 18123)
++++ ../trunk-jpl/src/c/shared/Numerics/isnan.h	(revision 18124)
+@@ -24,7 +24,9 @@
+ 
+ #if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
+ #include "./types.h"
+-template <> int xIsNan<adouble> (const adouble& X);
++template <> int xIsNan<adouble> (const adouble& X){
++  return isnan(X.getValue());
++}
+ #endif
+ 
+ #endif
+Index: ../trunk-jpl/src/c/shared/MemOps/MemOps.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/MemOps/MemOps.cpp	(revision 18123)
++++ ../trunk-jpl/src/c/shared/MemOps/MemOps.cpp	(revision 18124)
+@@ -1,23 +0,0 @@
+-/*
+- * MemOps.cpp
+- *
+- *  Created on: Sep 10, 2013
+- *      Author: utke
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-   #include <config.h>
+-#else
+-#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+-#endif
+-
+-#include "MemOps.h"
+-
+-#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
+-template <> adouble*  xNew(unsigned int size) {
+-	ensureContiguousLocations(size);
+-	adouble* aT_p=new adouble[size];
+-	assert(aT_p);
+-	return aT_p;
+-}
+-#endif
+Index: ../trunk-jpl/src/c/shared/MemOps/MemOps.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/MemOps/MemOps.h	(revision 18123)
++++ ../trunk-jpl/src/c/shared/MemOps/MemOps.h	(revision 18124)
+@@ -143,7 +143,12 @@
+ 
+ #if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
+ #include "../Numerics/types.h"
+-template <> adouble*  xNew(unsigned int size);
++template <> adouble*  xNew(unsigned int size) {
++	ensureContiguousLocations(size);
++	adouble* aT_p=new adouble[size];
++	assert(aT_p);
++	return aT_p;
++}
+ #endif
+ 
+ #endif
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 18123)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 18124)
+@@ -174,7 +174,6 @@
+ 					./classes/Profiler.cpp\
+ 					./shared/shared.h\
+ 					./shared/MemOps/MemOps.h\
+-					./shared/MemOps/MemOps.cpp\
+ 					./shared/Matrix/matrix.h\
+ 					./shared/Matrix/MatrixUtils.cpp\
+ 					./shared/io/io.h\
+@@ -203,7 +202,6 @@
+ 					./shared/Numerics/GaussPoints.cpp\
+ 					./shared/Numerics/cross.cpp\
+ 					./shared/Numerics/isnan.h\
+-					./shared/Numerics/isnan.cpp\
+ 					./shared/Numerics/cubic.cpp\
+ 					./shared/Numerics/NewtonSolveDnorm.cpp\
+ 					./shared/Numerics/extrema.cpp\
Index: /issm/oecreview/Archive/17984-18295/ISSM-18124-18125.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18124-18125.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18124-18125.diff	(revision 18296)
@@ -0,0 +1,101 @@
+Index: ../trunk-jpl/src/c/shared/Numerics/isnan.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/isnan.cpp	(revision 0)
++++ ../trunk-jpl/src/c/shared/Numerics/isnan.cpp	(revision 18125)
+@@ -0,0 +1,15 @@
++/*This routine only used by Intel compler: */
++
++#ifdef HAVE_CONFIG_H
++   #include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "isnan.h"
++
++#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
++template <> int xIsNan<adouble> (const adouble& X){
++  return isnan(X.getValue());
++}
++#endif
+Index: ../trunk-jpl/src/c/shared/Numerics/isnan.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/isnan.h	(revision 18124)
++++ ../trunk-jpl/src/c/shared/Numerics/isnan.h	(revision 18125)
+@@ -24,9 +24,7 @@
+ 
+ #if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
+ #include "./types.h"
+-template <> int xIsNan<adouble> (const adouble& X){
+-  return isnan(X.getValue());
+-}
++template <> int xIsNan<adouble> (const adouble& X);
+ #endif
+ 
+ #endif
+Index: ../trunk-jpl/src/c/shared/MemOps/MemOps.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/MemOps/MemOps.cpp	(revision 0)
++++ ../trunk-jpl/src/c/shared/MemOps/MemOps.cpp	(revision 18125)
+@@ -0,0 +1,23 @@
++/*
++ * MemOps.cpp
++ *
++ *  Created on: Sep 10, 2013
++ *      Author: utke
++ */
++
++#ifdef HAVE_CONFIG_H
++   #include <config.h>
++#else
++#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
++#endif
++
++#include "MemOps.h"
++
++#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
++template <> adouble*  xNew(unsigned int size) {
++	ensureContiguousLocations(size);
++	adouble* aT_p=new adouble[size];
++	assert(aT_p);
++	return aT_p;
++}
++#endif
+Index: ../trunk-jpl/src/c/shared/MemOps/MemOps.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/MemOps/MemOps.h	(revision 18124)
++++ ../trunk-jpl/src/c/shared/MemOps/MemOps.h	(revision 18125)
+@@ -143,12 +143,7 @@
+ 
+ #if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
+ #include "../Numerics/types.h"
+-template <> adouble*  xNew(unsigned int size) {
+-	ensureContiguousLocations(size);
+-	adouble* aT_p=new adouble[size];
+-	assert(aT_p);
+-	return aT_p;
+-}
++template <> adouble*  xNew(unsigned int size);
+ #endif
+ 
+ #endif
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 18124)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 18125)
+@@ -174,6 +174,7 @@
+ 					./classes/Profiler.cpp\
+ 					./shared/shared.h\
+ 					./shared/MemOps/MemOps.h\
++					./shared/MemOps/MemOps.cpp\
+ 					./shared/Matrix/matrix.h\
+ 					./shared/Matrix/MatrixUtils.cpp\
+ 					./shared/io/io.h\
+@@ -202,6 +203,7 @@
+ 					./shared/Numerics/GaussPoints.cpp\
+ 					./shared/Numerics/cross.cpp\
+ 					./shared/Numerics/isnan.h\
++					./shared/Numerics/isnan.cpp\
+ 					./shared/Numerics/cubic.cpp\
+ 					./shared/Numerics/NewtonSolveDnorm.cpp\
+ 					./shared/Numerics/extrema.cpp\
Index: /issm/oecreview/Archive/17984-18295/ISSM-18125-18126.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18125-18126.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18125-18126.diff	(revision 18296)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18125)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18126)
+@@ -820,6 +820,7 @@
+ 				name==SurfaceEnum ||
+ 				name==BaseEnum ||
+ 				name==BedEnum ||
++				name==BalancethicknessThickeningRateEnum ||
+ 				name==SurfaceSlopeXEnum ||
+ 				name==SurfaceSlopeYEnum ||
+ 				name==SurfaceforcingsMassBalanceEnum ||
Index: /issm/oecreview/Archive/17984-18295/ISSM-18126-18127.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18126-18127.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18126-18127.diff	(revision 18296)
@@ -0,0 +1,24 @@
+Index: ../trunk-jpl/src/m/parameterization/setflowequation.py
+===================================================================
+--- ../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 18126)
++++ ../trunk-jpl/src/m/parameterization/setflowequation.py	(revision 18127)
+@@ -7,7 +7,7 @@
+ 
+ def setflowequation(md,*args):
+ 	"""
+-	SETELEMENTSTYPE - associate a solution type to each element
++	SETFLOWEQUATION - associate a solution type to each element
+ 
+ 	   This routine works like plotmodel: it works with an even number of inputs
+ 	   'SIA','SSA','HO','L1L2','FS' and 'fill' are the possible options
+Index: ../trunk-jpl/src/m/parameterization/setflowequation.m
+===================================================================
+--- ../trunk-jpl/src/m/parameterization/setflowequation.m	(revision 18126)
++++ ../trunk-jpl/src/m/parameterization/setflowequation.m	(revision 18127)
+@@ -1,5 +1,5 @@
+ function md=setflowequation(md,varargin)
+-%SETELEMENTSTYPE - associate a solution type to each element
++%SETFLOWEQUATION - associate a solution type to each element
+ %
+ %   This routine works like plotmodel: it works with an even number of inputs
+ %   'SIA','SSA','L1L2','HO','FS' and 'fill' are the possible options
Index: /issm/oecreview/Archive/17984-18295/ISSM-18127-18128.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18127-18128.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18127-18128.diff	(revision 18296)
@@ -0,0 +1,1157 @@
+Index: ../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp	(revision 18127)
++++ ../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp	(revision 18128)
+@@ -19,205 +19,226 @@
+ #include "./types.h"
+ #include "./isnan.h"
+ 
+-void BrentSearch(IssmDouble* psearch_scalar,IssmDouble* pJ,OptPars* optpars,IssmDouble (*f)(IssmDouble,void*),void* optargs){
++void BrentSearch(IssmDouble** pJ,OptPars optpars,IssmDouble* X0,IssmDouble (*f)(IssmDouble*,void*),IssmDouble (*g)(IssmDouble**,IssmDouble*,void*),void* usr){
+ 
+ 	/* This routine is optimizing a given function using Brent's method
+ 	 * (Golden or parabolic procedure)*/
+ 
+ 	/*Intermediary*/
++	int        iter;
+ 	IssmDouble si,gold,intervalgold,oldintervalgold;
+-	IssmDouble parab_num,parab_den;
+-	IssmDouble distance,cm_jump;
++	IssmDouble parab_num,parab_den,distance;
+ 	IssmDouble fxmax,fxmin,fxbest;
+ 	IssmDouble fx,fx1,fx2;
+-	IssmDouble xmax,xmin,xbest;
+-	IssmDouble x,x1,x2,xm;
++	IssmDouble x,x1,x2,xm,xbest;
+ 	IssmDouble tol1,tol2,seps;
+ 	IssmDouble tolerance = 1.e-4;
+-	int        maxiter ,iter;
+-	bool       loop= true,goldenflag;
+ 
+ 	/*Recover parameters:*/
+-	xmin=optpars->xmin;
+-	xmax=optpars->xmax;
+-	maxiter=optpars->maxiter;
+-	cm_jump=optpars->cm_jump;
++	int         nsteps  = optpars.nsteps;
++	int         nsize   = optpars.nsize;
++	IssmDouble  xmin    = optpars.xmin;
++	IssmDouble  xmax    = optpars.xmax;
++	int        *maxiter = optpars.maxiter;
++	IssmDouble *cm_jump = optpars.cm_jump;
+ 
+-	/*initialize counter and get response at the boundaries*/
+-	iter=0;
+-	fxmin = (*f)(xmin,optargs);
+-	if (xIsNan<IssmDouble>(fxmin)) _error_("Function evaluation returned NaN");
+-	cout<<setprecision(5);
+-	if(VerboseControl()) _printf0_("\n");
+-	if(VerboseControl()) _printf0_("       Iteration         x           f(x)       Tolerance         Procedure\n");
+-	if(VerboseControl()) _printf0_("\n");
+-	if(VerboseControl()) _printf0_("           N/A    "<<setw(12)<<xmin<<"  "<<setw(12)<<fxmin<<"           N/A         boundary\n");
+-	fxmax = (*f)(xmax,optargs);
+-	if (xIsNan<IssmDouble>(fxmax)) _error_("Function evaluation returned NaN");
+-	if(VerboseControl()) _printf0_("           N/A    "<<setw(12)<<xmax<<"  "<<setw(12)<<fxmax<<"           N/A         boundary\n");
++	/*Initialize gradient and controls*/
++	IssmDouble* G = NULL;
++	IssmDouble* J = xNew<IssmDouble>(nsteps);
++	IssmDouble* X = xNew<IssmDouble>(nsize);
+ 
+-	/*test if jump option activated and xmin==0*/
+-	if (!xIsNan<IssmDouble>(cm_jump) && (xmin==0) && (fxmax/fxmin)<cm_jump){
+-		*psearch_scalar=xmax;
+-		*pJ=fxmax;
+-		return;
+-	}
++	/*start iterations*/
++	for(int n=0;n<nsteps;n++){
+ 
+-	/*initialize optimization variables*/
+-	seps=sqrt(DBL_EPSILON);    //precision of a IssmDouble
+-	distance=0.0;              //new_x=old_x + distance
+-	gold=0.5*(3.0-sqrt(5.0));  //gold = 1 - golden ratio
+-	intervalgold=0.0;          //distance used by Golden procedure
++		/*Reset some variables*/
++		iter = 0;
++		xmin = 0.;
++		xmax = 1.;
++		bool loop = true;
++		cout<<setprecision(5);
+ 
+-	/*1: initialize the values of the 4 x needed (x1,x2,x,xbest)*/
+-	x1=xmin+gold*(xmax-xmin);
+-	x2=x1;
+-	xbest=x1;
+-	x=xbest;
++		/*Get current Gradient at xmin=0*/
++		if(VerboseControl()) _printf0_("\n" << "   step " << n+1 << "/" << nsteps << "\n");
++		fxmin = (*g)(&G,X0,usr); if(xIsNan<IssmDouble>(fxmin)) _error_("Function evaluation returned NaN");
++		if(VerboseControl()) _printf0_("\n");
++		if(VerboseControl()) _printf0_("       Iteration         x           f(x)       Tolerance         Procedure\n");
++		if(VerboseControl()) _printf0_("\n");
++		if(VerboseControl()) _printf0_("           N/A    "<<setw(12)<<xmin<<"  "<<setw(12)<<fxmin<<"           N/A         boundary\n");
++		
++		/*Get f(xmax)*/
++		for(int i=0;i<nsize;i++) X[i]=X0[i]+xmax*G[i];
++		fxmax = (*f)(X,usr); if (xIsNan<IssmDouble>(fxmax)) _error_("Function evaluation returned NaN");
++		if(VerboseControl()) _printf0_("           N/A    "<<setw(12)<<xmax<<"  "<<setw(12)<<fxmax<<"           N/A         boundary\n");
+ 
+-	/*2: call the function to be evaluated*/
+-	fxbest = (*f)(x,optargs);
+-	if(xIsNan<IssmDouble>(fxbest)) _error_("Function evaluation returned NaN");
+-	iter=iter+1;
++		/*test if jump option activated and xmin==0*/
++		if(!xIsNan<IssmDouble>(cm_jump[n]) && (xmin==0) && (fxmax/fxmin)<cm_jump[n]){
++			for(int i=0;i<nsize;i++) X0[i]=X0[i]+xmax*G[i];
++			xDelete<IssmDouble>(G);
++			J[n]=fxmax;
++			continue;
++		}
+ 
+-	/*3: update the other variables*/
+-	fx1=fxbest;
+-	fx2=fxbest;
+-	/*xm is always in the middle of a and b*/
+-	xm=0.5*(xmin+xmax);                           
+-	/*update tolerances*/
+-	tol1=seps*sqrt(pow(xbest,2))+tolerance/3.0;
+-	tol2=2.0*tol1;
++		/*initialize optimization variables*/
++		seps=sqrt(DBL_EPSILON);    //precision of a IssmDouble
++		distance=0.0;              //new_x=old_x + distance
++		gold=0.5*(3.0-sqrt(5.0));  //gold = 1 - golden ratio
++		intervalgold=0.0;          //distance used by Golden procedure
+ 
+-	/*4: print result*/
+-	if(VerboseControl())
+-	 _printf0_("         "<<setw(5)<<iter<<"    "<<setw(12)<<xbest<<"  "<<setw(12)<<fxbest<<"  "<<setw(12)<<pow(pow(xbest-xm,2),0.5)<<"         initial\n");
+-	if (!xIsNan<IssmDouble>(cm_jump) && (xmin==0) && ((fxbest/fxmin)<cm_jump)){
+-		if(VerboseControl()) _printf0_("      optimization terminated: current x satisfies criteria 'cm_jump'=" << cm_jump << "\n");
+-		loop=false;
+-	}
++		/*1: initialize the values of the 4 x needed (x1,x2,x,xbest)*/
++		x1=xmin+gold*(xmax-xmin);
++		x2=x1;
++		xbest=x1;
++		x=xbest;
+ 
+-	while(loop){
++		/*2: call the function to be evaluated*/
++		for(int i=0;i<nsize;i++) X[i]=X0[i]+x*G[i];
++		fxbest = (*f)(X,usr); if(xIsNan<IssmDouble>(fxbest)) _error_("Function evaluation returned NaN");
++		iter++;
+ 
+-		goldenflag=true;
++		/*3: update the other variables*/
++		fx1=fxbest;
++		fx2=fxbest;
++		/*xm is always in the middle of a and b*/
++		xm=0.5*(xmin+xmax);                           
++		/*update tolerances*/
++		tol1=seps*sqrt(pow(xbest,2))+tolerance/3.0;
++		tol2=2.0*tol1;
+ 
+-		// Is a parabolic fit possible ?
+-		if (sqrt(pow(intervalgold,2))>tol1){
++		/*4: print result*/
++		if(VerboseControl())
++		 _printf0_("         "<<setw(5)<<iter<<"    "<<setw(12)<<xbest<<"  "<<setw(12)<<fxbest<<"  "<<setw(12)<<pow(pow(xbest-xm,2),0.5)<<"         initial\n");
++		if (!xIsNan<IssmDouble>(cm_jump[n]) && (xmin==0) && ((fxbest/fxmin)<cm_jump[n])){
++			if(VerboseControl()) _printf0_("      optimization terminated: current x satisfies criteria 'cm_jump'=" << cm_jump[n] << "\n");
++			loop=false;
++		}
+ 
+-			// Yes, so fit parabola
+-			goldenflag=false;
+-			parab_num=(xbest-x1)*(xbest-x1)*(fxbest-fx2)-(xbest-x2)*(xbest-x2)*(fxbest-fx1);;
+-			parab_den=2.0*(xbest-x1)*(fxbest-fx2)-2.0*(xbest-x2)*(fxbest-fx1);
++		while(loop){
+ 
+-			//reverse p if necessary
+-			if(parab_den>0.0){ 
+-				parab_num=-parab_num;
+-			}
+-			parab_den=sqrt(pow(parab_den,2));
+-			oldintervalgold=intervalgold;
+-			intervalgold=distance;
++			bool goldenflag=true;
+ 
+-			// Is the parabola acceptable (we use seps here because in some configuration parab_num==parab_den*(xmax-xbest)
+-			// and the result is not repeatable anymore
+-			if (( sqrt(pow(parab_num,2)) < sqrt(pow(0.5*parab_den*oldintervalgold,2))) &&
+-						(parab_num>parab_den*(xmin-xbest)+seps) && 
+-						(parab_num<parab_den*(xmax-xbest)-seps)){
++			// Is a parabolic fit possible ?
++			if (sqrt(pow(intervalgold,2))>tol1){
+ 
+-				// Yes, parabolic interpolation step
+-				distance=parab_num/parab_den;
+-				x=xbest+distance;
++				// Yes, so fit parabola
++				goldenflag=false;
++				parab_num=(xbest-x1)*(xbest-x1)*(fxbest-fx2)-(xbest-x2)*(xbest-x2)*(fxbest-fx1);;
++				parab_den=2.0*(xbest-x1)*(fxbest-fx2)-2.0*(xbest-x2)*(fxbest-fx1);
+ 
+-				// f must not be evaluated too close to min_x or max_x
+-				if (((x-xmin)<tol2) || ((xmax-x)<tol2)){
+-					if ((xm-xbest)<0.0) si=-1;
+-					else                si=1;
+-					//compute new distance
+-					distance=tol1*si;
++				//reverse p if necessary
++				if(parab_den>0.0){ 
++					parab_num=-parab_num;
+ 				}
++				parab_den=sqrt(pow(parab_den,2));
++				oldintervalgold=intervalgold;
++				intervalgold=distance;
++
++				// Is the parabola acceptable (we use seps here because in some configuration parab_num==parab_den*(xmax-xbest)
++				// and the result is not repeatable anymore
++				if (( sqrt(pow(parab_num,2)) < sqrt(pow(0.5*parab_den*oldintervalgold,2))) &&
++							(parab_num>parab_den*(xmin-xbest)+seps) && 
++							(parab_num<parab_den*(xmax-xbest)-seps)){
++
++					// Yes, parabolic interpolation step
++					distance=parab_num/parab_den;
++					x=xbest+distance;
++
++					// f must not be evaluated too close to min_x or max_x
++					if (((x-xmin)<tol2) || ((xmax-x)<tol2)){
++						if ((xm-xbest)<0.0) si=-1;
++						else                si=1;
++						//compute new distance
++						distance=tol1*si;
++					}
++				}
++				else{
++					// Not acceptable, must do a golden section step
++					goldenflag=true;
++				}
+ 			}
+-			else{
+-				// Not acceptable, must do a golden section step
+-				goldenflag=true;
+-			}
+-		}
+ 
+-		//Golden procedure
+-		if(goldenflag){
+-			// compute the new distance d
+-			if(xbest>=xm){
+-				intervalgold=xmin-xbest;    
++			//Golden procedure
++			if(goldenflag){
++				// compute the new distance d
++				if(xbest>=xm){
++					intervalgold=xmin-xbest;    
++				}
++				else{ 
++					intervalgold=xmax-xbest;  
++				}
++				distance=gold*intervalgold;
+ 			}
+-			else{ 
+-				intervalgold=xmax-xbest;  
+-			}
+-			distance=gold*intervalgold;
+-		}
+ 
+-		// The function must not be evaluated too close to xbest
+-		if(distance<0) si=-1;
+-		else           si=1;
+-		if(sqrt(pow(distance,2))>tol1) x=xbest+si*sqrt(pow(distance,2));
+-		else                           x=xbest+si*tol1;
++			// The function must not be evaluated too close to xbest
++			if(distance<0) si=-1;
++			else           si=1;
++			if(sqrt(pow(distance,2))>tol1) x=xbest+si*sqrt(pow(distance,2));
++			else                           x=xbest+si*tol1;
+ 
+-		//evaluate function on x
+-		fx = (*f)(x,optargs);
+-		if(xIsNan<IssmDouble>(fx)) _error_("Function evaluation returned NaN");
+-		iter=iter+1;
++			//evaluate function on x
++			for(int i=0;i<nsize;i++) X[i]=X0[i]+x*G[i];
++			fx = (*f)(X,usr); if(xIsNan<IssmDouble>(fx)) _error_("Function evaluation returned NaN");
++			iter++;
+ 
+-		// Update a, b, xm, x1, x2, tol1, tol2
+-		if (fx<=fxbest){
+-			if (x>=xbest) xmin=xbest;
+-			else          xmax=xbest;
+-			x1=x2;    fx1=fx2;
+-			x2=xbest; fx2=fxbest;
+-			xbest=x;  fxbest=fx;
+-		}
+-		else{ // fx > fxbest
+-			if (x<xbest) xmin=x;
+-			else         xmax=x;
+-			if ((fx<=fx2) || (x2==xbest)){
+-				x1=x2; fx1=fx2;
+-				x2=x;  fx2=fx;
++			// Update a, b, xm, x1, x2, tol1, tol2
++			if (fx<=fxbest){
++				if (x>=xbest) xmin=xbest;
++				else          xmax=xbest;
++				x1=x2;    fx1=fx2;
++				x2=xbest; fx2=fxbest;
++				xbest=x;  fxbest=fx;
+ 			}
+-			else if ( (fx <= fx1) || (x1 == xbest) || (x1 == x2) ){
+-				x1=x;  fx1=fx;
++			else{ // fx > fxbest
++				if (x<xbest) xmin=x;
++				else         xmax=x;
++				if ((fx<=fx2) || (x2==xbest)){
++					x1=x2; fx1=fx2;
++					x2=x;  fx2=fx;
++				}
++				else if ( (fx <= fx1) || (x1 == xbest) || (x1 == x2) ){
++					x1=x;  fx1=fx;
++				}
+ 			}
+-		}
+-		xm = 0.5*(xmin+xmax);
+-		tol1=seps*pow(pow(xbest,2),0.5)+tolerance/3.0;
+-		tol2=2.0*tol1;
+-		if(VerboseControl())
+-		 _printf0_("         "<<setw(5)<<iter<<"    "<<setw(12)<<x<<"  "<<setw(12)<<fx<<"  "<<setw(12)<<pow(pow(xbest-xm,2),0.5)<<
+-					 "         "<<(goldenflag?"golden":"parabolic")<<"\n");
++			xm = 0.5*(xmin+xmax);
++			tol1=seps*pow(pow(xbest,2),0.5)+tolerance/3.0;
++			tol2=2.0*tol1;
++			if(VerboseControl())
++			 _printf0_("         "<<setw(5)<<iter<<"    "<<setw(12)<<x<<"  "<<setw(12)<<fx<<"  "<<setw(12)<<pow(pow(xbest-xm,2),0.5)<<
++						 "         "<<(goldenflag?"golden":"parabolic")<<"\n");
+ 
+-		/*Stop the optimization?*/
+-		if (sqrt(pow(xbest-xm,2)) < (tol2-0.5*(xmax-xmin))){
+-			if(VerboseControl()) _printf0_("      optimization terminated: current x satisfies criteria 'tolx'=" << tolerance << "\n");
+-			loop=false;
++			/*Stop the optimization?*/
++			if (sqrt(pow(xbest-xm,2)) < (tol2-0.5*(xmax-xmin))){
++				if(VerboseControl()) _printf0_("      optimization terminated: current x satisfies criteria 'tolx'=" << tolerance << "\n");
++				loop=false;
++			}
++			else if (iter>=maxiter[n]){
++				if(VerboseControl()) _printf0_("      exiting: Maximum number of iterations has been exceeded  ('maxiter'=" << maxiter[n] << ")\n");
++				loop=false;
++			}
++			else if (!xIsNan<IssmDouble>(cm_jump[n]) && (xmin==0) && ((fxbest/fxmin)<cm_jump[n])){
++				if(VerboseControl()) _printf0_("      optimization terminated: current x satisfies criteria 'cm_jump'=" << cm_jump[n] << "\n");
++				loop=false;
++			}
++			else{
++				//continue
++				loop=true;
++			}
++		}//end while
++
++		//Now, check that the value on the boundaries are not better than current fxbest
++		if (fxbest>fxmin){
++			xbest=optpars.xmin; fxbest=fxmin;
+ 		}
+-		else if (iter>=maxiter){
+-			if(VerboseControl()) _printf0_("      exiting: Maximum number of iterations has been exceeded  ('maxiter'=" << maxiter << ")\n");
+-			loop=false;
++		if (fxbest>fxmax){
++			xbest=optpars.xmax; fxbest=fxmax;
+ 		}
+-		else if (!xIsNan<IssmDouble>(cm_jump) && (xmin==0) && ((fxbest/fxmin)<cm_jump)){
+-			if(VerboseControl()) _printf0_("      optimization terminated: current x satisfies criteria 'cm_jump'=" << cm_jump << "\n");
+-			loop=false;
+-		}
+-		else{
+-			//continue
+-			loop=true;
+-		}
+-	}//end while
+ 
+-	//Now, check that the value on the boundaries are not better than current fxbest
+-	if (fxbest>fxmin){
+-		xbest=optpars->xmin; fxbest=fxmin;
++		/*Assign output pointers: */
++		for(int i=0;i<nsize;i++) X0[i]=X0[i]+xbest*G[i];
++		xDelete<IssmDouble>(G);
++		J[n]=fxbest;
+ 	}
+-	if (fxbest>fxmax){
+-		xbest=optpars->xmax; fxbest=fxmax;
+-	}
+-
+-	/*Assign output pointers: */
+-	*psearch_scalar=xbest;
+-	*pJ=fxbest;
++	
++	/*return*/
++	xDelete<IssmDouble>(X);
++	*pJ=J;
+ }
+Index: ../trunk-jpl/src/c/shared/Numerics/numerics.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/numerics.h	(revision 18127)
++++ ../trunk-jpl/src/c/shared/Numerics/numerics.h	(revision 18128)
+@@ -29,7 +29,7 @@
+ 
+ int         min(int a,int b);
+ int         max(int a,int b);
+-void        BrentSearch(IssmDouble *psearch_scalar,IssmDouble*pJ,OptPars*optpars,IssmDouble (*f)(IssmDouble,void*),void* optargs);
++void        BrentSearch(IssmDouble** pJ,OptPars optpars,IssmDouble* X0,IssmDouble (*f)(IssmDouble*,void*),IssmDouble (*g)(IssmDouble**,IssmDouble*,void*),void* usr);
+ void        cross(IssmDouble *result,IssmDouble*vector1,IssmDouble*vector2);
+ void        XZvectorsToCoordinateSystem(IssmDouble *T,IssmDouble*xzvectors);
+ int         cubic(IssmDouble a, IssmDouble b, IssmDouble c, IssmDouble d, double X[3], int *num);
+Index: ../trunk-jpl/src/c/shared/Numerics/OptPars.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/OptPars.h	(revision 18127)
++++ ../trunk-jpl/src/c/shared/Numerics/OptPars.h	(revision 18128)
+@@ -9,10 +9,12 @@
+ 
+ struct OptPars{
+ 
+-	IssmDouble xmin;
+-	IssmDouble xmax;
+-	IssmDouble cm_jump;
+-	int maxiter;
++	IssmDouble  xmin;
++	IssmDouble  xmax;
++	IssmDouble *cm_jump;
++	int* maxiter;
++	int  nsteps;
++	int  nsize;
+ 
+ };
+ 
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp	(revision 18127)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp	(revision 18128)
+@@ -15,10 +15,10 @@
+ 	int         num_control_type;
+ 	int         num_cm_responses;
+ 	int        *control_type     = NULL;
++	int        *maxiter          = NULL;
+ 	int        *cm_responses     = NULL;
+ 	IssmDouble *cm_jump          = NULL;
+ 	IssmDouble *optscal          = NULL;
+-	IssmDouble *maxiter          = NULL;
+ 
+ 	/*retrieve some parameters: */
+ 	iomodel->Constant(&control_analysis,InversionIscontrolEnum);
+@@ -55,7 +55,7 @@
+ 				iomodel->FetchData(&maxiter,NULL,NULL,InversionMaxiterPerStepEnum);
+ 				parameters->AddObject(new DoubleMatParam(InversionGradientScalingEnum,optscal,nsteps,num_control_type));
+ 				parameters->AddObject(new DoubleVecParam(InversionStepThresholdEnum,cm_jump,nsteps));
+-				parameters->AddObject(new DoubleVecParam(InversionMaxiterPerStepEnum,maxiter,nsteps));
++				parameters->AddObject(new IntVecParam(InversionMaxiterPerStepEnum,maxiter,nsteps));
+ 				break;
+ 			case 1:/*TAO*/
+ 				parameters->AddObject(iomodel->CopyConstantObject(InversionFatolEnum));
+@@ -82,8 +82,8 @@
+ 
+ 		xDelete<int>(control_type);
+ 		xDelete<int>(cm_responses);
++		xDelete<int>(maxiter);
+ 		iomodel->DeleteData(cm_jump,InversionStepThresholdEnum);
+ 		iomodel->DeleteData(optscal,InversionGradientScalingEnum);
+-		iomodel->DeleteData(maxiter,InversionMaxiterPerStepEnum);
+ 	}
+ }
+Index: ../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp	(revision 18127)
++++ ../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp	(revision 18128)
+@@ -6,18 +6,18 @@
+ #include "../../shared/shared.h"
+ #include "../../toolkits/toolkits.h"
+ 
+-void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,IssmDouble* vector){
++void SetControlInputsFromVectorx(FemModel* femmodel,IssmDouble* vector){
+ 
+ 	int  num_controls;
+ 	int *control_type = NULL;
+ 
+ 	/*Retrieve some parameters*/
+-	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+-	parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
++	femmodel->parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
++	femmodel->parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
+ 
+ 	for(int i=0;i<num_controls;i++){
+-		for(int j=0;j<elements->Size();j++){
+-			Element* element=(Element*)elements->GetObjectByOffset(j);
++		for(int j=0;j<femmodel->elements->Size();j++){
++			Element* element=(Element*)femmodel->elements->GetObjectByOffset(j);
+ 			element->SetControlInputsFromVector(vector,control_type[i],i);
+ 		}
+ 	}
+@@ -25,14 +25,9 @@
+ 	xDelete<int>(control_type);
+ }
+ 
+-void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* vector){
++void SetControlInputsFromVectorx(FemModel* femmodel,Vector<IssmDouble>* vector){
+ 
+-	IssmDouble* serial_vector=NULL;
+-
+-	serial_vector=vector->ToMPISerial();
+-
+-	SetControlInputsFromVectorx(elements,nodes, vertices, loads, materials, parameters,serial_vector);
+-
+-	/*Free ressources:*/
++	IssmDouble* serial_vector=vector->ToMPISerial();
++	SetControlInputsFromVectorx(femmodel,serial_vector);
+ 	xDelete<IssmDouble>(serial_vector);
+ }
+Index: ../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h	(revision 18127)
++++ ../trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h	(revision 18128)
+@@ -7,7 +7,7 @@
+ #include "../../classes/classes.h"
+ 
+ /* local prototypes: */
+-void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector<IssmDouble>* vector);
+-void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,IssmDouble* vector);
++void SetControlInputsFromVectorx(FemModel* femmodel,Vector<IssmDouble>* vector);
++void SetControlInputsFromVectorx(FemModel* femmodel,IssmDouble* vector);
+ 
+ #endif 
+Index: ../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 18127)
++++ ../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 18128)
+@@ -49,6 +49,8 @@
+ 		gradient->AXPY(gradient_list[i],1.0);
+ 		delete gradient_list[i];
+ 	}
++	//gradient->Echo();
++	//_error_("S");
+ 
+ 	/*Check that gradient is clean*/
+ 	norm_inf=gradient->Norm(NORM_INF);
+Index: ../trunk-jpl/src/c/cores/controlvalidation_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 18127)
++++ ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 18128)
+@@ -72,7 +72,7 @@
+ 		for(int i=0;i<n;i++) X[i] = X0[i] + alpha;
+ 
+ 		/*Calculate j(k+alpha delta k) */
+-		SetControlInputsFromVectorx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,X);
++		SetControlInputsFromVectorx(femmodel,X);
+ 		solutioncore(femmodel);
+ 		femmodel->CostFunctionx(&j,NULL,NULL);
+ 
+Index: ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 18127)
++++ ../trunk-jpl/src/c/cores/controlm1qn3_core.cpp	(revision 18128)
+@@ -105,7 +105,7 @@
+ 	}
+ 
+ 	/*Get solution*/
+-	SetControlInputsFromVectorx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,X);
++	SetControlInputsFromVectorx(femmodel,X);
+ 	ControlInputSetGradientx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,G);
+ 	femmodel->OutputControlsx(&femmodel->results);
+ 	femmodel->results->AddObject(new GenericExternalResult<double>(JEnum,f,1,0));
+@@ -130,10 +130,9 @@
+ 	int         solution_type;
+ 	FemModel   *femmodel  = (FemModel*)dzs;
+ 
+-	/*Recover responses*/
+-	int         num_responses;
+-	int        *responses = NULL;
+-	femmodel->parameters->FindParam(&responses,&num_responses,InversionCostFunctionsEnum);
++	/*Recover number of cost functions responses*/
++	int num_responses;
++	femmodel->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
+ 
+ 	/*Constrain input vector*/
+ 	IssmDouble  *XL = NULL;
+@@ -146,7 +145,7 @@
+ 	}
+ 
+ 	/*Update control input*/
+-	SetControlInputsFromVectorx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,X);
++	SetControlInputsFromVectorx(femmodel,X);
+ 
+ 	/*Recover some parameters*/
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+@@ -169,7 +168,6 @@
+ 
+ 	if(indic==0){
+ 		/*dry run, no gradient required*/
+-		xDelete<int>(responses);
+ 		xDelete<IssmDouble>(XU);
+ 		xDelete<IssmDouble>(XL);
+ 		return;
+@@ -192,7 +190,6 @@
+ 	}
+ 
+ 	/*Clean-up and return*/
+-	xDelete<int>(responses);
+ 	xDelete<IssmDouble>(XU);
+ 	xDelete<IssmDouble>(XL);
+ }
+Index: ../trunk-jpl/src/c/cores/control_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/control_core.cpp	(revision 18127)
++++ ../trunk-jpl/src/c/cores/control_core.cpp	(revision 18128)
+@@ -10,15 +10,19 @@
+ #include "../solutionsequences/solutionsequences.h"
+ 
+ /*Local prototypes*/
+-bool controlconvergence(IssmDouble J, IssmDouble tol_cm);
+-IssmDouble objectivefunction(IssmDouble search_scalar,void* optargs);
++IssmDouble FormFunction(IssmDouble* X,void* usr);
++IssmDouble FormFunctionGradient(IssmDouble** pG,IssmDouble* X,void* usr);
++typedef struct {
++	FemModel* femmodel;
++	int       nsize;
++} AppCtx;
+ 
+ void control_core(FemModel* femmodel){
+ 
+ 	int     i;
+ 
+ 	/*parameters: */
+-	int        num_controls;
++	int        num_controls,nsize;
+ 	int        nsteps;
+ 	IssmDouble tol_cm;
+ 	int        solution_type;
+@@ -26,11 +30,10 @@
+ 	bool       dakota_analysis = false;
+ 
+ 	int        *control_type   = NULL;
+-	IssmDouble *maxiter        = NULL;
++	int*        maxiter        = NULL;
+ 	IssmDouble *cm_jump        = NULL;
+ 
+ 	/*intermediary: */
+-	IssmDouble search_scalar = 1.;
+ 	OptPars    optpars;
+ 
+ 	/*Solution and Adjoint core pointer*/
+@@ -60,37 +63,41 @@
+ 	if(VerboseControl()) _printf0_("   preparing initial solution\n");
+ 	if(isFS) solutioncore(femmodel);
+ 
+-	/*Initialize cost function: */
+-	J=xNew<IssmDouble>(nsteps);
++	/*Get initial guess*/
++	Vector<IssmDouble> *Xpetsc = NULL;
++	GetVectorFromControlInputsx(&Xpetsc,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"value");
++	IssmDouble* X0 = Xpetsc->ToMPISerial();
++	Xpetsc->GetSize(&nsize);
++	delete Xpetsc;
+ 
+ 	/*Initialize some of the BrentSearch arguments: */
+-	optpars.xmin=0; optpars.xmax=1;
++	optpars.xmin    = 0; 
++	optpars.xmax    = 1;
++	optpars.nsteps  = nsteps;
++	optpars.nsize   = nsize;
++	optpars.maxiter = maxiter;
++	optpars.cm_jump = cm_jump;
+ 
+-	/*Start looping: */
+-	for(int n=0;n<nsteps;n++){
++	/*Initialize function argument*/
++	AppCtx usr;
++	usr.femmodel = femmodel;
++	usr.nsize    = nsize;
+ 
+-		/*Display info*/
+-		if(VerboseControl()) _printf0_("\n" << "   control method step " << n+1 << "/" << nsteps << "\n");
++	/*Call Brent optimization*/
++	BrentSearch(&J,optpars,X0,&FormFunction,&FormFunctionGradient,(void*)&usr);
+ 
+-
+-		/*In steady state inversion, compute new temperature field now*/
+-		if(solution_type==SteadystateSolutionEnum) solutioncore(femmodel);
+-
+-		if(VerboseControl()) _printf0_("   compute adjoint state:\n");
+-		adjointcore(femmodel);
+-		gradient_core(femmodel,n,search_scalar==0.);
+-
+-		if(VerboseControl()) _printf0_("   optimizing along gradient direction\n");
+-		optpars.maxiter=reCast<int,IssmDouble>(maxiter[n]); optpars.cm_jump=cm_jump[n];
+-		BrentSearch(&search_scalar,J+n,&optpars,&objectivefunction,(void*)femmodel);
+-
+-		if(VerboseControl()) _printf0_("   updating parameter using optimized search scalar\n"); //true means update save controls
+-		InputControlUpdatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,search_scalar,true);
+-
+-		if(controlconvergence(J[n],tol_cm)) break;
++	if(VerboseControl()) _printf0_("   preparing final solution\n");
++	IssmDouble  *XL = NULL;
++	IssmDouble  *XU = NULL;
++	GetVectorFromControlInputsx(&XL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
++	GetVectorFromControlInputsx(&XU,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
++	for(long i=0;i<nsize;i++){
++		if(X0[i]>XU[i]) X0[i]=XU[i];
++		if(X0[i]<XL[i]) X0[i]=XL[i];
+ 	}
+-
+-	if(VerboseControl()) _printf0_("   preparing final solution\n");
++	xDelete<IssmDouble>(XU);
++	xDelete<IssmDouble>(XL);
++	SetControlInputsFromVectorx(femmodel,X0);
+ 	femmodel->parameters->SetParam(true,SaveResultsEnum);
+ 	solutioncore(femmodel);
+ 
+@@ -110,84 +117,187 @@
+ 
+ 	/*Free ressources: */
+ 	xDelete<int>(control_type);
+-	xDelete<IssmDouble>(maxiter);
++	xDelete<int>(maxiter);
+ 	xDelete<IssmDouble>(cm_jump);
+ 	xDelete<IssmDouble>(J);
++	xDelete<IssmDouble>(X0);
+ }
+-bool controlconvergence(IssmDouble J, IssmDouble tol_cm){
+ 
+-	bool converged=false;
++IssmDouble FormFunction(IssmDouble* X,void* usrvoid){
+ 
+-	/*Has convergence been reached?*/
+-	if (!xIsNan<IssmDouble>(tol_cm) && J<tol_cm){
+-		converged=true;
+-		if(VerboseConvergence()) _printf0_("      Convergence criterion reached: J = " << J << " < " << tol_cm);
+-	}
+-
+-	return converged;
+-}
+-
+-IssmDouble objectivefunction(IssmDouble search_scalar,void* optargs){
+-
+ 	/*output: */
+ 	IssmDouble J;
+ 
+ 	/*parameters: */
+-	int        solution_type,analysis_type;
+-	bool       isFS       = false;
++	int        solution_type,analysis_type,num_responses;
++	bool       isFS           = false;
+ 	bool       conserve_loads = true;
+-	FemModel  *femmodel       = (FemModel*)optargs;
++	AppCtx*    usr = (AppCtx*)usrvoid;
++	FemModel  *femmodel  = usr->femmodel;
++	int        nsize     = usr->nsize;
+ 
+ 	/*Recover parameters: */
+ 	femmodel->parameters->FindParam(&isFS,FlowequationIsFSEnum);
+ 	femmodel->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
++	femmodel->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
+ 
+-	/*set analysis type to compute velocity: */
++	/*Constrain input vector*/
++	IssmDouble  *XL = NULL;
++	IssmDouble  *XU = NULL;
++	GetVectorFromControlInputsx(&XL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
++	GetVectorFromControlInputsx(&XU,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
++	for(long i=0;i<nsize;i++){
++		if(X[i]>XU[i]) X[i]=XU[i];
++		if(X[i]<XL[i]) X[i]=XL[i];
++	}
++
++	/*Update control input*/
++	SetControlInputsFromVectorx(femmodel,X);
++
++	/*solve forward: */
+ 	switch(solution_type){
+ 		case SteadystateSolutionEnum:
++			femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
++			stressbalance_core(femmodel);	//We need a 3D velocity!! (vz is required for the next thermal run)
++			break;
+ 		case StressbalanceSolutionEnum:
+ 			femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
++			solutionsequence_nonlinear(femmodel,conserve_loads); 
+ 			break;
+ 		case BalancethicknessSolutionEnum:
+ 			femmodel->SetCurrentConfiguration(BalancethicknessAnalysisEnum);
++			solutionsequence_linear(femmodel); 
+ 			break;
+ 		case BalancethicknessSoftSolutionEnum:
+-			femmodel->SetCurrentConfiguration(BalancethicknessAnalysisEnum);
++			/*NOTHING*/
+ 			break;
+ 		case Balancethickness2SolutionEnum:
+ 			femmodel->SetCurrentConfiguration(Balancethickness2AnalysisEnum);
++			solutionsequence_linear(femmodel); 
+ 			break;
+ 		default:
+ 			_error_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
+ 	}
+ 
+-	/*update parameter according to scalar: */ //false means: do not save control
+-	InputControlUpdatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,search_scalar,false);
++	/*Compute misfit for this velocity field.*/
++	IssmDouble* Jlist = NULL;
++	femmodel->CostFunctionx(&J,&Jlist,NULL);
++	//_printf0_("f(x) = "<<setw(12)<<setprecision(7)<<*pf<<"  |  ");
+ 
+-	/*Run stressbalance with updated inputs: */
+-	if (solution_type==SteadystateSolutionEnum){
+-		stressbalance_core(femmodel);	//We need a 3D velocity!! (vz is required for the next thermal run)
++	/*Retrieve objective functions independently*/
++	//for(int i=0;i<num_responses;i++) _printf0_(" "<<setw(12)<<setprecision(7)<<Jlist[i]);
++	//_printf0_("\n");
++
++	/*Free ressources:*/
++	xDelete<IssmDouble>(XU);
++	xDelete<IssmDouble>(XL);
++	xDelete<IssmDouble>(Jlist);
++	return J;
++}
++IssmDouble FormFunctionGradient(IssmDouble** pG,IssmDouble* X,void* usrvoid){
++
++	/*output: */
++	IssmDouble J;
++
++	/*parameters: */
++	void (*adjointcore)(FemModel*)=NULL;
++	int         solution_type,analysis_type,num_responses,num_controls,numvertices;
++	bool        isFS           = false;
++	bool        conserve_loads = true;
++	IssmDouble *scalar_list    = NULL;
++	IssmDouble *Jlist          = NULL;
++	IssmDouble *G              = NULL;
++	IssmDouble *norm_list      = NULL;
++	AppCtx     *usr            = (AppCtx*)usrvoid;
++	FemModel   *femmodel       = usr->femmodel;
++	int         nsize          = usr->nsize;
++
++	/*Recover parameters: */
++	femmodel->parameters->FindParam(&isFS,FlowequationIsFSEnum);
++	femmodel->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
++	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
++	femmodel->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
++	femmodel->parameters->FindParam(&scalar_list,NULL,NULL,InversionGradientScalingEnum);
++	femmodel->parameters->FindParam(&num_controls,InversionNumControlParametersEnum);   _assert_(num_controls);
++	numvertices=femmodel->vertices->NumberOfVertices();
++
++	/*Constrain input vector*/
++	IssmDouble  *XL = NULL;
++	IssmDouble  *XU = NULL;
++	GetVectorFromControlInputsx(&XL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
++	GetVectorFromControlInputsx(&XU,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
++	for(long i=0;i<nsize;i++){
++		if(X[i]>XU[i]) X[i]=XU[i];
++		if(X[i]<XL[i]) X[i]=XL[i];
+ 	}
+-	else if (solution_type==StressbalanceSolutionEnum){
+-		solutionsequence_nonlinear(femmodel,conserve_loads); 
++
++	/*Update control input*/
++	SetControlInputsFromVectorx(femmodel,X);
++
++	/*Compute Adjoint*/
++	AdjointCorePointerFromSolutionEnum(&adjointcore,solution_type);
++	adjointcore(femmodel);
++
++	/*Compute gradient*/
++	Gradjx(&G,&norm_list,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
++
++	/*Compute scaling factor*/
++	IssmDouble scalar = scalar_list[0]/norm_list[0];
++	for(int i=1;i<num_controls;i++) scalar=min(scalar,scalar_list[i]/norm_list[i]);
++
++	/*Constrain Gradient*/
++	for(int i=0;i<num_controls;i++){
++		for(int j=0;j<numvertices;j++){
++			G[i*numvertices+j] = scalar*G[i*numvertices+j];
++		}
+ 	}
+-	else if (solution_type==BalancethicknessSolutionEnum){
+-		solutionsequence_linear(femmodel); 
++
++	/*Needed for output results (FIXME: should be placed 6 lines below)*/
++	ControlInputSetGradientx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,G);
++
++	for(long i=0;i<nsize;i++){
++		if(X[i]>=XU[i]) G[i]=0.;
++		if(X[i]<=XL[i]) G[i]=0.;
+ 	}
+-	else if (solution_type==Balancethickness2SolutionEnum){
+-		solutionsequence_linear(femmodel); 
++
++	/*solve forward: (FIXME: not needed actually...)*/
++	switch(solution_type){
++		case SteadystateSolutionEnum:
++			femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
++			stressbalance_core(femmodel);	//We need a 3D velocity!! (vz is required for the next thermal run)
++			break;
++		case StressbalanceSolutionEnum:
++			femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
++			solutionsequence_nonlinear(femmodel,conserve_loads); 
++			break;
++		case BalancethicknessSolutionEnum:
++			femmodel->SetCurrentConfiguration(BalancethicknessAnalysisEnum);
++			solutionsequence_linear(femmodel); 
++			break;
++		case BalancethicknessSoftSolutionEnum:
++			/*NOTHING*/
++			break;
++		case Balancethickness2SolutionEnum:
++			femmodel->SetCurrentConfiguration(Balancethickness2AnalysisEnum);
++			solutionsequence_linear(femmodel); 
++			break;
++		default:
++			_error_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
+ 	}
+-	else if (solution_type==BalancethicknessSoftSolutionEnum){
+-		/*Don't do anything*/
+-	}
+-	else{
+-		_error_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
+-	}
+ 
+ 	/*Compute misfit for this velocity field.*/
+-	femmodel->CostFunctionx(&J,NULL,NULL);
++	femmodel->CostFunctionx(&J,&Jlist,NULL);
++	//_printf0_("f(x) = "<<setw(12)<<setprecision(7)<<*pf<<"  |  ");
++	//for(int i=0;i<num_responses;i++) _printf0_(" "<<setw(12)<<setprecision(7)<<Jlist[i]);
++	//_printf0_("\n");
+ 
+-	/*Free ressources:*/
++	/*Clean-up and return*/
++	xDelete<IssmDouble>(XU);
++	xDelete<IssmDouble>(XL);
++	xDelete<IssmDouble>(norm_list);
++	xDelete<IssmDouble>(scalar_list);
++	xDelete<IssmDouble>(Jlist);
++	*pG = G;
+ 	return J;
+ }
+Index: ../trunk-jpl/src/c/cores/controltao_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controltao_core.cpp	(revision 18127)
++++ ../trunk-jpl/src/c/cores/controltao_core.cpp	(revision 18128)
+@@ -92,7 +92,7 @@
+ 	TaoGetSolutionVector(tao,&X->pvector->vector);
+ 	G=new Vector<IssmDouble>(0); VecFree(&G->pvector->vector);
+ 	TaoGetGradientVector(tao,&G->pvector->vector);
+-	SetControlInputsFromVectorx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,X);
++	SetControlInputsFromVectorx(femmodel,X);
+ 	ControlInputSetGradientx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,G);
+ 	femmodel->OutputControlsx(&femmodel->results);
+ 	femmodel->results->AddObject(new GenericExternalResult<double*>(femmodel->results->Size()+1,JEnum,user.J,maxiter+3,1,1,0));
+@@ -112,11 +112,11 @@
+ 	TaoDestroy(&tao);
+ 	TaoFinalize();
+ }
+-int FormFunctionGradient(TaoSolver tao, Vec Xpetsc, IssmDouble *fcn,Vec G,void *userCtx){
++int FormFunctionGradient(TaoSolver tao, Vec Xpetsc, IssmDouble *fcn,Vec G,void *uservoid){
+ 
+ 	/*Retreive arguments*/
+ 	int                  solution_type;
+-	AppCtx              *user            = (AppCtx *)userCtx;
++	AppCtx              *user            = (AppCtx *)uservoid;
+ 	FemModel            *femmodel        = user->femmodel;
+ 	Vector<IssmDouble>  *gradient        = NULL;
+ 	Vector<IssmDouble>  *X               = NULL;
+@@ -126,7 +126,7 @@
+ 
+ 	/*Set new variable*/
+ 	//VecView(X,PETSC_VIEWER_STDOUT_WORLD);
+-	SetControlInputsFromVectorx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,X);
++	SetControlInputsFromVectorx(femmodel,X);
+ 	delete X;
+ 
+ 	/*Recover some parameters*/
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18127)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18128)
+@@ -983,7 +983,6 @@
+ 		this->inputs->AddInput(new IntInput(ApproximationEnum,reCast<int>(iomodel->Data(FlowequationElementEquationEnum)[index])));
+ 	}
+ 
+-
+ 	/*Control Inputs*/
+ 	if (control_analysis && iomodel->Data(InversionControlParametersEnum)){
+ 		for(i=0;i<num_control_type;i++){
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18127)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18128)
+@@ -2850,6 +2850,7 @@
+ 	GradientIndexing(&vertexpidlist[0],control_index);
+ 
+ 	/*Get input (either in element or material)*/
++	if(control_enum==MaterialsRheologyBbarEnum) control_enum=MaterialsRheologyBEnum;
+ 	Input* input=inputs->GetInput(control_enum);
+ 	if(!input) _error_("Input " << EnumToStringx(control_enum) << " not found in element");
+ 
+@@ -2864,10 +2865,21 @@
+ void       Penta::SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index){/*{{{*/
+ 
+ 	IssmDouble  values[NUMVERTICES];
+-	int     vertexpidlist[NUMVERTICES];
+-	Input  *input     = NULL;
+-	Input  *new_input = NULL;
++	int         vertexpidlist[NUMVERTICES],control_init;
++	Input      *input     = NULL;
++	Input      *new_input = NULL;
+ 
++	/*Specific case for depth averaged quantities*/
++	control_init=control_enum;
++	if(control_enum==MaterialsRheologyBbarEnum){
++		control_enum=MaterialsRheologyBEnum;
++		if(!IsOnBase()) return;
++	}
++	if(control_enum==DamageDbarEnum){
++		control_enum=DamageDEnum;
++		if(!IsOnBase()) return;
++	}
++
+ 	/*Get out if this is not an element input*/
+ 	if(!IsInput(control_enum)) return;
+ 
+@@ -2875,7 +2887,7 @@
+ 	GradientIndexing(&vertexpidlist[0],control_index);
+ 
+ 	/*Get values on vertices*/
+-	for (int i=0;i<NUMVERTICES;i++){
++	for(int i=0;i<NUMVERTICES;i++){
+ 		values[i]=vector[vertexpidlist[i]];
+ 	}
+ 	new_input = new PentaInput(control_enum,values,P1Enum);
+@@ -2886,6 +2898,13 @@
+ 	}
+ 
+ 	((ControlInput*)input)->SetInput(new_input);
++
++	if(control_init==MaterialsRheologyBbarEnum){
++		this->InputExtrude(control_enum);
++	}
++	if(control_init==DamageDbarEnum){
++		this->InputExtrude(control_enum);
++	}
+ }
+ /*}}}*/
+ 
+Index: ../trunk-jpl/src/m/classes/inversion.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/inversion.m	(revision 18127)
++++ ../trunk-jpl/src/m/classes/inversion.m	(revision 18128)
+@@ -24,55 +24,55 @@
+ 		thickness_obs               = NaN
+ 	end
+ 	methods
+-         function createxml(obj,fid) % {{{
+-            fprintf(fid, '<!-- inversion -->\n');            
+-                    
+-            % inversion parameters
+-            fprintf(fid,'%s\n%s\n%s\n','<frame key="1" label="inversion parameters">','<section name="inversion" />');                    
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="iscontrol" type="',class(obj.iscontrol),'" default="',convert2str(obj.iscontrol),'">','     <section name="inversion" />','     <help> is inversion activated? </help>','  </parameter>');
+-            
+-            % incompleteadjoing drop-down (0 or 1)
+-            fprintf(fid,'%s\n%s\n%s\n%s\n','  <parameter key ="incomplete_adjoint" type="alternative" optional="false">','     <section name="inversion" />','     <help> 1: linear viscosity, 0: non-linear viscosity </help>');
+-            fprintf(fid,'%s\n','       <option value="0" type="string" default="true"> </option>');
+-            fprintf(fid,'%s\n%s\n','       <option value="1" type="string" default="false"> </option>','</parameter>');
+-            
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="control_parameters" type="',class(obj.control_parameters),'" default="',convert2str(obj.control_parameters),'">','     <section name="inversion" />','     <help> ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''} </help>','  </parameter>');
+-                
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="nsteps" type="',class(obj.nsteps),'" default="',convert2str(obj.nsteps),'">','     <section name="inversion" />','     <help> number of optimization searches </help>','  </parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="cost_functions" type="',class(obj.cost_functions),'" default="',convert2str(obj.cost_functions),'">','     <section name="inversion" />','     <help> indicate the type of response for each optimization step  </help>','  </parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="cost_functions_coefficients" type="',class(obj.cost_functions_coefficients),'" default="',convert2str(obj.cost_functions_coefficients),'">','     <section name="inversion" />','     <help> cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter </help>','  </parameter>');
+-                
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="cost_function_threshold" type="',class(obj.cost_function_threshold),'" default="',convert2str(obj.cost_function_threshold),'">','     <section name="inversion" />','     <help> misfit convergence criterion. Default is 1%, NaN if not applied </help>','  </parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="maxiter_per_step" type="',class(obj.maxiter_per_step),'" default="',convert2str(obj.maxiter_per_step),'">','     <section name="inversion" />','     <help> maximum iterations during each optimization step  </help>','  </parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="gradient_scaling" type="',class(obj.gradient_scaling),'" default="',convert2str(obj.gradient_scaling),'">','     <section name="inversion" />','     <help> scaling factor on gradient direction during optimization, for each optimization step </help>','  </parameter>');
+-               
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="step_threshold" type="',class(obj.step_threshold),'" default="',convert2str(obj.step_threshold),'">','     <section name="inversion" />','     <help> decrease threshold for misfit, default is 30% </help>','  </parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="min_parameters" type="',class(obj.min_parameters),'" default="',convert2str(obj.min_parameters),'">','     <section name="inversion" />','     <help> absolute minimum acceptable value of the inversed parameter on each vertex </help>','  </parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="max_parameters" type="',class(obj.max_parameters),'" default="',convert2str(obj.max_parameters),'">','     <section name="inversion" />','     <help> absolute maximum acceptable value of the inversed parameter on each vertex </help>','  </parameter>');
+-               
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="vx_obs" type="',class(obj.vx_obs),'" default="',convert2str(obj.vx_obs),'">','     <section name="inversion" />','     <help> observed velocity x component [m/yr] </help>','  </parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="vy_obs" type="',class(obj.vy_obs),'" default="',convert2str(obj.vy_obs),'">','     <section name="inversion" />','     <help> observed velocity y component [m/yr]  </help>','  </parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="vel_obs" type="',class(obj.vel_obs),'" default="',convert2str(obj.vel_obs),'">','     <section name="inversion" />','     <help> observed velocity magnitude [m/yr] </help>','  </parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="thickness_obs" type="',class(obj.thickness_obs),'" default="',convert2str(obj.thickness_obs),'">','     <section name="inversion" />','     <help> observed thickness [m]) </help>','  </parameter>');
+-               
+-            fprintf(fid,'%s\n%s\n','</frame>');    
+-            
+-            fprintf(fid,'%s\n%s\n%s\n','<frame key="2" label="Available cost functions">','<section name="inversion" />');                    
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="SurfaceAbsVelMisfit" type="','string','" default="','101','">','     <section name="inversion" />','     <help>  </help>','  </parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="SurfaceRelVelMisfit" type="','string','" default="','102','">','     <section name="inversion" />','     <help>   </help>','  </parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="SurfaceLogVelMisfit" type="','string','" default="','103','">','     <section name="inversion" />','     <help>  </help>','  </parameter>');
+-                
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="SurfaceLogVxVyMisfit" type="','string','" default="','104','">','     <section name="inversion" />','     <help>  </help>','  </parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="SurfaceAverageVelMisfit" type="','string','" default="','105','">','     <section name="inversion" />','     <help>   </help>','  </parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="ThicknessAbsMisfit" type="','string','" default="','106','">','     <section name="inversion" />','     <help>  </help>','  </parameter>');
+-               
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="DragCoefficientAbsGradient" type="','string','" default="','107','">','     <section name="inversion" />','     <help>  </help>','  </parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="RheologyBbarAbsGradient" type="','string','" default="','108','">','     <section name="inversion" />','     <help>  </help>','  </parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="ThicknessAbsGradient" type="','string','" default="','109','">','     <section name="inversion" />','     <help> </help>','  </parameter>');
+-               
+-            fprintf(fid,'%s\n%s\n','</frame>');    
+-        
+-        end % }}}       
++		function createxml(obj,fid) % {{{
++			fprintf(fid, '<!-- inversion -->\n');            
++
++			% inversion parameters
++			fprintf(fid,'%s\n%s\n%s\n','<frame key="1" label="inversion parameters">','<section name="inversion" />');                    
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="iscontrol" type="',class(obj.iscontrol),'" default="',convert2str(obj.iscontrol),'">','     <section name="inversion" />','     <help> is inversion activated? </help>','  </parameter>');
++
++			% incompleteadjoing drop-down (0 or 1)
++			fprintf(fid,'%s\n%s\n%s\n%s\n','  <parameter key ="incomplete_adjoint" type="alternative" optional="false">','     <section name="inversion" />','     <help> 1: linear viscosity, 0: non-linear viscosity </help>');
++			fprintf(fid,'%s\n','       <option value="0" type="string" default="true"> </option>');
++			fprintf(fid,'%s\n%s\n','       <option value="1" type="string" default="false"> </option>','</parameter>');
++
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="control_parameters" type="',class(obj.control_parameters),'" default="',convert2str(obj.control_parameters),'">','     <section name="inversion" />','     <help> ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''} </help>','  </parameter>');
++
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="nsteps" type="',class(obj.nsteps),'" default="',convert2str(obj.nsteps),'">','     <section name="inversion" />','     <help> number of optimization searches </help>','  </parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="cost_functions" type="',class(obj.cost_functions),'" default="',convert2str(obj.cost_functions),'">','     <section name="inversion" />','     <help> indicate the type of response for each optimization step  </help>','  </parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="cost_functions_coefficients" type="',class(obj.cost_functions_coefficients),'" default="',convert2str(obj.cost_functions_coefficients),'">','     <section name="inversion" />','     <help> cost_functions_coefficients applied to the misfit of each vertex and for each control_parameter </help>','  </parameter>');
++
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="cost_function_threshold" type="',class(obj.cost_function_threshold),'" default="',convert2str(obj.cost_function_threshold),'">','     <section name="inversion" />','     <help> misfit convergence criterion. Default is 1%, NaN if not applied </help>','  </parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="maxiter_per_step" type="',class(obj.maxiter_per_step),'" default="',convert2str(obj.maxiter_per_step),'">','     <section name="inversion" />','     <help> maximum iterations during each optimization step  </help>','  </parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="gradient_scaling" type="',class(obj.gradient_scaling),'" default="',convert2str(obj.gradient_scaling),'">','     <section name="inversion" />','     <help> scaling factor on gradient direction during optimization, for each optimization step </help>','  </parameter>');
++
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="step_threshold" type="',class(obj.step_threshold),'" default="',convert2str(obj.step_threshold),'">','     <section name="inversion" />','     <help> decrease threshold for misfit, default is 30% </help>','  </parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="min_parameters" type="',class(obj.min_parameters),'" default="',convert2str(obj.min_parameters),'">','     <section name="inversion" />','     <help> absolute minimum acceptable value of the inversed parameter on each vertex </help>','  </parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="max_parameters" type="',class(obj.max_parameters),'" default="',convert2str(obj.max_parameters),'">','     <section name="inversion" />','     <help> absolute maximum acceptable value of the inversed parameter on each vertex </help>','  </parameter>');
++
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="vx_obs" type="',class(obj.vx_obs),'" default="',convert2str(obj.vx_obs),'">','     <section name="inversion" />','     <help> observed velocity x component [m/yr] </help>','  </parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="vy_obs" type="',class(obj.vy_obs),'" default="',convert2str(obj.vy_obs),'">','     <section name="inversion" />','     <help> observed velocity y component [m/yr]  </help>','  </parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="vel_obs" type="',class(obj.vel_obs),'" default="',convert2str(obj.vel_obs),'">','     <section name="inversion" />','     <help> observed velocity magnitude [m/yr] </help>','  </parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="thickness_obs" type="',class(obj.thickness_obs),'" default="',convert2str(obj.thickness_obs),'">','     <section name="inversion" />','     <help> observed thickness [m]) </help>','  </parameter>');
++
++			fprintf(fid,'%s\n%s\n','</frame>');    
++
++			fprintf(fid,'%s\n%s\n%s\n','<frame key="2" label="Available cost functions">','<section name="inversion" />');                    
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="SurfaceAbsVelMisfit" type="','string','" default="','101','">','     <section name="inversion" />','     <help>  </help>','  </parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="SurfaceRelVelMisfit" type="','string','" default="','102','">','     <section name="inversion" />','     <help>   </help>','  </parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="SurfaceLogVelMisfit" type="','string','" default="','103','">','     <section name="inversion" />','     <help>  </help>','  </parameter>');
++
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="SurfaceLogVxVyMisfit" type="','string','" default="','104','">','     <section name="inversion" />','     <help>  </help>','  </parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="SurfaceAverageVelMisfit" type="','string','" default="','105','">','     <section name="inversion" />','     <help>   </help>','  </parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="ThicknessAbsMisfit" type="','string','" default="','106','">','     <section name="inversion" />','     <help>  </help>','  </parameter>');
++
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="DragCoefficientAbsGradient" type="','string','" default="','107','">','     <section name="inversion" />','     <help>  </help>','  </parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="RheologyBbarAbsGradient" type="','string','" default="','108','">','     <section name="inversion" />','     <help>  </help>','  </parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n','  <parameter key ="ThicknessAbsGradient" type="','string','" default="','109','">','     <section name="inversion" />','     <help> </help>','  </parameter>');
++
++			fprintf(fid,'%s\n%s\n','</frame>');    
++
++		end % }}}       
+ 		function obj = inversion(varargin) % {{{
+ 			switch nargin
+ 				case 0
+@@ -195,7 +195,7 @@
+ 			WriteData(fid,'object',obj,'fieldname','incomplete_adjoint','format','Boolean');
+ 			if ~obj.iscontrol, return; end
+ 			WriteData(fid,'object',obj,'fieldname','nsteps','format','Integer');
+-			WriteData(fid,'object',obj,'fieldname','maxiter_per_step','format','DoubleMat','mattype',3);
++			WriteData(fid,'object',obj,'fieldname','maxiter_per_step','format','IntMat','mattype',3);
+ 			WriteData(fid,'object',obj,'fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);
+ 			WriteData(fid,'object',obj,'fieldname','gradient_scaling','format','DoubleMat','mattype',3);
+ 			WriteData(fid,'object',obj,'fieldname','cost_function_threshold','format','Double');
Index: /issm/oecreview/Archive/17984-18295/ISSM-18128-18129.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18128-18129.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18128-18129.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/AUTHORS
+===================================================================
+--- ../trunk-jpl/AUTHORS	(revision 18128)
++++ ../trunk-jpl/AUTHORS	(revision 18129)
+@@ -10,7 +10,7 @@
+ Current core developers:
+    * Eric Larour <eric.larour@jpl.nasa.gov>
+    * Helene Seroussi <helene.seroussi@jpl.nasa.gov>
+-   * Mathieu Morlighem <mathieu.morlighem@jpl.nasa.gov>
++   * Mathieu Morlighem <mathieu.morlighem@uci.edu>
+ 
+ Contributors:
+ 	We thank the following contributors for their help in making ISSM better!
Index: /issm/oecreview/Archive/17984-18295/ISSM-18129-18130.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18129-18130.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18129-18130.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h	(revision 18129)
++++ ../trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h	(revision 18130)
+@@ -6,7 +6,7 @@
+ 
+ #include "../../classes/classes.h"
+ 
+-void	ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,double* gradient);
++void	ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,IssmDouble* gradient);
+ void	ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector<IssmDouble>* gradient);
+ 
+ #endif
Index: /issm/oecreview/Archive/17984-18295/ISSM-18130-18131.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18130-18131.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18130-18131.diff	(revision 18296)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/src/c/cores/control_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/control_core.cpp	(revision 18130)
++++ ../trunk-jpl/src/c/cores/control_core.cpp	(revision 18131)
+@@ -235,6 +235,9 @@
+ 	/*Update control input*/
+ 	SetControlInputsFromVectorx(femmodel,X);
+ 
++	/*Compute new temperature at this point*/
++	if(solution_type==SteadystateSolutionEnum) steadystate_core(femmodel);
++
+ 	/*Compute Adjoint*/
+ 	AdjointCorePointerFromSolutionEnum(&adjointcore,solution_type);
+ 	adjointcore(femmodel);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18131-18132.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18131-18132.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18131-18132.diff	(revision 18296)
@@ -0,0 +1,35 @@
+Index: ../trunk-jpl/src/c/cores/control_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/control_core.cpp	(revision 18131)
++++ ../trunk-jpl/src/c/cores/control_core.cpp	(revision 18132)
+@@ -130,14 +130,12 @@
+ 
+ 	/*parameters: */
+ 	int        solution_type,analysis_type,num_responses;
+-	bool       isFS           = false;
+ 	bool       conserve_loads = true;
+ 	AppCtx*    usr = (AppCtx*)usrvoid;
+ 	FemModel  *femmodel  = usr->femmodel;
+ 	int        nsize     = usr->nsize;
+ 
+ 	/*Recover parameters: */
+-	femmodel->parameters->FindParam(&isFS,FlowequationIsFSEnum);
+ 	femmodel->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+ 	femmodel->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
+@@ -203,7 +201,6 @@
+ 	/*parameters: */
+ 	void (*adjointcore)(FemModel*)=NULL;
+ 	int         solution_type,analysis_type,num_responses,num_controls,numvertices;
+-	bool        isFS           = false;
+ 	bool        conserve_loads = true;
+ 	IssmDouble *scalar_list    = NULL;
+ 	IssmDouble *Jlist          = NULL;
+@@ -214,7 +211,6 @@
+ 	int         nsize          = usr->nsize;
+ 
+ 	/*Recover parameters: */
+-	femmodel->parameters->FindParam(&isFS,FlowequationIsFSEnum);
+ 	femmodel->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+ 	femmodel->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18132-18133.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18132-18133.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18132-18133.diff	(revision 18296)
@@ -0,0 +1,4 @@
+Index: ../trunk-jpl/test/Archives/Archive322.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/17984-18295/ISSM-18133-18134.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18133-18134.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18133-18134.diff	(revision 18296)
@@ -0,0 +1,218 @@
+Index: ../trunk-jpl/src/c/modules/Orthx/Orthx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/Orthx/Orthx.cpp	(revision 18133)
++++ ../trunk-jpl/src/c/modules/Orthx/Orthx.cpp	(revision 18134)
+@@ -1,31 +0,0 @@
+-/*!\file Orthx
+- * \brief orthogonalize searching directions for inverse control methods
+- */
+-
+-#include "./Orthx.h"
+-
+-void	Orthx( Vector<IssmDouble>** pnewgradj, Vector<IssmDouble>* gradj, Vector<IssmDouble>* oldgradj){
+-
+-	/*output: */
+-	Vector<IssmDouble>* newgradj=NULL;
+-
+-	/*intermediary:*/
+-	IssmDouble norm_old,dot_product;;
+-
+-	/*Initialize output*/
+-	newgradj=gradj->Duplicate();
+-	gradj->Copy(newgradj);
+-
+-	/*rough orthagonalization
+-	gradient=gradient-(gradient'*oldgradient)*oldgradient /norm(oldgradient)^2; */
+-	if(oldgradj){
+-		norm_old=oldgradj->Norm(NORM_TWO);
+-		_assert_(norm_old!=0); 
+-		dot_product=newgradj->Dot(oldgradj);
+-		_assert_(dot_product!=NAN); 
+-		newgradj->AXPY(oldgradj,-dot_product/pow(norm_old,2));
+-	}
+-
+-	/*Assign correct pointer*/
+-	*pnewgradj=newgradj;
+-}
+Index: ../trunk-jpl/src/c/modules/Orthx/Orthx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/Orthx/Orthx.h	(revision 18133)
++++ ../trunk-jpl/src/c/modules/Orthx/Orthx.h	(revision 18134)
+@@ -1,14 +0,0 @@
+-/*!\file:  Orthx.h
+- * \brief orthogonalize searching directions for inverse control methods
+- */ 
+-
+-#ifndef _ORTHX_H
+-#define _ORTHX_H
+-
+-#include "../../classes/classes.h"
+-#include "../../shared/shared.h"
+-
+-/* local prototypes: */
+-void	Orthx( Vector<IssmDouble>** pnewgradj, Vector<IssmDouble>* gradj, Vector<IssmDouble>* oldgradj);
+-
+-#endif  /* _ORTHX_H */
+Index: ../trunk-jpl/src/c/modules/modules.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/modules.h	(revision 18133)
++++ ../trunk-jpl/src/c/modules/modules.h	(revision 18134)
+@@ -67,7 +67,6 @@
+ #include "./NodalValuex/NodalValuex.h"
+ #include "./NodeConnectivityx/NodeConnectivityx.h"
+ #include "./NodesDofx/NodesDofx.h"
+-#include "./Orthx/Orthx.h"
+ #include "./OutputDefinitionsResponsex/OutputDefinitionsResponsex.h"
+ #include "./OutputResultsx/OutputResultsx.h"
+ #include "./ConstraintsStatex/ConstraintsStatex.h"
+Index: ../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 18133)
++++ ../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 18134)
+@@ -49,8 +49,6 @@
+ 		gradient->AXPY(gradient_list[i],1.0);
+ 		delete gradient_list[i];
+ 	}
+-	//gradient->Echo();
+-	//_error_("S");
+ 
+ 	/*Check that gradient is clean*/
+ 	norm_inf=gradient->Norm(NORM_INF);
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 18133)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 18134)
+@@ -401,8 +401,6 @@
+ 					./modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp\
+ 					./modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.h\
+ 					./modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.cpp\
+-					./modules/Orthx/Orthx.h\
+-					./modules/Orthx/Orthx.cpp\
+ 					./modules/Gradjx/Gradjx.h\
+ 					./modules/Gradjx/Gradjx.cpp\
+ 					./modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp\
+@@ -420,7 +418,6 @@
+ 					./cores/controltao_core.cpp\
+ 					./cores/controlm1qn3_core.cpp\
+ 					./cores/controlvalidation_core.cpp\
+-					./cores/gradient_core.cpp\
+ 					./cores/adjointstressbalance_core.cpp\
+ 					./cores/adjointbalancethickness_core.cpp\
+ 					./cores/adjointbalancethickness2_core.cpp\
+Index: ../trunk-jpl/src/c/cores/gradient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/gradient_core.cpp	(revision 18133)
++++ ../trunk-jpl/src/c/cores/gradient_core.cpp	(revision 18134)
+@@ -1,48 +0,0 @@
+-/*!\file:  gradient_core.cpp
+- * \brief compute inverse method gradient direction.
+- */ 
+-
+-#include "./cores.h"
+-#include "../toolkits/toolkits.h"
+-#include "../classes/classes.h"
+-#include "../shared/shared.h"
+-#include "../modules/modules.h"
+-#include "../solutionsequences/solutionsequences.h"
+-
+-void gradient_core(FemModel* femmodel,int step,bool orthogonalize){ 
+-
+-	/*Intermediaries*/
+-	IssmDouble  norm_inf;
+-	IssmDouble *norm_list    = NULL;
+-	Vector<IssmDouble>*     new_gradient = NULL;
+-	Vector<IssmDouble>*     gradient     = NULL;
+-	Vector<IssmDouble>*     old_gradient = NULL;
+-
+-	/*Compute gradient*/
+-	if(VerboseControl()) _printf0_("   compute cost function gradient\n");
+-	Gradjx(&gradient,&norm_list,femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters);
+-
+-	if (orthogonalize){
+-		if(VerboseControl()) _printf0_("   orthogonalization\n");
+-		ControlInputGetGradientx(&old_gradient,femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters);
+-		Orthx(&new_gradient,gradient,old_gradient); delete old_gradient; delete gradient;
+-	}
+-	else{ 
+-		new_gradient=gradient;
+-	}
+-
+-	/*Check that gradient is clean*/
+-	norm_inf=new_gradient->Norm(NORM_INF);
+-	if(norm_inf<=0)    _error_("||∂J/∂α||∞ = 0    gradient norm is zero");
+-	if(xIsNan<IssmDouble>(norm_inf))_error_("||∂J/∂α||∞ = NaN  gradient norm is NaN");
+-
+-	/*plug back into inputs: */
+-	ControlInputSetGradientx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,new_gradient);
+-	delete new_gradient;
+-
+-	/*Scale Gradients*/
+-	ControlInputScaleGradientx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,norm_list,step);
+-
+-	/*Clean up and return*/
+-	xDelete<IssmDouble>(norm_list);
+-}
+Index: ../trunk-jpl/src/c/cores/cores.h
+===================================================================
+--- ../trunk-jpl/src/c/cores/cores.h	(revision 18133)
++++ ../trunk-jpl/src/c/cores/cores.h	(revision 18134)
+@@ -18,7 +18,6 @@
+ void adjointstressbalance_core(FemModel* femmodel);
+ void adjointbalancethickness_core(FemModel* femmodel);
+ void adjointbalancethickness2_core(FemModel* femmodel);
+-void gradient_core(FemModel* femmodel,int n=0,bool orthogonalize=false);
+ void stressbalance_core(FemModel* femmodel);
+ void hydrology_core(FemModel* femmodel);
+ void thermal_core(FemModel* femmodel);
+Index: ../trunk-jpl/src/c/cores/control_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/control_core.cpp	(revision 18133)
++++ ../trunk-jpl/src/c/cores/control_core.cpp	(revision 18134)
+@@ -10,14 +10,16 @@
+ #include "../solutionsequences/solutionsequences.h"
+ 
+ /*Local prototypes*/
++/*{{{*/
+ IssmDouble FormFunction(IssmDouble* X,void* usr);
+ IssmDouble FormFunctionGradient(IssmDouble** pG,IssmDouble* X,void* usr);
+ typedef struct {
+ 	FemModel* femmodel;
+ 	int       nsize;
+ } AppCtx;
++/*}}}*/
+ 
+-void control_core(FemModel* femmodel){
++void control_core(FemModel* femmodel){/*{{{*/
+ 
+ 	int     i;
+ 
+@@ -121,10 +123,9 @@
+ 	xDelete<IssmDouble>(cm_jump);
+ 	xDelete<IssmDouble>(J);
+ 	xDelete<IssmDouble>(X0);
+-}
++}/*}}}*/
++IssmDouble FormFunction(IssmDouble* X,void* usrvoid){/*{{{*/
+ 
+-IssmDouble FormFunction(IssmDouble* X,void* usrvoid){
+-
+ 	/*output: */
+ 	IssmDouble J;
+ 
+@@ -192,8 +193,8 @@
+ 	xDelete<IssmDouble>(XL);
+ 	xDelete<IssmDouble>(Jlist);
+ 	return J;
+-}
+-IssmDouble FormFunctionGradient(IssmDouble** pG,IssmDouble* X,void* usrvoid){
++}/*}}}*/
++IssmDouble FormFunctionGradient(IssmDouble** pG,IssmDouble* X,void* usrvoid){/*{{{*/
+ 
+ 	/*output: */
+ 	IssmDouble J;
+@@ -299,4 +300,4 @@
+ 	xDelete<IssmDouble>(Jlist);
+ 	*pG = G;
+ 	return J;
+-}
++}/*}}}*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18134-18135.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18134-18135.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18134-18135.diff	(revision 18296)
@@ -0,0 +1,295 @@
+Index: ../trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp	(revision 18134)
++++ ../trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp	(revision 18135)
+@@ -1,35 +0,0 @@
+-/*!\file ControlInputGetGradientx
+- * \brief retrieve gradient from inputs in elements
+- */
+-
+-#include "./ControlInputGetGradientx.h"
+-#include "../../shared/shared.h"
+-#include "../../toolkits/toolkits.h"
+-
+-void ControlInputGetGradientx( Vector<IssmDouble>** pgradient, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){
+-
+-	/*Intermediaries*/
+-	int  num_controls;
+-	int *control_type = NULL;
+-	Vector<IssmDouble>*  gradient=NULL;
+-
+-	/*Retrieve some parameters*/
+-	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+-	parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
+-
+-	/*Allocate and populate gradient*/
+-	gradient=new Vector<IssmDouble>(num_controls*vertices->NumberOfVertices());
+-
+-	for(int i=0;i<num_controls;i++){
+-		for(int j=0;j<elements->Size();j++){
+-			Element* element=(Element*)elements->GetObjectByOffset(j);
+-			element->ControlInputGetGradient(gradient,control_type[i],i);
+-		}
+-	}
+-
+-	gradient->Assemble();
+-
+-	/*Clean up and return*/
+-	xDelete<int>(control_type);
+-	*pgradient=gradient;
+-}
+Index: ../trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h	(revision 18134)
++++ ../trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h	(revision 18135)
+@@ -1,11 +0,0 @@
+-/*!\file:  ControlInputGetGradientx.h
+- */ 
+-
+-#ifndef _CONTROLINPUTGETGRADIENTX_H
+-#define _CONTROLINPUTGETGRADIENTX_H
+-
+-#include "../../classes/classes.h"
+-
+-void	ControlInputGetGradientx( Vector<IssmDouble>** pgradient, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
+-
+-#endif
+Index: ../trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.cpp	(revision 18134)
++++ ../trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.cpp	(revision 18135)
+@@ -1,38 +0,0 @@
+-/*!\file ControlInputScaleGradientx
+- * \brief retrieve gradient from inputs in elements
+- */
+-
+-#include "./ControlInputScaleGradientx.h"
+-#include "../../shared/shared.h"
+-#include "../../toolkits/toolkits.h"
+-
+-void ControlInputScaleGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,IssmDouble* norm_list,int step){
+-
+-	/*Intermediaries*/
+-	int     i,j,num_controls;
+-	int    *control_type = NULL;
+-	IssmDouble *scalar_list = NULL;
+-	IssmDouble  scalar;
+-
+-	/*Retrieve some parameters*/
+-	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+-	parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
+-	parameters->FindParam(&scalar_list,NULL,NULL,InversionGradientScalingEnum);
+-
+-	/*Compute scaling factor*/
+-	scalar=scalar_list[0]/norm_list[0];
+-	for(i=0;i<num_controls;i++){
+-		scalar=min(scalar,scalar_list[num_controls*step+i]/norm_list[i]);
+-	}
+-
+-	for(i=0;i<num_controls;i++){
+-		for(j=0;j<elements->Size();j++){
+-			Element* element=(Element*)elements->GetObjectByOffset(j);
+-			element->ControlInputScaleGradient(control_type[i],scalar);
+-		}
+-	}
+-
+-	/*Clean up and return*/
+-	xDelete<int>(control_type);
+-	xDelete<IssmDouble>(scalar_list);
+-}
+Index: ../trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h	(revision 18134)
++++ ../trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h	(revision 18135)
+@@ -1,11 +0,0 @@
+-/*!\file:  ControlInputScaleGradientx.h
+- */ 
+-
+-#ifndef _CONTROLINPUTSSCALEGRADIENTX_H
+-#define _CONTROLINPUTSSCALEGRADIENTX_H
+-
+-#include "../../classes/classes.h"
+-
+-void	ControlInputScaleGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,IssmDouble* norm_list,int step);
+-
+-#endif
+Index: ../trunk-jpl/src/c/modules/modules.h
+===================================================================
+--- ../trunk-jpl/src/c/modules/modules.h	(revision 18134)
++++ ../trunk-jpl/src/c/modules/modules.h	(revision 18135)
+@@ -15,9 +15,7 @@
+ #include "./ConfigureObjectsx/ConfigureObjectsx.h"
+ #include "./ContourToMeshx/ContourToMeshx.h"
+ #include "./ContourToNodesx/ContourToNodesx.h"
+-#include "./ControlInputGetGradientx/ControlInputGetGradientx.h"
+ #include "./ControlInputSetGradientx/ControlInputSetGradientx.h"
+-#include "./ControlInputScaleGradientx/ControlInputScaleGradientx.h"
+ #include "./CreateNodalConstraintsx/CreateNodalConstraintsx.h"
+ #include "./CreateJacobianMatrixx/CreateJacobianMatrixx.h"
+ #include "./DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.h"
+Index: ../trunk-jpl/src/c/Makefile.am
+===================================================================
+--- ../trunk-jpl/src/c/Makefile.am	(revision 18134)
++++ ../trunk-jpl/src/c/Makefile.am	(revision 18135)
+@@ -375,12 +375,8 @@
+ 					./cores/extrudefromtop_core.cpp\
+ 					./cores/thermal_core.cpp\
+ 					./solutionsequences/solutionsequence_thermal_nonlinear.cpp\
+-					./modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp\
+-					./modules/ControlInputGetGradientx/ControlInputGetGradientx.h\
+ 					./modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp\
+ 					./modules/ControlInputSetGradientx/ControlInputSetGradientx.h\
+-					./modules/ControlInputScaleGradientx/ControlInputScaleGradientx.cpp\
+-					./modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h\
+ 					./modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp\
+ 					./modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h\
+ 					./modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp\
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18134)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18135)
+@@ -269,9 +269,7 @@
+ 		virtual void   GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y)=0;
+ 		#endif
+ 
+-		virtual void   ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index)=0;
+ 		virtual void   ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index)=0;
+-		virtual void   ControlInputScaleGradient(int enum_type, IssmDouble scale)=0;
+ 		virtual void   ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum)=0;
+ 		virtual void   GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data)=0;
+ 		virtual void   SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index)=0;
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18134)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18135)
+@@ -2604,26 +2604,6 @@
+ 	xDelete<int>(control_type);
+ }
+ /*}}}*/
+-void       Tria::ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index){/*{{{*/
+-
+-	int vertexpidlist[NUMVERTICES];
+-
+-	Input* input=inputs->GetInput(enum_type);
+-	if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found");
+-	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
+-
+-	GradientIndexing(&vertexpidlist[0],control_index);
+-	((ControlInput*)input)->GetGradient(gradient,&vertexpidlist[0]);
+-
+-}/*}}}*/
+-void       Tria::ControlInputScaleGradient(int enum_type,IssmDouble scale){/*{{{*/
+-
+-	Input* input=inputs->GetInput(enum_type);
+-	if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found");
+-	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
+-
+-	((ControlInput*)input)->ScaleGradient(scale);
+-}/*}}}*/
+ void       Tria::ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index){/*{{{*/
+ 
+ 	int    vertexpidlist[NUMVERTICES];
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18134)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18135)
+@@ -126,8 +126,6 @@
+ 
+ 		void       GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data);
+ 		void       SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index);
+-		void       ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index);
+-		void       ControlInputScaleGradient(int enum_type,IssmDouble scale);
+ 		void       ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index);
+ 		void       ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum);
+ 		void       InputControlUpdate(IssmDouble scalar,bool save_parameter);
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18134)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18135)
+@@ -2689,47 +2689,6 @@
+ /*}}}*/
+ #endif
+ 
+-void       Penta::ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index){/*{{{*/
+-
+-	int vertexpidlist[NUMVERTICES];
+-	Input* input=NULL;
+-
+-	if(enum_type==MaterialsRheologyBbarEnum){
+-		if(!IsOnBase()) return;
+-		input=(Input*)inputs->GetInput(MaterialsRheologyBEnum);
+-	}
+-	else if(enum_type==DamageDbarEnum){
+-		if(!IsOnBase()) return;
+-		input=(Input*)inputs->GetInput(DamageDEnum);
+-	}
+-	else{
+-		input=inputs->GetInput(enum_type);
+-	}
+-	if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found");
+-	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
+-
+-	GradientIndexing(&vertexpidlist[0],control_index);
+-	((ControlInput*)input)->GetGradient(gradient,&vertexpidlist[0]);
+-
+-}/*}}}*/
+-void       Penta::ControlInputScaleGradient(int enum_type,IssmDouble scale){/*{{{*/
+-
+-	Input* input=NULL;
+-
+-	if(enum_type==MaterialsRheologyBbarEnum){
+-		input=(Input*)inputs->GetInput(MaterialsRheologyBEnum);
+-	}
+-	else if(enum_type==DamageDbarEnum){
+-		input=(Input*)inputs->GetInput(DamageDEnum);
+-	}
+-	else{
+-		input=inputs->GetInput(enum_type);
+-	}
+-	if (!input) _error_("Input " << EnumToStringx(enum_type) << " not found");
+-	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input " << EnumToStringx(enum_type) << " is not a ControlInput");
+-
+-	((ControlInput*)input)->ScaleGradient(scale);
+-}/*}}}*/
+ void       Penta::ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index){/*{{{*/
+ 
+ 	int    vertexpidlist[NUMVERTICES];
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 18134)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 18135)
+@@ -121,8 +121,6 @@
+ 
+ 		void   GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data);
+ 		void   SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index);
+-		void   ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index);
+-		void   ControlInputScaleGradient(int enum_type,IssmDouble scale);
+ 		void   ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index);
+ 		void   ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum);
+ 		void   InputControlUpdate(IssmDouble scalar,bool save_parameter);
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 18134)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 18135)
+@@ -157,8 +157,6 @@
+ 
+ 		void       GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data){_error_("not implemented yet");};
+ 		void       SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index){_error_("not implemented yet");};
+-		void       ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index){_error_("not implemented yet");};
+-		void       ControlInputScaleGradient(int enum_type,IssmDouble scale){_error_("not implemented yet");};
+ 		void       ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index){_error_("not implemented yet");};
+ 		void       ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum){_error_("not implemented yet");};
+ 		void       InputControlUpdate(IssmDouble scalar,bool save_parameter){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 18134)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 18135)
+@@ -163,8 +163,6 @@
+ 		void       GradientIndexing(int* indexing,int control_index){_error_("not implemented yet");};
+ 		void       GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data){_error_("not implemented yet");};
+ 		void       SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index){_error_("not implemented yet");};
+-		void       ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index){_error_("not implemented yet");};
+-		void       ControlInputScaleGradient(int enum_type,IssmDouble scale){_error_("not implemented yet");};
+ 		void       ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index){_error_("not implemented yet");};
+ 		void       ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum){_error_("not implemented yet");};
+ 		void       InputControlUpdate(IssmDouble scalar,bool save_parameter){_error_("not implemented yet");};
Index: /issm/oecreview/Archive/17984-18295/ISSM-18135-18136.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18135-18136.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18135-18136.diff	(revision 18296)
@@ -0,0 +1,133 @@
+Index: ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h	(revision 18135)
++++ ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h	(revision 18136)
+@@ -33,6 +33,7 @@
+ 		void UpdateConstraints(FemModel* femmodel);
+ 
+ 		/*Intermediaries*/
+-		void CreateDamageFInput(Element* element);
++		void CreateDamageFInputPralong(Element* element);
++		void CreateDamageFInputExp(Element* element);
+ };
+ #endif
+Index: ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 18135)
++++ ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 18136)
+@@ -265,7 +265,7 @@
+ 	if(!element->IsIceInElement()) return NULL;
+ 
+ 	/*Intermediaries*/
+-	int      domaintype;
++	int      domaintype,damagelaw;
+ 	Element* basalelement;
+ 	IssmDouble  Jdet,dt;
+ 	IssmDouble  f,damage;
+@@ -284,6 +284,7 @@
+ 		default: _error_("mesh "<<EnumToStringx(domaintype)<<" not supported yet");
+ 	}
+ 
++
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes = basalelement->GetNumberOfNodes();
+ 
+@@ -294,7 +295,13 @@
+ 	/*Retrieve all inputs and parameters*/
+ 	basalelement->GetVerticesCoordinates(&xyz_list);
+ 	basalelement->FindParam(&dt,TimesteppingTimeStepEnum);
+-	this->CreateDamageFInput(basalelement);
++	basalelement->FindParam(&damagelaw,DamageLawEnum);
++	if(damagelaw==1 | damagelaw==2){
++		this->CreateDamageFInputPralong(basalelement);
++	}
++	else if(damagelaw==3){
++		this->CreateDamageFInputExp(basalelement);
++	}
+ 	Input* damaged_input = basalelement->GetInput(DamageDEnum); _assert_(damaged_input);
+ 	Input* damagef_input = basalelement->GetInput(DamageFEnum); _assert_(damagef_input);
+ 
+@@ -439,7 +446,7 @@
+ }/*}}}*/
+ 
+ /*Intermediaries*/
+-void DamageEvolutionAnalysis::CreateDamageFInput(Element* element){/*{{{*/
++void DamageEvolutionAnalysis::CreateDamageFInputPralong(Element* element){/*{{{*/
+ 
+ 	/*Intermediaries */
+ 	IssmDouble c1,c2,c3,healing,stress_threshold;
+@@ -526,3 +533,74 @@
+ 	xDelete<IssmDouble>(f);
+ 	delete gauss;
+ }/*}}}*/
++void DamageEvolutionAnalysis::CreateDamageFInputExp(Element* element){/*{{{*/
++
++	/*Intermediaries */
++	IssmDouble epsf,stress_threshold,eps0;
++	IssmDouble damage,B,n,epseff;
++	IssmDouble eps_xx,eps_yy,eps_xy,eps1,eps2,epstmp;
++	int domaintype,damagelaw;
++
++	/*Fetch number of vertices and allocate output*/
++	int numnodes = element->GetNumberOfNodes();
++	IssmDouble* f   = xNew<IssmDouble>(numnodes);
++
++	/*retrieve parameters:*/
++	element->FindParam(&epsf,DamageC1Enum);
++	element->FindParam(&stress_threshold,DamageStressThresholdEnum);
++	element->FindParam(&domaintype,DomainTypeEnum);
++	element->FindParam(&damagelaw,DamageLawEnum);
++
++	/*Compute stress tensor: */
++	element->ComputeDeviatoricStressTensor();
++
++	/*retrieve what we need: */
++	Input* eps_xx_input  = element->GetInput(StrainRatexxEnum);     _assert_(eps_xx_input);
++	Input* eps_xy_input  = element->GetInput(StrainRatexyEnum);     _assert_(eps_xy_input);
++	Input* eps_yy_input  = element->GetInput(StrainRateyyEnum);     _assert_(eps_yy_input);
++	Input*  n_input=element->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
++	Input* damage_input = NULL;
++	Input* B_input = NULL;
++	if(domaintype==Domain2DhorizontalEnum){
++		damage_input = element->GetInput(DamageDbarEnum); 	_assert_(damage_input);
++		B_input=element->GetInput(MaterialsRheologyBbarEnum); _assert_(B_input);
++	}
++	else{
++		damage_input = element->GetInput(DamageDEnum);   _assert_(damage_input);
++		B_input=element->GetInput(MaterialsRheologyBEnum); _assert_(B_input);
++	}
++
++	/*Calculate damage evolution source term: */
++	Gauss* gauss=element->NewGauss();
++	for (int i=0;i<numnodes;i++){
++		gauss->GaussNode(element->GetElementType(),i);
++		
++		eps_xx_input->GetInputValue(&eps_xx,gauss);
++		eps_xy_input->GetInputValue(&eps_xy,gauss);
++		eps_yy_input->GetInputValue(&eps_yy,gauss);
++		B_input->GetInputValue(&B,gauss);
++		n_input->GetInputValue(&n,gauss);
++		damage_input->GetInputValue(&damage,gauss);
++	
++		/*Calculate principal effective strain rates*/
++		eps1=(eps_xx+eps_yy)/2.+sqrt(pow((eps_xx-eps_yy)/2.,2)+pow(eps_xy,2));
++		eps2=(eps_xx+eps_yy)/2.-sqrt(pow((eps_xx-eps_yy)/2.,2)+pow(eps_xy,2));
++		if(fabs(eps2)>fabs(eps1)){epstmp=eps2; eps2=eps1; eps1=epstmp;}
++
++		/*Calculate effective strain rate and threshold strain rate*/
++		epseff=1./sqrt(2.)*sqrt(eps1*eps1-eps1*eps2+eps2*eps2);
++		eps0=pow(stress_threshold/B,n);
++
++		if(epseff>eps0){
++			f[i]=1.-pow(eps0/epseff,1./n)*exp(-(epseff-eps0)/(epsf-eps0))-damage;
++		}
++		else f[i]=0;
++	}
++
++	/*Add input*/
++	element->AddInput(DamageFEnum,f,element->GetElementType());
++	
++	/*Clean up and return*/
++	xDelete<IssmDouble>(f);
++	delete gauss;
++}/*}}}*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18136-18137.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18136-18137.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18136-18137.diff	(revision 18296)
@@ -0,0 +1,133 @@
+Index: ../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp	(revision 18136)
++++ ../trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp	(revision 18137)
+@@ -47,9 +47,16 @@
+ 	IssmDouble* J = xNew<IssmDouble>(nsteps);
+ 	IssmDouble* X = xNew<IssmDouble>(nsize);
+ 
++	/*Header of printf*/
++	_printf0_("\n");
++	_printf0_("       x       |  Cost function f(x)  |  List of contributions\n");
++
+ 	/*start iterations*/
+ 	for(int n=0;n<nsteps;n++){
+ 
++		/*Print iteration number*/
++		_printf0_("====================== step "<< n+1 << "/" << nsteps <<" ===============================\n");
++
+ 		/*Reset some variables*/
+ 		iter = 0;
+ 		xmin = 0.;
+@@ -58,17 +65,14 @@
+ 		cout<<setprecision(5);
+ 
+ 		/*Get current Gradient at xmin=0*/
+-		if(VerboseControl()) _printf0_("\n" << "   step " << n+1 << "/" << nsteps << "\n");
++		_printf0_(" x = "<<setw(9)<<xmin<<" | ");
+ 		fxmin = (*g)(&G,X0,usr); if(xIsNan<IssmDouble>(fxmin)) _error_("Function evaluation returned NaN");
+-		if(VerboseControl()) _printf0_("\n");
+-		if(VerboseControl()) _printf0_("       Iteration         x           f(x)       Tolerance         Procedure\n");
+-		if(VerboseControl()) _printf0_("\n");
+-		if(VerboseControl()) _printf0_("           N/A    "<<setw(12)<<xmin<<"  "<<setw(12)<<fxmin<<"           N/A         boundary\n");
+ 		
+ 		/*Get f(xmax)*/
++		_printf0_(" x = "<<setw(9)<<xmax<<" | ");
+ 		for(int i=0;i<nsize;i++) X[i]=X0[i]+xmax*G[i];
+ 		fxmax = (*f)(X,usr); if (xIsNan<IssmDouble>(fxmax)) _error_("Function evaluation returned NaN");
+-		if(VerboseControl()) _printf0_("           N/A    "<<setw(12)<<xmax<<"  "<<setw(12)<<fxmax<<"           N/A         boundary\n");
++		//if(VerboseControl()) _printf0_("           N/A    "<<setw(12)<<xmax<<"  "<<setw(12)<<fxmax<<"           N/A         boundary\n");
+ 
+ 		/*test if jump option activated and xmin==0*/
+ 		if(!xIsNan<IssmDouble>(cm_jump[n]) && (xmin==0) && (fxmax/fxmin)<cm_jump[n]){
+@@ -91,6 +95,7 @@
+ 		x=xbest;
+ 
+ 		/*2: call the function to be evaluated*/
++		_printf0_(" x = "<<setw(9)<<x<<" | ");
+ 		for(int i=0;i<nsize;i++) X[i]=X0[i]+x*G[i];
+ 		fxbest = (*f)(X,usr); if(xIsNan<IssmDouble>(fxbest)) _error_("Function evaluation returned NaN");
+ 		iter++;
+@@ -105,10 +110,10 @@
+ 		tol2=2.0*tol1;
+ 
+ 		/*4: print result*/
+-		if(VerboseControl())
+-		 _printf0_("         "<<setw(5)<<iter<<"    "<<setw(12)<<xbest<<"  "<<setw(12)<<fxbest<<"  "<<setw(12)<<pow(pow(xbest-xm,2),0.5)<<"         initial\n");
++		//if(VerboseControl())
++		 //_printf0_("         "<<setw(5)<<iter<<"    "<<setw(12)<<xbest<<"  "<<setw(12)<<fxbest<<"  "<<setw(12)<<pow(pow(xbest-xm,2),0.5)<<"         initial\n");
+ 		if (!xIsNan<IssmDouble>(cm_jump[n]) && (xmin==0) && ((fxbest/fxmin)<cm_jump[n])){
+-			if(VerboseControl()) _printf0_("      optimization terminated: current x satisfies criteria 'cm_jump'=" << cm_jump[n] << "\n");
++			//if(VerboseControl()) _printf0_("      optimization terminated: current x satisfies criteria 'cm_jump'=" << cm_jump[n] << "\n");
+ 			loop=false;
+ 		}
+ 
+@@ -175,6 +180,7 @@
+ 			else                           x=xbest+si*tol1;
+ 
+ 			//evaluate function on x
++			_printf0_(" x = "<<setw(9)<<x<<" | ");
+ 			for(int i=0;i<nsize;i++) X[i]=X0[i]+x*G[i];
+ 			fx = (*f)(X,usr); if(xIsNan<IssmDouble>(fx)) _error_("Function evaluation returned NaN");
+ 			iter++;
+@@ -201,21 +207,21 @@
+ 			xm = 0.5*(xmin+xmax);
+ 			tol1=seps*pow(pow(xbest,2),0.5)+tolerance/3.0;
+ 			tol2=2.0*tol1;
+-			if(VerboseControl())
+-			 _printf0_("         "<<setw(5)<<iter<<"    "<<setw(12)<<x<<"  "<<setw(12)<<fx<<"  "<<setw(12)<<pow(pow(xbest-xm,2),0.5)<<
+-						 "         "<<(goldenflag?"golden":"parabolic")<<"\n");
++			//if(VerboseControl())
++			// _printf0_("         "<<setw(5)<<iter<<"    "<<setw(12)<<x<<"  "<<setw(12)<<fx<<"  "<<setw(12)<<pow(pow(xbest-xm,2),0.5)<<
++			//			 "         "<<(goldenflag?"golden":"parabolic")<<"\n");
+ 
+ 			/*Stop the optimization?*/
+ 			if (sqrt(pow(xbest-xm,2)) < (tol2-0.5*(xmax-xmin))){
+-				if(VerboseControl()) _printf0_("      optimization terminated: current x satisfies criteria 'tolx'=" << tolerance << "\n");
++				//if(VerboseControl()) _printf0_("      optimization terminated: current x satisfies criteria 'tolx'=" << tolerance << "\n");
+ 				loop=false;
+ 			}
+ 			else if (iter>=maxiter[n]){
+-				if(VerboseControl()) _printf0_("      exiting: Maximum number of iterations has been exceeded  ('maxiter'=" << maxiter[n] << ")\n");
++				//if(VerboseControl()) _printf0_("      exiting: Maximum number of iterations has been exceeded  ('maxiter'=" << maxiter[n] << ")\n");
+ 				loop=false;
+ 			}
+ 			else if (!xIsNan<IssmDouble>(cm_jump[n]) && (xmin==0) && ((fxbest/fxmin)<cm_jump[n])){
+-				if(VerboseControl()) _printf0_("      optimization terminated: current x satisfies criteria 'cm_jump'=" << cm_jump[n] << "\n");
++				//if(VerboseControl()) _printf0_("      optimization terminated: current x satisfies criteria 'cm_jump'=" << cm_jump[n] << "\n");
+ 				loop=false;
+ 			}
+ 			else{
+Index: ../trunk-jpl/src/c/cores/control_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/control_core.cpp	(revision 18136)
++++ ../trunk-jpl/src/c/cores/control_core.cpp	(revision 18137)
+@@ -182,12 +182,10 @@
+ 	/*Compute misfit for this velocity field.*/
+ 	IssmDouble* Jlist = NULL;
+ 	femmodel->CostFunctionx(&J,&Jlist,NULL);
+-	//_printf0_("f(x) = "<<setw(12)<<setprecision(7)<<*pf<<"  |  ");
++	_printf0_("f(x) = "<<setw(12)<<setprecision(7)<<J<<"  |  ");
++	for(int i=0;i<num_responses;i++) _printf0_(" "<<setw(12)<<setprecision(7)<<Jlist[i]);
++	_printf0_("\n");
+ 
+-	/*Retrieve objective functions independently*/
+-	//for(int i=0;i<num_responses;i++) _printf0_(" "<<setw(12)<<setprecision(7)<<Jlist[i]);
+-	//_printf0_("\n");
+-
+ 	/*Free ressources:*/
+ 	xDelete<IssmDouble>(XU);
+ 	xDelete<IssmDouble>(XL);
+@@ -288,9 +286,9 @@
+ 
+ 	/*Compute misfit for this velocity field.*/
+ 	femmodel->CostFunctionx(&J,&Jlist,NULL);
+-	//_printf0_("f(x) = "<<setw(12)<<setprecision(7)<<*pf<<"  |  ");
+-	//for(int i=0;i<num_responses;i++) _printf0_(" "<<setw(12)<<setprecision(7)<<Jlist[i]);
+-	//_printf0_("\n");
++	_printf0_("f(x) = "<<setw(12)<<setprecision(7)<<J<<"  |  ");
++	for(int i=0;i<num_responses;i++) _printf0_(" "<<setw(12)<<setprecision(7)<<Jlist[i]);
++	_printf0_("\n");
+ 
+ 	/*Clean-up and return*/
+ 	xDelete<IssmDouble>(XU);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18137-18138.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18137-18138.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18137-18138.diff	(revision 18296)
@@ -0,0 +1,101 @@
+Index: ../trunk-jpl/test/Archives/Archive212.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive272.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive322.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive215.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive513.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive319.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive320.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive213.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive415.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive511.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive321.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive214.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive416.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/test/Archives/Archive512.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/src/c/cores/control_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/control_core.cpp	(revision 18137)
++++ ../trunk-jpl/src/c/cores/control_core.cpp	(revision 18138)
+@@ -251,38 +251,13 @@
+ 		}
+ 	}
+ 
+-	/*Needed for output results (FIXME: should be placed 6 lines below)*/
+-	ControlInputSetGradientx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,G);
+-
+ 	for(long i=0;i<nsize;i++){
+ 		if(X[i]>=XU[i]) G[i]=0.;
+ 		if(X[i]<=XL[i]) G[i]=0.;
+ 	}
+ 
+-	/*solve forward: (FIXME: not needed actually...)*/
+-	switch(solution_type){
+-		case SteadystateSolutionEnum:
+-			femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
+-			stressbalance_core(femmodel);	//We need a 3D velocity!! (vz is required for the next thermal run)
+-			break;
+-		case StressbalanceSolutionEnum:
+-			femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
+-			solutionsequence_nonlinear(femmodel,conserve_loads); 
+-			break;
+-		case BalancethicknessSolutionEnum:
+-			femmodel->SetCurrentConfiguration(BalancethicknessAnalysisEnum);
+-			solutionsequence_linear(femmodel); 
+-			break;
+-		case BalancethicknessSoftSolutionEnum:
+-			/*NOTHING*/
+-			break;
+-		case Balancethickness2SolutionEnum:
+-			femmodel->SetCurrentConfiguration(Balancethickness2AnalysisEnum);
+-			solutionsequence_linear(femmodel); 
+-			break;
+-		default:
+-			_error_("Solution " << EnumToStringx(solution_type) << " not implemented yet");
+-	}
++	/*Needed for output results*/
++	ControlInputSetGradientx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,G);
+ 
+ 	/*Compute misfit for this velocity field.*/
+ 	femmodel->CostFunctionx(&J,&Jlist,NULL);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18138-18139.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18138-18139.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18138-18139.diff	(revision 18296)
@@ -0,0 +1,76 @@
+Index: ../trunk-jpl/src/c/classes/Elements/TetraRef.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/TetraRef.cpp	(revision 18138)
++++ ../trunk-jpl/src/c/classes/Elements/TetraRef.cpp	(revision 18139)
+@@ -29,11 +29,15 @@
+ /*}}}*/
+ 
+ /*Reference Element numerics*/
+-void TetraRef::GetNodalFunctions(IssmDouble* basis,GaussTetra* gauss,int finiteelement){/*{{{*/
++void TetraRef::GetNodalFunctions(IssmDouble* basis,Gauss* gauss_in,int finiteelement){/*{{{*/
+ 	/*This routine returns the values of the nodal functions  at the gaussian point.*/
+ 
+ 	_assert_(basis);
+ 
++	/*Cast gauss to GaussTetra*/
++	_assert_(gauss_in->Enum()==GaussTetraEnum);
++	GaussTetra* gauss = dynamic_cast<GaussTetra*>(gauss_in);
++
+ 	switch(finiteelement){
+ 		case P0Enum:
+ 			basis[0]=1.;
+@@ -238,7 +242,7 @@
+ 	p[2]=dpz;
+ }
+ /*}}}*/
+-void TetraRef::GetInputValue(IssmDouble* p, IssmDouble* plist, GaussTetra* gauss,int finiteelement){/*{{{*/
++void TetraRef::GetInputValue(IssmDouble* p, IssmDouble* plist, Gauss* gauss,int finiteelement){/*{{{*/
+ 
+ 	/*Output*/
+ 	IssmDouble value =0.;
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.cpp	(revision 18138)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.cpp	(revision 18139)
+@@ -873,6 +873,10 @@
+ 	this->InputUpdateFromIoModel(index,iomodel);
+ }
+ /*}}}*/
++void     Tetra::ValueP1OnGauss(IssmDouble* pvalue,IssmDouble* values,Gauss* gauss){/*{{{*/
++	TetraRef::GetInputValue(pvalue,values,gauss,P1Enum);
++}
++/*}}}*/
+ int      Tetra::VelocityInterpolation(void){/*{{{*/
+ 	return TetraRef::VelocityInterpolation(this->element_type);
+ }
+Index: ../trunk-jpl/src/c/classes/Elements/TetraRef.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/TetraRef.h	(revision 18138)
++++ ../trunk-jpl/src/c/classes/Elements/TetraRef.h	(revision 18139)
+@@ -19,11 +19,11 @@
+ 		void GetJacobianDeterminant(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussTetra* gauss);
+ 		void GetJacobianDeterminantFace(IssmDouble*  Jdet, IssmDouble* xyz_list,GaussTetra* gauss);
+ 		void GetJacobianInvert(IssmDouble* Jinv, IssmDouble* xyz_list,GaussTetra* gauss);
+-		void GetNodalFunctions(IssmDouble* basis,GaussTetra* gauss,int finiteelement);
++		void GetNodalFunctions(IssmDouble* basis,Gauss* gauss_in,int finiteelement);
+ 		void GetNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list, GaussTetra* gauss,int finiteelement);
+ 		void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussTetra* gauss,int finiteelement);
+ 		void GetInputDerivativeValue(IssmDouble* p, IssmDouble* plist,IssmDouble* xyz_list, GaussTetra* gauss,int finiteelement);
+-		void GetInputValue(IssmDouble* p, IssmDouble* plist, GaussTetra* gauss,int finiteelement);
++		void GetInputValue(IssmDouble* p, IssmDouble* plist, Gauss* gauss,int finiteelement);
+ 
+ 		int  NumberofNodes(int finiteelement);
+ 		int  VelocityInterpolation(int fe_stokes);
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 18138)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 18139)
+@@ -104,7 +104,7 @@
+ 		Tria*       SpawnTria(int index1,int index2,int index3);
+ 		IssmDouble  StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa){_error_("not implemented yet");};
+ 		int         PressureInterpolation(void);
+-		void        ValueP1OnGauss(IssmDouble* pvalue,IssmDouble* values,Gauss* gauss){_error_("not implemented yet");};
++		void        ValueP1OnGauss(IssmDouble* pvalue,IssmDouble* values,Gauss* gauss);
+ 		void        ValueP1DerivativesOnGauss(IssmDouble* dvalue,IssmDouble* values,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
+ 		int         VelocityInterpolation(void);
+ 		int         TensorInterpolation(void);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18139-18140.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18139-18140.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18139-18140.diff	(revision 18296)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateFaces.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateFaces.cpp	(revision 18139)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateFaces.cpp	(revision 18140)
+@@ -163,6 +163,7 @@
+ 			elementfaces_markers[0] = 1;
+ 			elementfaces_markers[1] = 1;
+ 			elementfaces_markers[2] = 1;
++			elementfaces_markers[3] = 1;
+ 			elementfaces[cols*0+0] = 3; elementfaces[cols*0+1] = 0;  elementfaces[cols*0+2] = 1; elementfaces[cols*0+3] = 2;
+ 			elementfaces[cols*1+0] = 3; elementfaces[cols*1+1] = 0;  elementfaces[cols*1+2] = 3; elementfaces[cols*1+3] = 1;
+ 			elementfaces[cols*2+0] = 3; elementfaces[cols*2+1] = 1;  elementfaces[cols*2+2] = 3; elementfaces[cols*2+3] = 2;
Index: /issm/oecreview/Archive/17984-18295/ISSM-18140-18141.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18140-18141.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18140-18141.diff	(revision 18296)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/m/mech/basalstress.m
+===================================================================
+--- ../trunk-jpl/src/m/mech/basalstress.m	(revision 18140)
++++ ../trunk-jpl/src/m/mech/basalstress.m	(revision 18141)
+@@ -1,6 +1,8 @@
+ function [bx by b]=basalstress(md)
+ %BASALSTRESS - compute basal stress from basal drag and geometric information. 
+ %
++%      Computes basal stress from geometric information and ice velocity in md.initialization.
++%
+ %   Usage:
+ %      [bx by b]=basalstress(md);
+ %
+Index: ../trunk-jpl/src/m/plot/plotdoc.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/plotdoc.m	(revision 18140)
++++ ../trunk-jpl/src/m/plot/plotdoc.m	(revision 18141)
+@@ -11,7 +11,7 @@
+ disp('       ''data'' : what we want to plot');
+ disp('                Available values for ''data'' are: ');
+ disp('                  - any field of the model structure. ex: plot(md,''data'',''vel''), or plot(md,''data'',md.initialization.vel)');
+-disp('                  - ''basal_drag'': plot the basal drag on the bed (in kPa)');
++disp('                  - ''basal_drag'': plot the basal drag on the bed (in kPa) based on the velocity in md.initialization');
+ disp('                  - ''basal_dragx'' or ''basal_dragy'' : plot a component of the basal drag on the bed (in kPa)');
+ disp('                  - ''boundaries'': this will draw all the segment boundaries to the model, including rifts.');
+ disp('                  - ''icefront'': this will show segments that are used to define the icefront of the model (Neumann boundary conditions).');
Index: /issm/oecreview/Archive/17984-18295/ISSM-18141-18142.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18141-18142.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18141-18142.diff	(revision 18296)
@@ -0,0 +1,21 @@
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 18141)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 18142)
+@@ -1163,7 +1163,7 @@
+ 					elements(3*(i-1)+1,:) = [v1 v2 v3 v4];
+ 					elements(3*(i-1)+2,:) = [v2 v4 v5 v6];
+ 					elements(3*(i-1)+3,:) = [v2 v3 v4 v6];
+-				elseif(min(v2,v4)>min(v1,v5) & min(v1,v6)<min(v3,v4) & min(v3,v5)>min(v2,v6)),
++				elseif(min(v2,v4)>min(v1,v5) & min(v1,v6)<min(v3,v4) & min(v3,v5)<min(v2,v6)),
+ 					elements(3*(i-1)+1,:) = [v1 v4 v5 v6];
+ 					elements(3*(i-1)+2,:) = [v1 v2 v3 v5];
+ 					elements(3*(i-1)+3,:) = [v1 v3 v5 v6];
+@@ -1176,7 +1176,6 @@
+ 					elements(3*(i-1)+2,:) = [v1 v2 v3 v5];
+ 					elements(3*(i-1)+3,:) = [v3 v4 v5 v6];
+ 				elseif(min(v2,v4)>min(v1,v5) & min(v1,v6)<min(v3,v4) & min(v3,v5)<min(v2,v6)),
+-					%NEW
+ 					elements(3*(i-1)+1,:) = [v1 v5 v6 v4];
+ 					elements(3*(i-1)+2,:) = [v1 v2 v3 v5];
+ 					elements(3*(i-1)+3,:) = [v5 v6 v3 v1];
Index: /issm/oecreview/Archive/17984-18295/ISSM-18142-18143.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18142-18143.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18142-18143.diff	(revision 18296)
@@ -0,0 +1,48 @@
+Index: ../trunk-jpl/src/c/classes/Elements/TetraRef.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/TetraRef.cpp	(revision 18142)
++++ ../trunk-jpl/src/c/classes/Elements/TetraRef.cpp	(revision 18143)
+@@ -353,6 +353,7 @@
+ 		case MINIcondensedEnum:     return NUMNODESP1b+NUMNODESP1;
+ 		case MINIEnum:              return NUMNODESP1b+NUMNODESP1;
+ 		case TaylorHoodEnum:        return NUMNODESP2+NUMNODESP1;
++		case XTaylorHoodEnum:       return NUMNODESP2+NUMNODESP1;
+ 		default: _error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
+ 	}
+ 
+@@ -367,13 +368,14 @@
+ 		case MINIcondensedEnum: return P1bubbleEnum;
+ 		case MINIEnum:          return P1bubbleEnum;
+ 		case TaylorHoodEnum:    return P2Enum;
++		case XTaylorHoodEnum:   return P2Enum;
+ 		default:       _error_("Element type "<<EnumToStringx(fe_stokes)<<" not supported yet");
+ 	}
+ 
+ 	return -1;
+ }
+ /*}}}*/
+-int TetraRef::PressureInterpolation(int fe_stokes){/*{{{*/
++int  TetraRef::PressureInterpolation(int fe_stokes){/*{{{*/
+ 
+ 	switch(fe_stokes){
+ 		case P1P1Enum:          return P1Enum;
+@@ -381,6 +383,7 @@
+ 		case MINIcondensedEnum: return P1Enum;
+ 		case MINIEnum:          return P1Enum;
+ 		case TaylorHoodEnum:    return P1Enum;
++		case XTaylorHoodEnum:   return P1Enum;
+ 		default:       _error_("Element type "<<EnumToStringx(fe_stokes)<<" not supported yet");
+ 	}
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.cpp	(revision 18142)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.cpp	(revision 18143)
+@@ -843,6 +843,7 @@
+ 			tetra_node_ids[8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofelements+iomodel->elements[4*index+3];
+ 			break;
+ 		case TaylorHoodEnum:
++		case XTaylorHoodEnum:
+ 			numnodes        = 14;
+ 			tetra_node_ids  = xNew<int>(numnodes);
+ 			tetra_node_ids[0]=iomodel->nodecounter+iomodel->elements[4*index+0];
Index: /issm/oecreview/Archive/17984-18295/ISSM-18147-18148.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18147-18148.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18147-18148.diff	(revision 18296)
@@ -0,0 +1,170 @@
+Index: ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 18147)
++++ ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 18148)
+@@ -2,6 +2,7 @@
+  * \brief triple multiply
+  */ 
+ 
++#include "../Elements/elements.h"
+ /*Headers*/
+ /*{{{*/
+ #include <stdio.h>
+@@ -308,6 +309,7 @@
+ 	xDelete<int>(pindx);
+ 	return noerr;
+ }/*}}}*/
++
+ void Matrix2x2Determinant(IssmDouble* Adet,IssmDouble* A){/*{{{*/
+ 	/*Compute determinant of a 2x2 matrix*/
+ 
+@@ -331,6 +333,7 @@
+ 	Ainv[3]=   A[0]/det; /* =  a/det */
+ 
+ }/*}}}*/
++
+ void Matrix3x3Determinant(IssmDouble* Adet,IssmDouble* A){/*{{{*/
+ 	/*Compute determinant of a 3x3 matrix*/
+ 
+@@ -338,6 +341,16 @@
+ 	*Adet= A[0]*A[4]*A[8]-A[0]*A[5]*A[7]-A[3]*A[1]*A[8]+A[3]*A[2]*A[7]+A[6]*A[1]*A[5]-A[6]*A[2]*A[4];
+ }
+ /*}}}*/
++IssmDouble Matrix3x3Determinant(IssmDouble a1,IssmDouble a2,IssmDouble a3, IssmDouble b1,IssmDouble b2,IssmDouble b3, IssmDouble c1,IssmDouble c2,IssmDouble c3){/*{{{*/
++	/*Compute determinant of a 3x3 matrix*/
++
++	/*det = a*(e*i-f*h)-b*(d*i-f*g)+c*(d*h-e*g)
++	 * a b c   a1 a2 a3
++	 * d e f   b1 b2 b3
++	 * g h i   c1 c2 c3 */
++	return a1*b2*c3-a1*b3*c2-b1*a2*c3+b1*a3*c2+c1*a2*b3-c1*a3*b2;
++}
++/*}}}*/
+ void Matrix3x3Invert(IssmDouble* Ainv,IssmDouble* A){/*{{{*/
+ 
+ 	/*Intermediaries*/
+@@ -367,6 +380,100 @@
+ 	for(int i=0;i<3;i++) X[i]=Ainv[i][0]*B[0] + Ainv[i][1]*B[1] + Ainv[i][2]*B[2];
+ 
+ }/*}}}*/
++
++void Matrix4x4Determinant(IssmDouble* Adet,IssmDouble* A){/*{{{*/
++	/*Compute determinant of a 4x4 matrix*/
++
++	IssmDouble a1 = A[0*4+0];
++	IssmDouble b1 = A[0*4+1]; 
++	IssmDouble c1 = A[0*4+2];
++	IssmDouble d1 = A[0*4+3];
++
++	IssmDouble a2 = A[1*4+0];
++	IssmDouble b2 = A[1*4+1]; 
++	IssmDouble c2 = A[1*4+2];
++	IssmDouble d2 = A[1*4+3];
++
++	IssmDouble a3 = A[2*4+0]; 
++	IssmDouble b3 = A[2*4+1];
++	IssmDouble c3 = A[2*4+2];
++	IssmDouble d3 = A[2*4+3];
++
++	IssmDouble a4 = A[3*4+0];
++	IssmDouble b4 = A[3*4+1]; 
++	IssmDouble c4 = A[3*4+2];
++	IssmDouble d4 = A[3*4+3];
++
++	*Adet= a1 * Matrix3x3Determinant(b2, b3, b4, c2, c3, c4, d2, d3, d4)
++		  - b1 * Matrix3x3Determinant(a2, a3, a4, c2, c3, c4, d2, d3, d4)
++		  + c1 * Matrix3x3Determinant(a2, a3, a4, b2, b3, b4, d2, d3, d4)
++		  - d1 * Matrix3x3Determinant(a2, a3, a4, b2, b3, b4, c2, c3, c4);
++}
++/*}}}*/
++void Matrix4x4Adjoint(IssmDouble* Aadj,IssmDouble* A){/*{{{*/
++
++    IssmDouble a1 = A[0*4+0];
++    IssmDouble b1 = A[0*4+1]; 
++    IssmDouble c1 = A[0*4+2];
++    IssmDouble d1 = A[0*4+3];
++
++    IssmDouble a2 = A[1*4+0];
++    IssmDouble b2 = A[1*4+1]; 
++    IssmDouble c2 = A[1*4+2];
++    IssmDouble d2 = A[1*4+3];
++
++    IssmDouble a3 = A[2*4+0];
++    IssmDouble b3 = A[2*4+1];
++    IssmDouble c3 = A[2*4+2];
++    IssmDouble d3 = A[2*4+3];
++
++    IssmDouble a4 = A[3*4+0];
++    IssmDouble b4 = A[3*4+1]; 
++    IssmDouble c4 = A[3*4+2];
++    IssmDouble d4 = A[3*4+3];
++
++    /* Row column labeling reversed since we transpose rows & columns*/
++    Aadj[0*4+0]  =   Matrix3x3Determinant(b2, b3, b4, c2, c3, c4, d2, d3, d4);
++    Aadj[1*4+0]  = - Matrix3x3Determinant(a2, a3, a4, c2, c3, c4, d2, d3, d4);
++    Aadj[2*4+0]  =   Matrix3x3Determinant(a2, a3, a4, b2, b3, b4, d2, d3, d4);
++    Aadj[3*4+0]  = - Matrix3x3Determinant(a2, a3, a4, b2, b3, b4, c2, c3, c4);
++
++    Aadj[0*4+1]  = - Matrix3x3Determinant(b1, b3, b4, c1, c3, c4, d1, d3, d4);
++    Aadj[1*4+1]  =   Matrix3x3Determinant(a1, a3, a4, c1, c3, c4, d1, d3, d4);
++    Aadj[2*4+1]  = - Matrix3x3Determinant(a1, a3, a4, b1, b3, b4, d1, d3, d4);
++    Aadj[3*4+1]  =   Matrix3x3Determinant(a1, a3, a4, b1, b3, b4, c1, c3, c4);
++
++    Aadj[0*4+2]  =   Matrix3x3Determinant(b1, b2, b4, c1, c2, c4, d1, d2, d4);
++    Aadj[1*4+2]  = - Matrix3x3Determinant(a1, a2, a4, c1, c2, c4, d1, d2, d4);
++    Aadj[2*4+2]  =   Matrix3x3Determinant(a1, a2, a4, b1, b2, b4, d1, d2, d4);
++    Aadj[3*4+2]  = - Matrix3x3Determinant(a1, a2, a4, b1, b2, b4, c1, c2, c4);
++
++    Aadj[0*4+3]  = - Matrix3x3Determinant(b1, b2, b3, c1, c2, c3, d1, d2, d3);
++    Aadj[1*4+3]  =   Matrix3x3Determinant(a1, a2, a3, c1, c2, c3, d1, d2, d3);
++    Aadj[2*4+3]  = - Matrix3x3Determinant(a1, a2, a3, b1, b2, b3, d1, d2, d3);
++    Aadj[3*4+3]  =   Matrix3x3Determinant(a1, a2, a3, b1, b2, b3, c1, c2, c3);
++}/*}}}*/
++void Matrix4x4Invert(IssmDouble* Ainv,IssmDouble* A){/*{{{*/
++
++	/*Intermediaries*/
++	IssmDouble det;
++
++	/*Compute determinant*/
++	Matrix4x4Determinant(&det,A);
++	if(fabs(det) < DBL_EPSILON){
++		printarray(A,4,4);
++		_error_("Determinant smaller than machine epsilon");
++	}
++
++	/*Compute adjoint matrix*/
++	Matrix4x4Adjoint(Ainv,A);
++
++	/*Scalte adjoint matrix to get inverse*/
++	for(int i=0;i<4*4;i++) Ainv[i] = Ainv[i]/det;
++}/*}}}*/
+ void Matrix4x4Solve(IssmDouble* X,IssmDouble* A,IssmDouble *B){/*{{{*/
+-	_error_("STOP");
++	IssmDouble Ainv[4][4];
++
++	Matrix4x4Invert(&Ainv[0][0],A);
++	for(int i=0;i<4;i++) X[i]=Ainv[i][0]*B[0] + Ainv[i][1]*B[1] + Ainv[i][2]*B[2] + Ainv[i][3]*B[3];
+ }/*}}}*/
+Index: ../trunk-jpl/src/c/shared/Matrix/matrix.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Matrix/matrix.h	(revision 18147)
++++ ../trunk-jpl/src/c/shared/Matrix/matrix.h	(revision 18148)
+@@ -10,11 +10,18 @@
+ int  TripleMultiply( IssmDouble* a, int nrowa, int ncola, int itrna, IssmDouble* b, int nrowb, int ncolb, int itrnb, IssmDouble* c, int nrowc, int ncolc, int itrnc, IssmDouble* d, int iaddd);
+ int  MatrixMultiply( IssmDouble* a, int nrowa, int ncola, int itrna, IssmDouble* b, int nrowb, int ncolb, int itrnb, IssmDouble* c, int iaddc );
+ int  MatrixInverse( IssmDouble* a, int ndim, int nrow, IssmDouble* b, int nvec, IssmDouble* pdet );
++
+ void Matrix2x2Invert(IssmDouble* Ainv, IssmDouble* A);
+ void Matrix2x2Determinant(IssmDouble* Adet,IssmDouble* A);
++
+ void Matrix3x3Invert(IssmDouble* Ainv, IssmDouble* A);
+ void Matrix3x3Determinant(IssmDouble* Adet,IssmDouble* A);
++IssmDouble Matrix3x3Determinant( IssmDouble a1,IssmDouble a2,IssmDouble a3, IssmDouble b1,IssmDouble b2,IssmDouble b3, IssmDouble c1,IssmDouble c2,IssmDouble c3);
+ void Matrix3x3Solve(IssmDouble* X,IssmDouble* A,IssmDouble* B);
++
++void Matrix4x4Adjoint(IssmDouble* Aadj, IssmDouble* A);
++void Matrix4x4Invert(IssmDouble* Ainv, IssmDouble* A);
++void Matrix4x4Determinant(IssmDouble* Adet,IssmDouble* A);
+ void Matrix4x4Solve(IssmDouble* X,IssmDouble* A,IssmDouble* B);
+ 
+ #endif //ifndef _MATRIXUTILS_H_
Index: /issm/oecreview/Archive/17984-18295/ISSM-18148-18149.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18148-18149.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18148-18149.diff	(revision 18296)
@@ -0,0 +1,69 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18148)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18149)
+@@ -6,7 +6,7 @@
+ #include "../solutionsequences/solutionsequences.h"
+ #include "../cores/cores.h"
+ 
+-//#define FSANALYTICAL 21
++#define FSANALYTICAL 4
+ 
+ /*Model processing*/
+ int  StressbalanceAnalysis::DofsPerNode(int** pdoftype,int domaintype,int approximation){/*{{{*/
+@@ -3063,6 +3063,7 @@
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixFSFriction(Element* element){/*{{{*/
+ 
+ 	if(element->IsFloating() || !element->IsOnBase()) return NULL;
++	return NULL;
+ 
+ 	/*If on water or not FS, skip stiffness: */
+ 	int approximation;
+@@ -3073,6 +3074,7 @@
+ 	int         i,dim;
+ 	IssmDouble  alpha2,Jdet;
+ 	IssmDouble  x_coord,y_coord,z_coord;
++	IssmDouble *xyz_list      = NULL;
+ 	IssmDouble *xyz_list_base = NULL;
+ 	Gauss*      gauss         = NULL;
+ 
+@@ -3090,6 +3092,7 @@
+ 	IssmDouble*    D  = xNewZeroInit<IssmDouble>((dim-1)*(dim-1));
+ 
+ 	/*Retrieve all inputs and parameters*/
++	element->GetVerticesCoordinates(&xyz_list);
+ 	element->GetVerticesCoordinatesBase(&xyz_list_base);
+ 	Input* vx_input         = element->GetInput(VxEnum);      _assert_(vx_input);
+ 	Input* vy_input         = element->GetInput(VyEnum);      _assert_(vy_input);
+@@ -3122,6 +3125,7 @@
+ 
+ 	/*Clean up and return*/
+ 	delete gauss;
++	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(xyz_list_base);
+ 	xDelete<IssmDouble>(B);
+ 	xDelete<IssmDouble>(D);
+Index: ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 18148)
++++ ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 18149)
+@@ -2,7 +2,6 @@
+  * \brief triple multiply
+  */ 
+ 
+-#include "../Elements/elements.h"
+ /*Headers*/
+ /*{{{*/
+ #include <stdio.h>
+@@ -460,10 +459,7 @@
+ 
+ 	/*Compute determinant*/
+ 	Matrix4x4Determinant(&det,A);
+-	if(fabs(det) < DBL_EPSILON){
+-		printarray(A,4,4);
+-		_error_("Determinant smaller than machine epsilon");
+-	}
++	if(fabs(det) < DBL_EPSILON) _error_("Determinant smaller than machine epsilon");
+ 
+ 	/*Compute adjoint matrix*/
+ 	Matrix4x4Adjoint(Ainv,A);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18149-18150.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18149-18150.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18149-18150.diff	(revision 18296)
@@ -0,0 +1,45 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18149)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18150)
+@@ -6,7 +6,7 @@
+ #include "../solutionsequences/solutionsequences.h"
+ #include "../cores/cores.h"
+ 
+-#define FSANALYTICAL 4
++//#define FSANALYTICAL 21
+ 
+ /*Model processing*/
+ int  StressbalanceAnalysis::DofsPerNode(int** pdoftype,int domaintype,int approximation){/*{{{*/
+@@ -3063,7 +3063,6 @@
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixFSFriction(Element* element){/*{{{*/
+ 
+ 	if(element->IsFloating() || !element->IsOnBase()) return NULL;
+-	return NULL;
+ 
+ 	/*If on water or not FS, skip stiffness: */
+ 	int approximation;
+@@ -3074,7 +3073,6 @@
+ 	int         i,dim;
+ 	IssmDouble  alpha2,Jdet;
+ 	IssmDouble  x_coord,y_coord,z_coord;
+-	IssmDouble *xyz_list      = NULL;
+ 	IssmDouble *xyz_list_base = NULL;
+ 	Gauss*      gauss         = NULL;
+ 
+@@ -3092,7 +3090,6 @@
+ 	IssmDouble*    D  = xNewZeroInit<IssmDouble>((dim-1)*(dim-1));
+ 
+ 	/*Retrieve all inputs and parameters*/
+-	element->GetVerticesCoordinates(&xyz_list);
+ 	element->GetVerticesCoordinatesBase(&xyz_list_base);
+ 	Input* vx_input         = element->GetInput(VxEnum);      _assert_(vx_input);
+ 	Input* vy_input         = element->GetInput(VyEnum);      _assert_(vy_input);
+@@ -3125,7 +3122,6 @@
+ 
+ 	/*Clean up and return*/
+ 	delete gauss;
+-	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(xyz_list_base);
+ 	xDelete<IssmDouble>(B);
+ 	xDelete<IssmDouble>(D);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18150-18151.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18150-18151.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18150-18151.diff	(revision 18296)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18150)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18151)
+@@ -4409,6 +4409,9 @@
+ 		}
+ 		else{
+ 			_assert_(tnumnodes==4);
++			d_zz = xNew<IssmDouble>(tnumnodes);
++			d_xz = xNew<IssmDouble>(tnumnodes);
++			d_yz = xNew<IssmDouble>(tnumnodes);
+ 			Matrix4x4Solve(&d_xx[0],Ke,pe_xx);
+ 			Matrix4x4Solve(&d_yy[0],Ke,pe_yy);
+ 			Matrix4x4Solve(&d_xy[0],Ke,pe_xy);
+@@ -4494,6 +4497,11 @@
+ 		IssmDouble* tau_zz = NULL;
+ 		IssmDouble* tau_xz = NULL;
+ 		IssmDouble* tau_yz = NULL;
++		if(dim==3){
++			tau_zz = xNew<IssmDouble>(tnumnodes);
++			tau_xz = xNew<IssmDouble>(tnumnodes);
++			tau_yz = xNew<IssmDouble>(tnumnodes);
++		}
+ 		Gauss* gauss = element->NewGauss();
+ 		for(int ig=0;ig<tnumnodes;ig++){
+ 			gauss->GaussNode(P1DGEnum,ig);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18151-18152.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18151-18152.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18151-18152.diff	(revision 18296)
@@ -0,0 +1,32 @@
+Index: ../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 18151)
++++ ../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 18152)
+@@ -37,7 +37,6 @@
+ 	for(int i=0;i<num_controls;i++){
+ 		for(int j=0;j<elements->Size();j++){
+ 			Element* element=(Element*)elements->GetObjectByOffset(j);
+-			//element->Gradj(gradient_list[i],control_type[i],i);
+ 			analysis->GradientJ(gradient_list[i],element,control_type[i],i);
+ 		}
+ 		gradient_list[i]->Assemble();
+@@ -56,6 +55,9 @@
+ 	if(xIsNan<IssmDouble>(norm_inf))_error_("||dJ/dk|| = NaN  gradient norm is NaN");
+ 
+ 	/*Clean-up and assign output pointer*/
++	delete analysis;
++	xDelete<Vector<IssmDouble>*>(gradient_list);
++	xDelete<int>(control_type);
+ 	if(pnorm_list){
+ 		*pnorm_list=norm_list;
+ 	}
+@@ -63,8 +65,7 @@
+ 		xDelete<IssmDouble>(norm_list);
+ 	}
+ 	if(pgradient)  *pgradient=gradient;
+-	xDelete<Vector<IssmDouble>*>(gradient_list);
+-	xDelete<int>(control_type);
++
+ }
+ void Gradjx(IssmDouble** pgradient,IssmDouble** pnorm_list, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18152-18153.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18152-18153.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18152-18153.diff	(revision 18296)
@@ -0,0 +1,108 @@
+Index: ../trunk-jpl/src/m/contrib/bamg/gmsh3d.m
+===================================================================
+--- ../trunk-jpl/src/m/contrib/bamg/gmsh3d.m	(revision 0)
++++ ../trunk-jpl/src/m/contrib/bamg/gmsh3d.m	(revision 18153)
+@@ -0,0 +1,103 @@
++function md=gmsh3d(md,domainfile,h),
++
++%Read domain
++domain=expread(domainfile);
++x   = domain.x(1:end-1);
++y   = domain.y(1:end-1);
++nbv = numel(x);
++
++%write files
++t1=clock; fprintf('%s','      writing initial mesh files...');
++fid=fopen('model.geo','w');
++fprintf(fid,['// Gmsh input file, created by ISSM on ' date '\n']);
++
++%Lower points
++for i=1:nbv,
++	fprintf(fid,'Point(%i) = {%8g, %8g, %8g};\n',i,x(i),y(i),0.);
++end
++%Upper points
++for i=1:nbv,
++	fprintf(fid,'Point(%i) = {%8g, %8g, %8g};\n',nbv+i,x(i),y(i),1.);
++end
++
++%Lower lines
++for i=1:nbv-1
++	fprintf(fid,'Line(%i) = {%i, %i};\n',i,i,i+1);
++end
++fprintf(fid,'Line(%i) = {%i, %i};\n',nbv,nbv,1);
++%Upper lines
++for i=nbv+1:2*nbv-1
++	fprintf(fid,'Line(%i) = {%i, %i};\n',i,i,i+1);
++end
++fprintf(fid,'Line(%i) = {%i, %i};\n',2*nbv,2*nbv,nbv+1);
++%Side lines
++for i=1:nbv
++	fprintf(fid,'Line(%i) = {%i, %i};\n',2*nbv+i,i,nbv+i);
++end
++
++counter = 3*nbv;
++ps = zeros(nbv+2,1);
++%Lower surface Loop and surface
++counter = counter+1;
++fprintf(fid,['Line Loop(' num2str(counter) ') = {']);
++for i=1:nbv-1
++	fprintf(fid,'%i,',i);
++end
++fprintf(fid,'%i};\n',nbv);
++fprintf(fid,['Plane Surface(' num2str(counter+1) ') = {' num2str(counter) '};\n']);
++ps(1)=counter+1;
++counter = counter+1;
++%Upper surface Loop and surface
++counter = counter+1;
++fprintf(fid,['Line Loop(' num2str(counter) ') = {']);
++for i=nbv+1:2*nbv-1
++	fprintf(fid,'%i,',i);
++end
++fprintf(fid,'%i};\n',2*nbv);
++ps(2)=counter+1;
++fprintf(fid,['Plane Surface(' num2str(counter+1) ') = {' num2str(counter) '};\n']);
++counter = counter+2;
++%Sides surfaces
++for i=1:nbv-1,
++	fprintf(fid,['Line Loop(' num2str(counter) ') = {' num2str(i) ',' num2str(2*nbv+i+1) ',-' num2str(nbv+i) ',-' num2str(2*nbv+i) '};\n']);
++	fprintf(fid,['Plane Surface(' num2str(counter+1) ') = {' num2str(counter) '};\n']);
++	ps(2+i)=counter+1;
++	counter=counter+2;
++end
++fprintf(fid,['Line Loop(' num2str(counter) ') = {' num2str(nbv) ',' num2str(2*nbv+1) ',-' num2str(2*nbv) ',-' num2str(3*nbv) '};\n']);
++fprintf(fid,['Plane Surface(' num2str(counter+1) ') = {' num2str(counter) '};\n']);
++ps(2+nbv)=counter+1;
++counter=counter+2;
++
++%Physical surfaces
++counter = counter+1;
++fprintf(fid,['Surface Loop(' num2str(counter) ') = {']);
++for i=1:numel(ps)-1
++	fprintf(fid,'%i,',ps(i));
++end
++fprintf(fid,'%i};\n',ps(end));
++fprintf(fid,['Physical Surface(1) = {' num2str(ps(2)) '};\n']);
++fprintf(fid,['Physical Surface(2) = {' num2str(ps(1)) '};\n']);
++fprintf(fid,['Physical Surface(3) = {']);
++for i=3:numel(ps)-1
++	fprintf(fid,'%i,',ps(i));
++end
++fprintf(fid,'%i};\n',ps(end));
++
++%Volume
++fprintf(fid,['Volume(1) = {' num2str(counter) '};\n']);
++fprintf(fid,['Physical Volume(2) = {1};\n']);
++
++%resolution
++fprintf(fid,'Mesh.CharacteristicLengthMax = %g;',h);
++fclose(fid);
++
++t2=clock;fprintf('%s\n',[' done (' num2str(etime(t2,t1)) ' seconds)']);
++
++%call gmsh
++fprintf('%s\n','      call gmsh...');
++system([issmdir() '/externalpackages/gmsh/install/gmsh -3 model.geo']);
++
++%plug new mesh
++t1=clock; fprintf('\n%s','      reading final mesh files...');
++md=importgmsh('model.msh',3);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18157-18158.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18157-18158.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18157-18158.diff	(revision 18296)
@@ -0,0 +1,62 @@
+Index: ../trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64_mavericks.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64_mavericks.sh	(revision 0)
++++ ../trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64_mavericks.sh	(revision 18158)
+@@ -0,0 +1,50 @@
++#!/bin/bash
++set -eu
++
++#Some cleanup
++rm -rf Dakota
++rm -rf src 
++rm -rf build 
++rm -rf install 
++mkdir src build install 
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
++
++#Untar 
++tar -zxvf dakota-5.3.1-public-src.tar.gz
++
++#Move Dakota to src directory
++mv dakota-5.3.1.src/* src
++rm -rf dakota-5.3.1.src
++
++#Set up Dakota cmake variables and config
++export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
++export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
++cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
++patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/5.3.1/BuildDakotaCustom.cmake.patch
++patch $DAK_SRC/cmake/DakotaDev.cmake configs/5.3.1/DakotaDev.cmake.patch
++
++#Apply patches
++patch src/src/ParallelLibrary.cpp configs/5.3.1/ParallelLibrary.cpp.patch
++patch src/src/ParallelLibrary.hpp configs/5.3.1/ParallelLibrary.hpp.patch
++patch src/src/NonDSampling.cpp configs/5.3.1/NonDSampling.cpp.patch
++patch src/src/NonDLocalReliability.cpp configs/5.3.1/NonDLocalReliability.cpp.patch
++patch src/packages/pecos/src/pecos_global_defs.hpp configs/5.3.1/pecos_global_defs.hpp.patch
++
++#Configure dakota
++cd $DAK_BUILD
++cmake -D CMAKE_C_COMPILER=/usr/local/gfortran/bin/gcc -D CMAKE_CXX_COMPILER=/usr/local/gfortran/bin/g++ -C $DAK_SRC/cmake/BuildDakotaCustom.cmake -C $DAK_SRC/cmake/DakotaDev.cmake $DAK_SRC
++cd ..
++
++#Compile and install dakota
++cd $DAK_BUILD
++if [ $# -eq 0 ];
++then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
++cd ..
+
+Property changes on: ../trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64_mavericks.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/17984-18295/ISSM-18158-18159.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18158-18159.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18158-18159.diff	(revision 18296)
@@ -0,0 +1,154 @@
+Index: ../trunk-jpl/externalpackages/boost/install-1.55-macosx-mavericks.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/boost/install-1.55-macosx-mavericks.sh	(revision 0)
++++ ../trunk-jpl/externalpackages/boost/install-1.55-macosx-mavericks.sh	(revision 18159)
+@@ -0,0 +1,40 @@
++#!/bin/bash
++set -eu
++
++#Note of caution:  stop after boostrap phase, and run 
++#bjam --debug-configuration, to figure out which paths boost is using to include 
++#python. make sure everyone of these paths is covered by python. If not, just make 
++#symlinks in externalpackages/python to what boost is expecting. Ther is NO WAY 
++#to get the boost library to include python support without doing that. 
++
++#Some cleanup
++rm -rf install boost_1_55_0 src
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
++
++#Untar 
++tar -zxvf  boost_1_55_0.tar.gz
++
++#Move boost into install directory
++mv boost_1_55_0/* src
++rm -rf boost_1_55_0
++
++patch src/boost/atomic/detail/cas128strong.hpp ./configs/1.55/cas128strong.hpp.patch
++patch src/boost/atomic/detail/gcc-atomic.hpp ./configs/1.55/gcc-atomic.hpp.patch
++
++#Configure and compile
++cd src 
++./bootstrap.sh \
++	--prefix="$ISSM_DIR/externalpackages/boost/install" \
++	--with-python=python3.2 \
++	--with-python-root="$ISSM_DIR/externalpackages/python/install" 
++
++#Compile boost
++./b2 toolset=clang cxxflags=-stdlib=libstdc++ linkflags=-stdlib=libstdc++ -j2 variant=release link=static threading=multi install
++#./bjam install
++
++#put bjam into install also: 
++mkdir ../install/bin
++cp bjam ../install/bin
+
+Property changes on: ../trunk-jpl/externalpackages/boost/install-1.55-macosx-mavericks.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/boost/install-1.49-linux.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/boost/install-1.49-linux.sh	(revision 0)
++++ ../trunk-jpl/externalpackages/boost/install-1.49-linux.sh	(revision 18159)
+@@ -0,0 +1,35 @@
++#!/bin/bash
++set -eu
++
++#Note of caution:  stop after boostrap phase, and run 
++#bjam --debug-configuration, to figure out which paths boost is using to include 
++#python. make sure everyone of these paths is covered by python. If not, just make 
++#symlinks in externalpackages/python to what boost is expecting. Ther is NO WAY 
++#to get the boost library to include python support without doing that. 
++
++#Some cleanup
++rm -rf install boost_1_49_0 src
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/boost_1_49_0.tar.gz' 'boost_1_49_0.tar.gz'
++
++#Untar 
++tar -zxvf  boost_1_49_0.tar.gz
++
++#Move boost into install directory
++mv boost_1_49_0/* src
++rm -rf boost_1_49_0
++#Configure and compile
++cd src 
++./bootstrap.sh \
++	--prefix="$ISSM_DIR/externalpackages/boost/install" \
++	--with-python=python3.2 \
++	--with-python-root="$ISSM_DIR/externalpackages/python/install" 
++
++#Compile boost
++./bjam install
++
++#put bjam into install also: 
++mkdir ../install/bin
++cp bjam ../install/bin
+
+Property changes on: ../trunk-jpl/externalpackages/boost/install-1.49-linux.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/boost/configs/1.55/cas128strong.hpp.patch
+===================================================================
+--- ../trunk-jpl/externalpackages/boost/configs/1.55/cas128strong.hpp.patch	(revision 0)
++++ ../trunk-jpl/externalpackages/boost/configs/1.55/cas128strong.hpp.patch	(revision 18159)
+@@ -0,0 +1,17 @@
++199c199
++<     explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0)
++---
++>     explicit base_atomic(value_type const& v) BOOST_NOEXCEPT 
++200a201
++> 	memset(&v_, 0, sizeof(v_));
++207c208,209
++<         storage_type value_s = 0;
++---
++> 	storage_type value_s;
++> 	memset(&value_s, 0, sizeof(value_s));
++250c252,254
++<         storage_type expected_s = 0, desired_s = 0;
++---
++> 	storage_type expected_s, desired_s; 
++> 	memset(&expected_s, 0, sizeof(expected_s));
++> 	memset(&desired_s, 0, sizeof(desired_s));
+Index: ../trunk-jpl/externalpackages/boost/configs/1.55/gcc-atomic.hpp.patch
+===================================================================
+--- ../trunk-jpl/externalpackages/boost/configs/1.55/gcc-atomic.hpp.patch	(revision 0)
++++ ../trunk-jpl/externalpackages/boost/configs/1.55/gcc-atomic.hpp.patch	(revision 18159)
+@@ -0,0 +1,28 @@
++961c961
++<     explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0)
++---
++>     explicit base_atomic(value_type const& v) BOOST_NOEXCEPT
++962a963
++>         memset(&v_, 0, sizeof(v_));
++968c969,970
++<         storage_type tmp = 0;
++---
++>         storage_type tmp;
++>         memset(&tmp, 0, sizeof(tmp));
++983c985,986
++<         storage_type tmp = 0;
++---
++>         storage_type tmp;
++>         memset(&tmp, 0, sizeof(tmp));
++997c1000,1002
++<         storage_type expected_s = 0, desired_s = 0;
++---
++> 	storage_type expected_s, desired_s;
++> 	memset(&expected_s, 0, sizeof(expected_s));
++> 	memset(&desired_s, 0, sizeof(desired_s));
++1013c1018,1020
++<         storage_type expected_s = 0, desired_s = 0;
++---
++> 	storage_type expected_s, desired_s;
++> 	memset(&expected_s, 0, sizeof(expected_s));
++> 	memset(&desired_s, 0, sizeof(desired_s));
Index: /issm/oecreview/Archive/17984-18295/ISSM-18159-18160.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18159-18160.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18159-18160.diff	(revision 18296)
@@ -0,0 +1,19 @@
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 18159)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 18160)
+@@ -345,10 +345,14 @@
+ 				else if test x$DAKOTA_VERSION = x5.1 || test x$DAKOTA_VERSION = x5.2; then
+ 					DAKOTALIB="-L$DAKOTA_ROOT/lib -ldakota -lteuchos -lpecos -llhs -lsparsegrid -lsurfpack -lconmin -lddace -lfsudace -ljega -lcport -loptpp -lpsuade -lncsuopt -lcolin -linterfaces -lmomh -lscolib -lpebbl -ltinyxml -lutilib -l3po -lhopspack -lnidr -lamplsolver -lboost_signals -lboost_regex -lboost_filesystem -lboost_system"
+ 					dnl DAKOTALIB+= "-lgslcblas -L/usr/lib -lblas -llapack"
++				else if test x$DAKOTA_VERSION = x5.3 || test x$DAKOTA_VERSION = x5.3.1; then
++					DAKOTAFLAGS="-DDISABLE_DAKOTA_CONFIG_H -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DDAKOTA_PLUGIN -DBOOST_DISABLE_ASSERTS -DDAKOTA_HAVE_BOOST_FS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DDAKOTA_COLINY -DDAKOTA_UTILIB -DHAVE_ADAPTIVE_SAMPLING -DHAVE_CONMIN -DDAKOTA_DDACE -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_JEGA -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL"
++					DAKOTALIB="-L$DAKOTA_ROOT/lib -ldakota_src -ldakota_src_fortran -lnidr -lteuchos -lpecos -lpecos_src -llhs -lmods -lmod -ldfftpack -lsparsegrid -lsurfpack -lsurfpack_fortran -lutilib -lcolin -linterfaces -lscolib -l3po -lpebbl -ltinyxml -lconmin -ldace -lanalyzer -lrandom -lsampling -lbose -lfsudace -lhopspack -ljega -ljega_fe -lmoga -lsoga -leutils -lutilities -lncsuopt -lcport -loptpp -lpsuade -lamplsolver -L$BOOST_ROOT/lib -lboost_signals -lboost_regex -lboost_filesystem -lboost_system "
+ 				else
+ 					AC_MSG_ERROR([Dakota version not found or version ($DAKOTA_VERSION) not supported!]);
+ 				fi
+ 				fi
++                                fi
+ 			;;
+ 		esac
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18160-18161.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18160-18161.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18160-18161.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 18160)
++++ ../trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 18161)
+@@ -459,7 +459,7 @@
+ 
+ 	/*Compute determinant*/
+ 	Matrix4x4Determinant(&det,A);
+-	if(fabs(det) < DBL_EPSILON) _error_("Determinant smaller than machine epsilon");
++	//if(fabs(det) < DBL_EPSILON) _error_("Determinant smaller than machine epsilon");
+ 
+ 	/*Compute adjoint matrix*/
+ 	Matrix4x4Adjoint(Ainv,A);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18161-18162.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18161-18162.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18161-18162.diff	(revision 18296)
@@ -0,0 +1,35 @@
+Index: ../trunk-jpl/src/m/plot/plot_unit.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/plot_unit.m	(revision 18161)
++++ ../trunk-jpl/src/m/plot/plot_unit.m	(revision 18162)
+@@ -15,17 +15,27 @@
+ 	case 1,
+ 
+ 		pos=find(~isnan(data)); %needed for element on water
+-		if is2d,
+-			A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
+-		else
++		if size(elements,2)==6, %prisms
+ 			A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
+ 			patch( 'Faces', [A B C],  'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
+ 			patch( 'Faces', [D E F],  'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
+ 			patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
+ 			patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
+ 			patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
++		elseif size(elements,2)==4, %tetras
++			A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4);
++			patch( 'Faces',[A B C],'Vertices', [x y z],'CData',data(pos),'FaceColor','flat','EdgeColor',edgecolor);
++			patch( 'Faces',[A B D],'Vertices', [x y z],'CData',data(pos),'FaceColor','flat','EdgeColor',edgecolor);
++			patch( 'Faces',[B C D],'Vertices', [x y z],'CData',data(pos),'FaceColor','flat','EdgeColor',edgecolor);
++			patch( 'Faces',[C A D],'Vertices', [x y z],'CData',data(pos),'FaceColor','flat','EdgeColor',edgecolor);
++		else
++			A=elements(pos,1); B=elements(pos,2); C=elements(pos,3);
++			patch( 'Faces', [A B C], 'Vertices', [x y z],'CData', data(pos),'FaceColor','flat','EdgeColor',edgecolor);
+ 		end
+ 
++		if is2d,
++		end
++
+ 	%node plot
+ 	case 2,
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18162-18163.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18162-18163.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18162-18163.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.cpp	(revision 18162)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.cpp	(revision 18163)
+@@ -663,7 +663,7 @@
+ 
+ 	/*For FS only: we want the CS to be tangential to the bedrock*/
+ 	inputs->GetInputValue(&approximation,ApproximationEnum);
+-	if(IsFloating() || !HasNodeOnBase() ||  approximation!=FSApproximationEnum) return;
++	if(!HasNodeOnBase() ||  approximation!=FSApproximationEnum) return;
+ 
+ 	//printf("element number %i \n",this->id);
+ 	/*Get inputs*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18163-18164.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18163-18164.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18163-18164.diff	(revision 18296)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/etc/environment.sh
+===================================================================
+--- ../trunk-jpl/etc/environment.sh	(revision 18163)
++++ ../trunk-jpl/etc/environment.sh	(revision 18164)
+@@ -101,6 +101,7 @@
+ DAKOTA_DIR="$ISSM_DIR/externalpackages/dakota/install"
+ pathappend "$DAKOTA_DIR/bin"
+ libpathappend "$DAKOTA_DIR/lib"
++dylibpathprepend "$DAKOTA_DIR/lib"
+ 
+ DOXYGEN_DIR="$ISSM_DIR/externalpackages/doxygen/install"
+ pathprepend "$DOXYGEN_DIR/bin"
Index: /issm/oecreview/Archive/17984-18295/ISSM-18164-18165.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18164-18165.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18164-18165.diff	(revision 18296)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/test/NightlyRun/test513.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test513.py	(revision 18164)
++++ ../trunk-jpl/test/NightlyRun/test513.py	(revision 18165)
+@@ -35,7 +35,7 @@
+ 
+ # Fields and tolerances to track changes
+ field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsGroundediceMeltingRate']
+-field_tolerances=[7e-10,2e-10,1e-10,1e-10,3e-6,3e-6,3e-6,3e-6,2e-6,2e-06]
++field_tolerances=[1e-09,2e-10,1e-10,1e-10,3e-6,3e-6,3e-6,3e-6,2e-6,2e-06]
+ field_values=[\
+ 	md.results.SteadystateSolution.Gradient1,\
+ 	md.results.SteadystateSolution.J,\
+Index: ../trunk-jpl/test/NightlyRun/test513.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test513.m	(revision 18164)
++++ ../trunk-jpl/test/NightlyRun/test513.m	(revision 18165)
+@@ -24,7 +24,7 @@
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy','Vz','Temperature','BasalforcingsGroundediceMeltingRate'};
+-field_tolerances={4e-10,2e-10,1e-10,1e-10,3e-6,3e-6,3e-6,3e-6,2e-6,2e-06};
++field_tolerances={1e-09,2e-10,1e-10,1e-10,3e-6,3e-6,3e-6,3e-6,2e-6,2e-06};
+ field_values={...
+ 	(md.results.SteadystateSolution.Gradient1),...
+ 	md.results.SteadystateSolution.J,...
Index: /issm/oecreview/Archive/17984-18295/ISSM-18165-18166.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18165-18166.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18165-18166.diff	(revision 18296)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/m/classes/model.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/model.m	(revision 18165)
++++ ../trunk-jpl/src/m/classes/model.m	(revision 18166)
+@@ -220,8 +220,8 @@
+ 			end
+ 
+ 			%special for thermal modeling:
+-			md.basalforcings.groundedice_melting_rate=project2d(md,md.basalforcings.melting_rate,1); 
+-			md.basalforcings.floatingice_melting_rate=project2d(md,md.basalforcings.melting_rate,1); 
++			md.basalforcings.groundedice_melting_rate=project2d(md,md.basalforcings.groundedice_melting_rate,1); 
++			md.basalforcings.floatingice_melting_rate=project2d(md,md.basalforcings.floatingice_melting_rate,1); 
+ 			md.basalforcings.geothermalflux=project2d(md,md.basalforcings.geothermalflux,1); %bedrock only gets geothermal flux
+ 
+ 			%update of connectivity matrix
Index: /issm/oecreview/Archive/17984-18295/ISSM-18166-18167.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18166-18167.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18166-18167.diff	(revision 18296)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/test/NightlyRun/test322.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test322.m	(revision 18166)
++++ ../trunk-jpl/test/NightlyRun/test322.m	(revision 18167)
+@@ -22,7 +22,7 @@
+ 
+ %Fields and tolerances to track changes
+ field_names     ={'Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy'};
+-field_tolerances={5e-05,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,5e-08,5e-08,5e-08};
++field_tolerances={5e-05,1e-08,1e-08,1e-09,1e-09,1e-09,1e-09,5e-08,5e-08,5e-08};
+ field_values={...
+ 	(md.results.StressbalanceSolution.Gradient1),...
+ 	(md.results.StressbalanceSolution.J),...
+Index: ../trunk-jpl/test/NightlyRun/test322.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test322.py	(revision 18166)
++++ ../trunk-jpl/test/NightlyRun/test322.py	(revision 18167)
+@@ -34,7 +34,7 @@
+ 
+ #Fields and tolerances to track changes
+ field_names     =['Gradient','Misfits','FrictionCoefficient','Pressure','Vel','Vx','Vy']
+-field_tolerances=[5e-05,1e-08,1e-09,1e-09,5e-08,5e-08,5e-08]
++field_tolerances=[5e-05,1e-08,1e-08,1e-09,5e-08,5e-08,5e-08]
+ field_values=[\
+ 	md.results.StressbalanceSolution.Gradient1,\
+ 	md.results.StressbalanceSolution.J,\
Index: /issm/oecreview/Archive/17984-18295/ISSM-18167-18168.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18167-18168.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18167-18168.diff	(revision 18296)
@@ -0,0 +1,38 @@
+Index: ../trunk-jpl/test/NightlyRun/test337.py
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test337.py	(revision 18167)
++++ ../trunk-jpl/test/NightlyRun/test337.py	(revision 18168)
+@@ -37,10 +37,10 @@
+ 	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SurfaceforcingsMassBalance3', \
+ 	'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SurfaceforcingsMassBalance4']
+ field_tolerances=[\
+-		1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
+-		1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
+-		1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
+-		1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10]
++		5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
++		5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
++		5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,\
++		5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10]
+ field_values=[\
+ 	md.results.TransientSolution[0].Vx,\
+ 	md.results.TransientSolution[0].Vy,\
+Index: ../trunk-jpl/test/NightlyRun/test337.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test337.m	(revision 18167)
++++ ../trunk-jpl/test/NightlyRun/test337.m	(revision 18168)
+@@ -27,10 +27,10 @@
+ 	'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SurfaceforcingsMassBalance3', ...
+ 	'Vx4','Vy4','Vel4','Pressure4','Bed4','Surface4','Thickness4','SurfaceforcingsMassBalance4'};
+ field_tolerances={...
+-	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
+-	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
+-	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
+-	1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10};
++	5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,...
++	5e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10};
+ field_values={...
+ 	(md.results.TransientSolution(1).Vx),...
+ 	(md.results.TransientSolution(1).Vy),...
Index: /issm/oecreview/Archive/17984-18295/ISSM-18168-18169.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18168-18169.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18168-18169.diff	(revision 18296)
@@ -0,0 +1,54 @@
+Index: ../trunk-jpl/src/m/classes/inversion.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/inversion.m	(revision 18168)
++++ ../trunk-jpl/src/m/classes/inversion.m	(revision 18169)
+@@ -131,11 +131,11 @@
+ 			md = checkfield(md,'fieldname','inversion.iscontrol','values',[0 1]);
+ 			md = checkfield(md,'fieldname','inversion.incomplete_adjoint','values',[0 1]);
+ 			md = checkfield(md,'fieldname','inversion.control_parameters','cell',1,'values',...
+-				{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'DamageDbar' 'Vx' 'Vy' 'Thickness'});
++				{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'DamageDbar' 'Vx' 'Vy' 'Thickness' 'BalancethicknessNux' 'BalancethicknessNuy' 'BalancethicknessApparentMassbalance'});
+ 			md = checkfield(md,'fieldname','inversion.nsteps','numel',1,'>=',0);
+ 			md = checkfield(md,'fieldname','inversion.maxiter_per_step','size',[md.inversion.nsteps 1],'>=',0);
+ 			md = checkfield(md,'fieldname','inversion.step_threshold','size',[md.inversion.nsteps 1]);
+-			md = checkfield(md,'fieldname','inversion.cost_functions','size',[1 num_costfunc],'values',[101:105 201 501:506]);
++			md = checkfield(md,'fieldname','inversion.cost_functions','size',[1 num_costfunc],'values',[101:105 201 501:507]);
+ 			md = checkfield(md,'fieldname','inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
+ 			md = checkfield(md,'fieldname','inversion.gradient_scaling','size',[md.inversion.nsteps num_controls]);
+ 			md = checkfield(md,'fieldname','inversion.min_parameters','size',[md.mesh.numberofvertices num_controls]);
+@@ -231,6 +231,7 @@
+ 			pos=find(obj.cost_functions==504); data(pos)=ThicknessAlongGradientEnum();
+ 			pos=find(obj.cost_functions==505); data(pos)=ThicknessAcrossGradientEnum();
+ 			pos=find(obj.cost_functions==506); data(pos)=BalancethicknessMisfitEnum();
++			pos=find(obj.cost_functions==507); data(pos)=Balancethickness2MisfitEnum();
+ 			WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3);
+ 			WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer');
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/taoinversion.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/taoinversion.m	(revision 18168)
++++ ../trunk-jpl/src/m/classes/taoinversion.m	(revision 18169)
+@@ -182,6 +182,7 @@
+ 			pos=find(obj.cost_functions==504); data(pos)=ThicknessAlongGradientEnum();
+ 			pos=find(obj.cost_functions==505); data(pos)=ThicknessAcrossGradientEnum();
+ 			pos=find(obj.cost_functions==506); data(pos)=BalancethicknessMisfitEnum();
++			pos=find(obj.cost_functions==507); data(pos)=Balancethickness2MisfitEnum();
+ 			WriteData(fid,'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3);
+ 			WriteData(fid,'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer');
+ 		end % }}}
+Index: ../trunk-jpl/src/m/classes/balancethickness2.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/balancethickness2.m	(revision 18168)
++++ ../trunk-jpl/src/m/classes/balancethickness2.m	(revision 18169)
+@@ -42,6 +42,11 @@
+ 
+ 			fielddisplay(obj,'spcpotential','potential constraints (NaN means no constraint)');
+ 			fielddisplay(obj,'apparent_massbalance','Apparent mass balance [m/yr]');
++			fielddisplay(obj,'nux','vx_bar = nux vx_s (in ]0 1])');
++			fielddisplay(obj,'nuy','vy_bar = nuy vy_s (in ]0 1])');
++			fielddisplay(obj,'vx_obs','observed vx');
++			fielddisplay(obj,'vy_obs','observed vy');
++			fielddisplay(obj,'thickness_obs','observed H');
+ 
+ 		end % }}}
+ 		function marshall(obj,md,fid) % {{{
Index: /issm/oecreview/Archive/17984-18295/ISSM-18169-18170.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18169-18170.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18169-18170.diff	(revision 18296)
@@ -0,0 +1,520 @@
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18169)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18170)
+@@ -601,6 +601,8 @@
+ 	P1bubbleEnum,
+ 	P1bubblecondensedEnum,
+ 	P2Enum,
++	P2bubbleEnum,
++	P2bubblecondensedEnum,
+ 	P2xP1Enum,
+ 	P1xP2Enum,
+ 	P1xP3Enum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18169)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18170)
+@@ -590,6 +590,8 @@
+ 		case P1bubbleEnum : return "P1bubble";
+ 		case P1bubblecondensedEnum : return "P1bubblecondensed";
+ 		case P2Enum : return "P2";
++		case P2bubbleEnum : return "P2bubble";
++		case P2bubblecondensedEnum : return "P2bubblecondensed";
+ 		case P2xP1Enum : return "P2xP1";
+ 		case P1xP2Enum : return "P1xP2";
+ 		case P1xP3Enum : return "P1xP3";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18169)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18170)
+@@ -602,6 +602,8 @@
+ 	      else if (strcmp(name,"P1bubble")==0) return P1bubbleEnum;
+ 	      else if (strcmp(name,"P1bubblecondensed")==0) return P1bubblecondensedEnum;
+ 	      else if (strcmp(name,"P2")==0) return P2Enum;
++	      else if (strcmp(name,"P2bubble")==0) return P2bubbleEnum;
++	      else if (strcmp(name,"P2bubblecondensed")==0) return P2bubblecondensedEnum;
+ 	      else if (strcmp(name,"P2xP1")==0) return P2xP1Enum;
+ 	      else if (strcmp(name,"P1xP2")==0) return P1xP2Enum;
+ 	      else if (strcmp(name,"P1xP3")==0) return P1xP3Enum;
+@@ -626,12 +628,12 @@
+ 	      else if (strcmp(name,"Outputdefinition")==0) return OutputdefinitionEnum;
+ 	      else if (strcmp(name,"OutputdefinitionList")==0) return OutputdefinitionListEnum;
+ 	      else if (strcmp(name,"Massfluxatgate")==0) return MassfluxatgateEnum;
+-	      else if (strcmp(name,"MassfluxatgateName")==0) return MassfluxatgateNameEnum;
+-	      else if (strcmp(name,"MassfluxatgateSegments")==0) return MassfluxatgateSegmentsEnum;
+          else stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"MisfitName")==0) return MisfitNameEnum;
++	      if (strcmp(name,"MassfluxatgateName")==0) return MassfluxatgateNameEnum;
++	      else if (strcmp(name,"MassfluxatgateSegments")==0) return MassfluxatgateSegmentsEnum;
++	      else if (strcmp(name,"MisfitName")==0) return MisfitNameEnum;
+ 	      else if (strcmp(name,"MisfitModelEnum")==0) return MisfitModelEnumEnum;
+ 	      else if (strcmp(name,"MisfitObservation")==0) return MisfitObservationEnum;
+ 	      else if (strcmp(name,"MisfitObservationEnum")==0) return MisfitObservationEnumEnum;
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateNodes.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateNodes.cpp	(revision 18169)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateNodes.cpp	(revision 18170)
+@@ -161,6 +161,43 @@
+ 				}
+ 			}
+ 			break;
++		case P2bubbleEnum:
++			EdgesPartitioning(&my_edges,iomodel);
++			for(i=0;i<iomodel->numberofvertices;i++){
++				if(iomodel->my_vertices[i]){
++					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,approximation));
++				}
++			}
++			for(i=0;i<iomodel->numberofedges;i++){
++				if(my_edges[i]){
++					nodes->AddObject(new Node(id0+iomodel->numberofvertices+i+1,iomodel->numberofvertices+i,lid++,0,iomodel,analysis,approximation));
++				}
++			}
++			id0 = id0+iomodel->numberofvertices+iomodel->numberofedges;
++			if(iomodel->meshelementtype==PentaEnum){
++				FacesPartitioning(&my_faces,iomodel);
++				for(i=0;i<iomodel->numberoffaces;i++){
++					if(iomodel->faces[i*iomodel->facescols+2]==2){/*Vertical quads*/
++						if(my_faces[i]){
++							node = new Node(id0+i+1,iomodel->numberofvertices+iomodel->numberofedges+i,lid++,0,iomodel,analysis,approximation);
++							nodes->AddObject(node);
++						}
++					}
++					else if(iomodel->faces[i*iomodel->facescols+2]==1){/*Triangular base/top*/
++						/*Nothing*/
++					}
++					else{
++						_error_("not supported");
++					}
++				}
++				id0 = id0+iomodel->numberoffaces;
++			}
++			for(i=0;i<iomodel->numberofelements;i++){
++				if(iomodel->my_elements[i]){
++					nodes->AddObject(new Node(id0+i+1,id0-iomodel->nodecounter+i,lid++,0,iomodel,analysis,approximation));
++				}
++			}
++			break;
+ 		case P2xP4Enum:
+ 			EdgesPartitioning(&my_edges,iomodel);
+ 			FacesPartitioning(&my_faces,iomodel);
+Index: ../trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 18169)
++++ ../trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp	(revision 18170)
+@@ -75,6 +75,19 @@
+ 			}
+ 			EdgeOnBoundaryFlags(&boundaryedge,iomodel);
+ 			break;
++		case P2bubbleEnum:
++			EdgesPartitioning(&my_edges,iomodel);
++			if(iomodel->meshelementtype==PentaEnum){
++				FacesPartitioning(&my_faces,iomodel);
++			}
++			EdgeOnBoundaryFlags(&boundaryedge,iomodel);
++			switch(iomodel->meshelementtype){
++				case TriaEnum:  elementnbv = 3; break;
++				case TetraEnum: elementnbv = 4; break;
++				case PentaEnum: elementnbv = 6; break;
++				default: _error_("mesh type not supported yet");
++			}
++			break;
+ 		case P2xP4Enum:
+ 			EdgesPartitioning(&my_edges,iomodel);
+ 			FacesPartitioning(&my_faces,iomodel);
+@@ -137,6 +150,62 @@
+ 					}
+ 				}
+ 				break;
++			case P2bubbleEnum:
++				for(i=0;i<iomodel->numberofvertices;i++){
++					if((iomodel->my_vertices[i])){
++						if (!xIsNan<IssmDouble>(spcdata[i])){
++							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,dof,spcdata[i],analysis_type));
++							count++;
++						}
++					}
++				}
++				for(i=0;i<iomodel->numberofedges;i++){
++					if(my_edges[i] && boundaryedge[i]){
++						v1 = iomodel->edges[3*i+0]-1;
++						v2 = iomodel->edges[3*i+1]-1;
++						if(!xIsNan<IssmDouble>(spcdata[v1]) && !xIsNan<IssmDouble>(spcdata[v2])){
++							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+i+1,
++											dof,(spcdata[v1]+spcdata[v2])/2.,analysis_type));
++							count++;
++						}
++					}
++				}
++				if(iomodel->meshelementtype==PentaEnum){
++					for(i=0;i<iomodel->numberoffaces;i++){
++						if(iomodel->faces[i*iomodel->facescols+2]==2){/*Vertical quads*/
++							if(my_faces[i]){
++								numfacevertices = iomodel->faces[i*iomodel->facescols+3];
++								value=0.;
++								for(j=0;j<numfacevertices;j++){
++									value += spcdata[iomodel->faces[i*iomodel->facescols+4+j] -1];
++								}
++								value = value/reCast<IssmDouble>(numfacevertices);
++								if(!xIsNan<IssmDouble>(value)){
++									constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,
++													iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+i+1,
++													dof,value,analysis_type));
++									count++;
++								}
++							}
++						}
++					}
++				}
++				for(i=0;i<iomodel->numberofelements;i++){
++					if(iomodel->my_elements[i]){
++						value = spcdata[iomodel->elements[i*elementnbv+0]-1];
++						for(j=1;j<elementnbv;j++) value += spcdata[iomodel->elements[i*elementnbv+j]-1];
++						value = value/reCast<IssmDouble,int>(elementnbv+0);
++						if(!xIsNan<IssmDouble>(value)){
++							int nodeid = iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+i+1;
++							if(iomodel->meshelementtype==PentaEnum){
++								nodeid += iomodel->numberoffaces;
++							}
++							constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,nodeid,dof,value,analysis_type));
++							count++;
++						}
++					}
++				}
++				break;
+ 			case P2xP4Enum:
+ 				for(i=0;i<iomodel->numberofvertices;i++){
+ 					if((iomodel->my_vertices[i])){
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18169)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18170)
+@@ -1925,6 +1925,17 @@
+ 			tria_node_ids[4]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+1]+1;
+ 			tria_node_ids[5]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+2]+1;
+ 			break;
++		case P2bubbleEnum: case P2bubblecondensedEnum:
++			numnodes        = 7;
++			tria_node_ids   = xNew<int>(numnodes);
++			tria_node_ids[0]=iomodel->nodecounter+iomodel->elements[3*index+0];
++			tria_node_ids[1]=iomodel->nodecounter+iomodel->elements[3*index+1];
++			tria_node_ids[2]=iomodel->nodecounter+iomodel->elements[3*index+2];
++			tria_node_ids[3]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+0]+1;
++			tria_node_ids[4]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+1]+1;
++			tria_node_ids[5]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+2]+1;
++			tria_node_ids[6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+index+1;
++			break;
+ 		case P1P1Enum: case P1P1GLSEnum:
+ 			numnodes        = 6;
+ 			tria_node_ids   = xNew<int>(numnodes);
+Index: ../trunk-jpl/src/c/classes/Elements/TriaRef.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/TriaRef.cpp	(revision 18169)
++++ ../trunk-jpl/src/c/classes/Elements/TriaRef.cpp	(revision 18170)
+@@ -19,6 +19,7 @@
+ #define NUMNODESP1  3
+ #define NUMNODESP1b 4
+ #define NUMNODESP2  6
++#define NUMNODESP2b 7
+ 
+ /*Object constructors and destructor*/
+ TriaRef::TriaRef(){/*{{{*/
+@@ -173,6 +174,18 @@
+ 			basis[4]=4.*gauss->coord3*gauss->coord1;
+ 			basis[5]=4.*gauss->coord1*gauss->coord2;
+ 			return;
++		case P2bubbleEnum: case P2bubblecondensedEnum:
++			/*Corner nodes*/
++			basis[0]=gauss->coord1*(2.*gauss->coord1-1.);
++			basis[1]=gauss->coord2*(2.*gauss->coord2-1.);
++			basis[2]=gauss->coord3*(2.*gauss->coord3-1.);
++			/*Mid-sides*/
++			basis[3]=4.*gauss->coord3*gauss->coord2;
++			basis[4]=4.*gauss->coord3*gauss->coord1;
++			basis[5]=4.*gauss->coord1*gauss->coord2;
++			/*bubble*/
++			basis[6]=27.*gauss->coord1*gauss->coord2*gauss->coord3;
++			return;
+ 		default:
+ 			_error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
+ 	}
+@@ -308,6 +321,29 @@
+ 			dbasis[NUMNODESP2*0+5] = 2.*(gauss->coord1-gauss->coord2);
+ 			dbasis[NUMNODESP2*1+5] = -2.*SQRT3/3.*(gauss->coord1+gauss->coord2);
+ 			return;
++		case P2bubbleEnum: case P2bubblecondensedEnum:
++			/*Nodal function 1*/
++			dbasis[NUMNODESP2b*0+0] = -2.*gauss->coord1 + 0.5;
++			dbasis[NUMNODESP2b*1+0] = -2.*SQRT3/3.*gauss->coord1 + SQRT3/6.;
++			/*Nodal function 2*/
++			dbasis[NUMNODESP2b*0+1] = +2.*gauss->coord2 - 0.5;
++			dbasis[NUMNODESP2b*1+1] = -2.*SQRT3/3.*gauss->coord2 + SQRT3/6.;
++			/*Nodal function 3*/
++			dbasis[NUMNODESP2b*0+2] = 0.;
++			dbasis[NUMNODESP2b*1+2] = +4.*SQRT3/3.*gauss->coord3 - SQRT3/3.;
++			/*Nodal function 4*/
++			dbasis[NUMNODESP2b*0+3] = +2.*gauss->coord3;
++			dbasis[NUMNODESP2b*1+3] = +4.*SQRT3/3.*gauss->coord2 - 2.*SQRT3/3.*gauss->coord3;
++			/*Nodal function 5*/
++			dbasis[NUMNODESP2b*0+4] = -2.*gauss->coord3;
++			dbasis[NUMNODESP2b*1+4] = +4.*SQRT3/3.*gauss->coord1 - 2.*SQRT3/3.*gauss->coord3;
++			/*Nodal function 6*/
++			dbasis[NUMNODESP2b*0+5] = 2.*(gauss->coord1-gauss->coord2);
++			dbasis[NUMNODESP2b*1+5] = -2.*SQRT3/3.*(gauss->coord1+gauss->coord2);
++			/*Nodal function 7*/
++			dbasis[NUMNODESP2b*0+6] = 27.*(-.5*gauss->coord2*gauss->coord3 + .5*gauss->coord1*gauss->coord3);
++			dbasis[NUMNODESP2b*1+6] = 27.*SQRT3*(-1./6.*gauss->coord2*gauss->coord3 - 1./6.*gauss->coord1*gauss->coord3 +1./3.*gauss->coord1*gauss->coord2);
++			return;
+ 		default:
+ 			_error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
+ 	}
+@@ -375,6 +411,8 @@
+ 		case P1bubbleEnum:          return NUMNODESP1b;
+ 		case P1bubblecondensedEnum: return NUMNODESP1b;
+ 		case P2Enum:                return NUMNODESP2;
++		case P2bubbleEnum:          return NUMNODESP2b;
++		case P2bubblecondensedEnum: return NUMNODESP2b;
+ 		case P1P1Enum:              return NUMNODESP1*2;
+ 		case P1P1GLSEnum:           return NUMNODESP1*2;
+ 		case MINIcondensedEnum:     return NUMNODESP1b+NUMNODESP1;
+Index: ../trunk-jpl/src/c/classes/gauss/GaussTria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 18169)
++++ ../trunk-jpl/src/c/classes/gauss/GaussTria.cpp	(revision 18170)
+@@ -462,6 +462,18 @@
+ 				default: _error_("node index should be in [0 5]");
+ 			}
+ 			break;
++		case P2bubbleEnum: case P2bubblecondensedEnum:
++			switch(iv){
++				case 0: coord1=1.; coord2=0.; coord3=0.; break;
++				case 1: coord1=0.; coord2=1.; coord3=0.; break;
++				case 2: coord1=0.; coord2=0.; coord3=1.; break;
++				case 3: coord1=0.; coord2=.5; coord3=.5; break;
++				case 4: coord1=.5; coord2=0.; coord3=.5; break;
++				case 5: coord1=.5; coord2=.5; coord3=0.; break;
++				case 6: coord1=1./3.; coord2=1./3.; coord3=1./3.; break;
++				default: _error_("node index should be in [0 6]");
++			}
++			break;
+ 		default: _error_("Finite element "<<EnumToStringx(finiteelement)<<" not supported");
+ 	}
+ 
+Index: ../trunk-jpl/src/m/classes/flowequation.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.py	(revision 18169)
++++ ../trunk-jpl/src/m/classes/flowequation.py	(revision 18170)
+@@ -75,7 +75,7 @@
+ 			md = checkfield(md,'fieldname','flowequation.isL1L2','numel',[1],'values',[0,1])
+ 			md = checkfield(md,'fieldname','flowequation.isHO','numel',[1],'values',[0,1])
+ 			md = checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0,1])
+-			md = checkfield(md,'fieldname','flowequation.fe_SSA','values',['P1','P1bubble','P1bubblecondensed','P2'])
++			md = checkfield(md,'fieldname','flowequation.fe_SSA','values',['P1','P1bubble','P1bubblecondensed','P2','P2bubble'])
+ 			md = checkfield(md,'fieldname','flowequation.fe_HO' ,'values',['P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P1xP3','P2xP4'])
+ 			md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',['P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','XTaylorHood','OneLayerP4z'])
+ 			md = checkfield(md,'fieldname','flowequation.borderSSA','size',[md.mesh.numberofvertices],'values',[0,1])
+Index: ../trunk-jpl/src/m/classes/flowequation.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.m	(revision 18169)
++++ ../trunk-jpl/src/m/classes/flowequation.m	(revision 18170)
+@@ -58,51 +58,51 @@
+ 		end% }}}
+ 	end
+ 	methods
+-        function createxml(obj,fid) % {{{
+-            fprintf(fid, '\n\n');
+-            fprintf(fid, '%s\n', '<!-- flowequation -->');
+-            fprintf(fid,'%s\n%s\n%s\n','<frame key="1" label="Flow equation parameters">','<section name="flowequation" />');                    
+-            
++		function createxml(obj,fid) % {{{
++			fprintf(fid, '\n\n');
++			fprintf(fid, '%s\n', '<!-- flowequation -->');
++			fprintf(fid,'%s\n%s\n%s\n','<frame key="1" label="Flow equation parameters">','<section name="flowequation" />');                    
++
+ 			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="isSIA" type="',              class(obj.isSIA),'" default="',                  convert2str(obj.isSIA),'">',              '     <section name="flowequation" />','     <help> is the Shallow Ice Approximation (SIA) used ? </help>','</parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="isSSA" type="',            class(obj.isSSA),'" default="',                convert2str(obj.isSSA),'">',   '     <section name="flowequation" />','     <help> is the Shelfy-Stream Approximation (SSA) used ? </help>','</parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',        '<parameter key ="isL1L2" type="',      class(obj.isL1L2),'" default="',          convert2str(obj.isL1L2),'">',            '     <section name="flowequation" />','     <help> is the L1L2 approximation used ? </help>','</parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',        '<parameter key ="isHO" type="',     class(obj.isHO),'" default="',         convert2str(obj.isHO),'">',            '     <section name="flowequation" />','     <help> is the Higher-Order (HO) approximation used ? </help>','</parameter>');
+-            
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="isFS" type="',       class(obj.isFS),'" default="',              convert2str(obj.isFS),'">',              '     <section name="flowequation" />','     <help> are the Full-FS (FS) equations used ? </help>','</parameter>');
+-            
+-            % fe_SSA drop-down (P1, P1bubble, P1bubblecondensed, P2)
+-            fprintf(fid,'%s\n%s\n%s\n%s\n',    '<parameter key ="fe_SSA" type="alternative" optional="false">','     <section name="flowequation" />','     <help> Finite Element for SSA  "P1", "P1bubble" "P1bubblecondensed" "P2" </help>');
+-            fprintf(fid,'%s\n','       <option value="P1" type="string" default="true"> </option>');
+-            fprintf(fid,'%s\n','       <option value="P1bubble" type="string" default="false"> </option>');
+-            fprintf(fid,'%s\n','       <option value="P1bubblecondensed" type="string" default="false"> </option>');
+-            fprintf(fid,'%s\n%s\n','       <option value="P2" type="string" default="false"> </option>','</parameter>');
+-            
+-            %fe_HO drop-down (P1, P1bubble, P1bubblecondensed, P1xP2, P2xP1, P2)
+-            fprintf(fid,'%s\n%s\n%s\n%s\n',        '<parameter key ="fe_HO" type="alternative" optional="false">','     <section name="flowequation" />','     <help> Finite Element for HO   "P1" "P1bubble" "P1bubblecondensed" "P1xP2" "P2xP1" "P2" </help>');
+-            fprintf(fid,'%s\n','       <option value="P1" type="string" default="true"> </option>');
+-            fprintf(fid,'%s\n','       <option value="P1bubble" type="string" default="false"> </option>');
+-            fprintf(fid,'%s\n','       <option value="P1bubblecondensed" type="string" default="false"> </option>');
+-            fprintf(fid,'%s\n','       <option value="P1xP2" type="string" default="false"> </option>');
+-            fprintf(fid,'%s\n','       <option value="P2xP1" type="string" default="false"> </option>');
+-            fprintf(fid,'%s\n%s\n','       <option value="P2" type="string" default="false"> </option>','</parameter>');
+-            
+-            % fe_FS drop-down (P1P1, P1P1GLS, MINIcondensed, MINI, TaylowHood)
+-            fprintf(fid,'%s\n%s\n%s\n%s\n',        '<parameter key ="fe_FS" type="alternative" optional="false">','     <section name="flowequation" />','     <help> Finite Element for FS   "P1P1" (debugging only) "P1P1GLS" "MINIcondensed" "MINI" "TaylorHood" </help>');
+-            fprintf(fid,'%s\n','       <option value="P1P1" type="string" default="true"> </option>');
+-            fprintf(fid,'%s\n','       <option value="P1P1GLS" type="string" default="false"> </option>');
+-            fprintf(fid,'%s\n','       <option value="MINIcondensed" type="string" default="false"> </option>');
+-            fprintf(fid,'%s\n','       <option value="MINI" type="string" default="false"> </option>');
+-            fprintf(fid,'%s\n%s\n','       <option value="TaylorHood" type="string" default="false"> </option>','</parameter>');
+-            
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',        '<parameter key ="vertex_equation" type="',      class(obj.vertex_equation),'" default="',            convert2str(obj.vertex_equation),'">',            '     <section name="flowequation" />','     <help> flow equation for each vertex </help>','</parameter>');
+-       
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="element_equation" type="',            class(obj.element_equation),'" default="',              convert2str(obj.element_equation),'">',              '     <section name="flowequation" />','     <help> flow equation for each element </help>','</parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="borderSSA" type="', class(obj.borderSSA),'" default="',   convert2str(obj.borderSSA),'">',   '     <section name="flowequation" />','     <help> vertices on SSAs border (for tiling) </help>','</parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',        '<parameter key ="borderHO" type="',          class(obj.borderHO),'" default="',            convert2str(obj.borderHO),'">',            '     <section name="flowequation" />','     <help> vertices on HOs border (for tiling) </help>','</parameter>');
+-            fprintf(fid,'%s%s%s%s%s\n%s\n%s\n',        '<parameter key ="borderFS" type="',          class(obj.borderFS),'" default="',            convert2str(obj.borderFS),'">',            '     <section name="flowequation" />','     <help> vertices on FS border (for tiling) </help>','</parameter>');
+-      
+-            fprintf(fid,'%s\n%s\n','</frame>');
+-        end % }}}
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="isSSA" type="',            class(obj.isSSA),'" default="',                convert2str(obj.isSSA),'">',   '     <section name="flowequation" />','     <help> is the Shelfy-Stream Approximation (SSA) used ? </help>','</parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',        '<parameter key ="isL1L2" type="',      class(obj.isL1L2),'" default="',          convert2str(obj.isL1L2),'">',            '     <section name="flowequation" />','     <help> is the L1L2 approximation used ? </help>','</parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',        '<parameter key ="isHO" type="',     class(obj.isHO),'" default="',         convert2str(obj.isHO),'">',            '     <section name="flowequation" />','     <help> is the Higher-Order (HO) approximation used ? </help>','</parameter>');
++
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="isFS" type="',       class(obj.isFS),'" default="',              convert2str(obj.isFS),'">',              '     <section name="flowequation" />','     <help> are the Full-FS (FS) equations used ? </help>','</parameter>');
++
++			% fe_SSA drop-down (P1, P1bubble, P1bubblecondensed, P2)
++			fprintf(fid,'%s\n%s\n%s\n%s\n',    '<parameter key ="fe_SSA" type="alternative" optional="false">','     <section name="flowequation" />','     <help> Finite Element for SSA  "P1", "P1bubble" "P1bubblecondensed" "P2" </help>');
++			fprintf(fid,'%s\n','       <option value="P1" type="string" default="true"> </option>');
++			fprintf(fid,'%s\n','       <option value="P1bubble" type="string" default="false"> </option>');
++			fprintf(fid,'%s\n','       <option value="P1bubblecondensed" type="string" default="false"> </option>');
++			fprintf(fid,'%s\n%s\n','       <option value="P2" type="string" default="false"> </option>','</parameter>');
++
++			%fe_HO drop-down (P1, P1bubble, P1bubblecondensed, P1xP2, P2xP1, P2)
++			fprintf(fid,'%s\n%s\n%s\n%s\n',        '<parameter key ="fe_HO" type="alternative" optional="false">','     <section name="flowequation" />','     <help> Finite Element for HO   "P1" "P1bubble" "P1bubblecondensed" "P1xP2" "P2xP1" "P2" </help>');
++			fprintf(fid,'%s\n','       <option value="P1" type="string" default="true"> </option>');
++			fprintf(fid,'%s\n','       <option value="P1bubble" type="string" default="false"> </option>');
++			fprintf(fid,'%s\n','       <option value="P1bubblecondensed" type="string" default="false"> </option>');
++			fprintf(fid,'%s\n','       <option value="P1xP2" type="string" default="false"> </option>');
++			fprintf(fid,'%s\n','       <option value="P2xP1" type="string" default="false"> </option>');
++			fprintf(fid,'%s\n%s\n','       <option value="P2" type="string" default="false"> </option>','</parameter>');
++
++			% fe_FS drop-down (P1P1, P1P1GLS, MINIcondensed, MINI, TaylowHood)
++			fprintf(fid,'%s\n%s\n%s\n%s\n',        '<parameter key ="fe_FS" type="alternative" optional="false">','     <section name="flowequation" />','     <help> Finite Element for FS   "P1P1" (debugging only) "P1P1GLS" "MINIcondensed" "MINI" "TaylorHood" </help>');
++			fprintf(fid,'%s\n','       <option value="P1P1" type="string" default="true"> </option>');
++			fprintf(fid,'%s\n','       <option value="P1P1GLS" type="string" default="false"> </option>');
++			fprintf(fid,'%s\n','       <option value="MINIcondensed" type="string" default="false"> </option>');
++			fprintf(fid,'%s\n','       <option value="MINI" type="string" default="false"> </option>');
++			fprintf(fid,'%s\n%s\n','       <option value="TaylorHood" type="string" default="false"> </option>','</parameter>');
++
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',        '<parameter key ="vertex_equation" type="',      class(obj.vertex_equation),'" default="',            convert2str(obj.vertex_equation),'">',            '     <section name="flowequation" />','     <help> flow equation for each vertex </help>','</parameter>');
++
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="element_equation" type="',            class(obj.element_equation),'" default="',              convert2str(obj.element_equation),'">',              '     <section name="flowequation" />','     <help> flow equation for each element </help>','</parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',    '<parameter key ="borderSSA" type="', class(obj.borderSSA),'" default="',   convert2str(obj.borderSSA),'">',   '     <section name="flowequation" />','     <help> vertices on SSAs border (for tiling) </help>','</parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n%s\n',        '<parameter key ="borderHO" type="',          class(obj.borderHO),'" default="',            convert2str(obj.borderHO),'">',            '     <section name="flowequation" />','     <help> vertices on HOs border (for tiling) </help>','</parameter>');
++			fprintf(fid,'%s%s%s%s%s\n%s\n%s\n',        '<parameter key ="borderFS" type="',          class(obj.borderFS),'" default="',            convert2str(obj.borderFS),'">',            '     <section name="flowequation" />','     <help> vertices on FS border (for tiling) </help>','</parameter>');
++
++			fprintf(fid,'%s\n%s\n','</frame>');
++		end % }}}
+ 		function obj = flowequation(varargin) % {{{
+ 			switch nargin
+ 				case 0
+@@ -131,7 +131,7 @@
+ 				md = checkfield(md,'fieldname','flowequation.isL1L2','numel',[1],'values',[0 1]);
+ 				md = checkfield(md,'fieldname','flowequation.isHO','numel',[1],'values',[0 1]);
+ 				md = checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0 1]);
+-				md = checkfield(md,'fieldname','flowequation.fe_SSA','values',{'P1','P1bubble','P1bubblecondensed','P2'});
++				md = checkfield(md,'fieldname','flowequation.fe_SSA','values',{'P1','P1bubble','P1bubblecondensed','P2','P2bubble'});
+ 				md = checkfield(md,'fieldname','flowequation.fe_HO' ,'values',{'P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P1xP3','P2xP4'});
+ 				md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',{'P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','XTaylorHood','OneLayerP4z'});
+ 				md = checkfield(md,'fieldname','flowequation.XTH_r','numel',[1],'>',0.);
+Index: ../trunk-jpl/src/m/enum/BasalforcingsMeltingRateCorrectionEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/BasalforcingsMeltingRateCorrectionEnum.m	(revision 18169)
++++ ../trunk-jpl/src/m/enum/BasalforcingsMeltingRateCorrectionEnum.m	(revision 18170)
+@@ -1,11 +0,0 @@
+-function macro=BasalforcingsMeltingRateCorrectionEnum()
+-%BASALFORCINGSMELTINGRATECORRECTIONENUM - Enum of BasalforcingsMeltingRateCorrection
+-%
+-%   WARNING: DO NOT MODIFY THIS FILE
+-%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
+-%            Please read src/c/shared/Enum/README for more information
+-%
+-%   Usage:
+-%      macro=BasalforcingsMeltingRateCorrectionEnum()
+-
+-macro=StringToEnum('BasalforcingsMeltingRateCorrection');
+Index: ../trunk-jpl/src/m/enum/BasalforcingsMeltingRateEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/BasalforcingsMeltingRateEnum.m	(revision 18169)
++++ ../trunk-jpl/src/m/enum/BasalforcingsMeltingRateEnum.m	(revision 18170)
+@@ -1,11 +0,0 @@
+-function macro=BasalforcingsMeltingRateEnum()
+-%BASALFORCINGSMELTINGRATEENUM - Enum of BasalforcingsMeltingRate
+-%
+-%   WARNING: DO NOT MODIFY THIS FILE
+-%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
+-%            Please read src/c/shared/Enum/README for more information
+-%
+-%   Usage:
+-%      macro=BasalforcingsMeltingRateEnum()
+-
+-macro=StringToEnum('BasalforcingsMeltingRate');
+Index: ../trunk-jpl/src/m/enum/GroundinglineMeltingRateEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/GroundinglineMeltingRateEnum.m	(revision 18169)
++++ ../trunk-jpl/src/m/enum/GroundinglineMeltingRateEnum.m	(revision 18170)
+@@ -1,11 +0,0 @@
+-function macro=GroundinglineMeltingRateEnum()
+-%GROUNDINGLINEMELTINGRATEENUM - Enum of GroundinglineMeltingRate
+-%
+-%   WARNING: DO NOT MODIFY THIS FILE
+-%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
+-%            Please read src/c/shared/Enum/README for more information
+-%
+-%   Usage:
+-%      macro=GroundinglineMeltingRateEnum()
+-
+-macro=StringToEnum('GroundinglineMeltingRate');
+Index: ../trunk-jpl/src/m/enum/P2bubblecondensedEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/P2bubblecondensedEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/P2bubblecondensedEnum.m	(revision 18170)
+@@ -0,0 +1,11 @@
++function macro=P2bubblecondensedEnum()
++%P2BUBBLECONDENSEDENUM - Enum of P2bubblecondensed
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=P2bubblecondensedEnum()
++
++macro=StringToEnum('P2bubblecondensed');
+Index: ../trunk-jpl/src/m/enum/P2bubbleEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/P2bubbleEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/P2bubbleEnum.m	(revision 18170)
+@@ -0,0 +1,11 @@
++function macro=P2bubbleEnum()
++%P2BUBBLEENUM - Enum of P2bubble
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=P2bubbleEnum()
++
++macro=StringToEnum('P2bubble');
+Index: ../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- ../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 18169)
++++ ../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 18170)
+@@ -582,6 +582,8 @@
+ def P1bubbleEnum(): return StringToEnum("P1bubble")[0]
+ def P1bubblecondensedEnum(): return StringToEnum("P1bubblecondensed")[0]
+ def P2Enum(): return StringToEnum("P2")[0]
++def P2bubbleEnum(): return StringToEnum("P2bubble")[0]
++def P2bubblecondensedEnum(): return StringToEnum("P2bubblecondensed")[0]
+ def P2xP1Enum(): return StringToEnum("P2xP1")[0]
+ def P1xP2Enum(): return StringToEnum("P1xP2")[0]
+ def P1xP3Enum(): return StringToEnum("P1xP3")[0]
Index: /issm/oecreview/Archive/17984-18295/ISSM-18170-18171.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18170-18171.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18170-18171.diff	(revision 18296)
@@ -0,0 +1,242 @@
+Index: ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp	(revision 18170)
++++ ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp	(revision 18171)
+@@ -23,6 +23,7 @@
+ #define NUMNODESP1xP3 12
+ #define NUMNODESP2xP1 12
+ #define NUMNODESP2    18
++#define NUMNODESP2b   19
+ #define NUMNODESP2xP4 30
+ 
+ /*Object constructors and destructor*/
+@@ -237,6 +238,32 @@
+ 			basis[16]=4.*gauss->coord3*gauss->coord1*(1.-zeta*zeta);
+ 			basis[17]=4.*gauss->coord1*gauss->coord2*(1.-zeta*zeta);
+ 			return;
++		case P2bubbleEnum: case P2bubblecondensedEnum:
++			/*Corner nodes*/
++			basis[ 0]=gauss->coord1*(2.*gauss->coord1-1.)*zeta*(zeta-1.)/2.;
++			basis[ 1]=gauss->coord2*(2.*gauss->coord2-1.)*zeta*(zeta-1.)/2.;
++			basis[ 2]=gauss->coord3*(2.*gauss->coord3-1.)*zeta*(zeta-1.)/2.;
++			basis[ 3]=gauss->coord1*(2.*gauss->coord1-1.)*zeta*(zeta+1.)/2.;
++			basis[ 4]=gauss->coord2*(2.*gauss->coord2-1.)*zeta*(zeta+1.)/2.;
++			basis[ 5]=gauss->coord3*(2.*gauss->coord3-1.)*zeta*(zeta+1.)/2.;
++			/*mid-sides of quads*/
++			basis[ 6]=gauss->coord1*(2.*gauss->coord1-1.)*(1.-zeta*zeta);
++			basis[ 7]=gauss->coord2*(2.*gauss->coord2-1.)*(1.-zeta*zeta);
++			basis[ 8]=gauss->coord3*(2.*gauss->coord3-1.)*(1.-zeta*zeta);
++			/*mid-sides of triangles*/
++			basis[ 9]=4.*gauss->coord3*gauss->coord2*zeta*(zeta-1.)/2.;
++			basis[10]=4.*gauss->coord3*gauss->coord1*zeta*(zeta-1.)/2.;
++			basis[11]=4.*gauss->coord1*gauss->coord2*zeta*(zeta-1.)/2.;
++			basis[12]=4.*gauss->coord3*gauss->coord2*zeta*(zeta+1.)/2.;
++			basis[13]=4.*gauss->coord3*gauss->coord1*zeta*(zeta+1.)/2.;
++			basis[14]=4.*gauss->coord1*gauss->coord2*zeta*(zeta+1.)/2.;
++			/*quad faces*/
++			basis[15]=4.*gauss->coord3*gauss->coord2*(1.-zeta*zeta);
++			basis[16]=4.*gauss->coord3*gauss->coord1*(1.-zeta*zeta);
++			basis[17]=4.*gauss->coord1*gauss->coord2*(1.-zeta*zeta);
++			/*bubble*/
++			basis[18]=27.*gauss->coord1*gauss->coord2*gauss->coord3*(1.+zeta)*(1.-zeta);
++			return;
+ 		case P2xP4Enum :
+ 			/*Corner nodes*/
+ 			basis[ 0]=gauss->coord1*(2.*gauss->coord1-1.)*(2./3.)*(zeta-1.)*(zeta-0.5 )*(zeta)*(zeta+0.5);
+@@ -572,6 +599,88 @@
+ 			dbasis[NUMNODESP2*1+17] = (1.-zeta*zeta)*(-2.*SQRT3/3.*(gauss->coord1+gauss->coord2));
+ 			dbasis[NUMNODESP2*2+17] = -2.*zeta*4.*gauss->coord1*gauss->coord2;
+ 			return;
++		case P2bubbleEnum: case P2bubblecondensedEnum:
++			/*Nodal function 1*/
++			dbasis[NUMNODESP2b*0+0 ] = .5*zeta*(zeta-1.)*(-2.*gauss->coord1 + 0.5);
++			dbasis[NUMNODESP2b*1+0 ] = .5*zeta*(zeta-1.)*(-2.*SQRT3/3.*gauss->coord1 + SQRT3/6.);
++			dbasis[NUMNODESP2b*2+0 ] = .5*(2.*zeta-1.)*gauss->coord1*(2.*gauss->coord1-1.);
++			/*Nodal function 2*/
++			dbasis[NUMNODESP2b*0+1 ] = .5*zeta*(zeta-1.)*(+2.*gauss->coord2 - 0.5);
++			dbasis[NUMNODESP2b*1+1 ] = .5*zeta*(zeta-1.)*(-2.*SQRT3/3.*gauss->coord2 + SQRT3/6.);
++			dbasis[NUMNODESP2b*2+1 ] = .5*(2.*zeta-1.)*gauss->coord2*(2.*gauss->coord2-1.);
++			/*Nodal function 3*/
++			dbasis[NUMNODESP2b*0+2 ] = 0.;
++			dbasis[NUMNODESP2b*1+2 ] = .5*zeta*(zeta-1.)*(4.*SQRT3/3.*gauss->coord3 - SQRT3/3.);
++			dbasis[NUMNODESP2b*2+2 ] = .5*(2.*zeta-1.)*gauss->coord3*(2.*gauss->coord3-1.);
++			/*Nodal function 4*/
++			dbasis[NUMNODESP2b*0+3 ] = .5*zeta*(zeta+1.)*(-2.*gauss->coord1 + 0.5);
++			dbasis[NUMNODESP2b*1+3 ] = .5*zeta*(zeta+1.)*(-2.*SQRT3/3.*gauss->coord1 + SQRT3/6.);
++			dbasis[NUMNODESP2b*2+3 ] = .5*(2.*zeta+1.)*gauss->coord1*(2.*gauss->coord1-1.);
++			/*Nodal function 5*/
++			dbasis[NUMNODESP2b*0+4 ] = .5*zeta*(zeta+1.)*(+2.*gauss->coord2 - 0.5);
++			dbasis[NUMNODESP2b*1+4 ] = .5*zeta*(zeta+1.)*(-2.*SQRT3/3.*gauss->coord2 + SQRT3/6.);
++			dbasis[NUMNODESP2b*2+4 ] = .5*(2.*zeta+1.)*gauss->coord2*(2.*gauss->coord2-1.);
++			/*Nodal function 6*/
++			dbasis[NUMNODESP2b*0+5 ] = 0.;
++			dbasis[NUMNODESP2b*1+5 ] = .5*zeta*(zeta+1.)*(4.*SQRT3/3.*gauss->coord3 - SQRT3/3.);
++			dbasis[NUMNODESP2b*2+5 ] = .5*(2.*zeta+1.)*gauss->coord3*(2.*gauss->coord3-1.);
++
++			/*Nodal function 7*/
++			dbasis[NUMNODESP2b*0+6 ] = (-2.*gauss->coord1 + 0.5)*(1.-zeta*zeta);
++			dbasis[NUMNODESP2b*1+6 ] = (-2.*SQRT3/3.*gauss->coord1 + SQRT3/6.)*(1.-zeta*zeta);
++			dbasis[NUMNODESP2b*2+6 ] = -2.*zeta*gauss->coord1*(2.*gauss->coord1-1.);
++			/*Nodal function 8*/
++			dbasis[NUMNODESP2b*0+7 ] = (+2.*gauss->coord2 - 0.5)*(1.-zeta*zeta);
++			dbasis[NUMNODESP2b*1+7 ] = (-2.*SQRT3/3.*gauss->coord2 + SQRT3/6.)*(1.-zeta*zeta);
++			dbasis[NUMNODESP2b*2+7 ] = -2.*zeta*gauss->coord2*(2.*gauss->coord2-1.);
++			/*Nodal function 9*/
++			dbasis[NUMNODESP2b*0+8 ] = 0.;
++			dbasis[NUMNODESP2b*1+8 ] = (+4.*SQRT3/3.*gauss->coord3 - SQRT3/3.)*(1.-zeta*zeta);
++			dbasis[NUMNODESP2b*2+8 ] = -2.*zeta*gauss->coord3*(2.*gauss->coord3-1.);
++
++			/*Nodal function 10*/
++			dbasis[NUMNODESP2b*0+9 ] = zeta*(zeta-1.)*gauss->coord3;
++			dbasis[NUMNODESP2b*1+9 ] = .5*zeta*(zeta-1.)*(+4.*SQRT3/3.*gauss->coord2 - 2.*SQRT3/3.*gauss->coord3);
++			dbasis[NUMNODESP2b*2+9 ] = 2.*gauss->coord3*gauss->coord2*(2.*zeta-1.);
++			/*Nodal function 11*/
++			dbasis[NUMNODESP2b*0+10] = -zeta*(zeta-1.)*gauss->coord3;
++			dbasis[NUMNODESP2b*1+10] = .5*zeta*(zeta-1.)*(+4.*SQRT3/3.*gauss->coord1 - 2.*SQRT3/3.*gauss->coord3);
++			dbasis[NUMNODESP2b*2+10] = 2.*gauss->coord3*gauss->coord1*(2.*zeta-1.);
++			/*Nodal function 12*/
++			dbasis[NUMNODESP2b*0+11] = zeta*(zeta-1.)*(gauss->coord1-gauss->coord2);
++			dbasis[NUMNODESP2b*1+11] = .5*zeta*(zeta-1.)*(-2.*SQRT3/3.*(gauss->coord1+gauss->coord2));
++			dbasis[NUMNODESP2b*2+11] = 2.*gauss->coord1*gauss->coord2*(2.*zeta-1.);
++			/*Nodal function 13*/
++			dbasis[NUMNODESP2b*0+12] = zeta*(zeta+1.)*gauss->coord3;
++			dbasis[NUMNODESP2b*1+12] = .5*zeta*(zeta+1.)*(+4.*SQRT3/3.*gauss->coord2 - 2.*SQRT3/3.*gauss->coord3);
++			dbasis[NUMNODESP2b*2+12] = 2.*gauss->coord3*gauss->coord2*(2.*zeta+1.);
++			/*Nodal function 14*/
++			dbasis[NUMNODESP2b*0+13] = -zeta*(zeta+1.)*gauss->coord3;
++			dbasis[NUMNODESP2b*1+13] = .5*zeta*(zeta+1.)*(+4.*SQRT3/3.*gauss->coord1 - 2.*SQRT3/3.*gauss->coord3);
++			dbasis[NUMNODESP2b*2+13] = 2.*gauss->coord3*gauss->coord1*(2.*zeta+1.);
++			/*Nodal function 15*/
++			dbasis[NUMNODESP2b*0+14] = zeta*(zeta+1.)*(gauss->coord1-gauss->coord2);
++			dbasis[NUMNODESP2b*1+14] = .5*zeta*(zeta+1.)*(-2.*SQRT3/3.*(gauss->coord1+gauss->coord2));
++			dbasis[NUMNODESP2b*2+14] = 2.*gauss->coord1*gauss->coord2*(2.*zeta+1.);
++
++			/*Nodal function 16*/
++			dbasis[NUMNODESP2b*0+15] = 2.*gauss->coord3*(1.-zeta*zeta);
++			dbasis[NUMNODESP2b*1+15] = (1.-zeta*zeta)*(+4.*SQRT3/3.*gauss->coord2 - 2.*SQRT3/3.*gauss->coord3);
++			dbasis[NUMNODESP2b*2+15] = -2.*zeta*4.*gauss->coord3*gauss->coord2;
++			/*Nodal function 17*/
++			dbasis[NUMNODESP2b*0+16] = -2.*gauss->coord3*(1.-zeta*zeta);
++			dbasis[NUMNODESP2b*1+16] = (1.-zeta*zeta)*(+4.*SQRT3/3.*gauss->coord1 - 2.*SQRT3/3.*gauss->coord3);
++			dbasis[NUMNODESP2b*2+16] = -2.*zeta*4.*gauss->coord3*gauss->coord1;
++			/*Nodal function 18*/
++			dbasis[NUMNODESP2b*0+17] = 2.*(gauss->coord1-gauss->coord2)*(1.-zeta*zeta);
++			dbasis[NUMNODESP2b*1+17] = (1.-zeta*zeta)*(-2.*SQRT3/3.*(gauss->coord1+gauss->coord2));
++			dbasis[NUMNODESP2b*2+17] = -2.*zeta*4.*gauss->coord1*gauss->coord2;
++
++			/*Nodal function 19*/
++			dbasis[NUMNODESP2b*0+18] = 27.*(1.+zeta)*(1.-zeta)*(-.5*gauss->coord2*gauss->coord3 + .5*gauss->coord1*gauss->coord3);
++			dbasis[NUMNODESP2b*1+18] = 27.*(1.+zeta)*(1.-zeta)*SQRT3*(-1./6.*gauss->coord2*gauss->coord3 - 1./6.*gauss->coord1*gauss->coord3 +1./3.*gauss->coord1*gauss->coord2);
++			dbasis[NUMNODESP2b*2+18] = -54*gauss->coord1*gauss->coord2*gauss->coord3*zeta;
++			return;
+ 		case P2xP4Enum :
+ 			/*Nodal function 1*/
+ 			dbasis[NUMNODESP2xP4*0+0 ] = (-2* gauss->coord1 + 0.5 ) *(2./3.) *(zeta - 1.)*(zeta - 0.5)*(zeta)*(zeta+0.5) ; 
+@@ -840,6 +949,8 @@
+ 		case P1bubbleEnum:          return NUMNODESP1b;
+ 		case P1bubblecondensedEnum: return NUMNODESP1b;
+ 		case P2Enum:                return NUMNODESP2;
++		case P2bubbleEnum:          return NUMNODESP2b;
++		case P2bubblecondensedEnum: return NUMNODESP2b;
+ 		case P2xP1Enum:             return NUMNODESP2xP1;
+ 		case P1xP2Enum:             return NUMNODESP1xP2;
+ 		case P1P1Enum:              return NUMNODESP1*2;
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18170)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18171)
+@@ -2233,6 +2233,29 @@
+ 			penta_node_ids[16]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+3]+1;
+ 			penta_node_ids[17]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+4]+1;
+ 			break;
++		case P2bubbleEnum: case P2bubblecondensedEnum:
++			numnodes         = 19;
++			penta_node_ids   = xNew<int>(numnodes);
++			penta_node_ids[ 0]=iomodel->nodecounter+iomodel->elements[6*index+0];
++			penta_node_ids[ 1]=iomodel->nodecounter+iomodel->elements[6*index+1];
++			penta_node_ids[ 2]=iomodel->nodecounter+iomodel->elements[6*index+2];
++			penta_node_ids[ 3]=iomodel->nodecounter+iomodel->elements[6*index+3];
++			penta_node_ids[ 4]=iomodel->nodecounter+iomodel->elements[6*index+4];
++			penta_node_ids[ 5]=iomodel->nodecounter+iomodel->elements[6*index+5];
++			penta_node_ids[ 6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+0]+1;
++			penta_node_ids[ 7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+1]+1;
++			penta_node_ids[ 8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+2]+1;
++			penta_node_ids[ 9]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+3]+1;
++			penta_node_ids[10]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+4]+1;
++			penta_node_ids[11]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+5]+1;
++			penta_node_ids[12]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+6]+1;
++			penta_node_ids[13]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+7]+1;
++			penta_node_ids[14]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+8]+1;
++			penta_node_ids[15]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+2]+1;
++			penta_node_ids[16]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+3]+1;
++			penta_node_ids[17]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+4]+1;
++			penta_node_ids[18]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+index+1;
++			break;
+ 		case P1P1Enum: case P1P1GLSEnum:
+ 			numnodes         = 12;
+ 			penta_node_ids   = xNew<int>(numnodes);
+Index: ../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp	(revision 18170)
++++ ../trunk-jpl/src/c/classes/gauss/GaussPenta.cpp	(revision 18171)
+@@ -646,6 +646,34 @@
+ 				default: _error_("node index should be in [0 17]");
+ 			}
+ 			break;
++		case P2bubbleEnum: case P2bubblecondensedEnum:
++			switch(iv){
++				case 0: coord1=1.; coord2=0.; coord3=0.; coord4=-1.; break;
++				case 1: coord1=0.; coord2=1.; coord3=0.; coord4=-1.; break;
++				case 2: coord1=0.; coord2=0.; coord3=1.; coord4=-1.; break;
++				case 3: coord1=1.; coord2=0.; coord3=0.; coord4=+1.; break;
++				case 4: coord1=0.; coord2=1.; coord3=0.; coord4=+1.; break;
++				case 5: coord1=0.; coord2=0.; coord3=1.; coord4=+1.; break;
++
++				case 6: coord1=1.; coord2=0.; coord3=0.; coord4=0.; break;
++				case 7: coord1=0.; coord2=1.; coord3=0.; coord4=0.; break;
++				case 8: coord1=0.; coord2=0.; coord3=1.; coord4=0.; break;
++
++				case  9: coord1=0.; coord2=.5; coord3=.5; coord4=-1.;break;
++				case 10: coord1=.5; coord2=0.; coord3=.5; coord4=-1.;break;
++				case 11: coord1=.5; coord2=.5; coord3=0.; coord4=-1.;break;
++				case 12: coord1=0.; coord2=.5; coord3=.5; coord4=+1.;break;
++				case 13: coord1=.5; coord2=0.; coord3=.5; coord4=+1.;break;
++				case 14: coord1=.5; coord2=.5; coord3=0.; coord4=+1.;break;
++
++				case 15: coord1=0.; coord2=.5; coord3=.5; coord4=0.;break;
++				case 16: coord1=.5; coord2=0.; coord3=.5; coord4=0.;break;
++				case 17: coord1=.5; coord2=.5; coord3=0.; coord4=0.;break;
++
++				case 18: coord1=1./3.; coord2=1./3.; coord3=1./3.; coord4=0.;  break;
++				default: _error_("node index should be in [0 18]");
++			}
++			break;
+ 		case P2xP4Enum:
+ 			switch(iv){
+ 				case 0: coord1=1.; coord2=0.; coord3=0.; coord4=-1.; break;
+Index: ../trunk-jpl/src/m/classes/flowequation.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.py	(revision 18170)
++++ ../trunk-jpl/src/m/classes/flowequation.py	(revision 18171)
+@@ -76,7 +76,7 @@
+ 			md = checkfield(md,'fieldname','flowequation.isHO','numel',[1],'values',[0,1])
+ 			md = checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0,1])
+ 			md = checkfield(md,'fieldname','flowequation.fe_SSA','values',['P1','P1bubble','P1bubblecondensed','P2','P2bubble'])
+-			md = checkfield(md,'fieldname','flowequation.fe_HO' ,'values',['P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P1xP3','P2xP4'])
++			md = checkfield(md,'fieldname','flowequation.fe_HO' ,'values',['P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P2bubble','P1xP3','P2xP4'])
+ 			md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',['P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','XTaylorHood','OneLayerP4z'])
+ 			md = checkfield(md,'fieldname','flowequation.borderSSA','size',[md.mesh.numberofvertices],'values',[0,1])
+ 			md = checkfield(md,'fieldname','flowequation.borderHO','size',[md.mesh.numberofvertices],'values',[0,1])
+Index: ../trunk-jpl/src/m/classes/flowequation.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.m	(revision 18170)
++++ ../trunk-jpl/src/m/classes/flowequation.m	(revision 18171)
+@@ -132,7 +132,7 @@
+ 				md = checkfield(md,'fieldname','flowequation.isHO','numel',[1],'values',[0 1]);
+ 				md = checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0 1]);
+ 				md = checkfield(md,'fieldname','flowequation.fe_SSA','values',{'P1','P1bubble','P1bubblecondensed','P2','P2bubble'});
+-				md = checkfield(md,'fieldname','flowequation.fe_HO' ,'values',{'P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P1xP3','P2xP4'});
++				md = checkfield(md,'fieldname','flowequation.fe_HO' ,'values',{'P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P2bubble','P1xP3','P2xP4'});
+ 				md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',{'P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','XTaylorHood','OneLayerP4z'});
+ 				md = checkfield(md,'fieldname','flowequation.XTH_r','numel',[1],'>',0.);
+ 				md = checkfield(md,'fieldname','flowequation.XTH_theta','numel',[1],'>=',0.,'<',0.5);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18171-18172.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18171-18172.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18171-18172.diff	(revision 18296)
@@ -0,0 +1,214 @@
+Index: ../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim
+===================================================================
+--- ../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim	(revision 18171)
++++ ../trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim	(revision 18172)
+@@ -411,13 +411,14 @@
+ "ISSM's objects begin
+ syn keyword cType BoolInput
+ syn keyword cType BoolParam
++syn keyword cType classes
+ syn keyword cType Constraint
+ syn keyword cType Constraints
+ syn keyword cType Contour
+ syn keyword cType Contours
+ syn keyword cType ControlInput
++syn keyword cType DatasetInput
+ syn keyword cType DataSetParam
+-syn keyword cType DatasetInput
+ syn keyword cType Definition
+ syn keyword cType DependentObject
+ syn keyword cType DofIndexing
+@@ -430,19 +431,20 @@
+ syn keyword cType Element
+ syn keyword cType ElementHook
+ syn keyword cType ElementMatrix
++syn keyword cType Elements
+ syn keyword cType ElementVector
+-syn keyword cType Elements
+ syn keyword cType ExponentialVariogram
+ syn keyword cType ExternalResult
+ syn keyword cType FemModel
+ syn keyword cType FileParam
+ syn keyword cType Friction
+ syn keyword cType Gauss
++syn keyword cType GaussianVariogram
++syn keyword cType gaussobjects
+ syn keyword cType GaussPenta
+ syn keyword cType GaussSeg
+ syn keyword cType GaussTetra
+ syn keyword cType GaussTria
+-syn keyword cType GaussianVariogram
+ syn keyword cType GenericExternalResult
+ syn keyword cType GenericOption
+ syn keyword cType GenericParam
+@@ -456,6 +458,7 @@
+ syn keyword cType IntParam
+ syn keyword cType IntVecParam
+ syn keyword cType IoModel
++syn keyword cType krigingobjects
+ syn keyword cType Load
+ syn keyword cType Loads
+ syn keyword cType Massfluxatgate
+@@ -463,6 +466,7 @@
+ syn keyword cType Materials
+ syn keyword cType Matice
+ syn keyword cType Matpar
++syn keyword cType matrixobjects
+ syn keyword cType MatrixParam
+ syn keyword cType Misfit
+ syn keyword cType Node
+@@ -471,8 +475,8 @@
+ syn keyword cType Observation
+ syn keyword cType Observations
+ syn keyword cType Option
++syn keyword cType Options
+ syn keyword cType OptionUtilities
+-syn keyword cType Options
+ syn keyword cType Param
+ syn keyword cType Parameters
+ syn keyword cType Pengrid
+@@ -484,12 +488,12 @@
+ syn keyword cType Profiler
+ syn keyword cType Quadtree
+ syn keyword cType Results
++syn keyword cType Riftfront
+ syn keyword cType RiftStruct
+-syn keyword cType Riftfront
+ syn keyword cType Seg
+ syn keyword cType SegInput
++syn keyword cType Segment
+ syn keyword cType SegRef
+-syn keyword cType Segment
+ syn keyword cType SpcDynamic
+ syn keyword cType SpcStatic
+ syn keyword cType SpcTransient
+@@ -509,10 +513,7 @@
+ syn keyword cType VectorParam
+ syn keyword cType Vertex
+ syn keyword cType Vertices
+-syn keyword cType classes
+-syn keyword cType gaussobjects
+-syn keyword cType krigingobjects
+-syn keyword cType matrixobjects
++syn keyword cType AdjointBalancethickness2Analysis
+ syn keyword cType AdjointBalancethicknessAnalysis
+ syn keyword cType AdjointHorizAnalysis
+ syn keyword cType Analysis
+@@ -577,9 +578,15 @@
+ syn keyword cConstant BalancethicknessSpcthicknessEnum
+ syn keyword cConstant BalancethicknessStabilizationEnum
+ syn keyword cConstant BalancethicknessThickeningRateEnum
++syn keyword cConstant BasalforcingsEnum
+ syn keyword cConstant BasalforcingsGeothermalfluxEnum
+-syn keyword cConstant BasalforcingsMeltingRateCorrectionEnum
+-syn keyword cConstant BasalforcingsMeltingRateEnum
++syn keyword cConstant BasalforcingsGroundediceMeltingRateEnum
++syn keyword cConstant BasalforcingsFloatingiceMeltingRateEnum
++syn keyword cConstant BasalforcingsDeepwaterMeltingRateEnum
++syn keyword cConstant BasalforcingsDeepwaterElevationEnum
++syn keyword cConstant BasalforcingsUpperwaterElevationEnum
++syn keyword cConstant FloatingMeltRateEnum
++syn keyword cConstant LinearFloatingMeltRateEnum
+ syn keyword cConstant BedEnum
+ syn keyword cConstant BaseEnum
+ syn keyword cConstant ConstantsGEnum
+@@ -623,6 +630,9 @@
+ syn keyword cConstant FrictionCoefficientEnum
+ syn keyword cConstant FrictionPEnum
+ syn keyword cConstant FrictionQEnum
++syn keyword cConstant FrictionMEnum
++syn keyword cConstant FrictionCEnum
++syn keyword cConstant FrictionLawEnum
+ syn keyword cConstant GeometryHydrostaticRatioEnum
+ syn keyword cConstant HydrologyModelEnum
+ syn keyword cConstant HydrologyshreveEnum
+@@ -681,15 +691,14 @@
+ syn keyword cConstant InversionMaxiterEnum
+ syn keyword cConstant InversionMaxstepsEnum
+ syn keyword cConstant InversionFatolEnum
+-syn keyword cConstant InversionFgtolEnum
++syn keyword cConstant InversionFrtolEnum
+ syn keyword cConstant InversionGatolEnum
+-syn keyword cConstant InversionGgtolEnum
++syn keyword cConstant InversionGrtolEnum
+ syn keyword cConstant InversionGttolEnum
+ syn keyword cConstant InversionAlgorithmEnum
+ syn keyword cConstant InversionMinParametersEnum
+ syn keyword cConstant InversionNstepsEnum
+ syn keyword cConstant InversionDxminEnum
+-syn keyword cConstant InversionEpsrelEnum
+ syn keyword cConstant InversionNumControlParametersEnum
+ syn keyword cConstant InversionNumCostFunctionsEnum
+ syn keyword cConstant InversionStepThresholdEnum
+@@ -732,7 +741,7 @@
+ syn keyword cConstant DamageEvolutionNumRequestedOutputsEnum
+ syn keyword cConstant DamageEvolutionRequestedOutputsEnum
+ syn keyword cConstant MaterialsRhoIceEnum
+-syn keyword cConstant MaterialsRhoWaterEnum
++syn keyword cConstant MaterialsRhoSeawaterEnum
+ syn keyword cConstant MaterialsRhoFreshwaterEnum
+ syn keyword cConstant MaterialsMuWaterEnum
+ syn keyword cConstant MaterialsThermalExchangeVelocityEnum
+@@ -820,6 +829,7 @@
+ syn keyword cConstant TimesteppingCflCoefficientEnum
+ syn keyword cConstant TimesteppingTimeAdaptEnum
+ syn keyword cConstant TimesteppingTimeStepEnum
++syn keyword cConstant TimesteppingInterpForcingsEnum
+ syn keyword cConstant TransientIsstressbalanceEnum
+ syn keyword cConstant TransientIsgroundinglineEnum
+ syn keyword cConstant TransientIsmasstransportEnum
+@@ -858,12 +868,20 @@
+ syn keyword cConstant SurfaceforcingsBPosEnum
+ syn keyword cConstant SurfaceforcingsBNegEnum
+ syn keyword cConstant SMBhenningEnum
++syn keyword cConstant SMBcomponentsEnum
++syn keyword cConstant SurfaceforcingsAccumulationEnum
++syn keyword cConstant SurfaceforcingsEvaporationEnum
++syn keyword cConstant SurfaceforcingsRunoffEnum
++syn keyword cConstant SMBmeltcomponentsEnum
++syn keyword cConstant SurfaceforcingsMeltEnum
++syn keyword cConstant SurfaceforcingsRefreezeEnum
+ syn keyword cConstant SurfaceforcingsIspddEnum
+ syn keyword cConstant SurfaceforcingsIssmbgradientsEnum
+ syn keyword cConstant SolutionTypeEnum
+ syn keyword cConstant AnalysisTypeEnum
+ syn keyword cConstant ConfigurationTypeEnum
+ syn keyword cConstant AdjointBalancethicknessAnalysisEnum
++syn keyword cConstant AdjointBalancethickness2AnalysisEnum
+ syn keyword cConstant AdjointHorizAnalysisEnum
+ syn keyword cConstant AnalysisCounterEnum
+ syn keyword cConstant DefaultAnalysisEnum
+@@ -1010,7 +1028,6 @@
+ syn keyword cConstant FillEnum
+ syn keyword cConstant FractionIncrementEnum
+ syn keyword cConstant FrictionEnum
+-syn keyword cConstant GroundinglineMeltingRateEnum
+ syn keyword cConstant InternalEnum
+ syn keyword cConstant MassFluxEnum
+ syn keyword cConstant MeltingOffsetEnum
+@@ -1106,6 +1123,8 @@
+ syn keyword cConstant P1bubbleEnum
+ syn keyword cConstant P1bubblecondensedEnum
+ syn keyword cConstant P2Enum
++syn keyword cConstant P2bubbleEnum
++syn keyword cConstant P2bubblecondensedEnum
+ syn keyword cConstant P2xP1Enum
+ syn keyword cConstant P1xP2Enum
+ syn keyword cConstant P1xP3Enum
+@@ -1117,6 +1136,7 @@
+ syn keyword cConstant TaylorHoodEnum
+ syn keyword cConstant XTaylorHoodEnum
+ syn keyword cConstant OneLayerP4zEnum
++syn keyword cConstant CrouzeixRaviartEnum
+ syn keyword cConstant SaveResultsEnum
+ syn keyword cConstant BoolExternalResultEnum
+ syn keyword cConstant DoubleExternalResultEnum
+@@ -1160,7 +1180,7 @@
+ syn keyword cConstant AugmentedLagrangianREnum
+ syn keyword cConstant AugmentedLagrangianThetaEnum
+ syn keyword cConstant NoneEnum
+-syn keyword cConstant AgressiveMigrationEnum
++syn keyword cConstant AggressiveMigrationEnum
+ syn keyword cConstant SoftMigrationEnum
+ syn keyword cConstant SubelementMigrationEnum
+ syn keyword cConstant SubelementMigration2Enum
Index: /issm/oecreview/Archive/17984-18295/ISSM-18172-18173.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18172-18173.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18172-18173.diff	(revision 18296)
@@ -0,0 +1,402 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18172)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18173)
+@@ -413,13 +413,14 @@
+ 		else if(isFS){  iomodel->Constant(&finiteelement,FlowequationFeFSEnum);
+ 			/*Deduce velocity interpolation from finite element*/
+ 			switch(finiteelement){
+-				case P1P1Enum          : finiteelement = P1Enum;       break;
+-				case P1P1GLSEnum       : finiteelement = P1Enum;       break;
+-				case MINIcondensedEnum : finiteelement = P1bubbleEnum; break;
+-				case MINIEnum          : finiteelement = P1bubbleEnum; break;
+-				case TaylorHoodEnum    : finiteelement = P2Enum;       break;
+-				case XTaylorHoodEnum   : finiteelement = P2Enum;       break;
+-				case OneLayerP4zEnum   : finiteelement = P2xP4Enum;    break;
++				case P1P1Enum            : finiteelement = P1Enum;       break;
++				case P1P1GLSEnum         : finiteelement = P1Enum;       break;
++				case MINIcondensedEnum   : finiteelement = P1bubbleEnum; break;
++				case MINIEnum            : finiteelement = P1bubbleEnum; break;
++				case TaylorHoodEnum      : finiteelement = P2Enum;       break;
++				case XTaylorHoodEnum     : finiteelement = P2Enum;       break;
++				case OneLayerP4zEnum     : finiteelement = P2xP4Enum;    break;
++				case CrouzeixRaviartEnum : finiteelement = P2bubbleEnum; break;
+ 				default: _error_("finite element "<<EnumToStringx(finiteelement)<<" not supported");
+ 			}
+ 		}
+@@ -498,6 +499,16 @@
+ 						}
+ 					}
+ 					break;
++				case P2bubbleEnum:
++					for(i=0;i<iomodel->numberofvertices;i++){
++						if(iomodel->my_vertices[i]){
++							if(reCast<int,IssmDouble>(vertices_type[i])==NoneApproximationEnum){
++								constraints->AddObject(new SpcStatic(count+1,iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofelements+iomodel->numberoffaces+i+1,0,g*rho_ice*(surface[i]-z[i])/FSreconditioning,StressbalanceAnalysisEnum));
++								count++;
++							}
++						}
++					}
++					break;
+ 				case P2xP4Enum:
+ 					//Nothing yet
+ 					break;
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18172)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18173)
+@@ -614,6 +614,7 @@
+ 	TaylorHoodEnum,
+ 	XTaylorHoodEnum,
+ 	OneLayerP4zEnum,
++	CrouzeixRaviartEnum,
+ 	/*}}}*/
+ 	/*Results{{{*/
+ 	SaveResultsEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18172)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18173)
+@@ -603,6 +603,7 @@
+ 		case TaylorHoodEnum : return "TaylorHood";
+ 		case XTaylorHoodEnum : return "XTaylorHood";
+ 		case OneLayerP4zEnum : return "OneLayerP4z";
++		case CrouzeixRaviartEnum : return "CrouzeixRaviart";
+ 		case SaveResultsEnum : return "SaveResults";
+ 		case BoolExternalResultEnum : return "BoolExternalResult";
+ 		case DoubleExternalResultEnum : return "DoubleExternalResult";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18172)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18173)
+@@ -615,6 +615,7 @@
+ 	      else if (strcmp(name,"TaylorHood")==0) return TaylorHoodEnum;
+ 	      else if (strcmp(name,"XTaylorHood")==0) return XTaylorHoodEnum;
+ 	      else if (strcmp(name,"OneLayerP4z")==0) return OneLayerP4zEnum;
++	      else if (strcmp(name,"CrouzeixRaviart")==0) return CrouzeixRaviartEnum;
+ 	      else if (strcmp(name,"SaveResults")==0) return SaveResultsEnum;
+ 	      else if (strcmp(name,"BoolExternalResult")==0) return BoolExternalResultEnum;
+ 	      else if (strcmp(name,"DoubleExternalResult")==0) return DoubleExternalResultEnum;
+@@ -627,11 +628,11 @@
+ 	      else if (strcmp(name,"WaterColumnOld")==0) return WaterColumnOldEnum;
+ 	      else if (strcmp(name,"Outputdefinition")==0) return OutputdefinitionEnum;
+ 	      else if (strcmp(name,"OutputdefinitionList")==0) return OutputdefinitionListEnum;
+-	      else if (strcmp(name,"Massfluxatgate")==0) return MassfluxatgateEnum;
+          else stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"MassfluxatgateName")==0) return MassfluxatgateNameEnum;
++	      if (strcmp(name,"Massfluxatgate")==0) return MassfluxatgateEnum;
++	      else if (strcmp(name,"MassfluxatgateName")==0) return MassfluxatgateNameEnum;
+ 	      else if (strcmp(name,"MassfluxatgateSegments")==0) return MassfluxatgateSegmentsEnum;
+ 	      else if (strcmp(name,"MisfitName")==0) return MisfitNameEnum;
+ 	      else if (strcmp(name,"MisfitModelEnum")==0) return MisfitModelEnumEnum;
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateNodes.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateNodes.cpp	(revision 18172)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateNodes.cpp	(revision 18173)
+@@ -12,7 +12,7 @@
+ 
+ 	/*Intermediaries*/
+ 	int   i,j,counter,vnodes,lid=0;
+-	int   numberoffaces;
++	int   numberoffaces,elementnbv;
+ 	int   id0 = iomodel->nodecounter;
+ 	bool *my_faces = NULL;
+ 	bool *my_edges = NULL;
+@@ -441,7 +441,63 @@
+ 				counter++;
+ 			}
+ 			break;
++		case CrouzeixRaviartEnum:
++			_assert_(approximation==FSApproximationEnum);
++			/*P2b velocity*/
++			EdgesPartitioning(&my_edges,iomodel);
++			for(i=0;i<iomodel->numberofvertices;i++){
++				if(iomodel->my_vertices[i]){
++					nodes->AddObject(new Node(id0+i+1,i,lid++,i,iomodel,analysis,FSvelocityEnum));
++				}
++			}
++			for(i=0;i<iomodel->numberofedges;i++){
++				if(my_edges[i]){
++					nodes->AddObject(new Node(id0+iomodel->numberofvertices+i+1,iomodel->numberofvertices+i,lid++,0,iomodel,analysis,FSvelocityEnum));
++				}
++			}
++			id0 = id0+iomodel->numberofvertices+iomodel->numberofedges;
++			if(iomodel->meshelementtype==PentaEnum){
++				FacesPartitioning(&my_faces,iomodel);
++				for(i=0;i<iomodel->numberoffaces;i++){
++					if(iomodel->faces[i*iomodel->facescols+2]==2){/*Vertical quads*/
++						if(my_faces[i]){
++							node = new Node(id0+i+1,iomodel->numberofvertices+iomodel->numberofedges+i,lid++,0,iomodel,analysis,FSvelocityEnum);
++							nodes->AddObject(node);
++						}
++					}
++					else if(iomodel->faces[i*iomodel->facescols+2]==1){/*Triangular base/top*/
++						/*Nothing*/
++					}
++					else{
++						_error_("not supported");
++					}
++				}
++				id0 = id0+iomodel->numberoffaces;
++			}
++			for(i=0;i<iomodel->numberofelements;i++){
++				if(iomodel->my_elements[i]){
++					nodes->AddObject(new Node(id0+i+1,id0-iomodel->nodecounter+i,lid++,0,iomodel,analysis,FSvelocityEnum));
++				}
++			}
+ 
++			/*P1 DG pressure*/
++			vnodes = id0+iomodel->numberofelements;
++			switch(iomodel->meshelementtype){
++				case TriaEnum:  elementnbv = 3; break;
++				case TetraEnum: elementnbv = 4; break;
++				case PentaEnum: elementnbv = 6; break;
++				default:        _error_("mesh dimension not supported yet");
++			}
++			for(i=0;i<iomodel->numberofelements;i++){
++				if(iomodel->my_elements[i]){
++					for(j=0;j<elementnbv;j++){
++						nodes->AddObject(new Node(vnodes+elementnbv*i+j+1,vnodes-iomodel->nodecounter+elementnbv*i+j,lid++,iomodel->elements[+elementnbv*i+j]-1,iomodel,analysis,FSpressureEnum));
++
++					}
++				}
++			}
++			break;
++
+ 		default:
+ 			_error_("Finite element "<<EnumToStringx(finite_element)<<" not supported yet");
+ 	}
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18172)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18173)
+@@ -1974,6 +1974,21 @@
+ 			tria_node_ids[7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[3*index+1];
+ 			tria_node_ids[8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elements[3*index+2];
+ 			break;
++		case CrouzeixRaviartEnum:
++			numnodes        = 10;
++			tria_node_ids   = xNew<int>(numnodes);
++			tria_node_ids[0]=iomodel->nodecounter+iomodel->elements[3*index+0];
++			tria_node_ids[1]=iomodel->nodecounter+iomodel->elements[3*index+1];
++			tria_node_ids[2]=iomodel->nodecounter+iomodel->elements[3*index+2];
++			tria_node_ids[3]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+0]+1;
++			tria_node_ids[4]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+1]+1;
++			tria_node_ids[5]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[3*index+2]+1;
++			tria_node_ids[6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+index+1;
++
++			tria_node_ids[7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofelements+3*index+1;
++			tria_node_ids[8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofelements+3*index+2;
++			tria_node_ids[9]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberofelements+3*index+3;
++			break;
+ 		default:
+ 			_error_("Finite element "<<EnumToStringx(finiteelement_type)<<" not supported yet");
+ 	}
+Index: ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp	(revision 18172)
++++ ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp	(revision 18173)
+@@ -946,6 +946,7 @@
+ 	switch(finiteelement){
+ 		case P0Enum:                return NUMNODESP0;
+ 		case P1Enum:                return NUMNODESP1;
++		case P1DGEnum:              return NUMNODESP1;
+ 		case P1bubbleEnum:          return NUMNODESP1b;
+ 		case P1bubblecondensedEnum: return NUMNODESP1b;
+ 		case P2Enum:                return NUMNODESP2;
+@@ -953,14 +954,15 @@
+ 		case P2bubblecondensedEnum: return NUMNODESP2b;
+ 		case P2xP1Enum:             return NUMNODESP2xP1;
+ 		case P1xP2Enum:             return NUMNODESP1xP2;
++		case P2xP4Enum:             return NUMNODESP2xP4;
++		case P1xP3Enum:             return NUMNODESP1xP3;
+ 		case P1P1Enum:              return NUMNODESP1*2;
+ 		case P1P1GLSEnum:           return NUMNODESP1*2;
+ 		case MINIcondensedEnum:     return NUMNODESP1b+NUMNODESP1;
+ 		case MINIEnum:              return NUMNODESP1b+NUMNODESP1;
+ 		case TaylorHoodEnum:        return NUMNODESP2+NUMNODESP1;
+ 		case OneLayerP4zEnum:       return NUMNODESP2xP4+NUMNODESP1;
+-		case P2xP4Enum:             return NUMNODESP2xP4;
+-		case P1xP3Enum:             return NUMNODESP1xP3;
++		case CrouzeixRaviartEnum:   return NUMNODESP2b+NUMNODESP1;
+ 		default:       _error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
+ 	}
+ 
+@@ -970,12 +972,13 @@
+ int  PentaRef::VelocityInterpolation(int fe_stokes){/*{{{*/
+ 
+ 	switch(fe_stokes){
+-		case P1P1Enum:          return P1Enum;
+-		case P1P1GLSEnum:       return P1Enum;
+-		case MINIcondensedEnum: return P1bubbleEnum;
+-		case MINIEnum:          return P1bubbleEnum;
+-		case TaylorHoodEnum:    return P2Enum;
+-		case OneLayerP4zEnum:   return P2xP4Enum;
++		case P1P1Enum:           return P1Enum;
++		case P1P1GLSEnum:        return P1Enum;
++		case MINIcondensedEnum:  return P1bubbleEnum;
++		case MINIEnum:           return P1bubbleEnum;
++		case TaylorHoodEnum:     return P2Enum;
++		case OneLayerP4zEnum:    return P2xP4Enum;
++		case CrouzeixRaviartEnum:return P2bubbleEnum;
+ 		default:       _error_("Element type "<<EnumToStringx(fe_stokes)<<" not supported yet");
+ 	}
+ 
+@@ -985,12 +988,13 @@
+ int  PentaRef::PressureInterpolation(int fe_stokes){/*{{{*/
+ 
+ 	switch(fe_stokes){
+-		case P1P1Enum:          return P1Enum;
+-		case P1P1GLSEnum:       return P1Enum;
+-		case MINIcondensedEnum: return P1Enum;
+-		case MINIEnum:          return P1Enum;
+-		case TaylorHoodEnum:    return P1Enum;
+-		case OneLayerP4zEnum:   return P1Enum;
++		case P1P1Enum:           return P1Enum;
++		case P1P1GLSEnum:        return P1Enum;
++		case MINIcondensedEnum:  return P1Enum;
++		case MINIEnum:           return P1Enum;
++		case TaylorHoodEnum:     return P1Enum;
++		case OneLayerP4zEnum:    return P1Enum;
++		case CrouzeixRaviartEnum:return P1DGEnum;
+ 		default:       _error_("Element type "<<EnumToStringx(fe_stokes)<<" not supported yet");
+ 	}
+ 
+@@ -1062,6 +1066,16 @@
+ 			indices[4] = 10;
+ 			indices[5] = 11;
+ 			break;
++		case P2bubbleEnum:
++			numindices = 6;
++			indices    = xNew<int>(numindices);
++			indices[0] = 0;
++			indices[1] = 1;
++			indices[2] = 2;
++			indices[3] = 9;
++			indices[4] = 10;
++			indices[5] = 11;
++			break;
+ 		case P2xP4Enum:
+ 			numindices = 6;
+ 			indices    = xNew<int>(numindices);
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18172)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18173)
+@@ -2361,6 +2361,36 @@
+ 			penta_node_ids[34]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->numberoffaces+iomodel->elements[6*index+4];
+ 			penta_node_ids[35]=iomodel->nodecounter+iomodel->numberofvertices+3*iomodel->numberofedges+3*iomodel->numberoffaces+iomodel->elements[6*index+5];
+ 			break;
++		case CrouzeixRaviartEnum:
++			numnodes         = 25;
++			penta_node_ids   = xNew<int>(numnodes);
++			penta_node_ids[ 0]=iomodel->nodecounter+iomodel->elements[6*index+0];
++			penta_node_ids[ 1]=iomodel->nodecounter+iomodel->elements[6*index+1];
++			penta_node_ids[ 2]=iomodel->nodecounter+iomodel->elements[6*index+2];
++			penta_node_ids[ 3]=iomodel->nodecounter+iomodel->elements[6*index+3];
++			penta_node_ids[ 4]=iomodel->nodecounter+iomodel->elements[6*index+4];
++			penta_node_ids[ 5]=iomodel->nodecounter+iomodel->elements[6*index+5];
++			penta_node_ids[ 6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+0]+1;
++			penta_node_ids[ 7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+1]+1;
++			penta_node_ids[ 8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+2]+1;
++			penta_node_ids[ 9]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+3]+1;
++			penta_node_ids[10]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+4]+1;
++			penta_node_ids[11]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+5]+1;
++			penta_node_ids[12]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+6]+1;
++			penta_node_ids[13]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+7]+1;
++			penta_node_ids[14]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+8]+1;
++			penta_node_ids[15]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+2]+1;
++			penta_node_ids[16]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+3]+1;
++			penta_node_ids[17]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+4]+1;
++			penta_node_ids[18]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+index+1;
++
++			penta_node_ids[19]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->numberofelements+6*index+1;
++			penta_node_ids[20]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->numberofelements+6*index+2;
++			penta_node_ids[21]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->numberofelements+6*index+3;
++			penta_node_ids[22]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->numberofelements+6*index+4;
++			penta_node_ids[23]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->numberofelements+6*index+5;
++			penta_node_ids[24]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->numberofelements+6*index+6;
++			break;
+ 		default:
+ 			_error_("Finite element "<<EnumToStringx(finiteelement_type)<<" not supported yet");
+ 	}
+Index: ../trunk-jpl/src/c/classes/Elements/TriaRef.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/TriaRef.cpp	(revision 18172)
++++ ../trunk-jpl/src/c/classes/Elements/TriaRef.cpp	(revision 18173)
+@@ -419,6 +419,7 @@
+ 		case MINIEnum:              return NUMNODESP1b+NUMNODESP1;
+ 		case TaylorHoodEnum:        return NUMNODESP2+NUMNODESP1;
+ 		case XTaylorHoodEnum:       return NUMNODESP2+NUMNODESP1;
++		case CrouzeixRaviartEnum:   return NUMNODESP2b+NUMNODESP1;
+ 		default: _error_("Element type "<<EnumToStringx(finiteelement)<<" not supported yet");
+ 	}
+ 
+@@ -428,12 +429,13 @@
+ int  TriaRef::VelocityInterpolation(int fe_stokes){/*{{{*/
+ 
+ 	switch(fe_stokes){
+-		case P1P1Enum:          return P1Enum;
+-		case P1P1GLSEnum:       return P1Enum;
+-		case MINIcondensedEnum: return P1bubbleEnum;
+-		case MINIEnum:          return P1bubbleEnum;
+-		case TaylorHoodEnum:    return P2Enum;
+-		case XTaylorHoodEnum:   return P2Enum;
++		case P1P1Enum:           return P1Enum;
++		case P1P1GLSEnum:        return P1Enum;
++		case MINIcondensedEnum:  return P1bubbleEnum;
++		case MINIEnum:           return P1bubbleEnum;
++		case TaylorHoodEnum:     return P2Enum;
++		case XTaylorHoodEnum:    return P2Enum;
++		case CrouzeixRaviartEnum:return P2bubbleEnum;
+ 		default:       _error_("Element type "<<EnumToStringx(fe_stokes)<<" not supported yet");
+ 	}
+ 
+@@ -443,12 +445,13 @@
+ int  TriaRef::PressureInterpolation(int fe_stokes){/*{{{*/
+ 
+ 	switch(fe_stokes){
+-		case P1P1Enum:          return P1Enum;
+-		case P1P1GLSEnum:       return P1Enum;
+-		case MINIcondensedEnum: return P1Enum;
+-		case MINIEnum:          return P1Enum;
+-		case TaylorHoodEnum:    return P1Enum;
+-		case XTaylorHoodEnum:   return P1Enum;
++		case P1P1Enum:            return P1Enum;
++		case P1P1GLSEnum:         return P1Enum;
++		case MINIcondensedEnum:   return P1Enum;
++		case MINIEnum:            return P1Enum;
++		case TaylorHoodEnum:      return P1Enum;
++		case XTaylorHoodEnum:     return P1Enum;
++		case CrouzeixRaviartEnum: return P1DGEnum;
+ 		default:       _error_("Element type "<<EnumToStringx(fe_stokes)<<" not supported yet");
+ 	}
+ 
+Index: ../trunk-jpl/src/m/classes/flowequation.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.py	(revision 18172)
++++ ../trunk-jpl/src/m/classes/flowequation.py	(revision 18173)
+@@ -77,7 +77,7 @@
+ 			md = checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0,1])
+ 			md = checkfield(md,'fieldname','flowequation.fe_SSA','values',['P1','P1bubble','P1bubblecondensed','P2','P2bubble'])
+ 			md = checkfield(md,'fieldname','flowequation.fe_HO' ,'values',['P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P2bubble','P1xP3','P2xP4'])
+-			md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',['P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','XTaylorHood','OneLayerP4z'])
++			md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',['P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','XTaylorHood','OneLayerP4z','CrouzeixRaviart'])
+ 			md = checkfield(md,'fieldname','flowequation.borderSSA','size',[md.mesh.numberofvertices],'values',[0,1])
+ 			md = checkfield(md,'fieldname','flowequation.borderHO','size',[md.mesh.numberofvertices],'values',[0,1])
+ 			md = checkfield(md,'fieldname','flowequation.borderFS','size',[md.mesh.numberofvertices],'values',[0,1])
+Index: ../trunk-jpl/src/m/classes/flowequation.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.m	(revision 18172)
++++ ../trunk-jpl/src/m/classes/flowequation.m	(revision 18173)
+@@ -133,7 +133,7 @@
+ 				md = checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0 1]);
+ 				md = checkfield(md,'fieldname','flowequation.fe_SSA','values',{'P1','P1bubble','P1bubblecondensed','P2','P2bubble'});
+ 				md = checkfield(md,'fieldname','flowequation.fe_HO' ,'values',{'P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P2bubble','P1xP3','P2xP4'});
+-				md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',{'P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','XTaylorHood','OneLayerP4z'});
++				md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',{'P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','XTaylorHood','OneLayerP4z','CrouzeixRaviart'});
+ 				md = checkfield(md,'fieldname','flowequation.XTH_r','numel',[1],'>',0.);
+ 				md = checkfield(md,'fieldname','flowequation.XTH_theta','numel',[1],'>=',0.,'<',0.5);
+ 				md = checkfield(md,'fieldname','flowequation.borderSSA','size',[md.mesh.numberofvertices 1],'values',[0 1]);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18173-18174.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18173-18174.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18173-18174.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/wrappers/InterpFromGridToMesh/InterpFromGridToMesh.cpp
+===================================================================
+--- ../trunk-jpl/src/wrappers/InterpFromGridToMesh/InterpFromGridToMesh.cpp	(revision 18173)
++++ ../trunk-jpl/src/wrappers/InterpFromGridToMesh/InterpFromGridToMesh.cpp	(revision 18174)
+@@ -8,7 +8,7 @@
+ 	_printf0_("INTERPFROMGRIDTOMESH - interpolation from a grid onto a list of points\n");
+ 	_printf0_("\n");
+ 	_printf0_("   This function is a multi-threaded mex file that interpolates a field\n");
+-	_printf0_("   defined on a grid onto a list of points\n");
++	_printf0_("   defined on a grid onto a list of points based on a bilinear interpolation\n");
+ 	_printf0_("\n");
+ 	_printf0_("   Usage:\n");
+ 	_printf0_("      data_mesh=InterpFromGridToMesh(x,y,data,x_mesh,y_mesh,default_value);\n");
Index: /issm/oecreview/Archive/17984-18295/ISSM-18174-18175.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18174-18175.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18174-18175.diff	(revision 18296)
@@ -0,0 +1,49 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18174)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18175)
+@@ -186,18 +186,23 @@
+ 	/*Compute element divergence*/
+ 
+ 	/*Intermediaries*/
++	int        dim;
+ 	IssmDouble Jdet;
+ 	IssmDouble divergence=0.;
+ 	IssmDouble dvx[3],dvy[3],dvz[3];
+ 	IssmDouble *xyz_list = NULL;
+ 
+ 	/*Get inputs and parameters*/
+-	Input* vx_input        = this->GetInput(VxEnum); _assert_(vx_input);
+-	Input* vy_input        = this->GetInput(VyEnum); _assert_(vy_input);
+-	Input* vz_input        = this->GetInput(VzEnum); _assert_(vz_input);
++	this->FindParam(&dim,DomainDimensionEnum);
++	Input* vx_input = this->GetInput(VxEnum); _assert_(vx_input);
++	Input* vy_input = this->GetInput(VyEnum); _assert_(vy_input);
++	Input* vz_input = NULL;
++	if(dim==3){
++		vz_input = this->GetInput(VzEnum); _assert_(vz_input);
++	}
+ 	this->GetVerticesCoordinates(&xyz_list);
+ 
+-	Gauss* gauss=this->NewGaussBase(5);
++	Gauss* gauss=this->NewGauss(5);
+ 	for(int ig=gauss->begin();ig<gauss->end();ig++){
+ 		gauss->GaussPoint(ig);
+ 		this->JacobianDeterminant(&Jdet,xyz_list,gauss);
+@@ -205,9 +210,14 @@
+ 		/*Get strain rate assuming that epsilon has been allocated*/
+ 		vx_input->GetInputDerivativeValue(&dvx[0],xyz_list,gauss);
+ 		vy_input->GetInputDerivativeValue(&dvy[0],xyz_list,gauss);
+-		vz_input->GetInputDerivativeValue(&dvz[0],xyz_list,gauss);
++		if(dim==2){
++			divergence += (dvx[0]+dvy[1])*gauss->weight*Jdet;
++		}
++		else{
++			vz_input->GetInputDerivativeValue(&dvz[0],xyz_list,gauss);
++			divergence += (dvx[0]+dvy[1]+dvz[2])*gauss->weight*Jdet;
++		}
+ 
+-		divergence += (dvx[0]+dvy[1]+dvz[2])*gauss->weight*Jdet;
+ 	}
+ 
+ 	/*Clean up and return*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18175-18176.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18175-18176.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18175-18176.diff	(revision 18296)
@@ -0,0 +1,16 @@
+Index: ../trunk-jpl/test/Exp/SquareFront.exp
+===================================================================
+--- ../trunk-jpl/test/Exp/SquareFront.exp	(revision 18175)
++++ ../trunk-jpl/test/Exp/SquareFront.exp	(revision 18176)
+@@ -3,8 +3,8 @@
+ # Points Count  Value
+ 5 1.
+ # X pos Y pos
+--1000 900000
++-1000 999999
+ -1000 1100000
+ 1100000 1100000
+-1100000 900000
+--1000 900000
++1100000 999999
++-1000 999999
Index: /issm/oecreview/Archive/17984-18295/ISSM-18176-18177.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18176-18177.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18176-18177.diff	(revision 18296)
@@ -0,0 +1,53 @@
+Index: ../trunk-jpl/test/NightlyRun/test701.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test701.m	(revision 18176)
++++ ../trunk-jpl/test/NightlyRun/test701.m	(revision 18177)
+@@ -33,24 +33,30 @@
+ md.stressbalance.spcvz = NaN*ones(md.mesh.numberofvertices,1);
+ md.stressbalance.spcvx(find(vertexflags(md.mesh,4)))=0;
+ md.stressbalance.spcvy(find(vertexflags(md.mesh,4)))=0;
+-%md.stressbalance.spcvx(find(vertexflags(md.mesh,4) | vertexflags(md.mesh,2)))=0;
+-%md.stressbalance.spcvy(find(vertexflags(md.mesh,4) | vertexflags(md.mesh,2)))=0;
+ 
+ %Misc
+ md=setflowequation(md,'FS','all');
+-md.flowequation.fe_FS='TaylorHood';
+ md.stressbalance.abstol=NaN;
++md.stressbalance.FSreconditioning=1;
++md.flowequation.XTH_r=10000;
+ md.miscellaneous.name = 'flowline';
++md.cluster=generic('np',2);
+ 
+ %Go solve
+-md.cluster=generic('np',2);
+-md=solve(md,StressbalanceSolutionEnum());
+-
+-%Fields and tolerances to track changes
+-field_names     ={'Vx','Vy','Vel','Pressure'};
+-field_tolerances={5e-10,2e-9,2e-9,1e-10};
+-field_values={...
+-	(md.results.StressbalanceSolution.Vx),...
+-	(md.results.StressbalanceSolution.Vy),...
+-	(md.results.StressbalanceSolution.Vel),...
+-	(md.results.StressbalanceSolution.Pressure)};
++field_names={};
++field_tolerances={};
++field_values={};
++for i={'MINI','MINIcondensed','TaylorHood','XTaylorHood','CrouzeixRaviart'}
++	disp(' ');
++	disp([' ===== Testing ' i{1} ' Full-Stokes Finite element =====']);
++	md.flowequation.fe_FS=i{1};
++	md=solve(md,StressbalanceSolutionEnum());
++	field_names     ={field_names{:},['Vx' i{1}],['Vy' i{1}],['Vel' i{1}],['Pressure' i{1}]};
++	field_tolerances={field_tolerances{:},5e-10,2e-9,2e-9,1e-10};
++	field_values={field_values{:},...
++		(md.results.StressbalanceSolution.Vx),...
++		(md.results.StressbalanceSolution.Vy),...
++		(md.results.StressbalanceSolution.Vel),...
++		(md.results.StressbalanceSolution.Pressure),...
++		};
++end
+Index: ../trunk-jpl/test/Archives/Archive701.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/17984-18295/ISSM-18179-18180.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18179-18180.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18179-18180.diff	(revision 18296)
@@ -0,0 +1,16 @@
+Index: ../trunk-jpl/src/m/enum/CrouzeixRaviartEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/CrouzeixRaviartEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/CrouzeixRaviartEnum.m	(revision 18180)
+@@ -0,0 +1,11 @@
++function macro=CrouzeixRaviartEnum()
++%CROUZEIXRAVIARTENUM - Enum of CrouzeixRaviart
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=CrouzeixRaviartEnum()
++
++macro=StringToEnum('CrouzeixRaviart');
Index: /issm/oecreview/Archive/17984-18295/ISSM-18180-18181.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18180-18181.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18180-18181.diff	(revision 18296)
@@ -0,0 +1,25 @@
+Index: ../trunk-jpl/m4/analyses.m4
+===================================================================
+--- ../trunk-jpl/m4/analyses.m4	(revision 18180)
++++ ../trunk-jpl/m4/analyses.m4	(revision 18181)
+@@ -373,6 +373,20 @@
+ AM_CONDITIONAL([SMOOTHEDSURFACESLOPEY], [test x$HAVE_SMOOTHEDSURFACESLOPEY = xyes])
+ AC_MSG_RESULT($HAVE_SMOOTHEDSURFACESLOPEY)
+ dnl }}}
++dnl with-UzawaPressure{{{
++AC_ARG_WITH([UzawaPressure],
++	AS_HELP_STRING([--with-UzawaPressure = YES], [compile with UzawaPressure capabilities (default is yes)]),
++	[UZAWAPRESSURE=$withval],[UZAWAPRESSURE=yes])
++AC_MSG_CHECKING(for UzawaPressure capability compilation)
++
++HAVE_UZAWAPRESSURE=no 
++if test "x$UZAWAPRESSURE" = "xyes"; then
++	HAVE_UZAWAPRESSURE=yes
++	AC_DEFINE([_HAVE_UZAWAPRESSURE_],[1],[with UzawaPressurecapability])
++fi
++AM_CONDITIONAL([UZAWAPRESSURE], [test x$HAVE_UZAWAPRESSURE = xyes])
++AC_MSG_RESULT($HAVE_UZAWAPRESSURE)
++dnl }}}
+ dnl with-Thermal{{{
+ AC_ARG_WITH([Thermal],
+ 	AS_HELP_STRING([--with-Thermal = YES], [compile with Thermal capabilities (default is yes)]),
Index: /issm/oecreview/Archive/17984-18295/ISSM-18181-18182.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18181-18182.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18181-18182.diff	(revision 18296)
@@ -0,0 +1,64 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18181)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18182)
+@@ -419,6 +419,7 @@
+ 				case MINIEnum            : finiteelement = P1bubbleEnum; break;
+ 				case TaylorHoodEnum      : finiteelement = P2Enum;       break;
+ 				case XTaylorHoodEnum     : finiteelement = P2Enum;       break;
++				case LATaylorHoodEnum    : finiteelement = P2Enum;       break;
+ 				case OneLayerP4zEnum     : finiteelement = P2xP4Enum;    break;
+ 				case CrouzeixRaviartEnum : finiteelement = P2bubbleEnum; break;
+ 				default: _error_("finite element "<<EnumToStringx(finiteelement)<<" not supported");
+@@ -2853,8 +2854,9 @@
+ 	ElementMatrix* Ke1=NULL;
+ 	if(fe_FS==XTaylorHoodEnum)
+ 	 Ke1=CreateKMatrixFSViscousXTH(element);
+-	else if(fe_FS==LATaylorHoodEnum)
++	else if(fe_FS==LATaylorHoodEnum){
+ 	 Ke1=CreateKMatrixFSViscousLATH(element);
++	}
+ 	else
+ 	 Ke1=CreateKMatrixFSViscous(element);
+ 
+@@ -3709,7 +3711,7 @@
+ 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
+ 		
+ 		pressure_input->GetInputValue(&pressure, gauss);
+-		element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
++		element->NodalFunctionsDerivativesVelocity(dbasis,xyz_list,gauss);
+ 
+ 		for(i=0;i<numnodes;i++){
+ 			pe->values[i*dim+0] += r*pressure*gauss->weight*Jdet*dbasis[0*numnodes+i];
+Index: ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 18181)
++++ ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 18182)
+@@ -25,10 +25,10 @@
+ 		}
+ 	}
+ 
+-	iomodel->FetchDataToInput(elements,VxEnum);
+-	iomodel->FetchDataToInput(elements,VyEnum);
+-	if(iomodel->domaintype==Domain3DEnum) iomodel->FetchDataToInput(elements,VzEnum);
+-	iomodel->FetchDataToInput(elements,PressureEnum);
++	iomodel->FetchDataToInput(elements,VxEnum,0.);
++	iomodel->FetchDataToInput(elements,VyEnum,0.);
++	if(iomodel->domaintype==Domain3DEnum) iomodel->FetchDataToInput(elements,VzEnum,0.);
++	iomodel->FetchDataToInput(elements,PressureEnum,0.);
+ }/*}}}*/
+ void UzawaPressureAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/TriaRef.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/TriaRef.cpp	(revision 18181)
++++ ../trunk-jpl/src/c/classes/Elements/TriaRef.cpp	(revision 18182)
+@@ -148,6 +148,8 @@
+ 	GaussTria* gauss = dynamic_cast<GaussTria*>(gauss_in);
+ 
+ 	switch(finiteelement){
++		case NoneEnum:
++			return;
+ 		case P0Enum:
+ 			basis[0]=1.;
+ 			return;
Index: /issm/oecreview/Archive/17984-18295/ISSM-18182-18183.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18182-18183.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18182-18183.diff	(revision 18296)
@@ -0,0 +1,35 @@
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 18182)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp	(revision 18183)
+@@ -558,7 +558,7 @@
+ 				EPL_N=gravity*((rho_ice*ice_thickness[i])-(rho_water*(eplhead[i]-bed[i])));
+ 				if(EPL_N<0.0)EPL_N=0.0;
+ 				/*Get then the square of the gradient of EPL heads*/
+-				EPLgrad2 = (epl_slopeX[i]*epl_slopeX[i]+epl_slopeY[i]*epl_slopeY[i]);
++				EPLgrad2 = (epl_slopeX[i]+epl_slopeY[i])*(epl_slopeX[i]+epl_slopeY[i]);
+ 				
+ 				/*And proceed to the real thing*/
+ 				thickness[i] = old_thickness[i]*(1+((rho_water*gravity*dt)/(rho_ice*latentheat))*epl_conductivity*EPLgrad2-2.0*(A*dt/(pow(n,n)))*(pow(EPL_N,n)));
+Index: ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 18182)
++++ ../trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp	(revision 18183)
+@@ -603,7 +603,9 @@
+ 		epl_head_input->GetInputValue(&epl_head,gauss);
+ 		sed_trans_input->GetInputValue(&sediment_transmitivity,gauss);
+ 		element->FindParam(&leakage,HydrologydcLeakageFactorEnum);
++		
+ 		transfer=(sediment_transmitivity)/(sediment_thickness*leakage);
++		
+ 		/* if(epl_head>sed_head){ */
+ 		/* 	h_max=GetHydrologyDCInefficientHmax(element,gauss,thickness_input,base_input); */
+ 		/* 	if(sed_head>=h_max){ */
+@@ -618,6 +620,7 @@
+ 		/* 	transfer=(sediment_transmitivity)/(sediment_thickness*leakage); */
+ 		/* 	//transfer=(sediment_storing*sediment_transmitivity)/(sediment_thickness*leakage); */
+ 		/* } */
++		
+ 		break;
+ 	default:
+ 		_error_("no case higher than 1 for the Transfer method");
Index: /issm/oecreview/Archive/17984-18295/ISSM-18183-18184.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18183-18184.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18183-18184.diff	(revision 18296)
@@ -0,0 +1,191 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h	(revision 18183)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h	(revision 18184)
+@@ -80,6 +80,8 @@
+ 		ElementVector* CreatePVectorFSFront(Element* element);
+ 		void GetBFS(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBFSprime(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
++		void GetBFSvel(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
++		void GetBFSprimevel(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBFSFriction(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBFSUzawa(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBFSprimeUzawa(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18183)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18184)
+@@ -2854,9 +2854,8 @@
+ 	ElementMatrix* Ke1=NULL;
+ 	if(fe_FS==XTaylorHoodEnum)
+ 	 Ke1=CreateKMatrixFSViscousXTH(element);
+-	else if(fe_FS==LATaylorHoodEnum){
++	else if(fe_FS==LATaylorHoodEnum)
+ 	 Ke1=CreateKMatrixFSViscousLATH(element);
+-	}
+ 	else
+ 	 Ke1=CreateKMatrixFSViscous(element);
+ 
+@@ -2901,7 +2900,7 @@
+ 	ElementMatrix* Ke       = element->NewElementMatrix(FSvelocityEnum);
+ 	IssmDouble*    B        = xNew<IssmDouble>(epssize*numdof);
+ 	IssmDouble*    Bprime   = xNew<IssmDouble>(epssize*numdof);
+-	IssmDouble*    BtBUzawa = xNew<IssmDouble>(numdof*pnumdof);
++	IssmDouble*    BtBUzawa = xNewZeroInit<IssmDouble>(numdof*pnumdof);
+ 	IssmDouble*    BU       = xNew<IssmDouble>(pnumdof);
+ 	IssmDouble*    BprimeU  = xNew<IssmDouble>(numdof);
+ 	IssmDouble*    D        = xNewZeroInit<IssmDouble>(epssize*epssize);
+@@ -2919,8 +2918,8 @@
+ 		gauss->GaussPoint(ig);
+ 
+ 		element->JacobianDeterminant(&Jdet,xyz_list,gauss);
+-		this->GetBFS(B,element,dim,xyz_list,gauss);
+-		this->GetBFSprime(Bprime,element,dim,xyz_list,gauss);
++		this->GetBFSvel(B,element,dim,xyz_list,gauss);
++		this->GetBFSprimevel(Bprime,element,dim,xyz_list,gauss);
+ 
+ 		element->ViscosityFS(&viscosity,dim,xyz_list,gauss,vx_input,vy_input,vz_input);
+ 		for(i=0;i<epssize;i++)   D[i*epssize+i] = 2*viscosity*gauss->weight*Jdet;
+@@ -4120,6 +4119,133 @@
+ 	xDelete<IssmDouble>(vdbasis);
+ 	xDelete<IssmDouble>(pbasis);
+ }/*}}}*/
++void StressbalanceAnalysis::GetBFSvel(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
++	/*Compute B  matrix. B=[Bv1 Bv2 ... Bp1 Bp2 ...] where Bvi is of size 3*NDOF3. 
++	 * For node i, Bvi can be expressed in the actual coordinate system
++	 * by: 	   Bvi=[ dphi/dx          0        ]
++	 *					 [   0           dphi/dy     ]
++	 *					 [ 1/2*dphi/dy    1/2*dphi/dx]
++	 *
++	 *
++	 *	In 3d:
++	 *     	   Bvi=[ dh/dx          0             0      ]
++	 *					[   0           dh/dy           0      ]
++	 *					[   0             0           dh/dz    ]
++	 *					[ 1/2*dh/dy    1/2*dh/dx        0      ]
++	 *					[ 1/2*dh/dz       0         1/2*dh/dx  ]
++	 *					[   0          1/2*dh/dz    1/2*dh/dy  ]
++	 *
++	 *	where phi is the finiteelement function for node i.
++	 *	Same thing for Bb except the last column that does not exist.
++	 */
++
++	/*Fetch number of nodes for this finite element*/
++	int vnumnodes = element->NumberofNodesVelocity();
++
++	/*Get nodal functions derivatives*/
++	IssmDouble* vdbasis=xNew<IssmDouble>(dim*vnumnodes);
++	element->NodalFunctionsDerivativesVelocity(vdbasis,xyz_list,gauss);
++
++	/*Build B: */
++	if(dim==2){
++		for(int i=0;i<vnumnodes;i++){
++			B[(dim*vnumnodes)*0+dim*i+0] = vdbasis[0*vnumnodes+i];
++			B[(dim*vnumnodes)*0+dim*i+1] = 0.;
++			B[(dim*vnumnodes)*1+dim*i+0] = 0.;
++			B[(dim*vnumnodes)*1+dim*i+1] = vdbasis[1*vnumnodes+i];
++			B[(dim*vnumnodes)*2+dim*i+0] = .5*vdbasis[1*vnumnodes+i];
++			B[(dim*vnumnodes)*2+dim*i+1] = .5*vdbasis[0*vnumnodes+i];
++		}
++	}
++	else{
++		for(int i=0;i<vnumnodes;i++){
++			B[(dim*vnumnodes)*0+dim*i+0] = vdbasis[0*vnumnodes+i];
++			B[(dim*vnumnodes)*0+dim*i+1] = 0.;
++			B[(dim*vnumnodes)*0+dim*i+2] = 0.;
++			B[(dim*vnumnodes)*1+dim*i+0] = 0.;
++			B[(dim*vnumnodes)*1+dim*i+1] = vdbasis[1*vnumnodes+i];
++			B[(dim*vnumnodes)*1+dim*i+2] = 0.;
++			B[(dim*vnumnodes)*2+dim*i+0] = 0.;
++			B[(dim*vnumnodes)*2+dim*i+1] = 0.;
++			B[(dim*vnumnodes)*2+dim*i+2] = vdbasis[2*vnumnodes+i];
++			B[(dim*vnumnodes)*3+dim*i+0] = .5*vdbasis[1*vnumnodes+i];
++			B[(dim*vnumnodes)*3+dim*i+1] = .5*vdbasis[0*vnumnodes+i];
++			B[(dim*vnumnodes)*3+dim*i+2] = 0.;
++			B[(dim*vnumnodes)*4+dim*i+0] = .5*vdbasis[2*vnumnodes+i];
++			B[(dim*vnumnodes)*4+dim*i+1] = 0.;
++			B[(dim*vnumnodes)*4+dim*i+2] = .5*vdbasis[0*vnumnodes+i];
++			B[(dim*vnumnodes)*5+dim*i+0] = 0.;
++			B[(dim*vnumnodes)*5+dim*i+1] = .5*vdbasis[2*vnumnodes+i];
++			B[(dim*vnumnodes)*5+dim*i+2] = .5*vdbasis[1*vnumnodes+i];
++		}
++	}
++
++	/*Clean up*/
++	xDelete<IssmDouble>(vdbasis);
++}/*}}}*/
++void StressbalanceAnalysis::GetBFSprimevel(IssmDouble* Bprime,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
++	/*	Compute B'  matrix. B'=[B1' B2' B3' B4' B5' B6' Bb'] where Bi' is of size 3*NDOF2. 
++	 *	For node i, Bi' can be expressed in the actual coordinate system
++	 *	by: 
++	 *			Bvi' = [  dphi/dx     0     ]
++	 *					 [     0      dphi/dy ]
++	 *					 [  dphi/dy   dphi/dx ]
++	 *
++	 *	In 3d
++	 *     	   Bvi=[ dh/dx     0        0    ]
++	 *					[   0      dh/dy      0    ]
++	 *					[   0        0      dh/dz  ]
++	 *					[ dh/dy    dh/dx      0    ]
++	 *					[ dh/dz      0      dh/dx  ]
++	 *					[   0      dh/dz    dh/dy  ]
++	 *	where phi is the finiteelement function for node i.
++	 *	In 3d:
++	 */
++
++	/*Fetch number of nodes for this finite element*/
++	int vnumnodes = element->NumberofNodesVelocity();
++
++	/*Get nodal functions derivatives*/
++	IssmDouble* vdbasis=xNew<IssmDouble>(dim*vnumnodes);
++	element->NodalFunctionsDerivativesVelocity(vdbasis,xyz_list,gauss);
++
++	/*Build B_prime: */
++	if(dim==2){
++		for(int i=0;i<vnumnodes;i++){
++			Bprime[(dim*vnumnodes)*0+dim*i+0] = vdbasis[0*vnumnodes+i];
++			Bprime[(dim*vnumnodes)*0+dim*i+1] = 0.;
++			Bprime[(dim*vnumnodes)*1+dim*i+0] = 0.;
++			Bprime[(dim*vnumnodes)*1+dim*i+1] = vdbasis[1*vnumnodes+i];
++			Bprime[(dim*vnumnodes)*2+dim*i+0] = vdbasis[1*vnumnodes+i];
++			Bprime[(dim*vnumnodes)*2+dim*i+1] = vdbasis[0*vnumnodes+i];
++		}
++	}
++	else{
++		for(int i=0;i<vnumnodes;i++){
++			Bprime[(dim*vnumnodes)*0+dim*i+0] = vdbasis[0*vnumnodes+i];
++			Bprime[(dim*vnumnodes)*0+dim*i+1] = 0.;
++			Bprime[(dim*vnumnodes)*0+dim*i+2] = 0.;
++			Bprime[(dim*vnumnodes)*1+dim*i+0] = 0.;
++			Bprime[(dim*vnumnodes)*1+dim*i+1] = vdbasis[1*vnumnodes+i];
++			Bprime[(dim*vnumnodes)*1+dim*i+2] = 0.;
++			Bprime[(dim*vnumnodes)*2+dim*i+0] = 0.;
++			Bprime[(dim*vnumnodes)*2+dim*i+1] = 0.;
++			Bprime[(dim*vnumnodes)*2+dim*i+2] = vdbasis[2*vnumnodes+i];
++			Bprime[(dim*vnumnodes)*3+dim*i+0] = vdbasis[1*vnumnodes+i];
++			Bprime[(dim*vnumnodes)*3+dim*i+1] = vdbasis[0*vnumnodes+i];
++			Bprime[(dim*vnumnodes)*3+dim*i+2] = 0.;
++			Bprime[(dim*vnumnodes)*4+dim*i+0] = vdbasis[2*vnumnodes+i];
++			Bprime[(dim*vnumnodes)*4+dim*i+1] = 0.;
++			Bprime[(dim*vnumnodes)*4+dim*i+2] = vdbasis[0*vnumnodes+i];
++			Bprime[(dim*vnumnodes)*5+dim*i+0] = 0.;
++			Bprime[(dim*vnumnodes)*5+dim*i+1] = vdbasis[2*vnumnodes+i];
++			Bprime[(dim*vnumnodes)*5+dim*i+2] = vdbasis[1*vnumnodes+i];
++		}
++	}
++
++	/*Clean up*/
++	xDelete<IssmDouble>(vdbasis);
++}/*}}}*/
+ void StressbalanceAnalysis::GetBFSUzawa(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+ 	/*Compute B  matrix. B=[Bp1 Bp2 ...] where Bpi=phi_pi. 
+ 	 */
+@@ -4283,7 +4409,7 @@
+ 
+ 	/*Add value to global vector*/
+ 	solution->SetValues(vnumdof,vdoflist,vvalues,INS_VAL);
+-	solution->SetValues(pnumdof,pdoflist,pvalues,INS_VAL);
++	if(pnumdof>0) solution->SetValues(pnumdof,pdoflist,pvalues,INS_VAL);
+ 
+ 	/*Free ressources:*/
+ 	delete gauss;
Index: /issm/oecreview/Archive/17984-18295/ISSM-18184-18185.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18184-18185.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18184-18185.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/classes/flowequation.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.m	(revision 18184)
++++ ../trunk-jpl/src/m/classes/flowequation.m	(revision 18185)
+@@ -133,7 +133,7 @@
+ 				md = checkfield(md,'fieldname','flowequation.isFS','numel',[1],'values',[0 1]);
+ 				md = checkfield(md,'fieldname','flowequation.fe_SSA','values',{'P1','P1bubble','P1bubblecondensed','P2','P2bubble'});
+ 				md = checkfield(md,'fieldname','flowequation.fe_HO' ,'values',{'P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P2bubble','P1xP3','P2xP4'});
+-				md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',{'P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','LaTaylorHood','XTaylorHood','OneLayerP4z','CrouzeixRaviart'});
++				md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',{'P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','LATaylorHood','XTaylorHood','OneLayerP4z','CrouzeixRaviart'});
+ 				md = checkfield(md,'fieldname','flowequation.XTH_r','numel',[1],'>',0.);
+ 				md = checkfield(md,'fieldname','flowequation.XTH_theta','numel',[1],'>=',0.,'<',0.5);
+ 				md = checkfield(md,'fieldname','flowequation.borderSSA','size',[md.mesh.numberofvertices 1],'values',[0 1]);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18185-18186.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18185-18186.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18185-18186.diff	(revision 18296)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_la.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_la.cpp	(revision 18185)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_la.cpp	(revision 18186)
+@@ -50,6 +50,7 @@
+ 		/*save pointer to old velocity*/
+ 		delete ug_old;ug_old=ug;
+ 		delete vx_old;vx_old=vx;
++		delete pug_old;pug_old=pug;
+ 
+ 		/*Solve KU=F*/
+ 		femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18186-18187.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18186-18187.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18186-18187.diff	(revision 18296)
@@ -0,0 +1,18 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18186)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18187)
+@@ -3713,10 +3713,10 @@
+ 		element->NodalFunctionsDerivativesVelocity(dbasis,xyz_list,gauss);
+ 
+ 		for(i=0;i<numnodes;i++){
+-			pe->values[i*dim+0] += r*pressure*gauss->weight*Jdet*dbasis[0*numnodes+i];
+-			pe->values[i*dim+1] += r*pressure*gauss->weight*Jdet*dbasis[1*numnodes+i];
++			pe->values[i*dim+0] += - r*pressure*gauss->weight*Jdet*dbasis[0*numnodes+i];
++			pe->values[i*dim+1] += - r*pressure*gauss->weight*Jdet*dbasis[1*numnodes+i];
+ 			if(dim==3){
+-				pe->values[i*dim+2]+=r*pressure*gauss->weight*Jdet*dbasis[2*numnodes+i];
++				pe->values[i*dim+2]+= - r*pressure*gauss->weight*Jdet*dbasis[2*numnodes+i];
+ 			}
+ 		}
+ 	}
Index: /issm/oecreview/Archive/17984-18295/ISSM-18187-18188.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18187-18188.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18187-18188.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18187)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18188)
+@@ -2932,7 +2932,7 @@
+ 		this->GetBFSUzawa(BU,element,dim,xyz_list,gauss);
+ 		this->GetBFSprimeUzawa(BprimeU,element,dim,xyz_list,gauss);
+ 
+-		DU = gauss->weight*Jdet;
++		DU = gauss->weight*Jdet*sqrt(r);
+ 
+ 		TripleMultiply(BU,1,pnumdof,1,
+ 					&DU,1,1,0,
Index: /issm/oecreview/Archive/17984-18295/ISSM-18188-18189.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18188-18189.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18188-18189.diff	(revision 18296)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/test/NightlyRun/test701.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test701.m	(revision 18188)
++++ ../trunk-jpl/test/NightlyRun/test701.m	(revision 18189)
+@@ -48,11 +48,11 @@
+ field_values={};
+ for i={'MINI','MINIcondensed','TaylorHood','XTaylorHood','CrouzeixRaviart'}
+ 	disp(' ');
+-	disp([' ===== Testing ' i{1} ' Full-Stokes Finite element =====']);
++	disp(['====== Testing ' i{1} ' Full-Stokes Finite element =====']);
+ 	md.flowequation.fe_FS=i{1};
+ 	md=solve(md,StressbalanceSolutionEnum());
+ 	field_names     ={field_names{:},['Vx' i{1}],['Vy' i{1}],['Vel' i{1}],['Pressure' i{1}]};
+-	field_tolerances={field_tolerances{:},5e-10,2e-9,2e-9,1e-10};
++	field_tolerances={field_tolerances{:},1e-5,1e-5,1e-5,1e-10};
+ 	field_values={field_values{:},...
+ 		(md.results.StressbalanceSolution.Vx),...
+ 		(md.results.StressbalanceSolution.Vy),...
+Index: ../trunk-jpl/test/Archives/Archive701.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/17984-18295/ISSM-18189-18190.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18189-18190.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18189-18190.diff	(revision 18296)
@@ -0,0 +1,176 @@
+Index: ../trunk-jpl/src/c/cores/control_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/control_core.cpp	(revision 18189)
++++ ../trunk-jpl/src/c/cores/control_core.cpp	(revision 18190)
+@@ -21,37 +21,25 @@
+ 
+ void control_core(FemModel* femmodel){/*{{{*/
+ 
+-	int     i;
+-
+ 	/*parameters: */
+-	int        num_controls,nsize;
+-	int        nsteps;
+-	IssmDouble tol_cm;
+-	int        solution_type;
+-	bool       isFS;
+-	bool       dakota_analysis = false;
++	int         num_controls,nsize,nsteps;
++	int         solution_type;
++	bool        isFS,dakota_analysis;
++	int        *control_type  = NULL;
++	int        *maxiter       = NULL;
++	IssmDouble *cm_jump       = NULL;
++	IssmDouble *J             = NULL;
+ 
+-	int        *control_type   = NULL;
+-	int*        maxiter        = NULL;
+-	IssmDouble *cm_jump        = NULL;
+-
+-	/*intermediary: */
+-	OptPars    optpars;
+-
+ 	/*Solution and Adjoint core pointer*/
+ 	void (*solutioncore)(FemModel*) = NULL;
+ 	void (*adjointcore)(FemModel*)  = NULL;
+ 
+-	/*output: */
+-	IssmDouble* J=NULL;
+-
+ 	/*Recover parameters used throughout the solution*/
+ 	femmodel->parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+ 	femmodel->parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
+ 	femmodel->parameters->FindParam(&nsteps,InversionNstepsEnum);
+ 	femmodel->parameters->FindParam(&maxiter,NULL,InversionMaxiterPerStepEnum);
+ 	femmodel->parameters->FindParam(&cm_jump,NULL,InversionStepThresholdEnum);
+-	femmodel->parameters->FindParam(&tol_cm,InversionCostFunctionThresholdEnum);
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+ 	femmodel->parameters->FindParam(&isFS,FlowequationIsFSEnum);
+ 	femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);
+@@ -73,6 +61,7 @@
+ 	delete Xpetsc;
+ 
+ 	/*Initialize some of the BrentSearch arguments: */
++	OptPars optpars;
+ 	optpars.xmin    = 0; 
+ 	optpars.xmax    = 1;
+ 	optpars.nsteps  = nsteps;
+@@ -109,7 +98,7 @@
+ 
+ 		#ifdef _HAVE_ADOLC_
+ 		IssmPDouble* J_passive=xNew<IssmPDouble>(nsteps);
+-		for(i=0;i<nsteps;i++) J_passive[i]=reCast<IssmPDouble>(J[i]);
++		for(int i=0;i<nsteps;i++) J_passive[i]=reCast<IssmPDouble>(J[i]);
+ 		femmodel->results->AddObject(new GenericExternalResult<IssmPDouble*>(femmodel->results->Size()+1,JEnum,J_passive,nsteps,1,1,0));
+ 		xDelete<IssmPDouble>(J_passive);
+ 		#else
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18189)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18190)
+@@ -2713,10 +2713,26 @@
+ void       Tria::SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index){/*{{{*/
+ 
+ 	IssmDouble  values[NUMVERTICES];
+-	int     vertexpidlist[NUMVERTICES];
+-	Input  *input     = NULL;
+-	Input  *new_input = NULL;
++	int         vertexpidlist[NUMVERTICES],control_init;
+ 
++
++	/*Get Domain type*/
++	int domaintype;
++	parameters->FindParam(&domaintype,DomainTypeEnum);
++
++	/*Specific case for depth averaged quantities*/
++	control_init=control_enum;
++	if(domaintype==Domain2DverticalEnum){
++		if(control_enum==MaterialsRheologyBbarEnum){
++			control_enum=MaterialsRheologyBEnum;
++			if(!IsOnBase()) return;
++		}
++		if(control_enum==DamageDbarEnum){
++			control_enum=DamageDEnum;
++			if(!IsOnBase()) return;
++		}
++	}
++
+ 	/*Get out if this is not an element input*/
+ 	if(!IsInput(control_enum)) return;
+ 
+@@ -2724,13 +2740,12 @@
+ 	GradientIndexing(&vertexpidlist[0],control_index);
+ 
+ 	/*Get values on vertices*/
+-	for (int i=0;i<NUMVERTICES;i++){
++	for(int i=0;i<NUMVERTICES;i++){
+ 		values[i]=vector[vertexpidlist[i]];
+ 	}
+-	new_input = new TriaInput(control_enum,values,P1Enum);
+-
+-	input=(Input*)this->inputs->GetInput(control_enum);   _assert_(input);
+-	if (input->ObjectEnum()!=ControlInputEnum){
++	Input* new_input = new TriaInput(control_enum,values,P1Enum);
++	Input* input     = (Input*)this->inputs->GetInput(control_enum);   _assert_(input);
++	if(input->ObjectEnum()!=ControlInputEnum){
+ 		_error_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
+ 	}
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18189)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18190)
+@@ -2878,8 +2878,6 @@
+ 
+ 	IssmDouble  values[NUMVERTICES];
+ 	int         vertexpidlist[NUMVERTICES],control_init;
+-	Input      *input     = NULL;
+-	Input      *new_input = NULL;
+ 
+ 	/*Specific case for depth averaged quantities*/
+ 	control_init=control_enum;
+@@ -2902,10 +2900,9 @@
+ 	for(int i=0;i<NUMVERTICES;i++){
+ 		values[i]=vector[vertexpidlist[i]];
+ 	}
+-	new_input = new PentaInput(control_enum,values,P1Enum);
+-	input=(Input*)this->inputs->GetInput(control_enum);   _assert_(input);
+-
+-	if (input->ObjectEnum()!=ControlInputEnum){
++	Input* new_input = new PentaInput(control_enum,values,P1Enum);
++	Input* input=(Input*)this->inputs->GetInput(control_enum);   _assert_(input);
++	if(input->ObjectEnum()!=ControlInputEnum){
+ 		_error_("input " << EnumToStringx(control_enum) << " is not a ControlInput");
+ 	}
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.cpp	(revision 18189)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.cpp	(revision 18190)
+@@ -101,6 +101,13 @@
+ 
+ 	*pxyz_front=xyz_front;
+ }/*}}}*/
++void       Seg::NodalFunctionsP1(IssmDouble* basis, Gauss* gauss){/*{{{*/
++
++	_assert_(gauss->Enum()==GaussSegEnum);
++	this->GetNodalFunctions(basis,(GaussSeg*)gauss,P1Enum);
++
++}
++/*}}}*/
+ int        Seg::GetNumberOfNodes(void){/*{{{*/
+ 	return this->NumberofNodes(this->element_type);
+ }
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 18189)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 18190)
+@@ -82,7 +82,7 @@
+ 		void        JacobianDeterminantTop(IssmDouble* pJdet,IssmDouble* xyz_list_base,Gauss* gauss){_error_("not implemented yet");};
+ 		IssmDouble  MinEdgeLength(IssmDouble* xyz_list){_error_("not implemented yet");};
+ 		void        NodalFunctions(IssmDouble* basis,Gauss* gauss);
+-		void        NodalFunctionsP1(IssmDouble* basis,Gauss* gauss){_error_("not implemented yet");};
++		void        NodalFunctionsP1(IssmDouble* basis,Gauss* gauss);
+ 		void        NodalFunctionsVelocity(IssmDouble* basis,Gauss* gauss){_error_("not implemented yet");};
+ 		void        NodalFunctionsPressure(IssmDouble* basis,Gauss* gauss){_error_("not implemented yet");};
+ 		void        NodalFunctionsTensor(IssmDouble* basis,Gauss* gauss){_error_("not implemented yet");};
Index: /issm/oecreview/Archive/17984-18295/ISSM-18190-18191.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18190-18191.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18190-18191.diff	(revision 18296)
@@ -0,0 +1,31 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18190)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18191)
+@@ -2941,13 +2941,14 @@
+ 
+ 	}
+ 
++	/*Transform Coordinate System*/
++	element->TransformStiffnessMatrixCoord(Ke,cs_list);
++
++	/*The pressure augmentation should not be transformed*/
+ 	MatrixMultiply(BtBUzawa,pnumdof,numdof,1,
+ 				BtBUzawa,pnumdof,numdof,0,
+ 				&Ke->values[0],1);
+ 
+-	/*Transform Coordinate System*/
+-	element->TransformStiffnessMatrixCoord(Ke,cs_list);
+-
+ 	/*Clean up and return*/
+ 	delete gauss;
+ 	xDelete<IssmDouble>(xyz_list);
+@@ -3722,7 +3723,7 @@
+ 	}
+ 
+ 	/*Transform coordinate system*/
+-	element->TransformLoadVectorCoord(pe,cs_list);
++	//element->TransformLoadVectorCoord(pe,cs_list); Do not transform pressure augmentation
+ 
+ 	/*Clean up and return*/
+ 	delete gauss;
Index: /issm/oecreview/Archive/17984-18295/ISSM-18191-18192.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18191-18192.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18191-18192.diff	(revision 18296)
@@ -0,0 +1,270 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18191)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18192)
+@@ -59,6 +59,7 @@
+ 		/* bool       AllActive(void); */
+ 		/* bool       AnyActive(void); */
+ 		void       CoordinateSystemTransform(IssmDouble** ptransform,Node** nodes,int numnodes,int* cs_array);
++		void       ComputeStrainRate();
+ 		void       Echo();
+ 		void       DeepEcho();
+ 		void       DeleteMaterials(void);
+@@ -208,8 +209,6 @@
+ 		virtual void   InputDepthAverageAtBase(int enum_type,int average_enum_type)=0;
+ 		virtual void   ComputeSigmaNN(void)=0;
+ 		virtual void   ComputeBasalStress(Vector<IssmDouble>* sigma_b)=0;
+-		virtual void   ComputeStrainRate()=0;
+-		virtual void   ComputeStrainRate(Vector<IssmDouble>* eps)=0;
+ 		virtual void   ComputeStressTensor(void)=0;
+ 		virtual void   ComputeDeviatoricStressTensor(void)=0;
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18191)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18192)
+@@ -197,51 +197,6 @@
+ 	}
+ }
+ /*}}}*/
+-void       Tria::ComputeStrainRate(){/*{{{*/
+-
+-	IssmDouble      xyz_list[NUMVERTICES][3];
+-	IssmDouble      epsilon[6]; /* epsilon=[exx,eyy,exy];*/
+-	IssmDouble      eps_xx[NUMVERTICES];
+-	IssmDouble		 eps_yy[NUMVERTICES];
+-	IssmDouble		 eps_zz[NUMVERTICES]={0,0,0};
+-	IssmDouble      eps_xy[NUMVERTICES];
+-	IssmDouble		 eps_xz[NUMVERTICES]={0,0,0};
+-	IssmDouble		 eps_yz[NUMVERTICES]={0,0,0};
+-	GaussTria*     gauss=NULL;
+-
+-	/* Get node coordinates and dof list: */
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-
+-	/*Retrieve all inputs we will be needing: */
+-	Input* vx_input=inputs->GetInput(VxEnum);             _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum);             _assert_(vy_input);
+-
+-	/* Start looping on the number of vertices: */
+-	gauss=new GaussTria();
+-	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
+-
+-		/*Compute strain rate viscosity and pressure: */
+-		this->StrainRateSSA(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+-
+-		eps_xx[iv]=epsilon[0]; 
+-		eps_yy[iv]=epsilon[1];
+-		eps_xy[iv]=epsilon[2];
+-	}
+-
+-	/*Add Stress tensor components into inputs*/
+-	this->inputs->AddInput(new TriaInput(StrainRatexxEnum,&eps_xx[0],P1Enum));
+-	this->inputs->AddInput(new TriaInput(StrainRatexyEnum,&eps_xy[0],P1Enum));
+-	this->inputs->AddInput(new TriaInput(StrainRatexzEnum,&eps_xz[0],P1Enum));
+-	this->inputs->AddInput(new TriaInput(StrainRateyyEnum,&eps_yy[0],P1Enum));
+-	this->inputs->AddInput(new TriaInput(StrainRateyzEnum,&eps_yz[0],P1Enum));
+-	this->inputs->AddInput(new TriaInput(StrainRatezzEnum,&eps_zz[0],P1Enum));
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-
+-}
+-/*}}}*/
+ void       Tria::ComputeStressTensor(){/*{{{*/
+ 
+ 	IssmDouble  xyz_list[NUMVERTICES][3];
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18191)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18192)
+@@ -52,8 +52,6 @@
+ 		IssmDouble  CharacteristicLength(void);
+ 		void        ComputeBasalStress(Vector<IssmDouble>* sigma_b);
+ 		void        ComputeSigmaNN();
+-		void		   ComputeStrainRate();
+-		void		   ComputeStrainRate(Vector<IssmDouble>* eps){_error_("not implemented yet");};
+ 		void        ComputeStressTensor();
+ 		void        ComputeDeviatoricStressTensor();
+ 		void        ComputeSurfaceNormalVelocity();
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18191)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18192)
+@@ -224,54 +224,6 @@
+ 	sigma_b->SetValue(id-1,value,INS_VAL);
+ }
+ /*}}}*/
+-void       Penta::ComputeStrainRate(){/*{{{*/
+-
+-	IssmDouble      xyz_list[NUMVERTICES][3];
+-	IssmDouble      epsilon[6]; /* epsilon=[exx,eyy,exy];*/
+-	IssmDouble      eps_xx[NUMVERTICES];
+-	IssmDouble		 eps_yy[NUMVERTICES];
+-	IssmDouble		 eps_zz[NUMVERTICES];
+-	IssmDouble      eps_xy[NUMVERTICES];
+-	IssmDouble		 eps_xz[NUMVERTICES];
+-	IssmDouble		 eps_yz[NUMVERTICES];
+-	GaussPenta*     gauss=NULL;
+-
+-	/* Get node coordinates and dof list: */
+-	::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
+-
+-	/*Retrieve all inputs we will be needing: */
+-	Input* vx_input=inputs->GetInput(VxEnum);             _assert_(vx_input);
+-	Input* vy_input=inputs->GetInput(VyEnum);             _assert_(vy_input);
+-	Input* vz_input=inputs->GetInput(VzEnum);             _assert_(vz_input);
+-
+-	/* Start looping on the number of vertices: */
+-	gauss=new GaussPenta();
+-	for (int iv=0;iv<NUMVERTICES;iv++){
+-		gauss->GaussVertex(iv);
+-
+-		/*Compute strain rate viscosity and pressure: */
+-		this->StrainRateFS(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input,vz_input);
+-
+-		eps_xx[iv]=epsilon[0]; 
+-		eps_yy[iv]=epsilon[1];
+-		eps_zz[iv]=epsilon[2];
+-		eps_xy[iv]=epsilon[3];
+-		eps_xz[iv]=epsilon[4];
+-		eps_yz[iv]=epsilon[5];
+-	}
+-
+-	/*Add Stress tensor components into inputs*/
+-	this->inputs->AddInput(new PentaInput(StrainRatexxEnum,&eps_xx[0],P1Enum));
+-	this->inputs->AddInput(new PentaInput(StrainRatexyEnum,&eps_xy[0],P1Enum));
+-	this->inputs->AddInput(new PentaInput(StrainRatexzEnum,&eps_xz[0],P1Enum));
+-	this->inputs->AddInput(new PentaInput(StrainRateyyEnum,&eps_yy[0],P1Enum));
+-	this->inputs->AddInput(new PentaInput(StrainRateyzEnum,&eps_yz[0],P1Enum));
+-	this->inputs->AddInput(new PentaInput(StrainRatezzEnum,&eps_zz[0],P1Enum));
+-
+-	/*Clean up and return*/
+-	delete gauss;
+-}
+-/*}}}*/
+ void       Penta::ComputeStressTensor(){/*{{{*/
+ 
+ 	IssmDouble      xyz_list[NUMVERTICES][3];
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 18191)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 18192)
+@@ -53,8 +53,6 @@
+ 		/*Element virtual functions definitions: {{{*/
+ 		IssmDouble CharacteristicLength(void){_error_("not implemented yet");};
+ 		void   ComputeBasalStress(Vector<IssmDouble>* sigma_b);
+-		void   ComputeStrainRate();
+-		void   ComputeStrainRate(Vector<IssmDouble>* eps){_error_("not implemented yet");};
+ 		void   ComputeSigmaNN(){_error_("not implemented yet");};
+ 		void   ComputeStressTensor();
+ 		void   ComputeDeviatoricStressTensor();
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 18191)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 18192)
+@@ -54,8 +54,6 @@
+ 		IssmDouble  CharacteristicLength(void);
+ 		void        ComputeBasalStress(Vector<IssmDouble>* sigma_b){_error_("not implemented yet");};
+ 		void        ComputeSigmaNN(){_error_("not implemented yet");};
+-		void        ComputeStrainRate(){_error_("not implemented yet");};
+-		void        ComputeStrainRate(Vector<IssmDouble>* eps){_error_("not implemented yet");};
+ 		void        ComputeStressTensor(){_error_("not implemented yet");};
+ 		void        ComputeDeviatoricStressTensor(){_error_("not implemented yet");};
+ 		void        Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 18191)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 18192)
+@@ -54,8 +54,6 @@
+ 		IssmDouble  CharacteristicLength(void){_error_("not implemented yet");};
+ 		void        ComputeBasalStress(Vector<IssmDouble>* sigma_b){_error_("not implemented yet");};
+ 		void        ComputeSigmaNN(){_error_("not implemented yet");};
+-		void        ComputeStrainRate(){_error_("not implemented yet");};
+-		void        ComputeStrainRate(Vector<IssmDouble>* eps){_error_("not implemented yet");};
+ 		void        ComputeStressTensor(){_error_("not implemented yet");};
+ 		void        ComputeDeviatoricStressTensor(){_error_("not implemented yet");};
+ 		void        Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters);
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18191)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18192)
+@@ -114,6 +114,77 @@
+ 	*ptransform=transform;
+ }
+ /*}}}*/
++void       Element::ComputeStrainRate(){/*{{{*/
++
++	int         dim;
++	IssmDouble *xyz_list = NULL;
++	IssmDouble  epsilon[6];
++
++	/*Retrieve all inputs we will be needing: */
++	this->GetVerticesCoordinates(&xyz_list);
++	parameters->FindParam(&dim,DomainDimensionEnum);
++	Input* vx_input=this->GetInput(VxEnum); _assert_(vx_input);
++	Input* vy_input=this->GetInput(VyEnum); _assert_(vy_input);
++	Input* vz_input=NULL;
++	if(dim==3){vz_input=this->GetInput(VzEnum); _assert_(vz_input);}
++
++	/*Allocate arrays*/
++	int numvertices = this->GetNumberOfVertices();
++	IssmDouble* eps_xx = xNew<IssmDouble>(numvertices);
++	IssmDouble* eps_yy = xNew<IssmDouble>(numvertices);
++	IssmDouble* eps_zz = xNew<IssmDouble>(numvertices);
++	IssmDouble* eps_xy = xNew<IssmDouble>(numvertices);
++	IssmDouble* eps_xz = xNew<IssmDouble>(numvertices);
++	IssmDouble* eps_yz = xNew<IssmDouble>(numvertices);
++
++	/* Start looping on the number of vertices: */
++	Gauss* gauss=this->NewGauss();
++	for (int iv=0;iv<numvertices;iv++){
++		gauss->GaussVertex(iv);
++
++		/*Compute strain rate viscosity and pressure: */
++		if(dim==2)
++		 this->StrainRateSSA(&epsilon[0],xyz_list,gauss,vx_input,vy_input);
++		else
++		 this->StrainRateFS(&epsilon[0],xyz_list,gauss,vx_input,vy_input,vz_input);
++
++		if(dim==2){
++			 /* epsilon=[exx,eyy,exy];*/
++			eps_xx[iv]=epsilon[0]; 
++			eps_yy[iv]=epsilon[1];
++			eps_xy[iv]=epsilon[2];
++		}
++		else{
++			/*epsilon=[exx eyy ezz exy exz eyz]*/
++			eps_xx[iv]=epsilon[0]; 
++			eps_yy[iv]=epsilon[1];
++			eps_zz[iv]=epsilon[2];
++			eps_xy[iv]=epsilon[3]; 
++			eps_xz[iv]=epsilon[4];
++			eps_yz[iv]=epsilon[5];
++		}
++	}
++
++	/*Add Stress tensor components into inputs*/
++	this->AddInput(StrainRatexxEnum,eps_xx,P1Enum);
++	this->AddInput(StrainRatexyEnum,eps_xy,P1Enum);
++	this->AddInput(StrainRatexzEnum,eps_xz,P1Enum);
++	this->AddInput(StrainRateyyEnum,eps_yy,P1Enum);
++	this->AddInput(StrainRateyzEnum,eps_yz,P1Enum);
++	this->AddInput(StrainRatezzEnum,eps_zz,P1Enum);
++
++	/*Clean up and return*/
++	delete gauss;
++	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(eps_xx);
++	xDelete<IssmDouble>(eps_yy);
++	xDelete<IssmDouble>(eps_zz);
++	xDelete<IssmDouble>(eps_xy);
++	xDelete<IssmDouble>(eps_xz);
++	xDelete<IssmDouble>(eps_yz);
++
++}
++/*}}}*/
+ void       Element::DeleteMaterials(void){/*{{{*/
+ 	delete this->material;
+ }/*}}}*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18192-18193.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18192-18193.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18192-18193.diff	(revision 18296)
@@ -0,0 +1,51 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18192)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18193)
+@@ -4824,7 +4824,7 @@
+ 		element->GetVerticesCoordinates(&xyz_list);
+ 		Input* vx_input=element->GetInput(VxEnum);                 _assert_(vx_input);
+ 		Input* vy_input=element->GetInput(VyEnum);                 _assert_(vy_input);
+-		Input* vz_input;
++		Input* vz_input=NULL;
+ 		if(dim==3){vz_input=element->GetInput(VzEnum); _assert_(vz_input);}
+ 
+ 		/*Get previous tau*/
+Index: ../trunk-jpl/src/c/cores/adjointbalancethickness2_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/adjointbalancethickness2_core.cpp	(revision 18192)
++++ ../trunk-jpl/src/c/cores/adjointbalancethickness2_core.cpp	(revision 18193)
+@@ -31,7 +31,7 @@
+ 	solutionsequence_adjoint_linear(femmodel);
+ 
+ 	/*Save results*/
+-	if(save_results){
++	if(save_results || true){
+ 		if(VerboseSolution()) _printf0_("   saving results\n");
+ 		int outputs[1] = {AdjointEnum};
+ 		femmodel->RequestedOutputsx(&femmodel->results,&outputs[0],1);
+Index: ../trunk-jpl/src/c/cores/controlvalidation_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 18192)
++++ ../trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 18193)
+@@ -53,7 +53,7 @@
+ 	/*Range of tests*/
+ 	IssmDouble exp0 = 0.;
+ 	IssmDouble incr = -0.2;
+-	IssmDouble exp1 = -8.;
++	IssmDouble exp1 = -10.;
+ 	int        num  = reCast<int,IssmDouble>((exp1-exp0)/incr);
+ 
+ 	/*Allocate output*/
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18192)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18193)
+@@ -902,6 +902,7 @@
+ 				name==BaseEnum ||
+ 				name==BedEnum ||
+ 				name==BalancethicknessThickeningRateEnum ||
++				name==BalancethicknessApparentMassbalanceEnum ||
+ 				name==SurfaceSlopeXEnum ||
+ 				name==SurfaceSlopeYEnum ||
+ 				name==SurfaceforcingsMassBalanceEnum ||
Index: /issm/oecreview/Archive/17984-18295/ISSM-18193-18194.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18193-18194.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18193-18194.diff	(revision 18296)
@@ -0,0 +1,372 @@
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18193)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18194)
+@@ -199,6 +199,7 @@
+ 	DamageEquivStressEnum,
+ 	DamageEvolutionNumRequestedOutputsEnum,
+ 	DamageEvolutionRequestedOutputsEnum,
++	NewDamageEnum,
+ 	MaterialsRhoIceEnum,
+ 	MaterialsRhoSeawaterEnum,
+ 	MaterialsRhoFreshwaterEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18193)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18194)
+@@ -207,6 +207,7 @@
+ 		case DamageEquivStressEnum : return "DamageEquivStress";
+ 		case DamageEvolutionNumRequestedOutputsEnum : return "DamageEvolutionNumRequestedOutputs";
+ 		case DamageEvolutionRequestedOutputsEnum : return "DamageEvolutionRequestedOutputs";
++		case NewDamageEnum : return "NewDamage";
+ 		case MaterialsRhoIceEnum : return "MaterialsRhoIce";
+ 		case MaterialsRhoSeawaterEnum : return "MaterialsRhoSeawater";
+ 		case MaterialsRhoFreshwaterEnum : return "MaterialsRhoFreshwater";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18193)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18194)
+@@ -210,6 +210,7 @@
+ 	      else if (strcmp(name,"DamageEquivStress")==0) return DamageEquivStressEnum;
+ 	      else if (strcmp(name,"DamageEvolutionNumRequestedOutputs")==0) return DamageEvolutionNumRequestedOutputsEnum;
+ 	      else if (strcmp(name,"DamageEvolutionRequestedOutputs")==0) return DamageEvolutionRequestedOutputsEnum;
++	      else if (strcmp(name,"NewDamage")==0) return NewDamageEnum;
+ 	      else if (strcmp(name,"MaterialsRhoIce")==0) return MaterialsRhoIceEnum;
+ 	      else if (strcmp(name,"MaterialsRhoSeawater")==0) return MaterialsRhoSeawaterEnum;
+ 	      else if (strcmp(name,"MaterialsRhoFreshwater")==0) return MaterialsRhoFreshwaterEnum;
+@@ -258,11 +259,11 @@
+ 	      else if (strcmp(name,"MassFluxSegments")==0) return MassFluxSegmentsEnum;
+ 	      else if (strcmp(name,"MassFluxSegmentsPresent")==0) return MassFluxSegmentsPresentEnum;
+ 	      else if (strcmp(name,"QmuMassFluxSegmentsPresent")==0) return QmuMassFluxSegmentsPresentEnum;
+-	      else if (strcmp(name,"QmuNumberofpartitions")==0) return QmuNumberofpartitionsEnum;
+          else stage=3;
+    }
+    if(stage==3){
+-	      if (strcmp(name,"QmuNumberofresponses")==0) return QmuNumberofresponsesEnum;
++	      if (strcmp(name,"QmuNumberofpartitions")==0) return QmuNumberofpartitionsEnum;
++	      else if (strcmp(name,"QmuNumberofresponses")==0) return QmuNumberofresponsesEnum;
+ 	      else if (strcmp(name,"QmuPartition")==0) return QmuPartitionEnum;
+ 	      else if (strcmp(name,"QmuResponsedescriptors")==0) return QmuResponsedescriptorsEnum;
+ 	      else if (strcmp(name,"QmuVariabledescriptors")==0) return QmuVariabledescriptorsEnum;
+@@ -381,11 +382,11 @@
+ 	      else if (strcmp(name,"HydrologyShreveAnalysis")==0) return HydrologyShreveAnalysisEnum;
+ 	      else if (strcmp(name,"HydrologyDCInefficientAnalysis")==0) return HydrologyDCInefficientAnalysisEnum;
+ 	      else if (strcmp(name,"HydrologyDCEfficientAnalysis")==0) return HydrologyDCEfficientAnalysisEnum;
+-	      else if (strcmp(name,"HydrologySolution")==0) return HydrologySolutionEnum;
+          else stage=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"MeltingAnalysis")==0) return MeltingAnalysisEnum;
++	      if (strcmp(name,"HydrologySolution")==0) return HydrologySolutionEnum;
++	      else if (strcmp(name,"MeltingAnalysis")==0) return MeltingAnalysisEnum;
+ 	      else if (strcmp(name,"MasstransportAnalysis")==0) return MasstransportAnalysisEnum;
+ 	      else if (strcmp(name,"MasstransportSolution")==0) return MasstransportSolutionEnum;
+ 	      else if (strcmp(name,"FreeSurfaceBaseAnalysis")==0) return FreeSurfaceBaseAnalysisEnum;
+@@ -504,11 +505,11 @@
+ 	      else if (strcmp(name,"Converged")==0) return ConvergedEnum;
+ 	      else if (strcmp(name,"Fill")==0) return FillEnum;
+ 	      else if (strcmp(name,"FractionIncrement")==0) return FractionIncrementEnum;
+-	      else if (strcmp(name,"Friction")==0) return FrictionEnum;
+          else stage=5;
+    }
+    if(stage==5){
+-	      if (strcmp(name,"Internal")==0) return InternalEnum;
++	      if (strcmp(name,"Friction")==0) return FrictionEnum;
++	      else if (strcmp(name,"Internal")==0) return InternalEnum;
+ 	      else if (strcmp(name,"MassFlux")==0) return MassFluxEnum;
+ 	      else if (strcmp(name,"MeltingOffset")==0) return MeltingOffsetEnum;
+ 	      else if (strcmp(name,"Misfit")==0) return MisfitEnum;
+@@ -627,11 +628,11 @@
+ 	      else if (strcmp(name,"StringExternalResult")==0) return StringExternalResultEnum;
+ 	      else if (strcmp(name,"Step")==0) return StepEnum;
+ 	      else if (strcmp(name,"Time")==0) return TimeEnum;
+-	      else if (strcmp(name,"WaterColumnOld")==0) return WaterColumnOldEnum;
+          else stage=6;
+    }
+    if(stage==6){
+-	      if (strcmp(name,"Outputdefinition")==0) return OutputdefinitionEnum;
++	      if (strcmp(name,"WaterColumnOld")==0) return WaterColumnOldEnum;
++	      else if (strcmp(name,"Outputdefinition")==0) return OutputdefinitionEnum;
+ 	      else if (strcmp(name,"OutputdefinitionList")==0) return OutputdefinitionListEnum;
+ 	      else if (strcmp(name,"Massfluxatgate")==0) return MassfluxatgateEnum;
+ 	      else if (strcmp(name,"MassfluxatgateName")==0) return MassfluxatgateNameEnum;
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18193)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18194)
+@@ -58,8 +58,9 @@
+ 		void       AddInput(Input* input_in);
+ 		/* bool       AllActive(void); */
+ 		/* bool       AnyActive(void); */
++		void       ComputeNewDamage();
++		void       ComputeStrainRate();
+ 		void       CoordinateSystemTransform(IssmDouble** ptransform,Node** nodes,int numnodes,int* cs_array);
+-		void       ComputeStrainRate();
+ 		void       Echo();
+ 		void       DeepEcho();
+ 		void       DeleteMaterials(void);
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18193)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18194)
+@@ -40,80 +40,60 @@
+ 	_assert_(this->inputs);
+ 	this->inputs->AddInput(input_in);
+ }/*}}}*/
+-void       Element::CoordinateSystemTransform(IssmDouble** ptransform,Node** nodes_list,int numnodes,int* cs_array){/*{{{*/
++void       Element::ComputeNewDamage(){/*{{{*/
+ 
+-	int         i,counter;
+-	int         numdofs   = 0;
+-	IssmDouble  norm;
+-	IssmDouble *transform = NULL;
+-	IssmDouble  coord_system[3][3];
++	IssmDouble *xyz_list=NULL;
++	IssmDouble  eps_xx,eps_xy,eps_yy,eps_xz,eps_yz,eps_zz,eps_eff;
++	IssmDouble  epsmin=1.e-27;
++	int         dim;
+ 
+-	/*Some checks in debugging mode*/
+-	_assert_(numnodes && nodes_list);
++	/*Retrieve all inputs we will be needing: */
++	/* TODO: retrieve parameters eps_0 and eps_f and input DamageD(bar?) */
++	this->GetVerticesCoordinates(&xyz_list);
++	this->ComputeStrainRate();
++	parameters->FindParam(&dim,DomainDimensionEnum);
++	Input* eps_xx_input=this->GetInput(StrainRatexxEnum); _assert_(eps_xx_input);
++	Input* eps_yy_input=this->GetInput(StrainRateyyEnum); _assert_(eps_yy_input);
++	Input* eps_xy_input=this->GetInput(StrainRatexyEnum); _assert_(eps_xy_input);
++	Input* eps_xz_input=NULL;
++	Input* eps_yz_input=NULL;
++	Input* eps_zz_input=NULL;
++	if(dim==3){
++		eps_xz_input=this->GetInput(StrainRatexzEnum); _assert_(eps_xz_input);
++		eps_yz_input=this->GetInput(StrainRateyzEnum); _assert_(eps_yz_input);
++		eps_zz_input=this->GetInput(StrainRatezzEnum); _assert_(eps_zz_input);
++	}
+ 
+-	/*Get total number of dofs*/
+-	for(i=0;i<numnodes;i++){
+-		switch(cs_array[i]){
+-			case PressureEnum: numdofs+=1; break;
+-			case XYEnum:       numdofs+=2; break;
+-			case XYZEnum:      numdofs+=3; break;
+-			default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++	/* Start looping on the number of vertices: */
++	Gauss* gauss=this->NewGauss();
++	int numvertices = this->GetNumberOfVertices();
++	for (int iv=0;iv<numvertices;iv++){
++		gauss->GaussVertex(iv);
++
++		eps_xx_input->GetInputValue(&eps_xx,gauss);
++		eps_yy_input->GetInputValue(&eps_yy,gauss);
++		eps_xy_input->GetInputValue(&eps_xy,gauss);
++		if(dim==3){
++			eps_xz_input->GetInputValue(&eps_xz,gauss);
++			eps_yz_input->GetInputValue(&eps_yz,gauss);
++			eps_zz_input->GetInputValue(&eps_zz,gauss);
+ 		}
+-	}
++		else{eps_xz=0; eps_yz=0; eps_zz=0;}
+ 
+-	/*Allocate and initialize transform matrix*/
+-	transform=xNew<IssmDouble>(numdofs*numdofs);
+-	for(i=0;i<numdofs*numdofs;i++) transform[i]=0.0;
++		/* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exz^2 + eyz^2 + exx*eyy */
++		eps_eff=sqrt(eps_xx*eps_xx+eps_yy*eps_yy+eps_xy*eps_xy+eps_xz*eps_xz+eps_yz*eps_yz+eps_xx*eps_xx*epsmin*epsmin);
+ 
+-	/*Create transform matrix for all nodes (x,y for 2d and x,y,z for 3d). It is a block matrix
+-	 *for 3 nodes:
++		/*TODO: compute kappa from initial D, then compute new D */
+ 
+-	 *     | T1 0  0 |
+-	 * Q = | 0  T2 0 |
+-	 *     | 0  0  T3|
+-	 *
+-	 * Where T1 is the transform matrix for node 1. It is a simple copy of the coordinate system
+-	 * associated to this node*/
+-	counter=0;
+-	for(i=0;i<numnodes;i++){
+-		nodes_list[i]->GetCoordinateSystem(&coord_system[0][0]);
+-		switch(cs_array[i]){
+-			case PressureEnum:
+-				/*DO NOT change anything*/
+-				transform[(numdofs)*(counter) + counter] = 1.;
+-				counter+=1;
+-				break;
+-			case XYEnum:
+-				/*We remove the z component, we need to renormalize x and y: x=[x1 x2 0] y=[-x2 x1 0]*/
+-				norm = sqrt( coord_system[0][0]*coord_system[0][0] + coord_system[1][0]*coord_system[1][0]); _assert_(norm>1.e-4);
+-				transform[(numdofs)*(counter+0) + counter+0] =   coord_system[0][0]/norm;
+-				transform[(numdofs)*(counter+0) + counter+1] = - coord_system[1][0]/norm;
+-				transform[(numdofs)*(counter+1) + counter+0] =   coord_system[1][0]/norm;
+-				transform[(numdofs)*(counter+1) + counter+1] =   coord_system[0][0]/norm;
+-				counter+=2;
+-				break;
+-			case XYZEnum:
+-				/*The 3 coordinates are changed (x,y,z)*/
+-				transform[(numdofs)*(counter+0) + counter+0] = coord_system[0][0];
+-				transform[(numdofs)*(counter+0) + counter+1] = coord_system[0][1];
+-				transform[(numdofs)*(counter+0) + counter+2] = coord_system[0][2];
+-				transform[(numdofs)*(counter+1) + counter+0] = coord_system[1][0];
+-				transform[(numdofs)*(counter+1) + counter+1] = coord_system[1][1];
+-				transform[(numdofs)*(counter+1) + counter+2] = coord_system[1][2];
+-				transform[(numdofs)*(counter+2) + counter+0] = coord_system[2][0];
+-				transform[(numdofs)*(counter+2) + counter+1] = coord_system[2][1];
+-				transform[(numdofs)*(counter+2) + counter+2] = coord_system[2][2];
+-				counter+=3;
+-				break;
+-			default:
+-				_error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
+-		}
+ 	}
+ 
+-	/*Assign output pointer*/
+-	*ptransform=transform;
+-}
+-/*}}}*/
++	/* TODO: add newdamage input to DamageEnum and NewDamageEnum */
++
++	/*Clean up and return*/
++	xDelete<IssmDouble>(xyz_list);
++	delete gauss;
++
++}/*}}}*/
+ void       Element::ComputeStrainRate(){/*{{{*/
+ 
+ 	int         dim;
+@@ -185,6 +165,80 @@
+ 
+ }
+ /*}}}*/
++void       Element::CoordinateSystemTransform(IssmDouble** ptransform,Node** nodes_list,int numnodes,int* cs_array){/*{{{*/
++
++	int         i,counter;
++	int         numdofs   = 0;
++	IssmDouble  norm;
++	IssmDouble *transform = NULL;
++	IssmDouble  coord_system[3][3];
++
++	/*Some checks in debugging mode*/
++	_assert_(numnodes && nodes_list);
++
++	/*Get total number of dofs*/
++	for(i=0;i<numnodes;i++){
++		switch(cs_array[i]){
++			case PressureEnum: numdofs+=1; break;
++			case XYEnum:       numdofs+=2; break;
++			case XYZEnum:      numdofs+=3; break;
++			default: _error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++		}
++	}
++
++	/*Allocate and initialize transform matrix*/
++	transform=xNew<IssmDouble>(numdofs*numdofs);
++	for(i=0;i<numdofs*numdofs;i++) transform[i]=0.0;
++
++	/*Create transform matrix for all nodes (x,y for 2d and x,y,z for 3d). It is a block matrix
++	 *for 3 nodes:
++
++	 *     | T1 0  0 |
++	 * Q = | 0  T2 0 |
++	 *     | 0  0  T3|
++	 *
++	 * Where T1 is the transform matrix for node 1. It is a simple copy of the coordinate system
++	 * associated to this node*/
++	counter=0;
++	for(i=0;i<numnodes;i++){
++		nodes_list[i]->GetCoordinateSystem(&coord_system[0][0]);
++		switch(cs_array[i]){
++			case PressureEnum:
++				/*DO NOT change anything*/
++				transform[(numdofs)*(counter) + counter] = 1.;
++				counter+=1;
++				break;
++			case XYEnum:
++				/*We remove the z component, we need to renormalize x and y: x=[x1 x2 0] y=[-x2 x1 0]*/
++				norm = sqrt( coord_system[0][0]*coord_system[0][0] + coord_system[1][0]*coord_system[1][0]); _assert_(norm>1.e-4);
++				transform[(numdofs)*(counter+0) + counter+0] =   coord_system[0][0]/norm;
++				transform[(numdofs)*(counter+0) + counter+1] = - coord_system[1][0]/norm;
++				transform[(numdofs)*(counter+1) + counter+0] =   coord_system[1][0]/norm;
++				transform[(numdofs)*(counter+1) + counter+1] =   coord_system[0][0]/norm;
++				counter+=2;
++				break;
++			case XYZEnum:
++				/*The 3 coordinates are changed (x,y,z)*/
++				transform[(numdofs)*(counter+0) + counter+0] = coord_system[0][0];
++				transform[(numdofs)*(counter+0) + counter+1] = coord_system[0][1];
++				transform[(numdofs)*(counter+0) + counter+2] = coord_system[0][2];
++				transform[(numdofs)*(counter+1) + counter+0] = coord_system[1][0];
++				transform[(numdofs)*(counter+1) + counter+1] = coord_system[1][1];
++				transform[(numdofs)*(counter+1) + counter+2] = coord_system[1][2];
++				transform[(numdofs)*(counter+2) + counter+0] = coord_system[2][0];
++				transform[(numdofs)*(counter+2) + counter+1] = coord_system[2][1];
++				transform[(numdofs)*(counter+2) + counter+2] = coord_system[2][2];
++				counter+=3;
++				break;
++			default:
++				_error_("Coordinate system " << EnumToStringx(cs_array[i]) << " not supported yet");
++		}
++	}
++
++	/*Assign output pointer*/
++	*ptransform=transform;
++}
++/*}}}*/
+ void       Element::DeleteMaterials(void){/*{{{*/
+ 	delete this->material;
+ }/*}}}*/
+@@ -1052,6 +1106,10 @@
+ 				this->ComputeSigmaNN();
+ 				input=this->inputs->GetInput(output_enum);
+ 				break;
++			case NewDamageEnum:
++				this->ComputeNewDamage();
++				input=this->inputs->GetInput(output_enum);
++				break;
+ 			default:
+ 				_error_("input "<<EnumToStringx(output_enum)<<" not found in element");
+ 		}
+Index: ../trunk-jpl/src/m/plot/plotmodel.py
+===================================================================
+--- ../trunk-jpl/src/m/plot/plotmodel.py	(revision 18193)
++++ ../trunk-jpl/src/m/plot/plotmodel.py	(revision 18194)
+@@ -53,8 +53,8 @@
+ 	#Go through plots
+ 	if numberofplots:
+ 		
+-		if plt.fignum_exists(figurenumber): 
+-			plt.cla()
++		#if plt.fignum_exists(figurenumber): 
++		#	plt.cla()
+ 
+ 		#if figsize specified
+ 		if options.list[0].exist('figsize'):
+Index: ../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- ../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 18193)
++++ ../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 18194)
+@@ -199,6 +199,7 @@
+ def DamageEquivStressEnum(): return StringToEnum("DamageEquivStress")[0]
+ def DamageEvolutionNumRequestedOutputsEnum(): return StringToEnum("DamageEvolutionNumRequestedOutputs")[0]
+ def DamageEvolutionRequestedOutputsEnum(): return StringToEnum("DamageEvolutionRequestedOutputs")[0]
++def NewDamageEnum(): return StringToEnum("NewDamage")[0]
+ def MaterialsRhoIceEnum(): return StringToEnum("MaterialsRhoIce")[0]
+ def MaterialsRhoSeawaterEnum(): return StringToEnum("MaterialsRhoSeawater")[0]
+ def MaterialsRhoFreshwaterEnum(): return StringToEnum("MaterialsRhoFreshwater")[0]
+Index: ../trunk-jpl/src/m/enum/NewDamageEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/NewDamageEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/NewDamageEnum.m	(revision 18194)
+@@ -0,0 +1,11 @@
++function macro=NewDamageEnum()
++%NEWDAMAGEENUM - Enum of NewDamage
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=NewDamageEnum()
++
++macro=StringToEnum('NewDamage');
Index: /issm/oecreview/Archive/17984-18295/ISSM-18194-18195.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18194-18195.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18194-18195.diff	(revision 18296)
@@ -0,0 +1,18 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18194)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18195)
+@@ -3714,10 +3714,10 @@
+ 		element->NodalFunctionsDerivativesVelocity(dbasis,xyz_list,gauss);
+ 
+ 		for(i=0;i<numnodes;i++){
+-			pe->values[i*dim+0] += - r*pressure*gauss->weight*Jdet*dbasis[0*numnodes+i];
+-			pe->values[i*dim+1] += - r*pressure*gauss->weight*Jdet*dbasis[1*numnodes+i];
++			pe->values[i*dim+0] += pressure*gauss->weight*Jdet*dbasis[0*numnodes+i];
++			pe->values[i*dim+1] += pressure*gauss->weight*Jdet*dbasis[1*numnodes+i];
+ 			if(dim==3){
+-				pe->values[i*dim+2]+= - r*pressure*gauss->weight*Jdet*dbasis[2*numnodes+i];
++				pe->values[i*dim+2]+= pressure*gauss->weight*Jdet*dbasis[2*numnodes+i];
+ 			}
+ 		}
+ 	}
Index: /issm/oecreview/Archive/17984-18295/ISSM-18195-18196.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18195-18196.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18195-18196.diff	(revision 18296)
@@ -0,0 +1,54 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18195)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18196)
+@@ -107,9 +107,9 @@
+ 	parameters->AddObject(iomodel->CopyConstantObject(StressbalanceViscosityOvershootEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(FrictionLawEnum));
+ 
+-	/*XTH parameters*/
++	/*XTH LATH parameters*/
+ 	iomodel->Constant(&fe_FS,FlowequationFeFSEnum);
+-	if(fe_FS==XTaylorHoodEnum){
++	if(fe_FS==XTaylorHoodEnum || fe_FS==LATaylorHoodEnum){
+ 		parameters->AddObject(iomodel->CopyConstantObject(AugmentedLagrangianREnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject(AugmentedLagrangianThetaEnum));
+ 	}
+@@ -124,7 +124,7 @@
+ void StressbalanceAnalysis::UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
+ 
+ 	/*Intermediaries*/
+-	int    materials_type,finiteelement;
++	int    materials_type,finiteelement,fe_FS;
+ 	int    approximation,frictionlaw;
+ 	int*   finiteelement_list=NULL;
+ 	bool   isSSA,isL1L2,isHO,isFS,iscoupling;
+@@ -236,6 +236,11 @@
+ 	if(islevelset){
+ 		iomodel->FetchDataToInput(elements,IceMaskNodeActivationEnum);
+ 	}
++	/*LATH parameters*/
++	iomodel->Constant(&fe_FS,FlowequationFeFSEnum);
++	if(fe_FS==LATaylorHoodEnum){
++		iomodel->FetchDataToInput(elements,PressureEnum);
++	}
+ 
+ 	/*Friction law variables*/
+ 	switch(frictionlaw){
+@@ -4567,14 +4572,14 @@
+ 	 * status, otherwise, we'll wipe them off: */
+ 	element->InputChangeName(VxEnum,VxPicardEnum);
+ 	element->InputChangeName(VyEnum,VyPicardEnum);
+-	element->InputChangeName(PressureEnum,PressurePicardEnum);
++	if(pnumdof>0) element->InputChangeName(PressureEnum,PressurePicardEnum);
+ 	if(dim==3) element->InputChangeName(VzEnum,VzPicardEnum);
+ 
+ 	/*Add vx and vy as inputs to the tria element: */
+ 	element->AddInput(VxEnum,      vx,      element->VelocityInterpolation());
+ 	element->AddInput(VyEnum,      vy,      element->VelocityInterpolation());
+ 	element->AddInput(VelEnum,     vel,     element->VelocityInterpolation());
+-	element->AddInput(PressureEnum,pressure,element->PressureInterpolation());
++	if(pnumdof>0) element->AddInput(PressureEnum,pressure,element->PressureInterpolation());
+ 	if(dim==3) element->AddInput(VzEnum,vz, element->VelocityInterpolation());
+ 
+ 	/*Free ressources:*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18196-18197.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18196-18197.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18196-18197.diff	(revision 18296)
@@ -0,0 +1,118 @@
+Index: ../trunk-jpl/src/m/classes/flowequation.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.py	(revision 18196)
++++ ../trunk-jpl/src/m/classes/flowequation.py	(revision 18197)
+@@ -16,21 +16,21 @@
+ 
+ 	def __init__(self): # {{{
+ 		
+-		self.isSIA            = 0
+-		self.isSSA            = 0
+-		self.isL1L2           = 0
+-		self.isHO             = 0
+-		self.isFS             = 0
+-		self.fe_SSA           = ''
+-		self.fe_HO            = ''
+-		self.fe_FS            = ''
+-		self.XTH_r            = 1.
+-		self.XTH_theta        = 0.
+-		self.vertex_equation  = float('NaN')
+-		self.element_equation = float('NaN')
+-		self.borderSSA        = float('NaN')
+-		self.borderHO         = float('NaN')
+-		self.borderFS         = float('NaN')
++		self.isSIA                   = 0
++		self.isSSA                   = 0
++		self.isL1L2                  = 0
++		self.isHO                    = 0
++		self.isFS                    = 0
++		self.fe_SSA                  = ''
++		self.fe_HO                   = ''
++		self.fe_FS                   = ''
++		self.augmented_lagrangian_r  = 1.
++		self.XTH_theta               = 0.
++		self.vertex_equation         = float('NaN')
++		self.element_equation        = float('NaN')
++		self.borderSSA               = float('NaN')
++		self.borderHO                = float('NaN')
++		self.borderFS                = float('NaN')
+ 
+ 		#set defaults
+ 		self.setdefaultparameters()
+@@ -81,7 +81,7 @@
+ 			md = checkfield(md,'fieldname','flowequation.borderSSA','size',[md.mesh.numberofvertices],'values',[0,1])
+ 			md = checkfield(md,'fieldname','flowequation.borderHO','size',[md.mesh.numberofvertices],'values',[0,1])
+ 			md = checkfield(md,'fieldname','flowequation.borderFS','size',[md.mesh.numberofvertices],'values',[0,1])
+-			md = checkfield(md,'fieldname','flowequation.XTH_r','numel',[1],'>',0.)
++			md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_r','numel',[1],'>',0.)
+ 			md = checkfield(md,'fieldname','flowequation.XTH_theta','numel',[1],'>=',0.,'<',.5)
+ 			if m.strcmp(md.mesh.domaintype(),'2Dhorizontal'):
+ 				md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices],'values',[1,2])
+@@ -110,7 +110,7 @@
+ 		WriteData(fid,'enum',FlowequationFeSSAEnum(),'data',StringToEnum(self.fe_SSA)[0],'format','Integer')
+ 		WriteData(fid,'enum',FlowequationFeHOEnum() ,'data',StringToEnum(self.fe_HO)[0] ,'format','Integer')
+ 		WriteData(fid,'enum',FlowequationFeFSEnum() ,'data',StringToEnum(self.fe_FS)[0] ,'format','Integer')
+-		WriteData(fid,'enum',AugmentedLagrangianREnum() ,'data',self.XTH_r ,'format','Double')
++		WriteData(fid,'enum',AugmentedLagrangianREnum(),'data',self.augmented_lagrangian_r ,'format','Double')
+ 		WriteData(fid,'enum',AugmentedLagrangianThetaEnum() ,'data',self.XTH_theta ,'format','Double')
+ 		WriteData(fid,'object',self,'fieldname','borderSSA','format','DoubleMat','mattype',1)
+ 		WriteData(fid,'object',self,'fieldname','borderHO','format','DoubleMat','mattype',1)
+Index: ../trunk-jpl/src/m/classes/flowequation.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.m	(revision 18196)
++++ ../trunk-jpl/src/m/classes/flowequation.m	(revision 18197)
+@@ -5,21 +5,21 @@
+ 
+ classdef flowequation
+ 	properties (SetAccess=public) 
+-		isSIA            = 0;
+-		isSSA            = 0;
+-		isL1L2           = 0;
+-		isHO             = 0;
+-		isFS             = 0;
+-		fe_SSA           = '';
+-		fe_HO            = '';
+-		fe_FS            = '';
+-		XTH_r            = 1.;
+-		XTH_theta        = 0.;
+-		vertex_equation  = NaN;
+-		element_equation = NaN;
+-		borderSSA        = NaN;
+-		borderHO         = NaN;
+-		borderFS         = NaN;
++		isSIA                  = 0;
++		isSSA                  = 0;
++		isL1L2                 = 0;
++		isHO                   = 0;
++		isFS                   = 0;
++		fe_SSA                 = '';
++		fe_HO                  = '';
++		fe_FS                  = '';
++		augmented_lagrangian_r = 1.;
++		XTH_theta              = 0.;
++		vertex_equation        = NaN;
++		element_equation       = NaN;
++		borderSSA              = NaN;
++		borderHO               = NaN;
++		borderFS               = NaN;
+ 	end
+ 	methods (Static)
+ 		function obj = loadobj(obj) % {{{
+@@ -134,7 +134,7 @@
+ 				md = checkfield(md,'fieldname','flowequation.fe_SSA','values',{'P1','P1bubble','P1bubblecondensed','P2','P2bubble'});
+ 				md = checkfield(md,'fieldname','flowequation.fe_HO' ,'values',{'P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P2bubble','P1xP3','P2xP4'});
+ 				md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',{'P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','LATaylorHood','XTaylorHood','OneLayerP4z','CrouzeixRaviart'});
+-				md = checkfield(md,'fieldname','flowequation.XTH_r','numel',[1],'>',0.);
++				md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_r','numel',[1],'>=',0.);
+ 				md = checkfield(md,'fieldname','flowequation.XTH_theta','numel',[1],'>=',0.,'<',0.5);
+ 				md = checkfield(md,'fieldname','flowequation.borderSSA','size',[md.mesh.numberofvertices 1],'values',[0 1]);
+ 				md = checkfield(md,'fieldname','flowequation.borderHO','size',[md.mesh.numberofvertices 1],'values',[0 1]);
+@@ -191,7 +191,7 @@
+ 			WriteData(fid,'enum',FlowequationFeSSAEnum(),'data',StringToEnum(obj.fe_SSA),'format','Integer');
+ 			WriteData(fid,'enum',FlowequationFeHOEnum() ,'data',StringToEnum(obj.fe_HO) ,'format','Integer');
+ 			WriteData(fid,'enum',FlowequationFeFSEnum() ,'data',StringToEnum(obj.fe_FS) ,'format','Integer');
+-			WriteData(fid,'enum',AugmentedLagrangianREnum() ,'data',obj.XTH_r ,'format','Double');
++			WriteData(fid,'enum',AugmentedLagrangianREnum(),'data',obj.augmented_lagrangian_r ,'format','Double');
+ 			WriteData(fid,'enum',AugmentedLagrangianThetaEnum() ,'data',obj.XTH_theta ,'format','Double');
+ 			WriteData(fid,'object',obj,'fieldname','borderSSA','format','DoubleMat','mattype',1);
+ 			WriteData(fid,'object',obj,'fieldname','borderHO','format','DoubleMat','mattype',1);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18197-18198.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18197-18198.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18197-18198.diff	(revision 18296)
@@ -0,0 +1,3927 @@
+Index: ../trunk-jpl/examples/Greenland/Jak_outline.exp
+===================================================================
+--- ../trunk-jpl/examples/Greenland/Jak_outline.exp	(revision 0)
++++ ../trunk-jpl/examples/Greenland/Jak_outline.exp	(revision 18198)
+@@ -0,0 +1,17 @@
++## Name:Jak
++## Icon:0
++# Points Count Value
++11 1.000000
++# X pos Y pos
++-421561.7247949215 -2216716.3488182197
++-386019.6416099078 -2203459.4896082953
++-351446.8879663036 -2185999.2360147359
++-289086.6874689616 -2214129.6445821370
++-255160.1535196303 -2282353.9688088228
++-340138.0433165266 -2317597.8140254519
++-383306.1449952667 -2302506.6581698526
++-416391.9672407377 -2279120.5885137189
++-448056.7322601135 -2246463.4475331730
++-429126.8716234095 -2231167.6696134652
++-421561.7247949215 -2216716.3488182197
++
+Index: ../trunk-jpl/examples/Greenland/Greenland.par
+===================================================================
+--- ../trunk-jpl/examples/Greenland/Greenland.par	(revision 0)
++++ ../trunk-jpl/examples/Greenland/Greenland.par	(revision 18198)
+@@ -0,0 +1,81 @@
++%Name and hemisphere
++md.miscellaneous.name='SeaRISEgreenland';
++md.mesh.hemisphere='n';
++
++disp('   Loading SeaRISE data from NetCDF');
++ncdata='../Data/Greenland_5km_dev1.2.nc';
++x1    = ncread(ncdata,'x1');
++y1    = ncread(ncdata,'y1');
++usrf  = ncread(ncdata,'usrf')';
++topg  = ncread(ncdata,'topg')';
++velx  = ncread(ncdata,'surfvelx')';
++vely  = ncread(ncdata,'surfvely')';
++temp  = ncread(ncdata,'airtemp2m')';
++smb   = ncread(ncdata,'smb')';
++gflux = ncread(ncdata,'bheatflx')';
++
++disp('   Interpolating surface and bedrock');
++md.geometry.base     = InterpFromGridToMesh(x1,y1,topg,md.mesh.x,md.mesh.y,0);
++md.geometry.surface = InterpFromGridToMesh(x1,y1,usrf,md.mesh.x,md.mesh.y,0);
++
++disp('   Constructing thickness');
++md.geometry.thickness=md.geometry.surface-md.geometry.base;
++
++%Set min thickness to 1 meter
++pos0=find(md.geometry.thickness<=0);
++md.geometry.thickness(pos0)=1;
++md.geometry.surface=md.geometry.thickness+md.geometry.base;
++
++disp('   Interpolating velocities ');
++md.inversion.vx_obs  = InterpFromGridToMesh(x1,y1,velx,md.mesh.x,md.mesh.y,0);
++md.inversion.vy_obs  = InterpFromGridToMesh(x1,y1,vely,md.mesh.x,md.mesh.y,0);
++md.inversion.vel_obs = sqrt(md.inversion.vx_obs.^2+md.inversion.vy_obs.^2);
++md.initialization.vx = md.inversion.vx_obs;
++md.initialization.vy = md.inversion.vy_obs;
++md.initialization.vz = zeros(md.mesh.numberofvertices,1);
++md.initialization.vel= md.inversion.vel_obs;
++
++disp('   Interpolating temperatures');
++md.initialization.temperature=InterpFromGridToMesh(x1,y1,temp,md.mesh.x,md.mesh.y,0)+273.15;
++
++disp('   Interpolating surface mass balance');
++md.surfaceforcings.mass_balance=InterpFromGridToMesh(x1,y1,smb,md.mesh.x,md.mesh.y,0);
++md.surfaceforcings.mass_balance=md.surfaceforcings.mass_balance*md.materials.rho_water/md.materials.rho_ice;
++
++disp('   Construct basal friction parameters');
++md.friction.coefficient=30*ones(md.mesh.numberofvertices,1);
++pos=find(md.mask.groundedice_levelset<0);
++md.friction.coefficient(pos)=0; %no friction applied on floating ice
++md.friction.p=ones(md.mesh.numberofelements,1);
++md.friction.q=ones(md.mesh.numberofelements,1);
++
++disp('   Construct ice rheological properties');
++md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
++md.materials.rheology_B=paterson(md.initialization.temperature);
++md.friction.q=ones(md.mesh.numberofelements,1);
++md.friction.p=ones(md.mesh.numberofelements,1);
++
++disp('   Set other boundary conditions');
++md.mask.ice_levelset(md.mesh.vertexonboundary==1)=0;
++md.basalforcings.melting_rate = zeros(md.mesh.numberofvertices,1);
++md.thermal.spctemperature     = [md.initialization.temperature;1]; %impose observed temperature on surface
++md.masstransport.spcthickness    = NaN*ones(md.mesh.numberofvertices,1);
++
++disp('   Set geothermal heat flux');
++md.basalforcings.geothermalflux=InterpFromGridToMesh(x1,y1,gflux,md.mesh.x,md.mesh.y,0);
++
++disp('   Set Pressure');
++md.initialization.pressure=md.materials.rho_ice*md.constants.g*md.geometry.thickness;
++
++disp('   Single point constraint for continental model');
++%Set at least one vertex to velocity 0 so as to not get a singular problem (point on the wet peninsula)
++md.stressbalance.referential=NaN*ones(md.mesh.numberofvertices,6);
++md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices,1);
++md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices,1);
++md.stressbalance.spcvz = NaN*ones(md.mesh.numberofvertices,1);
++location = 1.0e+06 *[.32011 -2.2039];
++[dist pos]=min(sqrt((md.mesh.x - location(1)).^2 + (md.mesh.y - location(2)).^2));
++md.stressbalance.spcvx(pos) = 0;
++md.stressbalance.spcvy(pos) = 0;
++md.stressbalance.spcvz(pos) = 0;
++
+
+Property changes on: ../trunk-jpl/examples/Greenland/Greenland.par
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/Greenland/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Greenland/runme.m	(revision 0)
++++ ../trunk-jpl/examples/Greenland/runme.m	(revision 18198)
+@@ -0,0 +1,272 @@
++clear all;
++steps=[ 1 ];
++
++%Location of SeaRISE dataset
++ncdata='../Data/Greenland_5km_dev1.2.nc';
++
++if any(steps==1)
++	disp('   Step 1: Mesh creation');
++
++	%Generate initial uniform mesh (resolution = 20000 m)
++	md=triangle(model,'./Exp_Par/DomainOutline.exp',20000);
++
++	% Get velocities (Note: You can use ncdisp('file') to see an ncdump)
++	x1   = ncread(ncdata,'x1');
++	y1   = ncread(ncdata,'y1');
++	velx = ncread(ncdata,'surfvelx');
++	vely = ncread(ncdata,'surfvely');
++	vx   = InterpFromGridToMesh(x1,y1,velx',md.mesh.x,md.mesh.y,0);
++	vy   = InterpFromGridToMesh(x1,y1,vely',md.mesh.x,md.mesh.y,0);
++	vel  = sqrt(vx.^2+vy.^2);
++
++	%Mesh Greenland
++	md=bamg(md,'hmax',400000,'hmin',5000,'gradation',1.7,'field',vel,'err',8);
++	
++	%convert x,y coordinates (Polar stereo) to lat/lon
++	[md.mesh.lat,md.mesh.long]=xy2ll(md.mesh.x,md.mesh.y,+1,39,71);
++
++	save ./Models/Greenland.Mesh_generation md;
++
++	plotmodel (md,'data','mesh');
++end
++
++if any(steps==2)
++	disp('   Step 2: Parameterization');
++	md = loadmodel('./Models/Greenland.Mesh_generation');
++
++	md = setmask(md,'','');
++	md = parameterize(md,'./Exp_Par/Greenland.par');
++	md = setflowequation(md,'SSA','all');
++
++	save ./Models/Greenland.Parameterization md; 
++end
++
++if any(steps==3)
++	disp('   Step 3: Control method friction');
++	md = loadmodel('./Models/Greenland.Parameterization');
++
++	%Control general
++	md.inversion.iscontrol=1;
++	md.inversion.nsteps=30;
++	md.inversion.step_threshold=0.99*ones(md.inversion.nsteps,1);
++	md.inversion.maxiter_per_step=5*ones(md.inversion.nsteps,1);
++
++	%Cost functions
++	md.inversion.cost_functions=[101 103 501];
++	md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,3);
++	md.inversion.cost_functions_coefficients(:,1)=350;
++	md.inversion.cost_functions_coefficients(:,2)=0.6;
++	md.inversion.cost_functions_coefficients(:,3)=2e-6;
++
++	%Controls
++	md.inversion.control_parameters={'FrictionCoefficient'};
++	md.inversion.gradient_scaling(1:md.inversion.nsteps)=50;
++	md.inversion.min_parameters=1*ones(md.mesh.numberofvertices,1);
++	md.inversion.max_parameters=200*ones(md.mesh.numberofvertices,1);
++
++	%Additional parameters
++	md.stressbalance.restol=0.01; md.stressbalance.reltol=0.1; 
++	md.stressbalance.abstol=NaN;
++
++	%Go solve
++	md.cluster=generic('name',oshostname,'np',2);
++	md.toolkits=toolkits;
++	md.verbose=verbose('solution',true,'control',true);
++	md=solve(md,StressbalanceSolutionEnum);
++
++	%Update model friction fields accordingly
++	md.friction.coefficient=md.results.StressbalanceSolution.FrictionCoefficient;
++
++	save ./Models/Greenland.Control_drag md; 
++end
++
++if any(steps==4)
++	disp('   Step 4: Transient run');
++	md = loadmodel('./Models/Greenland.Control_drag');
++
++	%Set surface mass balance
++	x1  = ncread(ncdata,'x1');
++	y1  = ncread(ncdata,'y1');
++	smb = ncread(ncdata,'smb');
++	smb = InterpFromGridToMesh(x1,y1,smb',md.mesh.x,md.mesh.y,0);
++	smb = smb*md.materials.rho_freshwater/md.materials.rho_ice;
++	smb = [smb smb smb-1.0];
++	md.surfaceforcings.mass_balance = [smb;1 10 20];
++
++	%Set transient options, run for 20 years, saving every timestep
++	md.timestepping.time_step=0.2;
++	md.timestepping.final_time=20;
++	md.settings.output_frequency=1;
++
++	%Additional options
++	md.inversion.iscontrol=0;
++	md.transient.requested_outputs={'IceVolume','TotalSmb', ...
++		                             'SurfaceforcingsMassBalance'};
++	md.verbose=verbose('solution',true,'module',true,'convergence',true);
++
++	%Go solve
++	md.cluster=generic('name',oshostname,'np',2);
++	md=solve(md,TransientSolutionEnum);
++
++	save ./Models/Greenland.Transient md; 
++end
++
++if any(steps==5)
++	disp('   Step 5: Plotting'); 
++	md = loadmodel('./Models/Greenland.Transient');
++	%md = loadmodel('./Models/Greenland.HistoricTransient');
++
++	%Planview plots
++	plotmodel(md,'data',md.results.TransientSolution(end).Vel,'caxis',[1e-1 6000],...
++		'log', 10, 'title', 'Velocity (m/y)','gridded',1, ...
++		'data', md.results.TransientSolution(1).SurfaceforcingsMassBalance, ...
++		'title', 'Surface mass balance (m/y)', 'gridded',1,...
++		'data',md.results.TransientSolution(end).Thickness,...
++		'title','Thickness (m)', 'gridded',1, ...
++		'data',md.results.TransientSolution(end).Surface, ...
++		'title', 'Surface (m)', 'gridded',1);
++
++	%Line Plots
++	figure
++
++	%Plot surface mass balance
++	surfmb=[]; for i=1:100; surfmb=[surfmb ...
++		md.results.TransientSolution(i).SurfaceforcingsMassBalance]; end
++	subplot(3,1,1); plot([0.2:0.2:20],mean(surfmb)); title('Mean Surface mass balance');
++
++	%Plot velocity
++	vel=[]; for i=1:100; vel=[vel md.results.TransientSolution(i).Vel]; end
++	subplot(3,1,2); plot([0.2:0.2:20],mean(vel)); title('Mean Velocity');
++
++	%Plot Volume
++	volume=[]; for i=1:100; volume=[volume md.results.TransientSolution(i).IceVolume]; end
++	subplot(3,1,3); plot([0.2:0.2:20],volume); title('Ice Volume');
++	xlabel('years')
++end
++
++if any(steps==6)
++	disp('   Step 6: Historical Relaxation run');
++	md = loadmodel('./Models/Greenland.Control_drag');
++
++	ncbox='../Data/Box_Greenland_SMB_monthly_1840-2012_5km_ver20140421.nc';
++
++	%convert mesh x,y into the Box projection
++	[md.mesh.lat,md.mesh.long]  = xy2ll(md.mesh.x,md.mesh.y,+1,39,71);
++	[xi,yi]= ll2xy(md.mesh.lat,md.mesh.long,+1,45,70);
++
++	%Set surface mass balance
++	lat  = ncread(ncbox,'lat');
++	lon  = ncread(ncbox,'lon');
++	smbbox = ncread(ncbox,'SMB');
++	[x1 y1]=ll2xy(lat,lon,+1,45,70);
++
++	%surface mass balance
++	smbmean = mean(mean(smbbox,3),4);
++	save -v7.3 smbbox smbbox x1 y1;
++	clear smbbox
++
++	%Interpolate and set surface mass balance
++	index = BamgTriangulate(x1(:),y1(:));
++	smb_mo = InterpFromMeshToMesh2d(index,x1(:),y1(:),smbmean(:),xi,yi);
++	smb = smb_mo*12/1000*md.materials.rho_freshwater/md.materials.rho_ice;
++	md.surfaceforcings.mass_balance = [smb;1 ];
++
++	%Set transient options, run for 20 years, saving every timestep
++	md.timestepping.time_step=0.2;
++	md.timestepping.final_time=20;
++	md.settings.output_frequency=1;
++
++	%Additional options
++	md.inversion.iscontrol=0;
++	md.transient.requested_outputs={'IceVolume','TotalSmb', ...
++		'SurfaceforcingsMassBalance'};
++	md.verbose=verbose('solution',true,'module',true);
++
++	%Go solve
++	md.cluster=generic('name',oshostname,'np',2);
++	md=solve(md,TransientSolutionEnum);
++
++	save ./Models/Greenland.HistoricTransient md;
++end
++
++if any(steps==7)
++	disp('   Step 7: Box Transient run');
++	md = loadmodel('../Data/Greenland.HistoricTransient_1000yr');
++
++	%load past transient results
++	md.geometry.base=md.results.TransientSolution(end).Base;
++	md.geometry.thickness=md.results.TransientSolution(end).Thickness;
++	md.geometry.surface=md.geometry.base+md.geometry.thickness;
++	md.initialization.vx=(md.results.TransientSolution(end).Vx);
++	md.initialization.vy=(md.results.TransientSolution(end).Vy);
++	md.results=[];
++
++	%convert mesh x,y into the Box projection
++	[md.mesh.lat,md.mesh.long]  = xy2ll(md.mesh.x,md.mesh.y,+1,39,71);
++	[xi,yi]= ll2xy(md.mesh.lat,md.mesh.long,+1,45,70);
++
++	%Set surface mass balance
++	load smbbox
++	index = BamgTriangulate(x1(:),y1(:));
++
++	%Set years to run
++	years_of_simulation = 2003:2012;
++
++	%initialize surface mass balance matrix
++	smb = nan*ones(md.mesh.numberofvertices,length(years_of_simulation)*12);
++
++	%Interpolate and set surface mass balance
++	for year=years_of_simulation
++		for month=1:12
++			smb_mo = griddata(double(x1),double(y1),...
++				double(squeeze(smbbox(:,:,month,year-1839))),xi,yi,'nearest');
++			smb(:,(year-years_of_simulation(1))*12+month) = smb_mo;
++		end
++	end
++	md.surfaceforcings.mass_balance = ...
++		[smb*12/1000*md.materials.rho_freshwater/md.materials.rho_ice; ...
++		[1/24:1/12:length(years_of_simulation)]];
++
++	%Set transient options, monthly timestep, saving every month
++	md.timestepping.time_step=1/12;
++	md.timestepping.final_time=length(years_of_simulation);
++	md.settings.output_frequency=1;
++
++	%Additional options
++	md.inversion.iscontrol=0;
++	md.transient.requested_outputs={'IceVolume','TotalSmb', ...
++		'SurfaceforcingsMassBalance'};
++	md.verbose=verbose('solution',true,'module',true);
++
++	%Go solve
++	md.cluster=generic('name',oshostname,'np',2);
++	md=solve(md,TransientSolutionEnum);
++
++	save ./Models/Greenland.BoxTransient md;
++end
++
++if any(steps==8)
++	disp('   Step 8: Plot Box Transient');
++	md = loadmodel('./Models/Greenland.BoxTransient');
++
++	%Set years run
++	years_of_simulation = 2003:2012;
++	t = [years_of_simulation(1):1/12:years_of_simulation(end)+11/12];
++
++	%Line Plots
++	figure
++
++	%Plot surface mass balance
++	surfmb=[]; for i=1:length(t); surfmb=[surfmb ...
++		md.results.TransientSolution(i).TotalSmb]; end
++	subplot(3,1,1); plot(t,surfmb); title('Total Surface mass balance');
++
++	%Plot velocity
++	vel=[]; for i=1:length(t); vel=[vel md.results.TransientSolution(i).Vel]; end
++	subplot(3,1,2); plot(t,max(vel)); title('Max Velocity');
++
++	%Plot Volume
++	volume=[]; for i=1:length(t); volume=[volume md.results.TransientSolution(i).IceVolume]; end
++	subplot(3,1,3); plot(t,volume); title('Ice Volume');
++	xlabel('years')
++end
+
+Property changes on: ../trunk-jpl/examples/Greenland/runme.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/Greenland/DomainOutline.exp
+===================================================================
+--- ../trunk-jpl/examples/Greenland/DomainOutline.exp	(revision 0)
++++ ../trunk-jpl/examples/Greenland/DomainOutline.exp	(revision 18198)
+@@ -0,0 +1,733 @@
++## Name:DomainOutline
++## Icon:0
++# Points Count Value
++727 1.000000
++# X pos Y pos
++47662.8073760000 -2621047.2585999998
++39869.9055420000 -2638077.6292949999
++26037.5047870000 -2644088.3483640002
++24868.5695120000 -2659115.1460360000
++25647.8596950000 -2674141.9437079998
++16880.8451320000 -2687666.0616130000
++515.7512810000 -2685662.4885900002
++-7666.7956450000 -2672639.2639410002
++-22083.6640370000 -2677147.3032430001
++-30071.3884170000 -2690170.5278920000
++-44683.0793550000 -2694678.5671930001
++-41760.7411680000 -2709705.3648660001
++-37669.4677050000 -2724231.2692820001
++-44488.2568100000 -2738757.1736989999
++-55787.9644690000 -2753283.0781149999
++-67672.1397650000 -2742263.4264890002
++-87154.3943500000 -2741762.5332330000
++-105078.0685680000 -2741011.1933490001
++-97090.3441880000 -2760546.0303230002
++-99817.8598300000 -2780581.7605530000
++-82478.6532500000 -2789096.9459000002
++-77218.4445120000 -2804123.7435730002
++-77023.6219660000 -2820152.3277560002
++-95336.9412760000 -2829669.2996149999
++-112870.9704020000 -2832674.6591500002
++-123196.5653320000 -2818649.6479890002
++-122417.2751480000 -2834177.3389170002
++-120274.2271440000 -2849204.1365890000
++-105662.5362060000 -2854713.9624020001
++-89492.2649000000 -2850706.8163560000
++-77997.7346950000 -2860724.6814710000
++-92024.9579960000 -2867737.1870519998
++-84816.5238000000 -2890277.3835600000
++-94752.4736380000 -2901797.9284419999
++-114234.7282230000 -2894284.5296060001
++-127677.4838860000 -2883765.7712349999
++-146964.9159250000 -2888774.7037930000
++-139951.3042750000 -2905805.0744880000
++-154173.3501210000 -2916824.7261140002
++-165667.8803260000 -2904302.3947210000
++-162550.7195930000 -2920330.9789040000
++-152809.5923000000 -2934355.9900650000
++-147744.2061080000 -2949883.6809930000
++-163719.6548680000 -2950384.5742489998
++-175603.8301650000 -2963908.6921540000
++-189825.8760110000 -2956896.1865730002
++-195670.5523870000 -2971422.0909899999
++-210282.2433250000 -2966413.1584319999
++-222750.8862590000 -2978301.3022220000
++-214763.1618800000 -2995247.5385030000
++-222750.8862590000 -3011386.8111520000
++-206970.2600460000 -3016228.5929470002
++-217295.8549760000 -3027122.6019839998
++-232686.8360980000 -3031964.3837790000
++-212035.6462380000 -3035192.2383090002
++-212814.9364210000 -3050928.0291410000
++-197229.1327540000 -3048910.6200600001
++-185344.9574570000 -3058190.7018329999
++-174824.5399810000 -3071102.1199520002
++-182812.2643610000 -3084820.5017030002
++-192163.7465610000 -3098942.3652710002
++-176577.9428940000 -3092486.6562120002
++-184955.3123650000 -3105801.5561469998
++-182617.4418150000 -3121537.3469790001
++-199372.1807580000 -3120326.9015310002
++-218464.7902510000 -3115888.6015519998
++-205022.0345870000 -3126782.6105900002
++-189825.8760110000 -3128800.0196710001
++-198592.8905740000 -3146149.7377680000
++-213009.7589670000 -3140904.4741580002
++-225283.5793550000 -3131220.9105679998
++-222750.8862590000 -3146149.7377680000
++-208334.0178670000 -3151395.0013790000
++-195670.5523870000 -3161078.5649680002
++-213009.7589670000 -3171569.0921900002
++-227621.4499060000 -3161078.5649680002
++-242622.7859360000 -3157850.7104389998
++-240090.0928400000 -3174393.4649040001
++-220023.3706180000 -3185690.9557579998
++-233076.4811890000 -3193357.1102660000
++-258013.7670580000 -3188111.8466550000
++-275158.1510920000 -3196181.4829790001
++-258208.5896040000 -3198198.8920600000
++-252753.5583200000 -3213127.7192600002
++-270482.4099920000 -3215952.0919740000
++-258793.0572410000 -3226442.6191960000
++-275547.7961840000 -3232969.1157640000
++-276521.9089130000 -3248275.5695210001
++-293276.6478560000 -3241868.2167850002
++-282561.4078340000 -3256818.7065010001
++-288211.2616640000 -3273549.0164200002
++-302433.3075110000 -3267141.6636850000
++-305745.2907900000 -3251479.2458879999
++-313733.0151700000 -3237596.6482950002
++-310810.6769820000 -3218018.6260489998
++-325812.0130120000 -3213747.0575589999
++-338280.6559470000 -3203780.0644160002
++-336527.2530340000 -3187761.6825779998
++-321720.7395500000 -3185269.9342919998
++-325812.0130120000 -3165691.9120459999
++-313538.1926240000 -3155368.9548610002
++-329708.4639290000 -3158928.5952699999
++-338085.8334010000 -3173167.1569030001
++-351723.4116100000 -3164268.0558819999
++-342566.7519550000 -3151809.3144530002
++-325812.0130120000 -3153233.1706160000
++-310615.8544360000 -3148249.6740450002
++-329123.9962920000 -3150029.4942490002
++-343151.2195930000 -3144334.0695949998
++-361854.1839940000 -3145401.9617180000
++-377634.8102080000 -3142910.2134320000
++-388350.0502290000 -3154657.0267800000
++-397701.5324300000 -3178150.6534750001
++-417573.4321060000 -3179930.4736790000
++-432720.8850460000 -3186308.0579260001
++-451813.4945390000 -3187438.8412219998
++-467788.9432980000 -3177261.7915590000
++-482985.1018740000 -3173492.5139070000
++-490583.1811620000 -3158792.3310610000
++-492726.2291670000 -3141453.6538590002
++-490193.5360710000 -3119214.9157079998
++-505389.6946470000 -3113560.9992289999
++-489803.8909790000 -3110922.5048719998
++-478309.3607740000 -3100368.5274439999
++-495648.5673540000 -3101122.3829750000
++-512792.9513890000 -3108660.9382799999
++-501103.5986380000 -3097353.1053220001
++-493895.1644420000 -3083783.7057719999
++-486491.9077000000 -3068329.6673960001
++-503636.2917340000 -3066068.1008040002
++-522728.9012270000 -3064183.4619780001
++-521559.9659520000 -3046467.8570099999
++-531301.0932440000 -3029506.1075729998
++-543769.7361790000 -3012167.4303710000
++-545912.7841830000 -2992944.1143419999
++-550004.0576459999 -2974474.6538439998
++-567538.0867720000 -2983897.8479749998
++-585851.4060810000 -2995959.5364640001
++-589942.6795440000 -2981259.3536189999
++-572213.8278720001 -2975982.3649050002
++-565200.2162220000 -2959397.5432330002
++-548055.8321870000 -2954120.5545190000
++-545717.9616370000 -2933389.5274290000
++-536561.3019820000 -2920197.0556450002
++-545523.1390910000 -2907758.4393910002
++-533444.1412490000 -2898335.2452590000
++-530568.0950890000 -2883304.2548420001
++-545624.1658510000 -2879383.1998239998
++-559750.8495300000 -2868110.1666489998
++-577223.3267109999 -2867129.9028940001
++-590606.5007220000 -2859287.7928590002
++-573319.9009570000 -2851445.6828239998
++-551572.2431889999 -2846054.2321750000
++-530939.8499220000 -2834781.1989989998
++-528337.5660870000 -2817626.5832969998
++-543765.3916830000 -2804883.1544900001
++-528151.6886699999 -2802432.4951040000
++-528151.6886699999 -2785768.0112790000
++-513467.3727410000 -2778416.0331210000
++-513839.1275750000 -2760771.2855420001
++-525735.2822510001 -2749498.2523670001
++-509563.9469880000 -2738225.2191909999
++-517184.9210780000 -2724501.5266300002
++-532240.9918400000 -2725971.9222610001
++-524248.2629170000 -2707837.0428050002
++-512537.9856570000 -2694113.3502429998
++-521088.3468310000 -2678429.1301730000
++-538189.0691780000 -2669606.7563829999
++-556033.3011930001 -2677448.8664190001
++-539676.0885130001 -2666175.8332429999
++-526664.6693360000 -2658333.7232080000
++-517556.6759110000 -2639708.7118739998
++-526107.0370850000 -2626965.2830670001
++-538932.5788460000 -2618142.9092779998
++-550456.9786890000 -2607360.0079790000
++-565698.9268680000 -2599517.8979440001
++-581126.7524640000 -2600988.2935759998
++-583110.5023000001 -2578346.1085480000
++-572583.8192940000 -2566324.6704099998
++-556315.3091930000 -2558811.2715739999
++-538132.8567270000 -2571333.6029679999
++-524735.2601730000 -2578346.1085480000
++-519759.0100240000 -2594875.5859869998
++-503107.7114500000 -2585859.5073839999
++-486456.4128760000 -2576342.5355250002
++-477843.6722340000 -2559312.1648300001
++-474015.7875040000 -2536771.9683220000
++-473441.6047950000 -2521244.2773940000
++-474972.7586870000 -2504714.7999539999
++-485690.8359300000 -2491691.5753049999
++-486073.6244030000 -2476664.7776330002
++-492581.0284430000 -2459634.4069380001
++-474207.1817410000 -2447112.0755440001
++-465594.4410990000 -2434589.7441509999
++-462340.7390790000 -2418060.2667109999
++-462914.9217880000 -2399026.3229930000
++-468465.3546460000 -2375484.3399729999
++-473058.8163220000 -2360457.5423010001
++-478417.8549440000 -2343427.1716060000
++-504256.0768690000 -2331405.7334679998
++-489901.5091330000 -2322389.6548649999
++-475164.1529230000 -2307863.7504480002
++-462577.4401970000 -2287577.5735909999
++-457317.2314590000 -2269044.5231289999
++-439783.2023330000 -2268042.7366169998
++-436666.0415990000 -2252014.1524330000
++-435886.7514160000 -2233481.1019710000
++-448550.2168960000 -2220457.8773220000
++-440172.8474240000 -2206933.7594170002
++-429262.7848570000 -2193409.6415120000
++-433743.7034120000 -2176880.1640720000
++-426730.0917610000 -2162354.2596560000
++-419716.4801110000 -2147327.4619840002
++-428678.3172200000 -2134805.1305900002
++-427314.5593990000 -2110762.2543150000
++-426535.2692150000 -2094733.6701310000
++-427509.3819440000 -2067184.5410650000
++-428093.8495820000 -2050655.0636260000
++-425366.3339400000 -2035628.2659539999
++-432379.9455910000 -2021102.3615369999
++-446017.5238000000 -2003571.0975860001
++-430821.3652240000 -2002569.3110750001
++-428678.3172200000 -1986039.8336360001
++-424197.3986650000 -1971013.0359630000
++-418060.4884710000 -1957238.4714309999
++-433451.4695930000 -1950225.9658500000
++-426243.0353960000 -1933696.4884110000
++-441634.0165180000 -1943714.3535259999
++-433841.1146840000 -1926683.9828300001
++-448647.6281690000 -1933696.4884110000
++-464428.2543820000 -1948222.3928270000
++-465402.3671120000 -1933195.5951550000
++-463843.7867450000 -1914662.5446929999
++-456245.7074570000 -1901138.4267879999
++-468714.3503910000 -1892122.3481840000
++-480208.8805960000 -1905646.4660890000
++-479429.5904130000 -1888616.0953939999
++-478455.4776830000 -1871585.7246989999
++-478650.3002290000 -1856558.9270270001
++-484494.9766050000 -1841031.2360990001
++-494430.9264430000 -1822498.1856370000
++-505925.4566480000 -1807972.2812200000
++-508847.7948350000 -1791442.8037810000
++-504172.0537350000 -1776416.0061079999
++-510990.8428400000 -1759886.5286689999
++-502223.8282770000 -1745861.5175079999
++-512939.0682980000 -1728330.2535570001
++-511964.9555690000 -1712802.5626300001
++-505340.9890100000 -1697775.7649570000
++-506315.1017390000 -1681747.1807740000
++-507289.2144690000 -1662713.2370559999
++-508446.9486300000 -1645056.7497910000
++-502180.9448550000 -1623518.3397939999
++-505662.0580630000 -1602480.8230530000
++-505836.1137240000 -1586953.1321250000
++-509317.2269320000 -1571425.4411970000
++-516105.3976870000 -1557400.4300360000
++-530552.0175000000 -1537865.5930620001
++-533336.9080660000 -1513321.8235309999
++-522719.5127820000 -1498295.0258589999
++-506532.3363650000 -1492284.3067900001
++-522893.5684430000 -1484770.9079539999
++-515757.2863660000 -1469744.1102819999
++-532118.5184440000 -1465236.0709800001
++-535947.7429720000 -1449708.3800520001
++-544476.4703320001 -1428670.8633109999
++-551960.8637290000 -1415146.7454059999
++-565363.1495800000 -1405629.7735470000
++-567277.7618440000 -1386094.9365729999
++-582420.6042990000 -1384091.3635499999
++-593212.0552430000 -1370066.3523899999
++-606266.2297730000 -1362052.0602980000
++-613793.7528780000 -1344395.5730330001
++-621618.1005840000 -1359923.2639609999
++-634079.0987820000 -1369440.2358200001
++-633354.6221430000 -1354413.4381480000
++-638860.6446030000 -1339386.6404760000
++-649438.0035390001 -1351908.9718690000
++-667405.0241970000 -1352409.8651250000
++-679431.3364110000 -1363429.5167510000
++-679721.1270670000 -1346900.0393119999
++-676533.4298540000 -1330370.5618720001
++-690008.6953470000 -1339386.6404760000
++-701165.6355950000 -1327365.2023380001
++-688994.4280520000 -1315844.6574560001
++-709279.7739560000 -1318349.1237339999
++-717249.0169900000 -1331372.3483839999
++-735216.0376480001 -1329869.6686160001
++-741420.6668040000 -1315969.8807699999
++-750947.3474350000 -1299440.4033299999
++-734597.5036490000 -1299440.4033299999
++-722496.0444700000 -1284413.6056580001
++-707948.5456690000 -1288420.7517039999
++-689023.9233340001 -1290424.3247270000
++-678209.8534290000 -1276399.3135660000
++-672545.3406220000 -1262374.3024060000
++-693401.0468670001 -1264377.8754280000
++-709493.4127980000 -1260871.6226379999
++-725971.9955110000 -1250853.7575240000
++-725714.5176560000 -1234825.1733400000
++-720951.1773400001 -1215290.3363659999
++-737172.2821980000 -1218295.6958999999
++-749402.4803050000 -1205272.4712510000
++-736399.8486340001 -1196757.2859040000
++-720822.4384130000 -1191247.4600899999
++-710652.0631450000 -1204771.5779949999
++-697906.9093280000 -1218796.5891559999
++-684131.8440910000 -1227812.6677590001
++-668940.6506530000 -1229816.2407819999
++-666237.1331770000 -1253358.2238020001
++-653620.7182870000 -1262374.3024060000
++-648471.1611900000 -1247347.5047330000
++-634696.0959530000 -1258868.0496149999
++-632625.0227419999 -1243541.0164699999
++-618416.8083510000 -1233878.1370890001
++-601000.2874830000 -1228080.4094600000
++-615361.2783740000 -1217451.2421410000
++-598861.4165000001 -1216968.0981719999
++-610625.2069099999 -1201990.6351310001
++-617652.9258560000 -1185080.5962139999
++-631708.3637490000 -1178799.7246160000
++-648666.5551200000 -1183631.1643070001
++-656458.1565610000 -1169136.8452349999
++-653708.1795820000 -1154159.3821950001
++-665166.4169950000 -1166237.9814210001
++-676166.3249110000 -1153193.0942569999
++-676166.3249110000 -1133384.1915249999
++-689305.1038110000 -1118406.7284850001
++-709013.2721609999 -1111159.5689490000
++-711610.4726409999 -1091833.8101870001
++-716346.5441050000 -1074440.6273010001
++-701527.2237180000 -1070092.3315790000
++-680291.2903790000 -1068642.8996720000
++-664096.9815030000 -1078788.9230219999
++-650958.2026030000 -1100530.4016300000
++-628041.7277770001 -1095698.9619390001
++-611236.3129050001 -1091350.6662170000
++-588930.9440750000 -1094732.6740009999
++-577319.9301640000 -1078305.7790530000
++-565250.5867559999 -1066710.3237960001
++-550431.2663680000 -1071541.7634860000
++-540042.4644469999 -1060429.4521979999
++-531203.6819710000 -1047613.0696300000
++-510357.6695660000 -1037937.0529810000
++-498473.4942690000 -1027821.2173940000
++-486199.6738810000 -1015066.4681760001
++-487953.0767930000 -994834.7970020000
++-464964.0163830000 -990876.4265550000
++-449378.2127160000 -998353.3485110000
++-430285.6032230000 -1001432.0810810000
++-417622.1377430000 -1012427.5545450000
++-399308.8184330000 -1004950.6325890000
++-384697.1274945000 -1000332.5337340001
++-370085.4365560000 -995714.4348789999
++-375540.4678400000 -980760.5909680000
++-380021.3863940000 -966246.5659950000
++-383528.1922200000 -949973.2652690000
++-383528.1922200000 -930181.4130330000
++-384112.6598570000 -911709.0176140000
++-380216.2089400000 -883560.6055450001
++-366919.5701860000 -892846.9764360000
++-353087.1694310000 -880338.0618260000
++-336527.2530340000 -873692.7009390000
++-322694.8522790000 -888547.0370390000
++-307888.3387940000 -897146.9158330000
++-294835.2282230000 -913564.8662580000
++-275937.4412760000 -919037.5164000000
++-252169.0906820000 -915128.4805850000
++-245350.3015780000 -901446.8552300000
++-244181.3663030000 -918646.6128190000
++-231615.3120950000 -930563.0925760000
++-215445.0407900000 -924017.9382920000
++-206872.8487730000 -937108.2468600000
++-190507.7549220000 -933426.5975750000
++-186611.3040050000 -912972.9904390000
++-185961.8955186667 -896882.8194913333
++-185312.4870323333 -880792.6485436666
++-184663.0785460000 -864702.4775960000
++-175311.5963460000 -883519.7961620000
++-174532.3061620000 -902337.1147280000
++-172584.0807040000 -918700.0004370000
++-168882.4523330000 -933835.6697180000
++-152322.5359360000 -933835.6697180000
++-142581.4086430000 -921563.5054359999
++-127969.7177050000 -912154.8461530000
++-131086.8784390000 -930563.0925760000
++-115501.0747710000 -924427.0104349999
++-112189.0914910000 -905609.6918690000
++-114916.6071330000 -887610.5175890001
++-101473.8514700000 -899882.6818710000
++-84329.4674350000 -896610.1047290000
++-100110.0936490000 -892110.3111590000
++-87836.2732610000 -879838.1468770000
++-74685.7514160000 -869305.2030530000
++-57541.3673810000 -863251.9975030000
++-49553.6430020000 -850388.9357080000
++-34357.4844260000 -846227.3568920000
++-47995.0626350000 -825797.7881600000
++-30071.3884170000 -835255.9218320000
++-18771.6807580000 -850767.2610550000
++-6303.0378240000 -859847.0693810000
++7139.7178400000 -852658.8877899999
++22141.0538700000 -862873.6721560000
++31297.7135250000 -877628.3606850000
++47662.8073760000 -874601.7579100000
++49611.0328340000 -893518.0252550000
++66365.7717770000 -886708.1690110000
++81123.5796250000 -882220.1151260000
++97683.4960220000 -884202.5846670000
++80149.4668960000 -888960.5115630000
++65537.7759570000 -896493.8958170000
++68460.1141450000 -914732.6155880000
++84435.5629050000 -917508.0729450000
++100605.8342100000 -907595.7252430000
++120282.9113400000 -911957.1582320000
++129049.9259030000 -927420.4206470000
++153402.7441340000 -925437.9511060000
++169767.8379850000 -920680.0242090001
++180677.9005530000 -910371.1825990001
++192367.2533040000 -899269.3531730000
++201134.2678670000 -912353.6521400000
++182626.1260110000 -920680.0242090001
++169183.3703480000 -936539.7805320000
++163338.6939720000 -950417.0673150000
++182820.9485570000 -955174.9942120000
++187301.8671120000 -970241.7627180000
++200744.6227750000 -980550.6043280000
++198796.3973170000 -995617.3728350000
++211118.9233410000 -983385.4589040000
++211508.5684330000 -999969.0227530000
++225146.1466420000 -1008484.9068910000
++240731.9503100000 -1009829.5201760000
++238588.9023060000 -1032239.7415930000
++253785.0608820000 -1029550.5150230000
++273072.4929210000 -1036273.5814480000
++281255.0398460000 -1056890.9851510001
++286320.4260380000 -1071681.7312860000
++305413.0355310000 -1086024.2729930000
++316907.5657360000 -1095884.7704169999
++326453.8704830000 -1081990.4331380001
++341260.3839670000 -1076611.9799980000
++355677.2523600000 -1064958.6648609999
++372319.0245690000 -1056006.2810410000
++387981.0391590000 -1068027.7191780000
++383779.0352450000 -1084056.3033620000
++366207.0188750000 -1085558.9831290001
++366971.0195860000 -1102088.4605690001
++352646.0062410000 -1113108.1121950001
++362960.0158500000 -1126131.3368440000
++380914.0325760000 -1133143.8424249999
++394093.0448530000 -1123626.8705660000
++409182.0589100000 -1113108.1121950001
++409182.0589100000 -1131641.1626569999
++404407.0544620000 -1158689.3984670001
++386262.0375580000 -1153179.5726540000
++374229.0263480000 -1166202.7973030000
++364488.0172730000 -1182732.2747430000
++377285.0291950000 -1191748.3533460000
++388172.0393370000 -1202768.0049719999
++392947.0437860000 -1219798.3756680000
++380341.0320420000 -1228814.4542710001
++383588.0350670000 -1251354.6507790000
++389509.0405830000 -1265880.5551960000
++389509.0405830000 -1282910.9258910001
++399632.0500130000 -1295934.1505400001
++408609.0583760000 -1313966.3077469999
++410137.0598000000 -1333000.2514650000
++413526.9681570000 -1350406.2921020000
++416526.2265730000 -1367436.6627970000
++415776.4119690000 -1385468.8200040001
++419900.3922910000 -1406005.4434890000
++430960.1577010000 -1421032.2411610000
++431897.4259560000 -1436059.0388330000
++448018.4399430000 -1436559.9320890000
++448580.8008960000 -1456094.7690630001
++438458.3037410000 -1469117.9937120001
++432459.7869090000 -1486148.3644069999
++449705.5228020000 -1494663.5497550000
++448393.3472450000 -1513196.6002170001
++463202.1856750000 -1521210.8923090000
++447830.9862920000 -1525218.0383550001
++458140.9370980000 -1539243.0495160001
++462639.8247220000 -1554269.8471880001
++473887.0437820000 -1564287.7123030000
++458703.2980510000 -1557275.2067219999
++463014.7320240000 -1574305.5774170000
++478948.2923600000 -1567293.0718370001
++484009.5409370000 -1584824.3357879999
++475011.7656880000 -1597346.6671819999
++484009.5409370000 -1614877.9311319999
++488508.4285610000 -1630906.5153160000
++470512.8780640000 -1618384.1839230000
++461702.5564670000 -1631407.4085720000
++474074.4974330000 -1641926.1669419999
++488883.3358630000 -1648938.6725230000
++495661.8324810000 -1662963.6836830000
++478923.6439970000 -1667471.7229849999
++463095.1396700000 -1663965.4701950001
++449449.8773190000 -1652945.8185690001
++455817.6664170000 -1670477.0825199999
++441626.5935720000 -1662963.6836830000
++433439.4361610000 -1648437.7792670000
++409690.0603430000 -1652315.3206390000
++394504.9542530000 -1655951.1781029999
++411243.1427370000 -1662462.7904280000
++426707.7734010000 -1676487.8015880000
++437260.1096190000 -1691514.5992610001
++455999.6032480000 -1702534.2508870000
++441626.5935720000 -1710047.6497229999
++428891.0153770000 -1692516.3857720001
++435076.8676430000 -1708544.9699560001
++419976.1106410000 -1704036.9306540000
++408696.0270980000 -1692516.3857720001
++395050.7647470000 -1701532.4643750000
++388501.0388190000 -1718562.8350710000
++378494.5130940000 -1731085.1664640000
++376129.3342870000 -1713553.9025129999
++361938.2614420000 -1720566.4080940001
++373582.2186480000 -1732086.9529760000
++358481.4616460000 -1738598.5652999999
++369397.6715270000 -1754627.1494839999
++352659.4830430000 -1751621.7899490001
++335805.3526830000 -1754501.9261700001
++338338.0457790000 -1777042.1226780000
++354897.9621760000 -1775539.4429110000
++349053.2858010000 -1792569.8136060000
++330739.9664910000 -1791568.0270950000
++344182.7221550000 -1806093.9315110000
++341455.2065130000 -1823625.1954620001
++351780.8014430000 -1809600.1843010001
++344377.5447010000 -1826129.6617409999
++356066.8974510000 -1836147.5268550001
++345546.4799760000 -1853678.7908059999
++363080.5091020000 -1853678.7908059999
++371847.5236650000 -1841156.4594129999
++370288.9432980000 -1859689.5098750000
++386848.8596950000 -1868204.6952229999
++404772.5339130000 -1856183.2570849999
++415098.1288430000 -1867703.8019669999
++428735.7070520000 -1860691.2963870000
++421137.6277640000 -1874215.4142920000
++413929.1935680000 -1888741.3187080000
++418799.7572140000 -1903768.1163800000
++428735.7070520000 -1916791.3410300000
++415098.1288430000 -1935825.2847480001
++398148.5673540000 -1926809.2061439999
++380030.0705910000 -1929814.5656790000
++364444.2669230000 -1929814.5656790000
++348468.8181630000 -1924304.7398659999
++333077.8370420000 -1919796.7005640001
++348079.1730720000 -1935825.2847480001
++332883.0144960000 -1939832.4307939999
++318855.7911950000 -1951853.8689309999
++331908.9017660000 -1964376.2003250001
++349442.9308930000 -1959868.1610230000
++358209.9454560000 -1943338.6835840000
++358404.7680020000 -1958365.4812560000
++345936.1250670000 -1971388.7059050000
++345351.6574300000 -1987918.1833450000
++330739.9664910000 -1991925.3293910001
++337753.5781420000 -2005449.4472960001
++353534.2043550000 -2007453.0203180001
++365223.5571060000 -1997435.1552040000
++385679.9244200000 -1986415.5035770000
++399317.5026290000 -1977399.4249740001
++399122.6800840000 -1993928.9024139999
++381393.8284120000 -1998436.9417150000
++399512.3251750000 -1999939.6214820000
++395615.8742580000 -2018973.5652000001
++387822.9724240000 -2032998.5763610001
++383975.2271440000 -2048275.8206610000
++398976.5631740000 -2062801.7250780000
++397223.1602620000 -2078830.3092610000
++379299.4860440000 -2080833.8822840001
++362739.5696470000 -2085842.8148419999
++374428.9223980000 -2097363.3597240001
++390599.1937030000 -2089849.9608880000
++379299.4860440000 -2103374.0787930000
++364492.9725590000 -2111388.3708839999
++355531.1354500000 -2097363.3597240001
++343257.3150620000 -2111889.2641400001
++351829.5070790000 -2127917.8483239999
++365661.9078340000 -2119402.6629760000
++357284.5383630000 -2133928.5673929998
++374039.2773060000 -2136933.9269269998
++385533.8075110000 -2147452.6852980000
++375792.6802180000 -2160976.8032030002
++390988.8387940000 -2162479.4829699998
++378520.1958600000 -2174000.0278520002
++394105.9995280000 -2164983.9492489998
++409107.3355580000 -2161978.5897140000
++421186.3334010000 -2149957.1515759998
++437941.0723440000 -2150958.9380879998
++450409.7152780000 -2171495.5615730002
++454695.8112860000 -2156969.6571570002
++471645.3727750000 -2159975.0166910002
++459566.3749330000 -2147452.6852980000
++465605.8738540000 -2132425.8876260002
++477490.0491500000 -2120404.4494880000
++485867.4186220000 -2133427.6741370000
++493264.3211700000 -2119402.6629760000
++495978.8328800000 -2102873.1855370002
++509098.9728100000 -2110386.5843730001
++523877.9810080000 -2104876.7585600000
++541371.5009160000 -2109885.6911169998
++529608.6168400000 -2096862.4664680001
++544990.8498620000 -2099366.9327469999
++561579.5325330000 -2107381.2248390000
++576509.3469370001 -2104876.7585600000
++596868.1847600000 -2102873.1855370002
++611948.8053700000 -2108883.9046060001
++597622.2157910001 -2119402.6629760000
++580430.3082950000 -2125413.3820449999
++599130.2778520000 -2126916.0618119999
++583144.8200050000 -2134930.3539040000
++568818.2304260000 -2148454.4718089998
++582843.2075930000 -2161477.6964580002
++566706.9435400000 -2162980.3762260000
++552983.5787850000 -2170994.6683180002
++543331.9815950000 -2188025.0390130002
++547554.5553660000 -2207058.9827310001
++538053.7643820000 -2193033.9715700001
++525084.4306570000 -2209062.5557539999
++516036.0582910000 -2221083.9938920001
++529910.2292520000 -2214572.3815669999
++541220.6947100000 -2225091.1399369999
++526140.0741000000 -2223087.5669140001
++526743.2989240000 -2239617.0443540001
++521615.8879170000 -2256647.4150490002
++506233.6548950000 -2255144.7352820002
++508194.1355740000 -2275681.3587670000
++489343.3598110000 -2268167.9599310001
++488740.1349870000 -2283695.6508590002
++475770.8012620000 -2293212.6227179999
++460539.3744460000 -2281692.0778359999
++449228.9089890000 -2296217.9822519999
++448022.4593400000 -2314250.1394590000
++440180.5366230000 -2298722.4485309999
++441085.3738600000 -2277184.0385340001
++426000.8914760000 -2286450.5637659999
++431125.9775380000 -2301477.3614380001
++426190.7094780000 -2317505.9456210001
++424672.1654600000 -2332532.7432940002
++421445.2594210000 -2313498.7995750001
++409296.9072740000 -2298472.0019029998
++411764.5413040000 -2318006.8388769999
++403222.7312010000 -2304983.6142279999
++411005.2692950000 -2289956.8165560002
++393542.0130840000 -2293463.0693460000
++378356.5729000000 -2295967.5356250000
++388416.9270220000 -2308489.8670180002
++405880.1832330000 -2317005.0523660001
++417838.7173770000 -2328525.5972480001
++402463.4591910000 -2342049.7151529999
++385000.2029800000 -2341047.9286409998
++375699.1208680000 -2327022.9174799998
++384240.9309710000 -2314500.5860870001
++368865.6727850000 -2321012.1984120002
++373421.3048400000 -2337541.6758510000
++363360.9507190000 -2353069.3667790000
++351402.4165740000 -2336539.8893400002
++340392.9724410000 -2324518.4512020000
++329573.3463100000 -2313999.6928309998
++335267.8863790000 -2329527.3837589999
++336216.9763910000 -2347058.6477100002
++337166.0664020000 -2362085.4453819999
++318374.0841750000 -2366593.4846839998
++303758.0979980000 -2362586.3386380002
++290314.2882280000 -2354697.2698599999
++292067.6911410000 -2339670.4721880001
++275702.5972900000 -2347684.7642799998
++277880.2580262116 -2321542.8592617917
++269420.4169677348 -2331176.2138948478
++260960.5759092579 -2323294.3782859840
++252500.7348507810 -2343436.8470641924
++254834.4841082919 -2357157.0794203631
++258918.5453089359 -2372336.9109633607
++266740.7601810000 -2359706.2024170002
++271754.1662252456 -2369125.7927523423
++266545.9376350000 -2379241.0393909998
++291483.2235030000 -2386253.5449720002
++275897.4198350000 -2396271.4100859999
++288755.7078610000 -2404786.5954339998
++276871.5325650000 -2415806.2470600000
++263818.4219930000 -2423820.5391520001
++259532.3259840000 -2445358.9491490000
++250570.4888750000 -2432836.6177559998
++248817.0859630000 -2452371.4547290001
++247258.5055960000 -2470403.6119360002
++229919.2990160000 -2474911.6512380000
++226022.8480990000 -2490439.3421660000
++239660.4263080000 -2499956.3140250002
++227776.2510110000 -2510975.9656509999
++220178.1717230000 -2523999.1902999999
++205761.3033310000 -2533015.2689029998
++210631.8669770000 -2560063.5047129998
++203228.6102350000 -2545036.7070410000
++194266.7731260000 -2558560.8249459998
++199624.3931360000 -2581101.0214539999
++185791.9923810000 -2568077.7968049999
++189493.6207520000 -2583104.5944770002
++186571.2825650000 -2601136.7516839998
++185207.5247440000 -2584106.3809890002
++169816.5436220000 -2595126.0326149999
++156568.6105040000 -2586610.8472679998
++134748.4853690000 -2581101.0214539999
++149749.8214000000 -2579598.3416869999
++136112.2431900000 -2592120.6730809999
++146437.8381200000 -2612657.2965660002
++130462.3893610000 -2620671.5886579999
++137281.1784650000 -2635197.4930739999
++125007.3580770000 -2621172.4819140001
++106888.8613130000 -2617666.2291230001
++91887.5252830000 -2609151.0437759999
++109031.9093180000 -2607648.3640089999
++92277.1703750000 -2603641.2179629998
++97537.3791130000 -2587111.7405229998
++88380.7194580000 -2573587.6226180000
++74743.1412490000 -2567076.0102940002
++61105.5630390000 -2577093.8754090001
++66950.2394150000 -2594124.2461040001
++57598.7572140000 -2581101.0214539999
++53117.8386600000 -2598131.3921500002
++41818.1310010000 -2586610.8472679998
++30810.6571600000 -2599133.1786610000
++44253.4128240000 -2608650.1505200001
++47662.8073760000 -2621047.2585999998
++
+Index: ../trunk-jpl/examples/Greenland/Jak_grounded.exp
+===================================================================
+--- ../trunk-jpl/examples/Greenland/Jak_grounded.exp	(revision 0)
++++ ../trunk-jpl/examples/Greenland/Jak_grounded.exp	(revision 18198)
+@@ -0,0 +1,19 @@
++## Name:Jak_grouded
++## Icon:0
++# Points Count Value
++13 1.000000
++# X pos Y pos
++-414397.6663804040 -2243466.6708395295
++-421486.9037621063 -2215731.3059818177
++-342860.8164377716 -2178965.8223332223
++-275835.2993744044 -2209281.2211311869
++-226210.6377024883 -2262816.9253914217
++-228144.0660793162 -2295067.3496445753
++-333193.6745536321 -2328607.7908678548
++-379595.9555975018 -2325382.7484425395
++-422775.8560133249 -2285392.2223686292
++-427287.1888925899 -2265396.9593316740
++-411819.7618779668 -2254431.8150856020
++-413108.7141291854 -2243466.6708395295
++-414397.6663804040 -2243466.6708395295
++
+Index: ../trunk-jpl/examples/Pig/06PIG_Application.pdf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+Index: ../trunk-jpl/examples/Pig/06PIG_Application.pdf
+===================================================================
+--- ../trunk-jpl/examples/Pig/06PIG_Application.pdf	(revision 18197)
++++ ../trunk-jpl/examples/Pig/06PIG_Application.pdf	(revision 18198)
+
+Property changes on: ../trunk-jpl/examples/Pig/06PIG_Application.pdf
+___________________________________________________________________
+Added: svn:mime-type
+## -0,0 +1 ##
++application/octet-stream
+\ No newline at end of property
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/Pig/Pig.par
+===================================================================
+--- ../trunk-jpl/examples/Pig/Pig.par	(revision 0)
++++ ../trunk-jpl/examples/Pig/Pig.par	(revision 18198)
+@@ -0,0 +1,134 @@
++% Parameters to change/Try
++friction_coefficient = 10; % default [10]
++Temp_change          =  0;  % default [0 K]
++
++%Name and hemisphere
++md.miscellaneous.name='PIG';
++md.mesh.hemisphere='s';
++
++% {{{ NetCdf Loading
++disp('   Loading SeaRISE data from NetCDF');
++ncdata='../Data/Antarctica_5km_withshelves_v0.75.nc';
++x1    = ncread(ncdata,'x1');
++y1    = ncread(ncdata,'y1');
++usrf  = ncread(ncdata,'usrf')';
++topg  = ncread(ncdata,'topg')';
++temp  = ncread(ncdata,'presartm')';
++smb   = ncread(ncdata,'presprcp')';
++gflux = ncread(ncdata,'bheatflx_fox')';
++
++disp('   Loading velocities data from NetCDF');
++nsidc_vel='../Data/Antarctica_ice_velocity.nc';
++
++xmin = ncreadatt(nsidc_vel,'/','xmin');
++xmin = strtrim(xmin);  %this is a string, and we need to recover the double value
++xmin = xmin(1:end-2);  %get rid of the unit
++xmin = str2num(xmin);  %convert to double
++
++ymax = ncreadatt(nsidc_vel,'/','ymax'); 
++ymax = strtrim(ymax);  
++ymax = ymax(1:end-2);  
++ymax = str2num(ymax); 
++
++nx = ncreadatt(nsidc_vel,'/','nx');
++ny = ncreadatt(nsidc_vel,'/','ny');
++
++spacing = ncreadatt(nsidc_vel,'/','spacing'); 
++spacing = strtrim(spacing);  
++spacing = spacing(1:end-2);  
++spacing = str2num(spacing); 
++
++velx = double(ncread(nsidc_vel,'vx'));
++vely = double(ncread(nsidc_vel,'vy'));
++
++x2=xmin+(0:1:nx)'*spacing; 
++x2=double(x2);
++
++y2=(ymax-ny*spacing)+(0:1:ny)'*spacing; 
++y2=double(y2);
++% }}}
++% {{{ Geometry
++disp('   Interpolating surface and ice base');
++md.geometry.base    = InterpFromGridToMesh(x1,y1,topg,md.mesh.x,md.mesh.y,0);
++md.geometry.surface = InterpFromGridToMesh(x1,y1,usrf,md.mesh.x,md.mesh.y,0);
++clear usrf, topg;
++
++disp('   Constructing thickness');
++md.geometry.thickness=md.geometry.surface-md.geometry.base;
++
++%ensure hydrostatic equilibrium on ice shelf: 
++di=md.materials.rho_ice/md.materials.rho_water;
++
++%Get the node numbers of floating nodes
++pos=find(md.mask.groundedice_levelset<0); 
++
++%apply a flotation criterion on the precedingly defined nodes and
++%redefine base and thickness accordingly
++md.geometry.thickness(pos)=1/(1-di)*md.geometry.surface(pos);
++md.geometry.base(pos)=md.geometry.surface(pos)-md.geometry.thickness(pos);
++md.geometry.hydrostatic_ratio=ones(md.mesh.numberofvertices,1);
++
++%Set min thickness to 1 meter
++pos0=find(md.geometry.thickness<=0);
++md.geometry.thickness(pos0)=1;
++md.geometry.surface=md.geometry.thickness+md.geometry.base;
++% }}} 
++% {{{ Initialization parameters
++disp('   Interpolating temperatures');
++md.initialization.temperature=InterpFromGridToMesh(x1,y1,temp,md.mesh.x,md.mesh.y,0)+273.15+Temp_change;
++clear temp;
++
++disp('   Set observed velocities')
++vx_obs=InterpFromGridToMesh(x2,y2,flipud(velx'),md.mesh.x,md.mesh.y,0);
++vy_obs=InterpFromGridToMesh(x2,y2,flipud(vely'),md.mesh.x,md.mesh.y,0);
++clear velx vely;
++
++vel_obs=sqrt(vx_obs.^2+vy_obs.^2);
++md.initialization.vx=vx_obs;
++md.initialization.vy=vy_obs;
++md.initialization.vz=zeros(md.mesh.numberofvertices,1);
++md.initialization.vel=vel_obs;
++
++disp('   Set Pressure');
++md.initialization.pressure=md.materials.rho_ice*md.constants.g*md.geometry.thickness;
++
++% }}}
++
++disp('   Construct ice rheological properties');
++md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
++md.materials.rheology_B=paterson(md.initialization.temperature);
++
++% {{{ Forcings
++disp('   Interpolating surface mass balance');
++md.surfaceforcings.mass_balance=InterpFromGridToMesh(x1,y1,smb,md.mesh.x,md.mesh.y,0);
++md.surfaceforcings.mass_balance=md.surfaceforcings.mass_balance*md.materials.rho_water/md.materials.rho_ice;
++clear smb;
++
++disp('   Set geothermal heat flux');
++md.basalforcings.geothermalflux=InterpFromGridToMesh(x1,y1,gflux,md.mesh.x,md.mesh.y,0);
++clear gflux;
++% }}}
++
++% {{{ Friction and inversion set up
++disp('   Construct basal friction parameters');
++md.friction.coefficient=friction_coefficient*ones(md.mesh.numberofvertices,1);
++md.friction.p=ones(md.mesh.numberofelements,1);
++md.friction.q=ones(md.mesh.numberofelements,1);
++
++%no friction applied on floating ice
++pos=find(md.mask.groundedice_levelset<0);
++md.friction.coefficient(pos)=0;
++
++md.inversion=m1qn3inversion();
++md.inversion.vx_obs=vx_obs;
++md.inversion.vy_obs=vy_obs;
++md.inversion.vel_obs=vel_obs;
++% }}}
++
++
++disp('   Set boundary conditions');
++md=SetMarineIceSheetBC(md);
++md.basalforcings.melting_rate = zeros(md.mesh.numberofvertices,1);
++md.thermal.spctemperature     = [md.initialization.temperature;1]; %impose observed temperature on surface
++md.masstransport.spcthickness    = NaN*ones(md.mesh.numberofvertices,1);
++
+Index: ../trunk-jpl/examples/Pig/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Pig/runme.m	(revision 0)
++++ ../trunk-jpl/examples/Pig/runme.m	(revision 18198)
+@@ -0,0 +1,230 @@
++%Which steps to be performed
++steps=[2] ;
++
++name_prefix='PIG.';
++%Run Steps
++org=organizer('repository','./Models','prefix',name_prefix,'steps',steps);
++
++% {{{ Mesh Generation #1
++if perform(org,'Mesh_generation'),
++
++	md.miscellaneous.name=strcat(name_prefix,'Mesh_generation');
++
++	%Mesh parameters
++	domain =['./DomainOutline.exp'];
++	hmax=40000;    % maximum element size of the final mesh
++	hmin=5000;     % minimum element size of the final mesh
++	hinit=10000;   % element size for the initial mesh
++	gradation=1.7; % maximum size ratio between two neighboring elements
++	err=8;         % maximum error between interpolated and control field
++
++	% Generate an initial uniform mesh (resolution = hinit m)
++	md=bamg(model,'domain',domain,'hmax',hinit,'MaxCornerAngle',1);
++
++	%ploting
++	plotmodel(md,'data','mesh')
++
++	% Load Velocities
++	% http://nsidc.org/data/nsidc-0484.html
++	nsidc_vel='../Data/Antarctica_ice_velocity.nc'; 	
++
++	% Get necessary data to build up the velocity grid
++	xmin = ncreadatt(nsidc_vel,'/','xmin');
++	xmin = strtrim(xmin);  % this is a string, and we need to recover the double value
++	xmin = xmin(1:end-2);  % get rid of the unit
++	xmin = str2num(xmin);  % convert to double
++	
++	ymax = ncreadatt(nsidc_vel,'/','ymax'); 
++	ymax = strtrim(ymax);  
++	ymax = ymax(1:end-2);  
++	ymax = str2num(ymax); 
++	
++	nx = ncreadatt(nsidc_vel,'/','nx');
++	ny = ncreadatt(nsidc_vel,'/','ny');
++	
++	spacing = ncreadatt(nsidc_vel,'/','spacing'); 
++	spacing = strtrim(spacing);
++	spacing = spacing(1:end-2);  
++	spacing = str2num(spacing); 
++	
++	% Get velocities (Note: You can use ncdisp('file') to see an ncdump)
++	vx = double(ncread(nsidc_vel,'vx'));
++	vy = double(ncread(nsidc_vel,'vy'));
++	
++	x=xmin+(0:1:nx)'*spacing; 
++	x=double(x);
++	y=(ymax-ny*spacing)+(0:1:ny)'*spacing; 
++	y=double(y);
++
++	% Interpolate velocities onto coarse mesh
++	vx_obs=InterpFromGridToMesh(x,y,flipud(vx'),md.mesh.x,md.mesh.y,0);
++	vy_obs=InterpFromGridToMesh(x,y,flipud(vy'),md.mesh.x,md.mesh.y,0);
++	vel_obs=sqrt(vx_obs.^2+vy_obs.^2);
++	clear vx vy x y;
++
++	% Adapt the mesh to minimize error in velocity interpolation
++	md=bamg(md,'hmax',hmax,'hmin',hmin,'gradation',gradation,'field',vel_obs,'err',err);
++	
++	%ploting
++	plotmodel(md,'data','mesh')
++
++	% Convert x,y coordinates (Polar stereo) to lat/lon
++	[md.mesh.lat,md.mesh.long]=xy2ll(md.mesh.x,md.mesh.y,-1,39,71);
++	
++	% Save model
++	savemodel(org,md);
++end
++% }}}
++
++% {{{ Masks #2
++if perform(org,'SetMask'), 
++	
++	md = loadmodel(org,'Mesh_generation');
++
++	% Load SeaRISe dataset for Antarctica  
++	% http://websrv.cs.umt.edu/isis/index.php/Present_Day_Antarctica
++	searise='../Data/Antarctica_5km_withshelves_v0.75.nc';
++	
++	%read thickness mask from SeaRISE
++	x1=double(ncread(searise,'x1'));
++	y1=double(ncread(searise,'y1'));
++	thkmask=double(ncread(searise,'thkmask'));
++	
++	%interpolate onto our mesh vertices
++	groundedice=double(InterpFromGridToMesh(x1,y1,thkmask',md.mesh.x,md.mesh.y,0));
++	groundedice(groundedice<=0)=-1;
++	clear thkmask;
++
++	%fill in the md.mask structure
++	md.mask.groundedice_levelset=groundedice; %ice is grounded for mask equal one
++	md.mask.ice_levelset=-1*ones(md.mesh.numberofvertices,1);%ice is present when negatvie
++
++	%ploting
++	plotmodel(md,'data',md.mask.groundedice_levelset,'title','grounded/floating','data',md.mask.ice_levelset,'title','ice/no-ice')
++	
++	% Save model
++	savemodel(org,md); 
++end
++% }}}
++
++% {{{ Parameterization #3
++if perform(org,'Parameterization') 
++
++	md = loadmodel(org,'SetMask');
++	md = parameterize(md,'./Pig.par');
++
++	% Use a MacAyeal flow model
++	md = setflowequation(md,'SSA','all');
++	
++	% Save model
++	savemodel(org,md); 
++end
++% }}}
++
++% {{{ Control Method #4
++if perform(org,'Control_drag') 
++
++	md = loadmodel(org,'Parameterization');
++
++	% Control general
++	md.inversion.iscontrol=1;
++	md.inversion.maxsteps=20;
++	md.inversion.maxiter=40;
++	md.inversion.dxmin=0.1;
++	md.inversion.gttol=1.0e-4;
++	md.verbose=verbose('solution',true,'control',true);
++
++	% Cost functions
++	md.inversion.cost_functions=[101 103 501];
++	md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,3);
++	md.inversion.cost_functions_coefficients(:,1)=1;
++	md.inversion.cost_functions_coefficients(:,2)=1;
++	md.inversion.cost_functions_coefficients(:,3)=8e-15;
++
++	% Controls
++	md.inversion.control_parameters={'FrictionCoefficient'};
++	md.inversion.min_parameters=1*ones(md.mesh.numberofvertices,1);
++	md.inversion.max_parameters=200*ones(md.mesh.numberofvertices,1);
++
++	% Additional parameters
++	md.stressbalance.restol=0.01;
++	md.stressbalance.reltol=0.1;
++	md.stressbalance.abstol=NaN;
++
++	% Solve
++	md.toolkits=toolkits;
++	md.cluster=generic('name',oshostname,'np',2);
++	md=solve(md,StressbalanceSolutionEnum);
++
++	% Update model friction fields accordingly
++	md.friction.coefficient=md.results.StressbalanceSolution.FrictionCoefficient;
++
++	plotmodel(md,'data',md.friction.coefficient)
++
++	% Save model
++	savemodel(org,md); 
++end
++% }}}
++
++% {{{ Plot #5
++if perform(org,'PlotSSA')
++
++	md = loadmodel(org,'Control_drag');
++
++	plotmodel(md,'nlines',2,'ncols',2,'unit#all','km','axis#all','equal',...
++		'xlim#all',[min(md.mesh.x) max(md.mesh.x)]/10^3,...
++		'ylim#all',[min(md.mesh.y) max(md.mesh.y)]/10^3,...
++		'FontSize#all',12,...
++		'data',md.initialization.vel,'title','Observed velocity',...
++		'data',md.results.StressbalanceSolution.Vel,'title','Modeled Velocity',...
++		'data',md.geometry.base,'title','Bed elevation',...
++		'data',md.results.StressbalanceSolution.FrictionCoefficient,'title','Friction Coefficient',...
++		'colorbar#all','on','colorbartitle#1-2','[m/yr]',...
++		'caxis#1-2',([1.5,4000]),...
++		'colorbartitle#3','[m]', 'log#1-2',10);
++end
++% }}}
++
++% {{{ HO #6
++if perform(org,'ModelHO')
++
++	% Load Model
++
++	% Disable inversion
++
++	%Extrude Mesh
++
++	% Set Flowequation
++
++	% Solve
++
++	% Save Model
++
++end
++% }}}
++
++% {{{ Plot #7
++if perform(org,'PlotHO')
++
++	mdHO = loadmodel(org,'ModelHO'); 
++	mdSSA = loadmodel(org,'Control_drag');
++
++	basal=find(mdHO.mesh.vertexonbase);
++	surf=find(mdHO.mesh.vertexonsurface);
++
++	plotmodel(md,'nlines',3,'ncols',2,'unit#all','km','axis#all','equal',...
++						'xlim#all',[min(md.mesh.x) max(md.mesh.x)]/10^3,...
++						'ylim#all',[min(md.mesh.y) max(md.mesh.y)]/10^3,...
++						'FontSize#all',12,...
++						'data',mdHO.initialization.vel,'title','Observed velocity',...
++						'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdHO.initialization.vel(surf)),'title','(HO-observed) velocities',...
++						'data',mdSSA.results.StressbalanceSolution.Vel,'title','Modeled SSA Velocity',...
++						'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdSSA.results.StressbalanceSolution.Vel),'title','(HO-SSA) velocities',...
++						'data',mdHO.results.StressbalanceSolution.Vel,'title','Modeled HO surface Velocities',...
++						'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdHO.results.StressbalanceSolution.Vel(basal)),'title','(HOsurf-HO base) velocities',...
++						'caxis#1',([1.5,4000]),'caxis#3',([1.5,4000]),'caxis#5',([1.5,4000]),...
++						'colorbar#all','on','view#all',2,...
++						'colorbartitle#all','[m/yr]',...
++						'layer#5',1, 'log#1', 10,'log#3', 10,'log#5', 10);
++end
++% }}}
+\ No newline at end of file
+
+Property changes on: ../trunk-jpl/examples/Pig/runme.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/Pig/DomainOutline.bkp
+===================================================================
+--- ../trunk-jpl/examples/Pig/DomainOutline.bkp	(revision 0)
++++ ../trunk-jpl/examples/Pig/DomainOutline.bkp	(revision 18198)
+@@ -0,0 +1,120 @@
++## Name:
++## Icon:0
++# Points Count Value
++114 25000.000000
++# X pos Y pos
++-1712113.0179281300 -349656.0205056490
++-1711509.1917759699 -349354.1074295690
++-1709240.6586108401 -349354.1074295690
++-1707080.1508345299 -348922.0058743060
++-1705459.7700022999 -347193.5996532570
++-1703083.2114483600 -345249.1426545770
++-1701138.7544496800 -344168.8887664210
++-1698438.1197292900 -343952.8379887900
++-1698006.0181740201 -341900.3556012940
++-1693793.0280102200 -340279.9747690600
++-1691092.3932898301 -339631.8224361670
++-1688391.7585694401 -339415.7716585360
++-1686447.3015707601 -340063.9239914290
++-1683530.6160727399 -341036.1524907690
++-1682558.3875734000 -343304.6856558960
++-1682134.7209454600 -344182.1487658350
++-1682126.2860181299 -345681.2442098390
++-1681072.0444963200 -345932.4393879640
++-1680634.4718407800 -346682.5639403050
++-1680571.9614614199 -348557.8753211580
++-1677446.4424933300 -348370.3441830730
++-1675508.6207331200 -349495.5310115840
++-1676616.9911885399 -353567.0975933760
++-1672991.8601872099 -353799.6175753630
++-1668839.1631938200 -353999.1991486380
++-1667132.2298986400 -355121.4651541420
++-1666069.5534494901 -357496.8595698890
++-1662944.0344814099 -358309.4945015920
++-1660756.1712037399 -358747.0671571240
++-1657922.9836098100 -361682.8074238540
++-1656579.2228470000 -364003.8487410000
++-1653004.8841628900 -364748.0635758530
++-1653442.4568184200 -361622.5446077650
++-1651129.5727820301 -355684.0585683980
++-1648929.2928810001 -350845.9692010000
++-1646260.7698359799 -347802.2804785470
++-1644571.8968503401 -341785.6704672340
++-1643503.3064999001 -340869.0986596620
++-1643190.7546030900 -336680.9032424240
++-1642690.6715682000 -335243.1645171040
++-1641913.0916588283 -332341.0814454452
++-1640683.9739821283 -330436.6112348017
++-1637816.0327364956 -328532.1410241582
++-1635241.2508976001 -328652.8685499910
++-1631765.4107996500 -327017.1790921330
++-1625934.5618617306 -322342.6128395668
++-1620608.3852626982 -320438.1426289233
++-1616101.6204481323 -320438.1426289233
++-1611594.8556335662 -320914.2601815842
++-1607907.5026034669 -321866.4952869060
++-1602991.0318966676 -324723.2006028712
++-1599713.3847588014 -327579.9059188365
++-1593977.5022675355 -328532.1410241582
++-1590699.8551296694 -334721.6692087495
++-1589259.8391499999 -338300.0840570000
++-1588627.0898328500 -343572.9950327750
++-1588056.6000060199 -345432.3563530700
++-1586993.9235568701 -347432.6884926460
++-1589259.8391499999 -349315.9832070000
++-1585493.6744521901 -352996.1122558430
++-1585118.6121760199 -354496.3613605250
++-1585861.9157163899 -356240.3342513760
++-1586368.8197632500 -358747.0671571240
++-1587889.0972700799 -360996.6006787950
++-1586681.3716600600 -363935.4286441500
++-1585806.2263489999 -365748.2296456410
++-1586743.8820394201 -368373.6655788350
++-1586056.2678664399 -370123.9562009640
++-1585493.6744521901 -371124.1222707520
++-1586243.7990045301 -373562.0270658610
++-1428620.2472997301 -364425.2597226670
++-1414257.6683934701 -327460.5482541260
++-1412220.4351378100 -325972.8942023180
++-1404515.9240538401 -296165.1737279960
++-1387984.9332285200 -267002.0106682320
++-1375329.9306695000 -287124.5773036880
++-1374139.7661228001 -286331.1342725540
++-1347030.4625590600 -322432.7921891520
++-1351262.1587251101 -326267.7668396330
++-1381809.7154237600 -297174.8556980530
++-1381677.4749185799 -295852.4506461620
++-1382481.1222932001 -294804.4361498400
++-1398663.5713381099 -316073.2308695170
++-1409694.4697897099 -363328.2128408530
++-1202495.3746585899 -351317.7619567180
++-1191463.4809399999 -350233.9748030000
++-1232161.1083569999 -292094.5070650000
++-1231243.1167609999 -288422.5406810000
++-1360067.9373810000 -107884.1934940000
++-1423274.3497420000 -81217.9259650000
++-1402446.7987670000 -45916.9921070000
++-1478343.8065599999 60338.8188030000
++-1513291.7310790000 4210.3339700000
++-1523175.9925589999 11976.5394190000
++-1503760.4789370000 36334.1837800000
++-1528509.5619775900 63667.6809196406
++-1623055.4918765700 62841.1506965373
++-1648011.3012850001 32874.5178730000
++-1638219.3909290000 20634.6299280000
++-1650153.2816760000 31038.5346810000
++-1725734.5897359999 -61372.6193030000
++-1719614.6457630000 -69022.5492690000
++-1759088.2843859999 -114004.1374660000
++-1755416.3180020000 -117064.1094530000
++-1761230.2647760001 -126856.0198080000
++-1758170.2927900001 -130527.9861920000
++-1762148.2563720001 -135423.9413700000
++-1764902.2311590000 -131445.9777880000
++-1769798.1863370000 -134199.9525750000
++-1775000.1387139999 -131445.9777880000
++-1794277.9622269999 -153477.7760890000
++-1712576.7101950001 -225081.1205660000
++-1729939.5891459100 -335652.4567604720
++-1712113.0179281300 -349656.0205056490
++
+Index: ../trunk-jpl/examples/Pig/DomainOutline.exp
+===================================================================
+--- ../trunk-jpl/examples/Pig/DomainOutline.exp	(revision 0)
++++ ../trunk-jpl/examples/Pig/DomainOutline.exp	(revision 18198)
+@@ -0,0 +1,101 @@
++## Name:
++## Icon:0
++# Points Count Value
++95 25000.000000
++# X pos Y pos
++-1712113.0179281300 -349656.0205056490
++-1711509.1917759699 -349354.1074295690
++-1709240.6586108401 -349354.1074295690
++-1707080.1508345299 -348922.0058743060
++-1705459.7700022999 -347193.5996532570
++-1703083.2114483600 -345249.1426545770
++-1701138.7544496800 -344168.8887664210
++-1698438.1197292900 -343952.8379887900
++-1698006.0181740201 -341900.3556012940
++-1693793.0280102200 -340279.9747690600
++-1691092.3932898301 -339631.8224361670
++-1688391.7585694401 -339415.7716585360
++-1686447.3015707601 -340063.9239914290
++-1683530.6160727399 -341036.1524907690
++-1682558.3875734000 -343304.6856558960
++-1682134.7209454600 -344182.1487658350
++-1682126.2860181299 -345681.2442098390
++-1681072.0444963200 -345932.4393879640
++-1680634.4718407800 -346682.5639403050
++-1680571.9614614199 -348557.8753211580
++-1677446.4424933300 -348370.3441830730
++-1675508.6207331200 -349495.5310115840
++-1676616.9911885399 -353567.0975933760
++-1672991.8601872099 -353799.6175753630
++-1668839.1631938200 -353999.1991486380
++-1667132.2298986400 -355121.4651541420
++-1666069.5534494901 -357496.8595698890
++-1662944.0344814099 -358309.4945015920
++-1660756.1712037399 -358747.0671571240
++-1657922.9836098100 -361682.8074238540
++-1656579.2228470000 -364003.8487410000
++-1653004.8841628900 -364748.0635758530
++-1653442.4568184200 -361622.5446077650
++-1651129.5727820301 -355684.0585683980
++-1648929.2928810001 -350845.9692010000
++-1646260.7698359799 -347802.2804785470
++-1644571.8968503401 -341785.6704672340
++-1643503.3064999001 -340869.0986596620
++-1643190.7546030900 -336680.9032424240
++-1642690.6715682000 -335243.1645171040
++-1641913.0916588283 -332341.0814454452
++-1640683.9739821283 -330436.6112348017
++-1637816.0327364956 -328532.1410241582
++-1635241.2508976001 -328652.8685499910
++-1631765.4107996500 -327017.1790921330
++-1625934.5618617306 -322342.6128395668
++-1620608.3852626982 -320438.1426289233
++-1616101.6204481323 -320438.1426289233
++-1611594.8556335662 -320914.2601815842
++-1607907.5026034669 -321866.4952869060
++-1602991.0318966676 -324723.2006028712
++-1599713.3847588014 -327579.9059188365
++-1593977.5022675355 -328532.1410241582
++-1590699.8551296694 -334721.6692087495
++-1589259.8391499999 -338300.0840570000
++-1588627.0898328500 -343572.9950327750
++-1588056.6000060199 -345432.3563530700
++-1586993.9235568701 -347432.6884926460
++-1589259.8391499999 -349315.9832070000
++-1585493.6744521901 -352996.1122558430
++-1585118.6121760199 -354496.3613605250
++-1585861.9157163899 -356240.3342513760
++-1586368.8197632500 -358747.0671571240
++-1587889.0972700799 -360996.6006787950
++-1586681.3716600600 -363935.4286441500
++-1585806.2263489999 -365748.2296456410
++-1586743.8820394201 -368373.6655788350
++-1586056.2678664399 -370123.9562009640
++-1585493.6744521901 -371124.1222707520
++-1586243.7990045301 -373562.0270658610
++-1414257.6683934701 -327460.5482541260
++-1412220.4351378100 -325972.8942023180
++-1404515.9240538401 -296165.1737279960
++-1387984.9332285200 -267002.0106682320
++-1360067.9373810000 -107884.1934940000
++-1423274.3497420000 -81217.9259650000
++-1402446.7987670000 -45916.9921070000
++-1478343.8065599999 60338.8188030000
++-1503760.4789370000 36334.1837800000
++-1528509.5619775900 63667.6809196406
++-1623055.4918765700 62841.1506965373
++-1725734.5897359999 -61372.6193030000
++-1719614.6457630000 -69022.5492690000
++-1759088.2843859999 -114004.1374660000
++-1755416.3180020000 -117064.1094530000
++-1761230.2647760001 -126856.0198080000
++-1758170.2927900001 -130527.9861920000
++-1762148.2563720001 -135423.9413700000
++-1764902.2311590000 -131445.9777880000
++-1769798.1863370000 -134199.9525750000
++-1775000.1387139999 -131445.9777880000
++-1794277.9622269999 -153477.7760890000
++-1712576.7101950001 -225081.1205660000
++-1729939.5891459100 -335652.4567604720
++-1712113.0179281300 -349656.0205056490
++
+Index: ../trunk-jpl/examples/Pig/CheatSheet.m
+===================================================================
+--- ../trunk-jpl/examples/Pig/CheatSheet.m	(revision 0)
++++ ../trunk-jpl/examples/Pig/CheatSheet.m	(revision 18198)
+@@ -0,0 +1,18 @@
++if perform(org,'ModelHO')
++  % Load Model
++  md = loadmodel(org,'Control_drag');
++  md.inversion.iscontrol=0;
++
++  disp('   Extruding mesh')
++  number_of_layers=3;
++  md=extrude(md,number_of_layers,0.9);
++
++  disp('   Using HO Ice Flow Model')
++  md=setflowequation(md, 'HO', 'all');
++
++  % Solve
++  md=solve(md,StressbalanceSolutionEnum);
++
++  % Save Model
++  savemodel(org,md);
++end
+Index: ../trunk-jpl/examples/Pig/PigRegion.m
+===================================================================
+--- ../trunk-jpl/examples/Pig/PigRegion.m	(revision 0)
++++ ../trunk-jpl/examples/Pig/PigRegion.m	(revision 18198)
+@@ -0,0 +1,54 @@
++% {{{ Getting the velocity in PIG vicinity for the ExpDraw
++
++% Load Velocities
++% http://nsidc.org/data/nsidc-0484.html
++nsidc_vel='../Data/Antarctica_ice_velocity.nc'; 	
++
++% Get necessary data to build up the velocity grid
++xmin = ncreadatt(nsidc_vel,'/','xmin');
++xmin = strtrim(xmin);  % this is a string, and we need to recover the double value
++xmin = xmin(1:end-2);  % get rid of the unit
++xmin = str2num(xmin);  % convert to double
++
++ymax = ncreadatt(nsidc_vel,'/','ymax'); 
++ymax = strtrim(ymax);  
++ymax = ymax(1:end-2);  
++ymax = str2num(ymax); 
++	
++nx = ncreadatt(nsidc_vel,'/','nx');
++ny = ncreadatt(nsidc_vel,'/','ny');
++
++spacing = ncreadatt(nsidc_vel,'/','spacing'); 
++spacing = strtrim(spacing);
++spacing = spacing(1:end-2);  
++spacing = str2num(spacing); 
++
++
++x=xmin+(0:1:nx-1)'*spacing; 
++x=double(x);
++y=(ymax)-(0:1:ny-1)'*spacing; 
++y=double(y);
++
++posx=find(x<=-12.0e5);
++id1x=find(x>=-18.0e5,1);
++id2x=posx(end);
++
++posy=find(y>=-4.0e5);
++id1y=find(y<=1.0e5,1);
++id2y=posy(end);
++
++%Get velocity subset
++vx = double(ncread(nsidc_vel,'vx'));
++vx_obs = vx(id1x:id2x,id1y:id2y);
++vx_obs = flipud(vx_obs');
++
++vy = double(ncread(nsidc_vel,'vy'));
++vy_obs = vy (id1x:id2x,id1y:id2y);
++vy_obs = flipud(vy_obs');
++
++xred=x(id1x:id2x);
++yred=y(id1y:id2y);
++vel_obs=sqrt(vx_obs.^2.+vy_obs.^2.);
++imagesc(xred,yred,vel_obs)
++
++%}}}
+\ No newline at end of file
+
+Property changes on: ../trunk-jpl/examples/Pig/PigRegion.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/ISMIP/CheatyRunme.m
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/CheatyRunme.m	(revision 0)
++++ ../trunk-jpl/examples/ISMIP/CheatyRunme.m	(revision 18198)
+@@ -0,0 +1,232 @@
++%wich steps to perform steps are from 1 to 8 
++%step 7 is specific to ISMIPA
++%step 8 is specific to ISMIPF
++
++steps=[1 2 3 4 5 6 8];
++
++% parameter file to be used, choose between CheatyIsmipA.par or CheatyIsmipF.par
++ParamFile='CheatyIsmipF.par'
++
++name_prefix='ISMIP';
++%Run Steps
++org=organizer('repository','./Models','prefix',name_prefix,'steps',steps);
++
++% {{{ Mesh Generation #1
++if perform(org,'Mesh_Generation')
++
++	%initialize md as a new model #help model
++	%->
++	md=model();
++	% generate a squaremesh #help squaremesh
++	% Side is 80 km long with 20 points
++	%->
++	if(ParamFile=='CheatyIsmipA.par'),
++		md=squaremesh(md,80000,80000,20,20);
++	elseif(ParamFile=='CheatyIsmipF.par'),
++		md=squaremesh(md,100000,100000,30,30);
++  end
++	% plot the given mesh #plotdoc
++	%->
++	plotmodel(md,'data','mesh')
++	% save the given model
++	%->
++	savemodel(org,md);
++end
++% }}}
++
++% {{{ Masks #2
++if perform(org,'SetMask'), 
++
++	% load the preceding step #help loadmodel
++	% path is given by the organizer with the name of the given step
++	%->
++	md=loadmodel(org,'Mesh_Generation');
++	% set the mask #help setmask
++	% all MISMIP nodes are grounded
++	%->
++	md=setmask(md,'','');
++	% plot the given mask #md.mask to locate the field
++	%->
++	plotmodel(md,'data',md.mask.groundedice_levelset);
++	% save the given model
++	%->
++	savemodel(org,md);
++end
++% }}}
++
++% {{{ Parameterization #3
++if perform(org,'Parameterization') 
++
++	% load the preceding step #help loadmodel
++	% path is given by the organizer with the name of the given step
++	%->
++	md=loadmodel(org,'SetMask');
++	% parametrize the model # help parameterize
++	% you will need to fil-up the parameter file defined by the
++  % ParamFile variable
++	%->
++	md=parameterize(md,ParamFile);
++	% save the given model
++	%->
++	savemodel(org,md);
++end
++% }}}
++
++% {{{ Extrusion #4
++if perform(org,'Extrusion')
++	
++	% load the preceding step #help loadmodel
++	% path is given by the organizer with the name of the given step
++	%->
++	md=loadmodel(org,'Parameterization');
++	% vertically extrude the preceding mesh #help extrude
++	% only 5 layers exponent 1
++	%->
++	md=extrude(md,9,1);
++	% plot the 3D geometry #plotdoc
++	%->
++	plotmodel(md,'data',md.geometry.base)
++	% save the given model
++	%->
++	savemodel(org,md);
++end
++% }}}
++
++% {{{ Set the flow computing method #5
++
++if perform(org,'SetFlow')
++
++	% load the preceding step #help loadmodel
++	% path is given by the organizer with the name of the given step
++	%->
++	md=loadmodel(org,'Extrusion');
++	% set the approximation for the flow computation #help setflowequation
++	% We will be using the Higher Order Model (HO)
++	%->
++	md=setflowequation(md,'HO','all');
++	% save the given model
++	%->
++	savemodel(org,md);
++end
++% }}}
++
++% {{{ Set Boundary Conditions #6
++if perform(org,'BoundaryCondition')
++
++	% load the preceding step #help loadmodel
++	% path is given by the organizer with the name of the given step
++	%->
++	md=loadmodel(org,'SetFlow');
++	% dirichlet boundary condition are known as SPCs
++	% ice frozen to the base, no velocity	#md.stressbalance
++	% SPCs are initialized at NaN one value per vertex
++	%->
++	md.stressbalance.spcvx=NaN*ones(md.mesh.numberofvertices,1);
++	%->
++	md.stressbalance.spcvy=NaN*ones(md.mesh.numberofvertices,1);
++	%->
++	md.stressbalance.spcvz=NaN*ones(md.mesh.numberofvertices,1);
++	% extract the nodenumbers at the base #md.mesh.vertexonbase
++	%->
++	basalnodes=find(md.mesh.vertexonbase);
++  % set the sliding to zero on the bed
++	%->
++	md.stressbalance.spcvx(basalnodes)=0.0;
++	%->
++	md.stressbalance.spcvy(basalnodes)=0.0;
++	% periodic boundaries have to be fixed on the sides
++	% create tabs with the side of the domain
++	% for x
++	% create maxX #help find
++	%->
++	maxX=find(md.mesh.x==max(md.mesh.x));
++	% create minX
++	%->
++	minX=find(md.mesh.x==min(md.mesh.x));
++	% for y, max X and minX should be excluded
++	% create maxY
++	%->
++	maxY=find(md.mesh.y==max(md.mesh.y) & md.mesh.x~=max(md.mesh.x) & md.mesh.x~=min(md.mesh.x));
++	% create minY
++	%->
++	minY=find(md.mesh.y==min(md.mesh.y) & md.mesh.x~=max(md.mesh.x) & md.mesh.x~=min(md.mesh.x));
++	% set the node that should be paired together
++	% #md.stressbalance.vertex_pairing
++	%->
++	md.stressbalance.vertex_pairing=[minX,maxX;minY,maxY];
++	if (ParamFile=='CheatyIsmipF.par')
++		% if we are dealing with IsmipF the solution is in
++		% masstransport
++		md.masstransport.vertex_pairing=md.stressbalance.vertex_pairing;
++  end
++	% save the given model
++	%->
++	savemodel(org,md);
++end
++% }}}
++
++% {{{ Solving #7
++if perform(org,'SolvingISMIPA')
++	% load the preceding step #help loadmodel
++	% path is given by the organizer with the name of the given step
++	%->
++	md=loadmodel(org,'BoundaryCondition');
++	% Set cluster #md.cluster
++	% generic parameters #help generic
++	% set only the name and number of process
++	%->
++	md.cluster=generic('name',oshostname(),'np',2);
++	% Set which control message you want to see #help verbose
++	%->
++	md.verbose=verbose('convergence',true);
++	% Solve #help solve
++	% we are solving a StressBalanc
++	%->
++	md=solve(md,StressbalanceSolutionEnum());
++	% save the given model
++	%->
++	savemodel(org,md);
++	% plot the surface velocities #plotdoc
++	%->
++	plotmodel(md,'data',md.results.StressbalanceSolution.Vel)
++end
++% }}}
++
++% {{{ Solving #8
++if perform(org,'SolvingISMIPF')
++	% load the preceding step #help loadmodel
++	% path is given by the organizer with the name of the given step
++	%->
++	md=loadmodel(org,'BoundaryCondition');
++	% Set cluster #md.cluster
++	% generic parameters #help generic
++	% set only the name and number of process
++	%->
++	md.cluster=generic('name',oshostname(),'np',2);
++	% Set which control message you want to see #help verbose
++	%->
++	md.verbose=verbose('convergence',true);
++	% set the transient model to ignore the thermal model
++	% #md.transient 
++	%->
++	md.transient.isthermal=0;
++	% define the timestepping scheme
++	% everything here should be provided in years #md.timestepping
++	% give the length of the time_step (4 years)
++	%->
++	md.timestepping.time_step=4;
++	% give final_time (20*4 years time_steps)
++	%->
++	md.timestepping.final_time=4*20;
++	% Solve #help solve
++	% we are solving a TransientSolution
++	%->
++	md=solve(md,TransientSolutionEnum);
++	% save the given model
++	%->
++	savemodel(org,md);
++	% plot the surface velocities #plotdoc
++	%->
++	plotmodel(md,'data',md.results.TransientSolution(20).Vel)
++end
++% }}}
+Index: ../trunk-jpl/examples/ISMIP/CheatyIsmipA.par
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/CheatyIsmipA.par	(revision 0)
++++ ../trunk-jpl/examples/ISMIP/CheatyIsmipA.par	(revision 18198)
+@@ -0,0 +1,52 @@
++%Parameterization for ISMIP A experiment
++
++%Set the Simulation generic name #md.miscellaneous
++%->
++
++%Geometry
++disp('   Constructing Geometry');
++
++%Define the geometry of the simulation #md.geometry
++%surface is [-x*tan(0.5*pi/180)] #md.mesh
++%->
++md.geometry.surface=-md.mesh.x*tan(0.5*pi/180.);
++%base is [surface-1000+500*sin(x*2*pi/L).*sin(y*2*pi/L)]
++%L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)
++%->
++L=max(md.mesh.x)-min(md.mesh.x);
++md.geometry.base=md.geometry.surface-1000.0+500.0*sin(md.mesh.x*2.0*pi/L).*sin(md.mesh.y*2.0*pi/L);
++%thickness is the difference between surface and base #md.geometry
++%->
++md.geometry.thickness=md.geometry.surface-md.geometry.base;
++%plot the geometry to check it out
++%->
++plotmodel(md,'data',md.geometry.thickness);
++
++disp('   Defining friction parameters');
++
++%These parameters will not be used but need to be fixed #md.friction
++%one friciton coefficient per node (md.mesh.numberofvertices,1)
++%->
++md.friction.coefficient=200.0*ones(md.mesh.numberofvertices,1);
++%one friciton exponent (p,q) per element
++%->
++md.friction.p=ones(md.mesh.numberofelements,1);
++%->
++md.friction.q=ones(md.mesh.numberofelements,1);
++
++disp('   Construct ice rheological properties');
++
++%The rheology parameters sit in the material section #md.materials
++%B has one value per vertex
++%->
++md.materials.rheology_B=6.8067e7*ones(md.mesh.numberofvertices,1);
++%n has one value per element
++%->
++md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
++
++disp('   Set boundary conditions');
++
++%Set the default boundary conditions for an ice-sheet 
++% #help SetIceSheetBC
++%->
++md=SetIceSheetBC(md);
+\ No newline at end of file
+Index: ../trunk-jpl/examples/ISMIP/runme.m
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/runme.m	(revision 0)
++++ ../trunk-jpl/examples/ISMIP/runme.m	(revision 18198)
+@@ -0,0 +1,226 @@
++%wich steps to perform steps are from 1 to 8 
++%step 7 is specific to ISMIPA
++%step 8 is specific to ISMIPF
++
++steps=[1];
++
++% parameter file to be used, choose between IsmipA.par or IsmipF.par
++ParamFile='IsmipA.par'
++
++name_prefix='ISMIP';
++%Run Steps
++org=organizer('repository','./Models','prefix',name_prefix,'steps',steps);
++
++% {{{ Mesh Generation #1
++if perform(org,'Mesh_Generation')
++
++	%initialize md as a new model #help model
++	%->
++
++	% generate a squaremesh #help squaremesh
++	% Side is 80 km long with 20 points
++	%->
++
++	% plot the given mesh #plotdoc
++	%->
++
++	% save the given model
++	%->
++
++end
++% }}}
++
++% {{{ Masks #2
++if perform(org,'SetMask'), 
++
++	% load the preceding step #help loadmodel
++	% path is given by the organizer with the name of the given step
++	%->
++
++	% set the mask #help setmask
++	% all MISMIP nodes are grounded
++	%->
++
++	% plot the given mask #md.mask to locate the field
++	%->
++
++	% save the given model
++	%->
++
++end
++% }}}
++
++% {{{ Parameterization #3
++if perform(org,'Parameterization') 
++
++	% load the preceding step #help loadmodel
++	% path is given by the organizer with the name of the given step
++	%->
++
++	% parametrize the model # help parameterize
++	% you will need to fil-up the parameter file (given by the
++  % ParamFile variable)
++	%->
++
++	% save the given model
++	%->
++
++end
++% }}}
++
++% {{{ Extrusion #4
++if perform(org,'Extrusion')
++	
++	% load the preceding step #help loadmodel
++	% path is given by the organizer with the name of the given step
++	%->
++
++	% vertically extrude the preceding mesh #help extrude
++	% only 5 layers exponent 1
++	%->
++
++	% plot the 3D geometry #plotdoc
++	%->
++
++	% save the given model
++	%->
++
++end
++% }}}
++
++% {{{ Set the flow computing method #5
++
++if perform(org,'SetFlow')
++
++	% load the preceding step #help loadmodel
++	% path is given by the organizer with the name of the given step
++	%->
++
++	% set the approximation for the flow computation #help setflowequation
++	% We will be using the Higher Order Model (HO)
++	%->
++
++	% save the given model
++	%->
++
++end
++% }}}
++
++% {{{ Set Boundary Conditions #6
++if perform(org,'BoundaryCondition')
++
++	% load the preceding step #help loadmodel
++	% path is given by the organizer with the name of the given step
++	%->
++
++	% dirichlet boundary condition are known as SPCs
++	% ice frozen to the base, no velocity	#md.stressbalance
++	% SPCs are initialized at NaN one value per vertex
++	%->
++
++	%->
++
++	%->
++
++	% extract the nodenumbers at the base #md.mesh.vertexonbase
++	%->
++
++  % set the sliding to zero on the bed (Vx and Vy)
++	%->
++
++	%->
++
++	% periodic boundaries have to be fixed on the sides
++	% create tabs with the side of the domain
++	% for x
++	% create maxX #help find
++	%->
++
++	% create minX
++	%->
++
++	% for y, max X and minX should be excluded
++	% create maxY
++	%->
++
++	% create minY
++	%->
++
++	% set the node that should be paired together
++	% #md.stressbalance.vertex_pairing
++	%->
++
++	if (ParamFile=='IsmipF.par')
++		% if we are dealing with IsmipF the solution is in masstransport
++		md.masstransport.vertex_pairing=md.stressbalance.vertex_pairing;
++  end
++	% save the given model
++	%->
++
++end
++% }}}
++
++% {{{ Solving #7
++if perform(org,'SolvingISMIPA')
++	% load the preceding step #help loadmodel
++	% path is given by the organizer with the name of the given step
++	%->
++
++	% Set cluster #md.cluster
++	% generic parameters #help generic
++	% set only the name and number of process
++	%->
++
++	% Set which control message you want to see #help verbose
++	%->
++
++	% Solve #help solve
++	% we are solving a StressBalanc
++	%->
++
++	% save the given model
++	%->
++
++	% plot the surface velocities #plotdoc
++	%->
++end
++% }}}
++
++% {{{ Solving #8
++if perform(org,'SolvingISMIPF')
++	% load the preceding step #help loadmodel
++	% path is given by the organizer with the name of the given step
++	%->
++
++	% Set cluster #md.cluster
++	% generic parameters #help generic
++	% set only the name and number of process
++	%->
++
++	% Set which control message you want to see #help verbose
++	%->
++
++	% set the transient model to ignore the thermal model
++	% #md.transient 
++	%->
++
++	% define the timestepping scheme
++	% everything here should be provided in years #md.timestepping
++	% give the length of the time_step (4 years)
++	%->
++
++	% give final_time (20*4 years time_steps)
++	%->
++
++	% Solve #help solve
++	% we are solving a TransientSolution
++	%->
++
++	% save the given model
++	%->
++
++	% plot the surface velocities #plotdoc
++	%->
++
++end
++% }}}
+Index: ../trunk-jpl/examples/ISMIP/IsmipA.par
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/IsmipA.par	(revision 0)
++++ ../trunk-jpl/examples/ISMIP/IsmipA.par	(revision 18198)
+@@ -0,0 +1,52 @@
++%Parameterization for ISMIP A experiment
++
++%Set the Simulation generic name #md.miscellaneous
++%->
++
++%Geometry
++disp('   Constructing Geometry');
++
++%Define the geometry of the simulation #md.geometry
++%surface is [-x*tan(0.5*pi/180)] #md.mesh
++%->
++
++%base is [surface-1000+500*sin(x*2*pi/L).*sin(y*2*pi/L)]
++%L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)
++%->
++
++%->
++
++%thickness is the difference between surface and base #md.geometry
++%->
++
++%plot the geometry to check it out
++%->
++
++
++disp('   Defining friction parameters');
++
++%These parameters will not be used but need to be fixed #md.friction
++%one friciton coefficient per node (md.mesh.numberofvertices,1)
++%->
++
++%one friciton exponent (p,q) per element
++%->
++
++%->
++
++
++disp('   Construct ice rheological properties');
++
++%The rheology parameters sit in the material section #md.materials
++%B has one value per vertex
++%->
++
++%n has one value per element
++%->
++
++
++disp('   Set boundary conditions');
++
++%Set the default boundary conditions for an ice-sheet 
++% #help SetIceSheetBC
++%->
+Index: ../trunk-jpl/examples/ISMIP/CheatyIsmipF.par
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/CheatyIsmipF.par	(revision 0)
++++ ../trunk-jpl/examples/ISMIP/CheatyIsmipF.par	(revision 18198)
+@@ -0,0 +1,66 @@
++%Parameterization for ISMIP F experiment
++
++%Set the Simulation generic name #md.miscellaneous
++%->
++
++%Geometry
++disp('   Constructing Geometry');
++
++%Define the geometry of the simulation #md.geometry
++%surface is [-x*tan(3.0*pi/180)] #md.mesh
++%->
++md.geometry.surface=md.mesh.x*tan(3.0*pi/180.0);
++%base is [surface-1000+100*exp(-((x-L/2).^2+(y-L/2).^2)/(10000.^2))]
++%L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)
++%->
++L=max(md.mesh.x)-min(md.mesh.x);
++%->
++md.geometry.base=md.geometry.surface-1000.0+100.0*exp(-((md.mesh.x-L/2.0).^2.0+(md.mesh.y-L/2.0).^2.0)/(10000.^2.0));
++%thickness is the difference between surface and base #md.geometry
++%->
++md.geometry.thickness=md.geometry.surface-md.geometry.base;
++%plot the geometry to check it out
++%->
++plotmodel(md,'data',md.geometry.thickness);
++
++disp('   Defining friction parameters');
++
++%These parameters will not be used but need to be fixed #md.friction
++%one friciton coefficient per node (md.mesh.numberofvertices,1)
++%conversion form year to seconds with #md.constants.yts
++%->
++md.friction.coefficient=sqrt(md.constants.yts/(1000*2.140373*10^-7))*ones(md.mesh.numberofvertices,1);
++%one friciton exponent (p,q) per element
++%->
++md.friction.p=ones(md.mesh.numberofelements,1);
++%->
++md.friction.q=zeros(md.mesh.numberofelements,1);
++
++disp('   Construct ice rheological properties');
++
++%The rheology parameters sit in the material section #md.materials
++%B has one value per vertex
++%->
++md.materials.rheology_B=(1/(2.140373*10^-7/md.constants.yts))*ones(md.mesh.numberofvertices,1);
++%n has one value per element
++%->
++md.materials.rheology_n=1*ones(md.mesh.numberofelements,1);
++
++disp('   Set boundary conditions');
++
++%Set the default boundary conditions for an ice-sheet 
++% #help SetIceSheetBC
++%->
++md=SetIceSheetBC(md);
++
++disp('   Initializing velocity and pressure');
++
++%initialize the velocity and pressurefields of #md.initialization
++%->
++md.initialization.vx=zeros(md.mesh.numberofvertices,1);
++%->
++md.initialization.vy=zeros(md.mesh.numberofvertices,1);
++%->
++md.initialization.vz=zeros(md.mesh.numberofvertices,1);
++%->
++md.initialization.pressure=zeros(md.mesh.numberofvertices,1);
+\ No newline at end of file
+Index: ../trunk-jpl/examples/ISMIP/IsmipF.par
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/IsmipF.par	(revision 0)
++++ ../trunk-jpl/examples/ISMIP/IsmipF.par	(revision 18198)
+@@ -0,0 +1,64 @@
++%Parameterization for ISMIP F experiment
++
++%Set the Simulation generic name #md.miscellaneous
++%->
++
++%Geometry
++disp('   Constructing Geometry');
++
++%Define the geometry of the simulation #md.geometry
++%surface is [-x*tan(3.0*pi/180)] #md.mesh
++%->
++
++%base is [surface-1000+100*exp(-((x-L/2).^2+(y-L/2).^2)/(0.1*L^2))]
++%L is the size of the side of the square #max(md.mesh.x)-min(md.mesh.x)
++%->
++
++%->
++
++%thickness is the difference between surface and base #md.geometry
++%->
++
++%plot the geometry to check it out
++%->
++
++
++disp('   Defining friction parameters');
++
++%These parameters will not be used but need to be fixed #md.friction
++%one friciton coefficient per node (md.mesh.numberofvertices,1)
++%conversion form year to seconds with #md.constants.yts
++%->
++
++%one friciton exponent (p,q) per element
++%->
++
++%->
++
++
++disp('   Construct ice rheological properties');
++
++%The rheology parameters sit in the material section #md.materials
++%B has one value per vertex
++%->
++
++%n has one value per element
++%->
++
++
++disp('   Set boundary conditions');
++
++%Set the default boundary conditions for an ice-sheet 
++% #help SetIceSheetBC
++%->
++
++disp('   Initializing velocity and pressure');
++
++%initialize the velocity and pressurefields of #md.initialization
++%->
++
++%->
++
++%->
++
++%->
+Index: ../trunk-jpl/examples/UncertaintyQuantification/runme.m
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 0)
++++ ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 18198)
+@@ -0,0 +1,290 @@
++%PIG Uncertainty Quantification Application
++steps=[3]; eval(['addpath ' pwd]);
++
++if any(steps==1) 
++	disp('   Step 1: plot flux gates'); 
++	
++	md = loadmodel('../Data/PIG.Control_drag_default');
++
++	texts=cell(1,13);
++	textpositions=cell(1,13);
++
++	for i=1:13,
++		contour=expread(['./Exp_Par/MassFluxes/MassFlux' num2str(i) '.exp']);
++		textpositions{i}=[contour.x(end) contour.y(end)];
++	end
++
++	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'log',10,'expdisp',...
++		{'Exp_Par/MassFluxes/MassFlux1.exp','Exp_Par/MassFluxes/MassFlux2.exp',...
++		'Exp_Par/MassFluxes/MassFlux3.exp','Exp_Par/MassFluxes/MassFlux4.exp',...
++		'Exp_Par/MassFluxes/MassFlux5.exp','Exp_Par/MassFluxes/MassFlux6.exp',...
++		'Exp_Par/MassFluxes/MassFlux7.exp','Exp_Par/MassFluxes/MassFlux8.exp',...
++		'Exp_Par/MassFluxes/MassFlux9.exp','Exp_Par/MassFluxes/MassFlux10.exp',...
++		'Exp_Par/MassFluxes/MassFlux11.exp','Exp_Par/MassFluxes/MassFlux12.exp',...
++		'Exp_Par/MassFluxes/MassFlux13.exp'},...
++		'expstyle',{'k-','k-','k-','k-','k-','k-','k-',...
++		'k-','k-','k-','k-','k-','k-'},'linewidth',2,...
++		'text',{'1','2','3','4','5','6','7',...
++		'8','9','10','11','12','13'},...
++		'textposition',textpositions);
++
++end
++if any(steps==2) 
++	disp('   Step 2: compute cross overs from CRESIS'); 
++	
++	md = loadmodel('../Data/PIG.Control_drag_default');
++
++	%load cross overs: CRESIS McCord Antarctica, 2009 (courtesy of John Paden)
++	load('../Data/CrossOvers2009.mat');
++	
++	%interpolate cross over errors over our mesh vertices
++	DeltaHH=InterpFromMeshToMesh2d(index,x,y,dhh,md.mesh.x,md.mesh.y);
++
++	%avoid NaN values
++	pos=find(isnan(DeltaHH)); DeltaHH(pos)=0;
++
++	%filter out unrealistic error ranges
++	flags=ContourToNodes(md.mesh.x,md.mesh.y,'Exp_Par/ErrorContour.exp',1);
++	pos=find(~flags); DeltaHH(pos)=0; 
++
++	%avoid large unrealistic values
++	pos=find(DeltaHH>1); DeltaHH(pos)=1;
++	pos=find(DeltaHH<-1); DeltaHH(pos)=-1;
++	
++	%transform into absolute errors and setup a minimum error everywhere.
++	DeltaHH=abs(DeltaHH);
++	pos=find(DeltaHH==0); pos2=find(DeltaHH~=0); 
++	DeltaHH(pos)=min(DeltaHH(pos2));
++
++	save Models/PIG.CrossOvers DeltaHH
++
++end
++if any(steps==3) 
++	disp('   Step 3: sampling analysis'); 
++	
++	%load model and cross over errors
++	md = loadmodel('../Data/PIG.Control_drag_default');
++	load -mat Models/PIG.CrossOvers
++
++	%partition the mesh
++	md.qmu.numberofpartitions=50;
++	md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,...
++	'weighting','on');
++	md.qmu.partition=md.qmu.partition-1; %switch partition to c-indexing
++
++	%make DeltaHH into our 3 sigma deviation
++	DeltaHH=DeltaHH/6; %2 (to transform DeltaHH into a radius) x 3 (for 3 sigma)
++	DeltaHH_on_partition=AreaAverageOntoPartition(md,DeltaHH);
++	DeltaHH_on_grids=DeltaHH_on_partition(md.qmu.partition+1); %just to check in case
++	
++	md.qmu.variables.thickness=normal_uncertain('scaled_Thickness',1,1);
++	md.qmu.variables.thickness.stddev=DeltaHH_on_partition;
++
++	%responses
++	md.qmu.responses.MassFlux1=response_function('indexed_MassFlux_1',[],...
++		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux2=response_function('indexed_MassFlux_2',[],...
++		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]); %grounding line
++	md.qmu.responses.MassFlux3=response_function('indexed_MassFlux_3',[],...
++		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux4=response_function('indexed_MassFlux_4',[],...
++		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux5=response_function('indexed_MassFlux_5',[],...
++		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux6=response_function('indexed_MassFlux_6',[],...
++		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux7=response_function('indexed_MassFlux_7',[],...
++		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux8=response_function('indexed_MassFlux_8',[],...
++		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux9=response_function('indexed_MassFlux_9',[],...
++		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux10=response_function('indexed_MassFlux_10',[],...
++		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux11=response_function('indexed_MassFlux_11',[],...
++		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux12=response_function('indexed_MassFlux_12',[],...
++		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux13=response_function('indexed_MassFlux_13',[],...
++		[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++
++	%mass flux profiles
++	md.qmu.mass_flux_profiles={'MassFlux1.exp',...
++	                           'MassFlux2.exp',...
++	                           'MassFlux3.exp',...
++	                           'MassFlux4.exp',...
++	                           'MassFlux5.exp',...
++	                           'MassFlux6.exp',...
++	                           'MassFlux7.exp',...
++	                           'MassFlux8.exp',...
++	                           'MassFlux9.exp',...
++	                           'MassFlux10.exp',...
++	                           'MassFlux11.exp',...
++	                           'MassFlux12.exp',...
++	                           'MassFlux13.exp'};
++	md.qmu.mass_flux_profile_directory='../Exp_Par/MassFluxes/';
++
++	%%  sampling analysis
++	md.qmu.method     =dakota_method('nond_samp');
++	md.qmu.method(end)=dmeth_params_set(md.qmu.method(end),...
++	'seed',1234,...
++	'samples',30,...
++	'sample_type','lhs'); %random or lhs
++
++	%%  a variety of parameters
++	md.qmu.params.evaluation_concurrency=1;
++	md.qmu.params.analysis_driver='';
++	md.qmu.params.analysis_components='';
++	md.qmu.params.tabular_graphics_data=true;
++	md.verbose=verbose('qmu',true);
++
++	md.stressbalance.restol=10^-5; %tighten tolerances for UQ analyses
++	
++	%solve
++	md.qmu.isdakota=1; md.inversion.iscontrol=0;
++	md.cluster=generic('name',oshostname,'np',4);
++	md=solve(md,StressbalanceSolutionEnum,'overwrite','y');
++
++	save ./Models/PIG.Sampling md; 
++end
++if any(steps==4) 
++	disp('   Step 4: sensitivity analysis'); 
++	
++	%load model
++	md = loadmodel('../Data/PIG.Control_drag_default');
++
++	%partition the mesh
++	md.qmu.numberofpartitions=10;
++	md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
++	md.qmu.partition=md.qmu.partition-1; %switch partition to c-indexing
++
++	%all types of variables and responses: scaled_Thickness, indexed_MassFlux_i,MaxVel,nodal_DragCoefficient_i. scaled variables are expanded.
++
++	%variables
++	md.qmu.variables.DragCoefficient=normal_uncertain(...
++	'scaled_FrictionCoefficient',1,0.05);
++	md.qmu.variables.rheology_B=normal_uncertain(...
++	'scaled_MaterialsRheologyB',1,0.05);
++	md.qmu.variables.Thickness=normal_uncertain('scaled_Thickness',1,0.05);
++
++	%responses
++	md.qmu.responses.MassFlux1=response_function('indexed_MassFlux_1',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux2=response_function('indexed_MassFlux_2',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux3=response_function('indexed_MassFlux_3',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux4=response_function('indexed_MassFlux_4',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux5=response_function('indexed_MassFlux_5',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux6=response_function('indexed_MassFlux_6',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux7=response_function('indexed_MassFlux_7',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux8=response_function('indexed_MassFlux_8',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux9=response_function('indexed_MassFlux_9',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux10=response_function('indexed_MassFlux_10',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux11=response_function('indexed_MassFlux_11',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux12=response_function('indexed_MassFlux_12',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++	md.qmu.responses.MassFlux13=response_function('indexed_MassFlux_13',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
++
++	%mass flux profiles
++	md.qmu.mass_flux_profiles={'MassFlux1.exp',...
++	                           'MassFlux2.exp',...
++	                           'MassFlux3.exp',...
++	                           'MassFlux4.exp',...
++	                           'MassFlux5.exp',...
++	                           'MassFlux6.exp',...
++	                           'MassFlux7.exp',...
++	                           'MassFlux8.exp',...
++	                           'MassFlux9.exp',...
++	                           'MassFlux10.exp',...
++	                           'MassFlux11.exp',...
++	                           'MassFlux12.exp',...
++	                           'MassFlux13.exp'};
++	md.qmu.mass_flux_profile_directory='../Exp_Par/MassFluxes/';
++
++	%method: local reliability
++	md.qmu.method     =dakota_method('nond_l');
++	md.qmu.method(end)=dmeth_params_set(md.qmu.method(end),...
++	'output','quiet');
++
++	%parameters
++	md.qmu.params.evaluation_concurrency=1;
++	md.qmu.params.analysis_driver='';
++	md.qmu.params.analysis_components='';
++	md.qmu.params.tabular_graphics_data=false;
++
++	md.stressbalance.restol=10^-5; %tighten for qmu analyses
++	
++	%solve
++	md.qmu.isdakota=1; 
++	md.inversion.iscontrol=0;
++	md.cluster=generic('name',oshostname,'np',2);
++	md.verbose=verbose('qmu',true);
++	md=solve(md,StressbalanceSolutionEnum,'overwrite','y');
++	
++	save ./Models/PIG.Sensitivity md; 
++end
++if any(steps==5) 
++	disp('   Step 5: plot partition');
++	
++	%load model
++	md = loadmodel('./Models/PIG.Sampling');
++	
++	plotmodel(md,'data','mesh','partitionedges','on','meshlinewidth',1.5,...
++	'linewidth',2, 'axis#all','image','unit','km','colorbar','off',...
++	'title','','meshcolor','b','grid','on');
++
++end 
++if any(steps==6) 
++	disp('   Step 6: plot histogram'); 
++	
++	%load model
++	md = loadmodel('./Models/PIG.Sampling');
++
++	%which profile are we looking at?
++	index=1; 	
++
++	%retrieve results for the specific profile, mass flux in m^3 water equiv/s
++	result=md.results.dakota.dresp_dat(md.qmu.numberofpartitions+index);
++	result.sample=result.sample/1e12*60*60*24*365;
++		
++	%plot histogram
++	plot_hist_norm(result,'cdfleg','off','cdfplt','off','nrmplt','off',...
++	'xlabelplt','M (Gt/yr)','ylabelplt','F','FontSize',8,'FaceColor',...
++	'none','EdgeColor','red');
++
++end
++if any(steps==7) 
++	disp('   Step 7: plot sensitivity'); 
++	
++	%load model
++	md = loadmodel('./Models/PIG.Sensitivity');
++	%copy dakota results into model qmu
++	md.qmu.results=md.results.dakota;
++
++	%which profile are we looking at?
++	index=1; 	
++
++	%To plot sensitivities
++	sa=md.results.dakota.dresp_out(index).sens(1:10); sa=sa(md.qmu.partition+1)/1e12*60*60*24*365;
++	sb=md.results.dakota.dresp_out(index).sens(11:20); sb=sb(md.qmu.partition+1)/1e12*60*60*24*365;
++	sh=md.results.dakota.dresp_out(index).sens(21:30); sh=sh(md.qmu.partition+1)/1e12*60*60*24*365;
++
++	plotmodel(md,'data',sh,'data',sa,'data',sb,'expdisp#all',...
++		['Exp_Par/MassFluxes/MassFlux' num2str(index) '.exp'],...
++		'expstyle#all','b-','linewidth#all',2,...
++		'nlines',3,'ncols',1, 'axis#all','image',...
++		'colorbar#all','on','colorbarfontsize#all',10,...
++		'colorbartitle#1','S_{H}', 'colorbartitle#2','S_{\alpha}',...
++		'colorbartitle#3','S_{B}','unit#all','km','figure',1);
++
++	%To plot importance factors
++	ifa=importancefactors(md,'scaled_FrictionCoefficient',['indexed_MassFlux_' num2str(index)]);
++	ifb=importancefactors(md,'scaled_MaterialsRheologyB',['indexed_MassFlux_' num2str(index)]);
++	ifh=importancefactors(md,'scaled_Thickness',['indexed_MassFlux_' num2str(index)]);
++
++	plotmodel(md,'data',ifh,'data',ifa,'data',ifb,'expdisp#all',...
++		['Exp_Par/MassFluxes/MassFlux' num2str(index) '.exp'],...
++		'expstyle#all','b-','linewidth#all',2,'log#all',10,...
++		'nlines',3,'ncols',1, 'axis#all','image','caxis#all',[1e-10 1],...
++		'colorbar#all','on','colorbarfontsize#all',10,...
++		'colorbartitle#1','If_{H}', 'colorbartitle#2','If_{\alpha}',...
++		'colorbartitle#3','If_{B}','unit#all','km','figure',2);
++
++end
+
+Property changes on: ../trunk-jpl/examples/UncertaintyQuantification/runme.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux11.exp
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux11.exp	(revision 0)
++++ ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux11.exp	(revision 18198)
+@@ -0,0 +1,8 @@
++## Name:MassFlux12
++## Icon:0
++# Points Count Value
++2 1.000000
++# X pos Y pos
++-1559431.5986180613 -236969.7272119786
++-1549112.1094185982 -261719.2194756830
++
+Index: ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux2.exp
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux2.exp	(revision 0)
++++ ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux2.exp	(revision 18198)
+@@ -0,0 +1,171 @@
++## Name:MassFlux2
++## Icon:0
++# Points Count Value
++165 1.000000
++# X pos Y pos
++-1609993.8450579999 -266189.3103270000
++-1609790.4465310001 -265898.8271340000
++-1609587.0480040000 -265608.3439410000
++-1609383.6494770001 -265317.8607480000
++-1609136.7086169999 -265274.3184150000
++-1608933.3100900000 -264983.8352220000
++-1608686.3692300001 -264940.2928890000
++-1608236.0298430000 -264606.2673630000
++-1607989.0889830000 -264562.7250310000
++-1607785.6904559999 -264272.2418380000
++-1607538.7495960000 -264228.6995050000
++-1607291.8087370000 -264185.1571720000
++-1607044.8678770000 -264141.6148390000
++-1606797.9270170000 -264098.0725060000
++-1606304.0452970001 -264010.9878410000
++-1606057.1044369999 -263967.4455080000
++-1605810.1635769999 -263923.9031750000
++-1605563.2227179999 -263880.3608420000
++-1605316.2818580000 -263836.8185100000
++-1605069.3409980000 -263793.2761770000
++-1604778.8578049999 -263996.6747040000
++-1604531.9169449999 -263953.1323710000
++-1604038.0352250000 -263866.0477060000
++-1603791.0943660000 -263822.5053730000
++-1603500.6111730000 -264025.9039000000
++-1603253.6703130000 -263982.3615680000
++-1602963.1871199999 -264185.7600950000
++-1602716.2462599999 -264142.2177620000
++-1602425.7630680001 -264345.6162900000
++-1601888.3390150000 -264505.4724840000
++-1601641.3981550001 -264461.9301510000
++-1601350.9149630000 -264665.3286790000
++-1601060.4317699999 -264868.7272060000
++-1600479.4653840000 -265275.5242610000
++-1600188.9821919999 -265478.9227880000
++-1599898.4989990001 -265682.3213160000
++-1599608.0158060000 -265885.7198430000
++-1599027.0494210001 -266292.5168980000
++-1598736.5662280000 -266495.9154250000
++-1598446.0830349999 -266699.3139520000
++-1598402.5407030000 -266946.2548130000
++-1598605.9392299999 -267236.7380050000
++-1598518.8545639999 -267730.6197260000
++-1598722.2530910000 -268021.1029190000
++-1598678.7107579999 -268268.0437790000
++-1598635.1684250000 -268514.9846390000
++-1598591.6260919999 -268761.9254990000
++-1598795.0246190000 -269052.4086920000
++-1598751.4822869999 -269299.3495520000
++-1598707.9399540001 -269546.2904130000
++-1598620.8552880001 -270040.1721330000
++-1598577.3129550000 -270287.1129930000
++-1598533.7706220001 -270534.0538530000
++-1598737.1691490000 -270824.5370460000
++-1598693.6268170001 -271071.4779060000
++-1598650.0844840000 -271318.4187660000
++-1598606.5421509999 -271565.3596270000
++-1598316.0589580000 -271768.7581540000
++-1598228.9742930001 -272262.6398740000
++-1597938.4911000000 -272466.0384020000
++-1597648.0079069999 -272669.4369290000
++-1597067.0415220000 -273076.2339840000
++-1597023.4991890001 -273323.1748440000
++-1596979.9568560000 -273570.1157040000
++-1596936.4145229999 -273817.0565640000
++-1596892.8721900000 -274063.9974240000
++-1596805.7875250001 -274557.8791450000
++-1596762.2451919999 -274804.8200050000
++-1596718.7028590001 -275051.7608650000
++-1596675.1605260000 -275298.7017250000
++-1596631.6181930001 -275545.6425850000
++-1596341.1350010000 -275749.0411130000
++-1596297.5926679999 -275995.9819730000
++-1595963.5671420000 -276446.3213600000
++-1595920.0248090001 -276693.2622210000
++-1595629.5416170000 -276896.6607480000
++-1595339.0584239999 -277100.0592750000
++-1595048.5752310001 -277303.4578030000
++-1594467.6088459999 -277710.2548570000
++-1594177.1256530001 -277913.6533850000
++-1593886.6424600000 -278117.0519120000
++-1593392.7607410001 -278029.9672470000
++-1593102.2775480000 -278233.3657740000
++-1592898.8790209999 -277942.8825810000
++-1592695.4804940000 -277652.3993880000
++-1592201.5987740001 -277565.3147220000
++-1591998.2002470000 -277274.8315290000
++-1592041.7425800001 -277027.8906690000
++-1591838.3440530000 -276737.4074760000
++-1591881.8863860001 -276490.4666160000
++-1591722.0301910001 -275953.0425630000
++-1591765.5725240000 -275706.1017030000
++-1591562.1739970001 -275415.6185100000
++-1591605.7163300000 -275168.6776500000
++-1591402.3178030001 -274878.1944570000
++-1591198.9192760000 -274587.7112640000
++-1591242.4616090001 -274340.7704040000
++-1591039.0630820000 -274050.2872110000
++-1591082.6054150001 -273803.3463510000
++-1590922.7492209999 -273265.9222970000
++-1590966.2915530000 -273018.9814370000
++-1590762.8930259999 -272728.4982440000
++-1590806.4353590000 -272481.5573840000
++-1590603.0368319999 -272191.0741910000
++-1590399.6383050000 -271900.5909980000
++-1590443.1806379999 -271653.6501380000
++-1590239.7821110000 -271363.1669450000
++-1590036.3835839999 -271072.6837520000
++-1590123.4682499999 -270578.8020320000
++-1589920.0697230001 -270288.3188390000
++-1589716.6711960000 -269997.8356460000
++-1589760.2135280001 -269750.8947860000
++-1589556.8150010000 -269460.4115930000
++-1589600.3573340001 -269213.4707330000
++-1589440.5011400001 -268676.0466800000
++-1589484.0434729999 -268429.1058190000
++-1589280.6449460001 -268138.6226260000
++-1589077.2464190000 -267848.1394340000
++-1588873.8478920001 -267557.6562410000
++-1588423.5085050000 -267223.6307150000
++-1588220.1099779999 -266933.1475220000
++-1587973.1691180000 -266889.6051890000
++-1587726.2282580000 -266846.0628560000
++-1587479.2873980000 -266802.5205230000
++-1586985.4056780001 -266715.4358580000
++-1586738.4648190001 -266671.8935250000
++-1586491.5239589999 -266628.3511920000
++-1586244.5830989999 -266584.8088590000
++-1585997.6422389999 -266541.2665270000
++-1585750.7013790000 -266497.7241940000
++-1585256.8196590000 -266410.6395280000
++-1585009.8787990001 -266367.0971960000
++-1584762.9379400001 -266323.5548630000
++-1584472.4547470000 -266526.9533900000
++-1584428.9124139999 -266773.8942500000
++-1584138.4292210001 -266977.2927780000
++-1583804.4036960001 -267427.6321650000
++-1583760.8613630000 -267674.5730250000
++-1583470.3781699999 -267877.9715530000
++-1583179.8949770001 -268081.3700800000
++-1583136.3526450000 -268328.3109400000
++-1582845.8694519999 -268531.7094680000
++-1582802.3271190000 -268778.6503280000
++-1582468.3015940001 -269228.9897150000
++-1582424.7592610000 -269475.9305750000
++-1582134.2760679999 -269679.3291030000
++-1582090.7337350000 -269926.2699630000
++-1581800.2505419999 -270129.6684900000
++-1581509.7673500001 -270333.0670180000
++-1581219.2841570000 -270536.4655450000
++-1581132.1994910000 -271030.3472650000
++-1580841.7162990000 -271233.7457930000
++-1580551.2331060001 -271437.1443200000
++-1580507.6907730000 -271684.0851800000
++-1580217.2075799999 -271887.4837080000
++-1580173.6652470001 -272134.4245680000
++-1579839.6397220001 -272584.7639550000
++-1579796.0973890000 -272831.7048160000
++-1579505.6141959999 -273035.1033430000
++-1579462.0718640001 -273282.0442030000
++-1579418.5295309999 -273528.9850630000
++-1579128.0463380001 -273732.3835910000
++-1579084.5040050000 -273979.3244510000
++-1578750.4784800000 -274429.6638380000
++-1578706.9361469999 -274676.6046980000
++
+Index: ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux12.exp
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux12.exp	(revision 0)
++++ ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux12.exp	(revision 18198)
+@@ -0,0 +1,8 @@
++## Name:MassFlux13
++## Icon:0
++# Points Count Value
++2 1.000000
++# X pos Y pos
++-1572656.1032135738 -292391.9615161452
++-1573651.1418990945 -315407.7936937447
++
+Index: ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux3.exp
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux3.exp	(revision 0)
++++ ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux3.exp	(revision 18198)
+@@ -0,0 +1,10 @@
++## Name:MassFlux4
++## Icon:0
++# Points Count Value
++4 1.000000
++# X pos Y pos
++-1605390.0162510793 -209047.7381093690
++-1592454.5133393104 -208141.0538114636
++-1574086.0992045982 -208918.2117810968
++-1560891.8862345938 -210472.5277203633
++
+Index: ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux13.exp
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux13.exp	(revision 0)
++++ ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux13.exp	(revision 18198)
+@@ -0,0 +1,8 @@
++## Name:MassFlux14
++## Icon:0
++# Points Count Value
++2 1.000000
++# X pos Y pos
++-1579674.9916810417 -321516.2892665596
++-1587436.3185859676 -337140.9687259690
++
+Index: ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux4.exp
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux4.exp	(revision 0)
++++ ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux4.exp	(revision 18198)
+@@ -0,0 +1,8 @@
++## Name:MassFlux5
++## Icon:0
++# Points Count Value
++2 1.000000
++# X pos Y pos
++-1660144.8928561222 -319887.0521198768
++-1630434.8468677206 -298387.4931837295
++
+Index: ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux14.exp
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux14.exp	(revision 0)
++++ ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux14.exp	(revision 18198)
+@@ -0,0 +1,8 @@
++## Name:MassFlux14
++## Icon:0
++# Points Count Value
++2 1.000000
++# X pos Y pos
++-1579674.9916810417 -321516.2892665596
++-1587436.3185859676 -337140.9687259690
++
+Index: ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux5.exp
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux5.exp	(revision 0)
++++ ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux5.exp	(revision 18198)
+@@ -0,0 +1,8 @@
++## Name:MassFlux6
++## Icon:0
++# Points Count Value
++2 1.000000
++# X pos Y pos
++-1635925.9455644884 -157610.4872330402
++-1625288.0602165582 -120861.2411445094
++
+Index: ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux15.exp
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux15.exp	(revision 0)
++++ ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux15.exp	(revision 18198)
+@@ -0,0 +1,127 @@
++## Name:
++## Icon:0
++# Points Count Value
++121 25000.000000
++# X pos Y pos
++-1712012.0818103175 -348661.1275967784
++-1711738.9446965172 -348380.8584401013
++-1709339.1962288069 -348358.9741029009
++-1707566.1624406802 -348048.0535193763
++-1706142.6423542583 -346463.0619396989
++-1703644.8906504354 -344421.7875470470
++-1701428.0245438961 -343211.6412474416
++-1699098.6802015656 -343202.0651453367
++-1698767.2671226400 -341251.8958583454
++-1694089.8466347910 -339325.0408948531
++-1691249.4280928215 -338644.2293668062
++-1688271.0930389061 -338423.0784381799
++-1686131.0738047434 -339115.2406933784
++-1682853.5065837551 -340300.2702040364
++-1681648.3224467863 -342890.2203795200
++-1681160.5378740367 -343956.3892846339
++-1681343.2453770319 -345059.2736684235
++-1680476.2008784728 -345129.3389066600
++-1679673.6094558411 -346405.5378093903
++-1679898.5797234357 -347818.5803631411
++-1677215.4777375804 -347397.3820658240
++-1674583.5118423651 -349115.8291018623
++-1675803.3920552148 -352985.6713725598
++-1672935.8509424068 -352801.1873251720
++-1668529.5198238282 -353048.3463822120
++-1666370.5689502691 -354473.4893832008
++-1665423.6161039397 -356733.4691418489
++-1662720.0686237188 -357334.8975107344
++-1660276.4961961196 -357869.6209268258
++-1657124.6115999895 -361080.6428832713
++-1655993.6074009922 -363193.2597271361
++-1653688.2093358042 -364017.9494011777
++-1654435.7188006472 -361506.6539926908
++-1652050.9793420888 -355295.4585798742
++-1649364.4081354018 -349945.5944371450
++-1645761.7354861272 -350839.5079576963
++-1645996.5509334437 -351783.7951824765
++-1645345.5744557772 -351250.5634369315
++-1644300.2406060672 -352221.4198542684
++-1644633.1139884400 -348521.7302174515
++-1647057.7191411837 -348406.3266729190
++-1645415.0137059502 -341247.9400814587
++-1644395.7076754270 -340417.8557739360
++-1644169.8943326229 -336477.7151767056
++-1643216.0658811626 -334392.3056475453
++-1641434.0471865973 -334447.2336099123
++-1641190.7738541283 -334332.2252321915
++-1641050.9552025823 -333796.1902735520
++-1639787.1689887117 -331073.8439645328
++-1637807.1154673321 -329711.1825533187
++-1635805.1587214153 -327827.0308139678
++-1632065.9795259857 -326063.4189332099
++-1625929.4636559838 -324999.2470617331
++-1619584.9279456623 -324892.7557348280
++-1615193.9710026928 -325097.1546172730
++-1611296.7956007582 -324995.1262699560
++-1608304.4173934418 -325211.0183405159
++-1603316.9037486394 -326424.5673739603
++-1600245.1111844976 -328836.3685103582
++-1595818.7639296530 -331148.7367850624
++-1591649.1976614639 -334787.7632693424
++-1588371.5600852505 -337840.7799059978
++-1587648.7608976758 -343365.9382903088
++-1587132.8425864622 -345049.3782468919
++-1586012.7810109658 -347625.9740446581
++-1588260.6470941922 -349356.1732009141
++-1584626.3352827206 -352498.3947002917
++-1584121.7278491815 -354575.2387267592
++-1584906.9380743054 -356537.0120279597
++-1585446.5634405916 -359133.6460951389
++-1586894.3150289655 -361098.6217195836
++-1585768.2162689434 -363527.8170254802
++-1584807.6500740163 -365694.8871387623
++-1585744.0045738907 -368358.0113804646
++-1585152.9531241022 -369694.9777909298
++-1584499.3876485692 -371017.3807505022
++-1585456.9434211247 -372944.8898924028
++-1429208.6248950495 -363616.6734221856
++-1415050.5145378630 -326851.1264040734
++-1413047.7406149551 -325411.1419014899
++-1405442.9810691341 -295790.2533492565
++-1388007.7873070226 -266002.2718567938
++-1375120.7873420289 -286146.6923060659
++-1373971.2210923850 -285345.4403176561
++-1346034.9931278315 -322527.8743193840
++-1351274.5360716779 -327267.6902373450
++-1382747.3419384742 -297522.4999399224
++-1382639.2845126297 -296126.1700367680
++-1382479.2357768724 -295804.4343703665
++-1397758.7640077863 -316499.0520702488
++-1408929.4248104726 -362684.2359936420
++-1202573.2098436793 -350320.7957165864
++-1192371.9994205239 -349816.1301302491
++-1233144.4335198263 -292276.3631183850
++-1232225.6096719459 -288608.8406540032
++-1360692.9373680721 -108664.8182541504
++-1424223.8165527256 -81531.7934136631
++-1403445.8481024427 -45960.5859752788
++-1478312.1378749039 59339.3203815984
++-1513118.6444103392 3225.4273728387
++-1524169.2804273698 11860.8708815790
++-1504759.9852699745 36302.7657860445
++-1528911.0294425790 62751.8076344339
++-1622627.2364271644 61937.4929792271
++-1647011.3496706884 32864.6807476235
++-1637527.3859760596 19912.7371761968
++-1650069.2631712460 30042.0704865309
++-1724734.6043381831 -61378.0233897057
++-1718614.9048978437 -69045.3133313945
++-1758091.3164752426 -113926.3236823874
++-1754430.7541207569 -116894.8054778867
++-1760233.4203404333 -126776.6398906443
++-1757170.3120773330 -130521.7753713153
++-1762186.6328915418 -136423.2047200473
++-1765126.7323215308 -132420.4516091067
++-1769785.4415677825 -135199.8713571306
++-1774818.6171028516 -132429.3647437230
++-1793280.1507095622 -153411.6536596067
++-1711636.5537849038 -224740.3773715630
++-1729008.9305659365 -335286.5679692774
++-1712012.0818103175 -348661.1275967784
++
+Index: ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux6.exp
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux6.exp	(revision 0)
++++ ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux6.exp	(revision 18198)
+@@ -0,0 +1,8 @@
++## Name:MassFlux7
++## Icon:0
++# Points Count Value
++2 1.000000
++# X pos Y pos
++-1642052.5574172530 -95522.7999921589
++-1610982.9267521810 -78949.7704229522
++
+Index: ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux7.exp
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux7.exp	(revision 0)
++++ ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux7.exp	(revision 18198)
+@@ -0,0 +1,8 @@
++## Name:MassFlux8
++## Icon:0
++# Points Count Value
++2 1.000000
++# X pos Y pos
++-1605014.5365509845 -81707.1563440522
++-1566756.1417461073 -82763.2940976564
++
+Index: ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux8.exp
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux8.exp	(revision 0)
++++ ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux8.exp	(revision 18198)
+@@ -0,0 +1,8 @@
++## Name:MassFlux9
++## Icon:0
++# Points Count Value
++2 1.000000
++# X pos Y pos
++-1555378.1885604258 -45179.9925785796
++-1550583.9034971579 -68415.0231578706
++
+Index: ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux9.exp
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux9.exp	(revision 0)
++++ ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux9.exp	(revision 18198)
+@@ -0,0 +1,8 @@
++## Name:MassFlux10
++## Icon:0
++# Points Count Value
++2 1.000000
++# X pos Y pos
++-1565010.6613481115 -111795.8673475993
++-1537474.3225972611 -138442.9656094175
++
+Index: ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux1.exp
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux1.exp	(revision 0)
++++ ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux1.exp	(revision 18198)
+@@ -0,0 +1,22 @@
++## Name:MassFlux1
++## Icon:0
++# Points Count Value
++16 1.000000
++# X pos Y pos
++-1638344.3538415846 -328022.1178486745
++-1636175.0592654669 -328022.1178486745
++-1634647.1933393457 -327710.7373731936
++-1631836.4701132313 -326087.2311287920
++-1629847.9500851235 -324428.7567974643
++-1626413.2336729371 -321756.7703747695
++-1622074.6445207016 -320098.2960434417
++-1618278.3790124957 -319637.6087291840
++-1614210.9516822749 -319729.7461920356
++-1609601.2007080249 -320466.8458948479
++-1604539.5133637502 -322954.5573918396
++-1602370.2187876324 -324613.0317231673
++-1599206.6641974607 -326824.3308316044
++-1595681.5605112694 -327008.6057573075
++-1593150.7168391321 -327653.5679972683
++-1590710.2604409996 -330786.2417342208
++
+Index: ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux10.exp
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux10.exp	(revision 0)
++++ ../trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux10.exp	(revision 18198)
+@@ -0,0 +1,8 @@
++## Name:MassFlux11
++## Icon:0
++# Points Count Value
++2 1.000000
++# X pos Y pos
++-1539536.1089629673 -171232.8272031187
++-1540384.1546699132 -200614.0179257037
++
+Index: ../trunk-jpl/examples/UncertaintyQuantification/ErrorContour.exp
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/ErrorContour.exp	(revision 0)
++++ ../trunk-jpl/examples/UncertaintyQuantification/ErrorContour.exp	(revision 18198)
+@@ -0,0 +1,24 @@
++## Name:ErrorContour
++## Icon:0
++# Points Count Value
++18 1.000000
++# X pos Y pos
++-1642090.6657102096 -328038.7002928721
++-1665417.0018035804 -319119.8070807009
++-1681882.6508106657 -304712.3641995014
++-1666103.0705122089 -245710.4552574461
++-1632485.7037894099 -232675.1497935036
++-1616020.0547823247 -224442.3252899610
++-1598182.2683579824 -200429.9204879618
++-1596810.1309407253 -181219.9966463624
++-1615333.9860736963 -160637.9353875059
++-1559762.4206747836 -147602.6299235635
++-1527517.1913692418 -188080.6837326479
++-1566623.1077610692 -218953.7756209326
++-1533691.8097468987 -229244.8062503609
++-1523400.7791174706 -309514.8451599012
++-1533691.8097468987 -350678.9676776142
++-1594751.9248148398 -371261.0289364707
++-1636602.1160411814 -349306.8302603571
++-1642090.6657102096 -328038.7002928721
++
+Index: ../trunk-jpl/examples/Data/Download.sh
+===================================================================
+--- ../trunk-jpl/examples/Data/Download.sh	(revision 0)
++++ ../trunk-jpl/examples/Data/Download.sh	(revision 18198)
+@@ -0,0 +1,25 @@
++#!/bin/bash
++
++echo "Downloading Square shelf dataset"
++$ISSM_DIR/scripts/DownloadExternalPackage2.py 'http://issm.jpl.nasa.gov/files/workshop2014/SquareShelf.nc' 'SquareShelf.nc'
++
++echo "Downloading SeaRISE dataset - Antarctica"
++$ISSM_DIR/scripts/DownloadExternalPackage2.py 'http://websrv.cs.umt.edu/isis/images/c/cc/Antarctica_5km_withshelves_v0.75.nc' 'Antarctica_5km_withshelves_v0.75.nc'
++
++echo "Downloading InSAR Antarctic velocities"
++$ISSM_DIR/scripts/DownloadExternalPackage2.py 'ftp://sidads.colorado.edu/pub/DATASETS/nsidc0484_MEASURES_antarc_vel_V01/900m/antarctica_ice_velocity.nc' 'Antarctica_ice_velocity.nc' 
++
++echo "Downloading PIG errors"
++$ISSM_DIR/scripts/DownloadExternalPackage2.py 'http://issm.jpl.nasa.gov/files/workshop2014/CrossOvers2009.mat' 'CrossOvers2009.mat'
++
++echo "Downloading SeaRISE dataset - Greenland"
++$ISSM_DIR/scripts/DownloadExternalPackage2.py 'http://websrv.cs.umt.edu/isis/images/e/e9/Greenland_5km_dev1.2.nc' 'Greenland_5km_dev1.2.nc'
++
++echo "Downloading Jason Box's SMB"
++$ISSM_DIR/scripts/DownloadExternalPackage2.py 'http://issm.jpl.nasa.gov/files/workshop2014/Box_Greenland_SMB_monthly_1840-2012_5km_ver20140421.nc' 'Box_Greenland_SMB_monthly_1840-2012_5km_ver20140421.nc'
++
++echo "Downloading IceBridge Jakobshavn bedrock"
++$ISSM_DIR/scripts/DownloadExternalPackage2.py 'https://data.cresis.ku.edu/data/grids/old_versions/Jakobshavn_2008_2011_Composite.zip' 'Jakobshavn_2008_2011_Composite.zip'
++unzip Jakobshavn_2008_2011_Composite.zip
++mv Jakobshavn_2008_2011_Composite/grids/Jakobshavn_2008_2011_Composite_XYZGrid.txt .
++rm -rf Jakobshavn_2008_2011_Composite Jakobshavn_2008_2011_Composite.zip
+
+Property changes on: ../trunk-jpl/examples/Data/Download.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/IceflowModels/runme.m
+===================================================================
+--- ../trunk-jpl/examples/IceflowModels/runme.m	(revision 0)
++++ ../trunk-jpl/examples/IceflowModels/runme.m	(revision 18198)
+@@ -0,0 +1,8 @@
++md=triangle(model(),'Square.exp',80000.);
++md=setmask(md,'all','');
++md=parameterize(md,'SquareShelf.par');
++md=extrude(md,3,1);
++%Set flow equation
++md=setflowequation(md,'HO','Contour.exp','fill','SSA','coupling','tiling');
++%Solve
++md=solve(md,StressbalanceSolutionEnum);
+
+Property changes on: ../trunk-jpl/examples/IceflowModels/runme.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/IceflowModels/SquareShelf.par
+===================================================================
+--- ../trunk-jpl/examples/IceflowModels/SquareShelf.par	(revision 0)
++++ ../trunk-jpl/examples/IceflowModels/SquareShelf.par	(revision 18198)
+@@ -0,0 +1,55 @@
++%Start defining model parameters here
++
++%Geometry
++hmin=300;
++hmax=1000;
++ymin=min(md.mesh.y);
++ymax=max(md.mesh.y);
++xmin=min(md.mesh.x);
++xmax=max(md.mesh.x);
++md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x-xmin)/(xmax-xmin);
++md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness;
++md.geometry.surface=md.geometry.base+md.geometry.thickness;
++
++%Initial velocity and pressure
++x     = transpose(ncread('../Data/SquareShelf.nc','x'));
++y     = transpose(ncread('../Data/SquareShelf.nc','y'));
++vx    = transpose(ncread('../Data/SquareShelf.nc','vx'));
++vy    = transpose(ncread('../Data/SquareShelf.nc','vy'));
++index = transpose(ncread('../Data/SquareShelf.nc','index'));
++md.initialization.vx=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y);
++md.initialization.vy=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y);
++clear vx vy x y index;
++md.initialization.vz=zeros(md.mesh.numberofvertices,1);
++md.initialization.pressure=zeros(md.mesh.numberofvertices,1);
++
++%Materials
++md.initialization.temperature=(273-20)*ones(md.mesh.numberofvertices,1);
++md.materials.rheology_B=paterson(md.initialization.temperature);
++md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
++
++%Friction
++md.friction.coefficient=20*ones(md.mesh.numberofvertices,1);
++md.friction.coefficient(find(md.mask.groundedice_levelset<0.))=0.;
++md.friction.p=ones(md.mesh.numberofelements,1);
++md.friction.q=ones(md.mesh.numberofelements,1);
++
++%Numerical parameters
++md.stressbalance.viscosity_overshoot=0.3;
++md.masstransport.stabilization=1;
++md.thermal.stabilization=1;
++md.settings.waitonlock=30;
++md.verbose=verbose(0);
++md.stressbalance.restol=0.10;
++md.steadystate.reltol=0.02;
++md.stressbalance.reltol=0.02;
++md.stressbalance.abstol=NaN;
++md.timestepping.time_step=1;
++md.timestepping.final_time=3;
++
++%Boundary conditions:
++md=SetIceShelfBC(md,'./SquareFront.exp');
++
++%Change name so that no test have the same name
++A=dbstack;
++if (length(A)>2), md.miscellaneous.name=A(3).file(1:end-2); end
+
+Property changes on: ../trunk-jpl/examples/IceflowModels/SquareShelf.par
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/IceflowModels/eismint.m
+===================================================================
+--- ../trunk-jpl/examples/IceflowModels/eismint.m	(revision 0)
++++ ../trunk-jpl/examples/IceflowModels/eismint.m	(revision 18198)
+@@ -0,0 +1,51 @@
++md=model();
++
++%Create mesh with roundmesh
++md=roundmesh(md,750000,30000);
++
++%Set mask
++md=setmask(md,'','');
++
++%Parameterize model
++md=parameterize(md,'EISMINT.par');
++
++%We extrude the model to have a 3d model
++md=extrude(md,10,1);
++
++%Set ice flow approximation
++md=setflowequation(md,'SIA','all');
++
++%Create boundary conditions: zero velocity on the bed
++pos=find(md.mesh.vertexonbase);
++md.stressbalance.spcvx(pos)=0;
++md.stressbalance.spcvy(pos)=0;
++md.stressbalance.spcvz(pos)=0;
++
++%Go Solve
++md.cluster=generic('np',2);
++md.verbose.convergence=1;
++md=solve(md,StressbalanceSolutionEnum());
++vel=DepthAverage(md,sqrt(md.results.StressbalanceSolution.Vx.^2+md.results.StressbalanceSolution.Vy.^2));
++
++%Calculate analytical velocity
++constant=0.3;
++vx_obs=constant/2*md.mesh.x.*(md.geometry.thickness).^-1;
++vy_obs=constant/2*md.mesh.y.*(md.geometry.thickness).^-1;
++vel_obs=sqrt(vx_obs.^2+vy_obs.^2);
++vel_obs=project2d(md,vel_obs,1);
++
++plotmodel(md,...
++	'data',vel    ,'view',2,'caxis',[0 200],'title','Modelled velocity',...
++	'data',vel_obs,'view',2,'caxis',[0 200],'title','Analytical velocity',...
++	'data',abs(vel-vel_obs)./(vel_obs+eps)*100,'caxis',[0 30],'view',2,'title','Relative misfit (%)');
++
++subplot(2,2,4)
++hold on;
++plot(sqrt((md.mesh.x2d).^2+(md.mesh.y2d).^2),vel,'r.');
++plot(sqrt((md.mesh.x2d).^2+(md.mesh.y2d).^2),vel_obs,'b.');
++title('Analytical vs calculated velocity');
++xlabel('distance to the center of the icesheet [m]');
++ylabel('velocity (m/yr)');
++legend('calculated velocity','exact velocity');
++axis([0 750000 0 200]);
++hold off;
+
+Property changes on: ../trunk-jpl/examples/IceflowModels/eismint.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/IceflowModels/Contour.exp
+===================================================================
+--- ../trunk-jpl/examples/IceflowModels/Contour.exp	(revision 0)
++++ ../trunk-jpl/examples/IceflowModels/Contour.exp	(revision 18198)
+@@ -0,0 +1,11 @@
++## Name:Contour
++## Icon:0
++# Points Count Value
++5 1.000000
++# X pos Y pos
++260815.7808871837 745919.4159004869
++712422.3484428506 757574.3645213632
++640499.8210173184 195805.8409951325
++342774.0098139530 279721.4710654409
++260815.7808871837 745919.4159004869
++
+Index: ../trunk-jpl/examples/IceflowModels/SquareFront.exp
+===================================================================
+--- ../trunk-jpl/examples/IceflowModels/SquareFront.exp	(revision 0)
++++ ../trunk-jpl/examples/IceflowModels/SquareFront.exp	(revision 18198)
+@@ -0,0 +1,10 @@
++## Name:icefront
++## Icon:0
++# Points Count  Value
++5 1.
++# X pos Y pos
++-1000 900000
++-1000 1100000
++1100000 1100000
++1100000 900000
++-1000 900000
+
+Property changes on: ../trunk-jpl/examples/IceflowModels/SquareFront.exp
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/IceflowModels/EISMINT.par
+===================================================================
+--- ../trunk-jpl/examples/IceflowModels/EISMINT.par	(revision 0)
++++ ../trunk-jpl/examples/IceflowModels/EISMINT.par	(revision 18198)
+@@ -0,0 +1,53 @@
++disp('      creating thickness');
++hmin=0.01;
++hmax=2756.7;
++radius=sqrt((md.mesh.x).^2+(md.mesh.y).^2);
++radiusmax=max(radius);
++radius(find(radius>(1.-10^-9)*radiusmax))=radiusmax;    %eliminate roundoff issues in next statement
++md.geometry.thickness=hmin*ones(size(md.mesh.x,1),1)+hmax*(4.*((1./2.)^(4./3.)*ones(size(md.mesh.x,1),1)-((radius)./(2.*radiusmax)).^(4./3.))).^(3./8.);
++md.geometry.base=0.*md.geometry.thickness;
++md.geometry.surface=md.geometry.base+md.geometry.thickness;
++
++disp('      creating drag');
++md.friction.coefficient=20.*ones(md.mesh.numberofvertices,1);
++md.friction.coefficient(find(md.mask.groundedice_levelset<0.))=0.;
++md.friction.p=ones(md.mesh.numberofelements,1);
++md.friction.q=ones(md.mesh.numberofelements,1);
++
++disp('      creating temperatures');
++tmin=238.15; %K
++st=1.67*10^-2/1000.; %k/m
++md.initialization.temperature=tmin+st*radius;
++md.basalforcings.geothermalflux=4.2*10^-2*ones(md.mesh.numberofvertices,1);
++
++disp('      creating flow law parameter');
++md.materials.rheology_B=6.81*10^7*ones(md.mesh.numberofvertices,1); %to have the same B as the analytical solution 
++md.materials.rheology_n=3.*ones(md.mesh.numberofelements,1);
++
++disp('      creating surface mass balance');
++smb_max=0.5; %m/yr
++sb=10^-2/1000.; %m/yr/m
++rel=450.*1000.; %m
++md.surfaceforcings.mass_balance=min(smb_max,sb*(rel-radius));
++
++disp('      creating velocities');
++constant=0.3;
++md.inversion.vx_obs=constant/2.*md.mesh.x.*(md.geometry.thickness).^-1;
++md.inversion.vy_obs=constant/2.*md.mesh.y.*(md.geometry.thickness).^-1;
++md.inversion.vel_obs=sqrt((md.inversion.vx_obs).^2+(md.inversion.vy_obs).^2);
++md.initialization.vx=zeros(md.mesh.numberofvertices,1);
++md.initialization.vy=zeros(md.mesh.numberofvertices,1);
++md.initialization.vz=zeros(md.mesh.numberofvertices,1);
++md.initialization.pressure=zeros(md.mesh.numberofvertices,1);
++
++%Deal with boundary conditions:
++disp('      boundary conditions for stressbalance model:');
++md=SetMarineIceSheetBC(md,'./RoundFront.exp');
++
++radius=sqrt((md.mesh.x).^2+(md.mesh.y).^2);
++pos=find(radius==min(radius));
++md.mesh.x(pos)=0.; md.mesh.y(pos)=0.; %the closest node to the center is changed to be exactly at the center
++
++md.stressbalance.spcvx(pos)=0.;
++md.stressbalance.spcvy(pos)=0.;
++md.stressbalance.spcvz(pos)=0.;
+
+Property changes on: ../trunk-jpl/examples/IceflowModels/EISMINT.par
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/IceflowModels/RoundFront.exp
+===================================================================
+--- ../trunk-jpl/examples/IceflowModels/RoundFront.exp	(revision 0)
++++ ../trunk-jpl/examples/IceflowModels/RoundFront.exp	(revision 18198)
+@@ -0,0 +1,47 @@
++## Name:
++## Icon:0
++# Points Count Value
++41 1
++# X pos Y pos
++1000000.000000 0.000000
++987688.340595 156434.465040
++951056.516295 309016.994375
++891006.524188 453990.499740
++809016.994375 587785.252292
++707106.781187 707106.781187
++587785.252292 809016.994375
++453990.499740 891006.524188
++309016.994375 951056.516295
++156434.465040 987688.340595
++0.000000 1000000.000000
++-156434.465040 987688.340595
++-309016.994375 951056.516295
++-453990.499740 891006.524188
++-587785.252292 809016.994375
++-707106.781187 707106.781187
++-809016.994375 587785.252292
++-891006.524188 453990.499740
++-951056.516295 309016.994375
++-987688.340595 156434.465040
++-1000000.000000 0.000000
++-987688.340595 -156434.465040
++-951056.516295 -309016.994375
++-891006.524188 -453990.499740
++-809016.994375 -587785.252292
++-707106.781187 -707106.781187
++-587785.252292 -809016.994375
++-453990.499740 -891006.524188
++-309016.994375 -951056.516295
++-156434.465040 -987688.340595
++-0.000000 -1000000.000000
++156434.465040 -987688.340595
++309016.994375 -951056.516295
++453990.499740 -891006.524188
++587785.252292 -809016.994375
++707106.781187 -707106.781187
++809016.994375 -587785.252292
++891006.524188 -453990.499740
++951056.516295 -309016.994375
++987688.340595 -156434.465040
++1000000.000000 0.000000
++
+Index: ../trunk-jpl/examples/IceflowModels/Square.exp
+===================================================================
+--- ../trunk-jpl/examples/IceflowModels/Square.exp	(revision 0)
++++ ../trunk-jpl/examples/IceflowModels/Square.exp	(revision 18198)
+@@ -0,0 +1,10 @@
++## Name:domainoutline
++## Icon:0
++# Points Count  Value
++5 1.
++# X pos Y pos
++0 0
++1000000 0
++1000000 1000000
++0 1000000
++0 0
+
+Property changes on: ../trunk-jpl/examples/IceflowModels/Square.exp
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/Inversion/Square.par
+===================================================================
+--- ../trunk-jpl/examples/Inversion/Square.par	(revision 0)
++++ ../trunk-jpl/examples/Inversion/Square.par	(revision 18198)
+@@ -0,0 +1,24 @@
++%Start defining model parameters here
++
++disp('      creating thickness');
++hmin = 300;
++hmax = 1000;
++ymin = min(md.mesh.y);
++ymax = max(md.mesh.y);
++md.geometry.thickness = hmax+(hmin-hmax)*(md.mesh.y-ymin)/(ymax-ymin);
++md.geometry.base      = -md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness;
++md.geometry.surface   = md.geometry.base+md.geometry.thickness;
++
++disp('      creating drag');
++md.friction.coefficient=200*ones(md.mesh.numberofvertices,1);
++md.friction.coefficient(find(md.mask.groundedice_levelset<0.))=0.;
++md.friction.p = ones(md.mesh.numberofelements,1);
++md.friction.q = ones(md.mesh.numberofelements,1);
++
++disp('      creating flow law paramter');
++md.materials.rheology_B=1.8*10^8*ones(md.mesh.numberofvertices,1);
++md.materials.rheology_B(find(md.mesh.x<md.mesh.y))=1.4*10^8;
++md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
++
++disp('      creating boundary conditions');
++md=SetIceShelfBC(md,'Front.exp');
+Index: ../trunk-jpl/examples/Inversion/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Inversion/runme.m	(revision 0)
++++ ../trunk-jpl/examples/Inversion/runme.m	(revision 18198)
+@@ -0,0 +1,61 @@
++step=1;
++if step==1
++	%Generate observation
++	md = model;
++	md = triangle(md,'DomainOutline.exp',100000);
++    
++	md = setmask(md,'','');
++    
++	md = parameterize(md,'Square.par');
++	md = setflowequation(md,'SSA','all');
++	md.cluster = generic('np',2);
++    
++    md.geometry.surface=md.geometry.surface+100;
++    md.geometry.base = md.geometry.base+100;
++    md.materials.rheology_B(:)=1.8*10^8;
++    md.friction.coefficient(:)=50;
++    md.friction.coefficient(find(md.mesh.x>400000 & md.mesh.x<600000))=10;
++    
++	md = solve(md,StressbalanceSolutionEnum);
++	plotmodel(md,'data',md.friction.coefficient,'caxis',[0 100],'figure',1);
++	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
++	save model1 md
++end
++if step==2
++	%Modify rheology, now constant
++	loadmodel('model1.mat');
++	md.friction.coefficient(:)=50;
++
++	%results of previous run are taken as observations
++	md.inversion=m1qn3inversion();
++	md.inversion.vx_obs  = md.results.StressbalanceSolution.Vx;
++	md.inversion.vy_obs  = md.results.StressbalanceSolution.Vy;
++	md.inversion.vel_obs = md.results.StressbalanceSolution.Vel;
++
++	md = solve(md,StressbalanceSolutionEnum);
++	plotmodel(md,'data',md.friction.coefficient,'caxis',[0 100],'figure',1);
++	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
++	save model2 md
++end
++if step==3
++	%invert for ice rigidity
++	loadmodel('model2.mat');
++
++	%Set up inversion parameters
++	maxsteps = 20;
++	md.inversion.iscontrol = 1;
++	md.inversion.control_parameters = {'FrictionCoefficient'};
++	md.inversion.maxsteps = maxsteps;
++    md.inversion.dxmin=10^-6;
++	md.inversion.cost_functions = [103 501];
++	md.inversion.cost_functions_coefficients = ones(md.mesh.numberofvertices,2);
++    md.inversion.cost_functions_coefficients(:,2)=0;
++	md.inversion.min_parameters    = 10^-5*ones(md.mesh.numberofvertices,1);
++	md.inversion.max_parameters    = 100*ones(md.mesh.numberofvertices,1);
++
++	%Go solve!
++	md.verbose=verbose(0);
++	md=solve(md,StressbalanceSolutionEnum);
++	plotmodel(md,'data',md.results.StressbalanceSolution.FrictionCoefficient,'caxis',[0 100],'figure',1);
++	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
++end
+Index: ../trunk-jpl/examples/Inversion/DomainOutline.exp
+===================================================================
+--- ../trunk-jpl/examples/Inversion/DomainOutline.exp	(revision 0)
++++ ../trunk-jpl/examples/Inversion/DomainOutline.exp	(revision 18198)
+@@ -0,0 +1,10 @@
++## Name:DomainOutline
++## Icon:0
++# Points Count  Value
++5 1.000000
++# X pos Y pos
++0 0
++1000000 0
++1000000 1000000
++0 1000000
++0 0
+Index: ../trunk-jpl/examples/Inversion/Front.exp
+===================================================================
+--- ../trunk-jpl/examples/Inversion/Front.exp	(revision 0)
++++ ../trunk-jpl/examples/Inversion/Front.exp	(revision 18198)
+@@ -0,0 +1,10 @@
++## Name:icefront
++## Icon:0
++# Points Count  Value
++5 1.
++# X pos Y pos
++-1000 900000
++-1000 1100000
++1100000 1100000
++1100000 900000
++-1000 900000
+
+Property changes on: ../trunk-jpl/examples/Inversion/Front.exp
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/17984-18295/ISSM-18198-18199.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18198-18199.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18198-18199.diff	(revision 18296)
@@ -0,0 +1,4 @@
+Index: ../trunk-jpl/examples/Pig/06PIG_Application.pdf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/17984-18295/ISSM-18199-18200.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18199-18200.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18199-18200.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/NightlyRun/test701.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test701.m	(revision 18199)
++++ ../trunk-jpl/test/NightlyRun/test701.m	(revision 18200)
+@@ -38,7 +38,7 @@
+ md=setflowequation(md,'FS','all');
+ md.stressbalance.abstol=NaN;
+ md.stressbalance.FSreconditioning=1;
+-md.flowequation.XTH_r=10000;
++md.flowequation.augmented_lagrangian_r=10000;
+ md.miscellaneous.name = 'flowline';
+ md.cluster=generic('np',2);
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18200-18201.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18200-18201.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18200-18201.diff	(revision 18296)
@@ -0,0 +1,49 @@
+Index: ../trunk-jpl/examples/Jakobshavn/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Jakobshavn/runme.m	(revision 18200)
++++ ../trunk-jpl/examples/Jakobshavn/runme.m	(revision 18201)
+@@ -1,13 +1,13 @@
+-steps=[1:3];
++steps=[4];
+ 
+ if any(steps==1)
+ 	disp('	Step 1: Mesh creation'); 
+ 	md=triangle(model,'Domain.exp',2000);
+ 
+ 	%Get observed velocity field on mesh nodes
+-	ncdata='Greenland_5km_v1.1.nc';
++	ncdata='../Data/Greenland_5km_dev1.2.nc';
+ 	if ~exist(ncdata,'file'), 
+-		error('Download Greenland5km_v1.1.nc first on http://websrv.cs.umt.edu/isis/index.php/Present_Day_Greenland');
++		error('File Greenland_5km_dev1.2.nc not downloaded in Data Directory.  Please cd ../Data and run the download script.');
+ 	end
+ 	x1   = ncread(ncdata,'x1');
+ 	y1   = ncread(ncdata,'y1');
+@@ -83,7 +83,7 @@
+ 		'data',md.results.StressbalanceSolution.Vel,'title','Modeled Velocity',...
+ 		'colorbar#1','off','colorbar#2','on','colorbartitle#2','[m/yr]',...
+ 		'caxis#1-2',[0,7000],...
+-		'data',md.geometry.bed,'title','Bed elevation',...
++		'data',md.geometry.base,'title','Base elevation',...
+ 		'data',md.results.StressbalanceSolution.FrictionCoefficient,...
+ 		'title','Friction Coefficient',...
+ 		'colorbar#3','on','colorbartitle#3','[m]','colorbar#4','on');
+Index: ../trunk-jpl/examples/Jakobshavn/Jks.par
+===================================================================
+--- ../trunk-jpl/examples/Jakobshavn/Jks.par	(revision 18200)
++++ ../trunk-jpl/examples/Jakobshavn/Jks.par	(revision 18201)
+@@ -5,7 +5,7 @@
+ 
+ %Load SeaRISE dataset
+ disp('   Loading SeaRISE data from NetCDF');
+-ncdata = './Greenland_5km_v1.1.nc';
++ncdata = '../Data/Greenland_5km_dev1.2.nc';
+ x1    = ncread(ncdata,'x1');
+ y1    = ncread(ncdata,'y1');
+ thk   = ncread(ncdata,'thk')';
+@@ -57,4 +57,4 @@
+ 
+ disp('   Set other boundary conditions');
+ md=SetMarineIceSheetBC(md,'./Front.exp');
+-md.basalforcings.melting_rate=zeros(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18201-18202.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18201-18202.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18201-18202.diff	(revision 18296)
@@ -0,0 +1,172 @@
+Index: ../trunk-jpl/examples/Pig/Pig.par
+===================================================================
+--- ../trunk-jpl/examples/Pig/Pig.par	(revision 18201)
++++ ../trunk-jpl/examples/Pig/Pig.par	(revision 18202)
+@@ -128,7 +128,7 @@
+ 
+ disp('   Set boundary conditions');
+ md=SetMarineIceSheetBC(md);
+-md.basalforcings.melting_rate = zeros(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate = zeros(md.mesh.numberofvertices,1);
+ md.thermal.spctemperature     = [md.initialization.temperature;1]; %impose observed temperature on surface
+ md.masstransport.spcthickness    = NaN*ones(md.mesh.numberofvertices,1);
+ 
+Index: ../trunk-jpl/examples/Pig/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Pig/runme.m	(revision 18201)
++++ ../trunk-jpl/examples/Pig/runme.m	(revision 18202)
+@@ -1,14 +1,12 @@
+ %Which steps to be performed
+-steps=[2] ;
++steps=[1:5] ;
+ 
+-name_prefix='PIG.';
+ %Run Steps
+-org=organizer('repository','./Models','prefix',name_prefix,'steps',steps);
+ 
+ % {{{ Mesh Generation #1
+-if perform(org,'Mesh_generation'),
++if any(steps==1)
+ 
+-	md.miscellaneous.name=strcat(name_prefix,'Mesh_generation');
++	md.miscellaneous.name='PIG.Mesh_generation';
+ 
+ 	%Mesh parameters
+ 	domain =['./DomainOutline.exp'];
+@@ -69,18 +67,18 @@
+ 	plotmodel(md,'data','mesh')
+ 
+ 	% Convert x,y coordinates (Polar stereo) to lat/lon
+-	[md.mesh.lat,md.mesh.long]=xy2ll(md.mesh.x,md.mesh.y,-1,39,71);
++	[md.mesh.lat,md.mesh.long]=xy2ll(md.mesh.x,md.mesh.y,-1);
+ 	
+ 	% Save model
+-	savemodel(org,md);
++	save ./Models/PIG.Mesh_generation md;
+ end
+ % }}}
+ 
+ % {{{ Masks #2
+-if perform(org,'SetMask'), 
+-	
+-	md = loadmodel(org,'Mesh_generation');
++if any(steps==2) 
+ 
++	md = loadmodel('./Models/PIG.Mesh_generation');	
++
+ 	% Load SeaRISe dataset for Antarctica  
+ 	% http://websrv.cs.umt.edu/isis/index.php/Present_Day_Antarctica
+ 	searise='../Data/Antarctica_5km_withshelves_v0.75.nc';
+@@ -103,28 +101,28 @@
+ 	plotmodel(md,'data',md.mask.groundedice_levelset,'title','grounded/floating','data',md.mask.ice_levelset,'title','ice/no-ice')
+ 	
+ 	% Save model
+-	savemodel(org,md); 
++	save ./Models/PIG.SetMask md;
+ end
+ % }}}
+ 
+ % {{{ Parameterization #3
+-if perform(org,'Parameterization') 
++if any(steps==3) 
+ 
+-	md = loadmodel(org,'SetMask');
++	md = loadmodel('./Models/PIG.SetMask');
+ 	md = parameterize(md,'./Pig.par');
+ 
+ 	% Use a MacAyeal flow model
+ 	md = setflowequation(md,'SSA','all');
+ 	
+ 	% Save model
+-	savemodel(org,md); 
++	save ./Models/PIG.Parameterization md;
+ end
+ % }}}
+ 
+ % {{{ Control Method #4
+-if perform(org,'Control_drag') 
++if any(steps==4)
+ 
+-	md = loadmodel(org,'Parameterization');
++	md = loadmodel('./Models/PIG.Parameterization');
+ 
+ 	% Control general
+ 	md.inversion.iscontrol=1;
+@@ -162,14 +160,14 @@
+ 	plotmodel(md,'data',md.friction.coefficient)
+ 
+ 	% Save model
+-	savemodel(org,md); 
++	save ./Models/PIG.Control_drag md;
+ end
+ % }}}
+ 
+ % {{{ Plot #5
+-if perform(org,'PlotSSA')
++if any(steps==5)
+ 
+-	md = loadmodel(org,'Control_drag');
++	md = loadmodel('./Models/PIG.Control_drag');
+ 
+ 	plotmodel(md,'nlines',2,'ncols',2,'unit#all','km','axis#all','equal',...
+ 		'xlim#all',[min(md.mesh.x) max(md.mesh.x)]/10^3,...
+@@ -186,7 +184,7 @@
+ % }}}
+ 
+ % {{{ HO #6
+-if perform(org,'ModelHO')
++if any(steps==6)
+ 
+ 	% Load Model
+ 
+@@ -204,10 +202,10 @@
+ % }}}
+ 
+ % {{{ Plot #7
+-if perform(org,'PlotHO')
++if any(steps==7)
+ 
+-	mdHO = loadmodel(org,'ModelHO'); 
+-	mdSSA = loadmodel(org,'Control_drag');
++	mdHO = loadmodel('./Models/PIG.ModelHO');
++	mdSSA = loadmodel('./Models/PIG.Control_drag');
+ 
+ 	basal=find(mdHO.mesh.vertexonbase);
+ 	surf=find(mdHO.mesh.vertexonsurface);
+@@ -227,4 +225,4 @@
+ 						'colorbartitle#all','[m/yr]',...
+ 						'layer#5',1, 'log#1', 10,'log#3', 10,'log#5', 10);
+ end
+-% }}}
+\ No newline at end of file
++% }}}
+Index: ../trunk-jpl/examples/Pig/CheatSheet.m
+===================================================================
+--- ../trunk-jpl/examples/Pig/CheatSheet.m	(revision 18201)
++++ ../trunk-jpl/examples/Pig/CheatSheet.m	(revision 18202)
+@@ -1,6 +1,6 @@
+ if perform(org,'ModelHO')
+   % Load Model
+-  md = loadmodel(org,'Control_drag');
++  mdHO = loadmodel('./Models/PIG.Control_drag');
+   md.inversion.iscontrol=0;
+ 
+   disp('   Extruding mesh')
+@@ -14,5 +14,5 @@
+   md=solve(md,StressbalanceSolutionEnum);
+ 
+   % Save Model
+-  savemodel(org,md);
++  save ./Models/PIG.ModelHO md;
+ end
+Index: ../trunk-jpl/examples/Pig/PigRegion.m
+===================================================================
+--- ../trunk-jpl/examples/Pig/PigRegion.m	(revision 18201)
++++ ../trunk-jpl/examples/Pig/PigRegion.m	(revision 18202)
+@@ -51,4 +51,4 @@
+ vel_obs=sqrt(vx_obs.^2.+vy_obs.^2.);
+ imagesc(xred,yred,vel_obs)
+ 
+-%}}}
+\ No newline at end of file
++%}}}
Index: /issm/oecreview/Archive/17984-18295/ISSM-18202-18203.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18202-18203.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18202-18203.diff	(revision 18296)
@@ -0,0 +1,431 @@
+Index: ../trunk-jpl/examples/ISMIP/CheatyRunme.m
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/CheatyRunme.m	(revision 18202)
++++ ../trunk-jpl/examples/ISMIP/CheatyRunme.m	(revision 18203)
+@@ -2,17 +2,15 @@
+ %step 7 is specific to ISMIPA
+ %step 8 is specific to ISMIPF
+ 
+-steps=[1 2 3 4 5 6 8];
++steps=[1:7];
+ 
+ % parameter file to be used, choose between CheatyIsmipA.par or CheatyIsmipF.par
+ ParamFile='CheatyIsmipF.par'
+ 
+-name_prefix='ISMIP';
+ %Run Steps
+-org=organizer('repository','./Models','prefix',name_prefix,'steps',steps);
+ 
+ % {{{ Mesh Generation #1
+-if perform(org,'Mesh_Generation')
++if any(steps==1)
+ 
+ 	%initialize md as a new model #help model
+ 	%->
+@@ -30,17 +28,17 @@
+ 	plotmodel(md,'data','mesh')
+ 	% save the given model
+ 	%->
+-	savemodel(org,md);
++	save ./Models/ISMIP.Mesh_generation md;
+ end
+ % }}}
+ 
+ % {{{ Masks #2
+-if perform(org,'SetMask'), 
++if any(steps==2)
+ 
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+ 	%->
+-	md=loadmodel(org,'Mesh_Generation');
++	md = loadmodel('./Models/ISMIP.Mesh_generation');
+ 	% set the mask #help setmask
+ 	% all MISMIP nodes are grounded
+ 	%->
+@@ -50,35 +48,35 @@
+ 	plotmodel(md,'data',md.mask.groundedice_levelset);
+ 	% save the given model
+ 	%->
+-	savemodel(org,md);
++	save ./Models/ISMIP.SetMask md;
+ end
+ % }}}
+ 
+ % {{{ Parameterization #3
+-if perform(org,'Parameterization') 
++if any(steps==3)
+ 
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+ 	%->
+-	md=loadmodel(org,'SetMask');
++	md = loadmodel('./Models/ISMIP.SetMask');
+ 	% parametrize the model # help parameterize
+ 	% you will need to fil-up the parameter file defined by the
+-  % ParamFile variable
++	% ParamFile variable
+ 	%->
+ 	md=parameterize(md,ParamFile);
+ 	% save the given model
+ 	%->
+-	savemodel(org,md);
++	save ./Models/ISMIP.Parameterization md;
+ end
+ % }}}
+ 
+ % {{{ Extrusion #4
+-if perform(org,'Extrusion')
++if any(steps==4)
+ 	
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+ 	%->
+-	md=loadmodel(org,'Parameterization');
++	md = loadmodel('./Models/ISMIP.Parameterization');
+ 	% vertically extrude the preceding mesh #help extrude
+ 	% only 5 layers exponent 1
+ 	%->
+@@ -88,35 +86,34 @@
+ 	plotmodel(md,'data',md.geometry.base)
+ 	% save the given model
+ 	%->
+-	savemodel(org,md);
++	save ./Models/ISMIP.Extrusion md;
+ end
+ % }}}
+ 
+ % {{{ Set the flow computing method #5
++if any(steps==5)
+ 
+-if perform(org,'SetFlow')
+-
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+ 	%->
+-	md=loadmodel(org,'Extrusion');
++	md = loadmodel('./Models/ISMIP.Extrusion');
+ 	% set the approximation for the flow computation #help setflowequation
+ 	% We will be using the Higher Order Model (HO)
+ 	%->
+ 	md=setflowequation(md,'HO','all');
+ 	% save the given model
+ 	%->
+-	savemodel(org,md);
++	save ./Models/ISMIP.SetFlow md;
+ end
+ % }}}
+ 
+ % {{{ Set Boundary Conditions #6
+-if perform(org,'BoundaryCondition')
++if any(steps==6)
+ 
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+ 	%->
+-	md=loadmodel(org,'SetFlow');
++	md = loadmodel('./Models/ISMIP.SetFlow');
+ 	% dirichlet boundary condition are known as SPCs
+ 	% ice frozen to the base, no velocity	#md.stressbalance
+ 	% SPCs are initialized at NaN one value per vertex
+@@ -129,7 +126,7 @@
+ 	% extract the nodenumbers at the base #md.mesh.vertexonbase
+ 	%->
+ 	basalnodes=find(md.mesh.vertexonbase);
+-  % set the sliding to zero on the bed
++	% set the sliding to zero on the bed
+ 	%->
+ 	md.stressbalance.spcvx(basalnodes)=0.0;
+ 	%->
+@@ -161,16 +158,16 @@
+   end
+ 	% save the given model
+ 	%->
+-	savemodel(org,md);
++	save ./Models/ISMIP.BoundaryCondition md;
+ end
+ % }}}
+ 
+ % {{{ Solving #7
+-if perform(org,'SolvingISMIPA')
++if any(steps==7)
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+ 	%->
+-	md=loadmodel(org,'BoundaryCondition');
++	md = loadmodel('./Models/ISMIP.BoundaryCondition');
+ 	% Set cluster #md.cluster
+ 	% generic parameters #help generic
+ 	% set only the name and number of process
+@@ -185,7 +182,7 @@
+ 	md=solve(md,StressbalanceSolutionEnum());
+ 	% save the given model
+ 	%->
+-	savemodel(org,md);
++	save ./Models/ISMIP.StressBalance md;
+ 	% plot the surface velocities #plotdoc
+ 	%->
+ 	plotmodel(md,'data',md.results.StressbalanceSolution.Vel)
+@@ -193,11 +190,11 @@
+ % }}}
+ 
+ % {{{ Solving #8
+-if perform(org,'SolvingISMIPF')
++if any(steps==8)
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+ 	%->
+-	md=loadmodel(org,'BoundaryCondition');
++	md = loadmodel('./Models/ISMIP.BoundaryCondition');
+ 	% Set cluster #md.cluster
+ 	% generic parameters #help generic
+ 	% set only the name and number of process
+@@ -224,7 +221,7 @@
+ 	md=solve(md,TransientSolutionEnum);
+ 	% save the given model
+ 	%->
+-	savemodel(org,md);
++	save ./Models/ISMIP.Transient md;
+ 	% plot the surface velocities #plotdoc
+ 	%->
+ 	plotmodel(md,'data',md.results.TransientSolution(20).Vel)
+Index: ../trunk-jpl/examples/ISMIP/CheatyIsmipA.par
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/CheatyIsmipA.par	(revision 18202)
++++ ../trunk-jpl/examples/ISMIP/CheatyIsmipA.par	(revision 18203)
+@@ -49,4 +49,4 @@
+ %Set the default boundary conditions for an ice-sheet 
+ % #help SetIceSheetBC
+ %->
+-md=SetIceSheetBC(md);
+\ No newline at end of file
++md=SetIceSheetBC(md);
+Index: ../trunk-jpl/examples/ISMIP/runme.m
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/runme.m	(revision 18202)
++++ ../trunk-jpl/examples/ISMIP/runme.m	(revision 18203)
+@@ -7,12 +7,10 @@
+ % parameter file to be used, choose between IsmipA.par or IsmipF.par
+ ParamFile='IsmipA.par'
+ 
+-name_prefix='ISMIP';
+ %Run Steps
+-org=organizer('repository','./Models','prefix',name_prefix,'steps',steps);
+ 
+ % {{{ Mesh Generation #1
+-if perform(org,'Mesh_Generation')
++if any(steps==1) 
+ 
+ 	%initialize md as a new model #help model
+ 	%->
+@@ -31,7 +29,7 @@
+ % }}}
+ 
+ % {{{ Masks #2
+-if perform(org,'SetMask'), 
++if any(steps==2) 
+ 
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+@@ -51,7 +49,7 @@
+ % }}}
+ 
+ % {{{ Parameterization #3
+-if perform(org,'Parameterization') 
++if any(steps==3) 
+ 
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+@@ -69,7 +67,7 @@
+ % }}}
+ 
+ % {{{ Extrusion #4
+-if perform(org,'Extrusion')
++if any(steps==4)
+ 	
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+@@ -90,7 +88,7 @@
+ 
+ % {{{ Set the flow computing method #5
+ 
+-if perform(org,'SetFlow')
++if any(steps==5)
+ 
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+@@ -107,7 +105,7 @@
+ % }}}
+ 
+ % {{{ Set Boundary Conditions #6
+-if perform(org,'BoundaryCondition')
++if any(steps==6)
+ 
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+@@ -161,7 +159,7 @@
+ % }}}
+ 
+ % {{{ Solving #7
+-if perform(org,'SolvingISMIPA')
++if any(steps==7)
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+ 	%->
+@@ -187,7 +185,7 @@
+ % }}}
+ 
+ % {{{ Solving #8
+-if perform(org,'SolvingISMIPF')
++if any(steps==8)
+ 	% load the preceding step #help loadmodel
+ 	% path is given by the organizer with the name of the given step
+ 	%->
+Index: ../trunk-jpl/examples/ISMIP/CheatyIsmipF.par
+===================================================================
+--- ../trunk-jpl/examples/ISMIP/CheatyIsmipF.par	(revision 18202)
++++ ../trunk-jpl/examples/ISMIP/CheatyIsmipF.par	(revision 18203)
+@@ -63,4 +63,4 @@
+ %->
+ md.initialization.vz=zeros(md.mesh.numberofvertices,1);
+ %->
+-md.initialization.pressure=zeros(md.mesh.numberofvertices,1);
+\ No newline at end of file
++md.initialization.pressure=zeros(md.mesh.numberofvertices,1);
+Index: ../trunk-jpl/examples/UncertaintyQuantification/runme.m
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 18202)
++++ ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 18203)
+@@ -1,27 +1,27 @@
+ %PIG Uncertainty Quantification Application
+-steps=[3]; eval(['addpath ' pwd]);
++steps=[3]; 
+ 
+ if any(steps==1) 
+ 	disp('   Step 1: plot flux gates'); 
+ 	
+-	md = loadmodel('../Data/PIG.Control_drag_default');
++	md = loadmodel('../Pig/Models/PIG.Control_drag');
+ 
+ 	texts=cell(1,13);
+ 	textpositions=cell(1,13);
+ 
+ 	for i=1:13,
+-		contour=expread(['./Exp_Par/MassFluxes/MassFlux' num2str(i) '.exp']);
++		contour=expread(['./MassFluxes/MassFlux' num2str(i) '.exp']);
+ 		textpositions{i}=[contour.x(end) contour.y(end)];
+ 	end
+ 
+ 	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'log',10,'expdisp',...
+-		{'Exp_Par/MassFluxes/MassFlux1.exp','Exp_Par/MassFluxes/MassFlux2.exp',...
+-		'Exp_Par/MassFluxes/MassFlux3.exp','Exp_Par/MassFluxes/MassFlux4.exp',...
+-		'Exp_Par/MassFluxes/MassFlux5.exp','Exp_Par/MassFluxes/MassFlux6.exp',...
+-		'Exp_Par/MassFluxes/MassFlux7.exp','Exp_Par/MassFluxes/MassFlux8.exp',...
+-		'Exp_Par/MassFluxes/MassFlux9.exp','Exp_Par/MassFluxes/MassFlux10.exp',...
+-		'Exp_Par/MassFluxes/MassFlux11.exp','Exp_Par/MassFluxes/MassFlux12.exp',...
+-		'Exp_Par/MassFluxes/MassFlux13.exp'},...
++		{'MassFluxes/MassFlux1.exp','MassFluxes/MassFlux2.exp',...
++		'MassFluxes/MassFlux3.exp','MassFluxes/MassFlux4.exp',...
++		'MassFluxes/MassFlux5.exp','MassFluxes/MassFlux6.exp',...
++		'MassFluxes/MassFlux7.exp','MassFluxes/MassFlux8.exp',...
++		'MassFluxes/MassFlux9.exp','MassFluxes/MassFlux10.exp',...
++		'MassFluxes/MassFlux11.exp','MassFluxes/MassFlux12.exp',...
++		'MassFluxes/MassFlux13.exp'},...
+ 		'expstyle',{'k-','k-','k-','k-','k-','k-','k-',...
+ 		'k-','k-','k-','k-','k-','k-'},'linewidth',2,...
+ 		'text',{'1','2','3','4','5','6','7',...
+@@ -32,7 +32,7 @@
+ if any(steps==2) 
+ 	disp('   Step 2: compute cross overs from CRESIS'); 
+ 	
+-	md = loadmodel('../Data/PIG.Control_drag_default');
++	md = loadmodel('../Pig/Models/PIG.Control_drag');
+ 
+ 	%load cross overs: CRESIS McCord Antarctica, 2009 (courtesy of John Paden)
+ 	load('../Data/CrossOvers2009.mat');
+@@ -44,7 +44,7 @@
+ 	pos=find(isnan(DeltaHH)); DeltaHH(pos)=0;
+ 
+ 	%filter out unrealistic error ranges
+-	flags=ContourToNodes(md.mesh.x,md.mesh.y,'Exp_Par/ErrorContour.exp',1);
++	flags=ContourToNodes(md.mesh.x,md.mesh.y,'ErrorContour.exp',1);
+ 	pos=find(~flags); DeltaHH(pos)=0; 
+ 
+ 	%avoid large unrealistic values
+@@ -63,7 +63,7 @@
+ 	disp('   Step 3: sampling analysis'); 
+ 	
+ 	%load model and cross over errors
+-	md = loadmodel('../Data/PIG.Control_drag_default');
++	md = loadmodel('../Pig/Models/PIG.Control_drag');
+ 	load -mat Models/PIG.CrossOvers
+ 
+ 	%partition the mesh
+@@ -122,7 +122,7 @@
+ 	                           'MassFlux11.exp',...
+ 	                           'MassFlux12.exp',...
+ 	                           'MassFlux13.exp'};
+-	md.qmu.mass_flux_profile_directory='../Exp_Par/MassFluxes/';
++	md.qmu.mass_flux_profile_directory='../MassFluxes/';
+ 
+ 	%%  sampling analysis
+ 	md.qmu.method     =dakota_method('nond_samp');
+@@ -151,7 +151,7 @@
+ 	disp('   Step 4: sensitivity analysis'); 
+ 	
+ 	%load model
+-	md = loadmodel('../Data/PIG.Control_drag_default');
++	md = loadmodel('../Pig/Models/PIG.Control_drag');
+ 
+ 	%partition the mesh
+ 	md.qmu.numberofpartitions=10;
+@@ -196,7 +196,7 @@
+ 	                           'MassFlux11.exp',...
+ 	                           'MassFlux12.exp',...
+ 	                           'MassFlux13.exp'};
+-	md.qmu.mass_flux_profile_directory='../Exp_Par/MassFluxes/';
++	md.qmu.mass_flux_profile_directory='../MassFluxes/';
+ 
+ 	%method: local reliability
+ 	md.qmu.method     =dakota_method('nond_l');
+@@ -267,7 +267,7 @@
+ 	sh=md.results.dakota.dresp_out(index).sens(21:30); sh=sh(md.qmu.partition+1)/1e12*60*60*24*365;
+ 
+ 	plotmodel(md,'data',sh,'data',sa,'data',sb,'expdisp#all',...
+-		['Exp_Par/MassFluxes/MassFlux' num2str(index) '.exp'],...
++		['MassFluxes/MassFlux' num2str(index) '.exp'],...
+ 		'expstyle#all','b-','linewidth#all',2,...
+ 		'nlines',3,'ncols',1, 'axis#all','image',...
+ 		'colorbar#all','on','colorbarfontsize#all',10,...
+@@ -280,7 +280,7 @@
+ 	ifh=importancefactors(md,'scaled_Thickness',['indexed_MassFlux_' num2str(index)]);
+ 
+ 	plotmodel(md,'data',ifh,'data',ifa,'data',ifb,'expdisp#all',...
+-		['Exp_Par/MassFluxes/MassFlux' num2str(index) '.exp'],...
++		['MassFluxes/MassFlux' num2str(index) '.exp'],...
+ 		'expstyle#all','b-','linewidth#all',2,'log#all',10,...
+ 		'nlines',3,'ncols',1, 'axis#all','image','caxis#all',[1e-10 1],...
+ 		'colorbar#all','on','colorbarfontsize#all',10,...
+Index: ../trunk-jpl/examples/Inversion/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Inversion/runme.m	(revision 18202)
++++ ../trunk-jpl/examples/Inversion/runme.m	(revision 18203)
+@@ -1,4 +1,4 @@
+-step=1;
++step=3;
+ if step==1
+ 	%Generate observation
+ 	md = model;
+@@ -46,10 +46,10 @@
+ 	md.inversion.iscontrol = 1;
+ 	md.inversion.control_parameters = {'FrictionCoefficient'};
+ 	md.inversion.maxsteps = maxsteps;
+-    md.inversion.dxmin=10^-6;
++	md.inversion.dxmin=10^-6;
+ 	md.inversion.cost_functions = [103 501];
+ 	md.inversion.cost_functions_coefficients = ones(md.mesh.numberofvertices,2);
+-    md.inversion.cost_functions_coefficients(:,2)=0;
++	md.inversion.cost_functions_coefficients(:,2)=0;
+ 	md.inversion.min_parameters    = 10^-5*ones(md.mesh.numberofvertices,1);
+ 	md.inversion.max_parameters    = 100*ones(md.mesh.numberofvertices,1);
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18203-18204.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18203-18204.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18203-18204.diff	(revision 18296)
@@ -0,0 +1,11 @@
+Index: ../trunk-jpl/examples/UncertaintyQuantification/runme.m
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 18203)
++++ ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 18204)
+@@ -1,5 +1,5 @@
+ %PIG Uncertainty Quantification Application
+-steps=[3]; 
++steps=[1]; 
+ 
+ if any(steps==1) 
+ 	disp('   Step 1: plot flux gates'); 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18204-18205.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18204-18205.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18204-18205.diff	(revision 18296)
@@ -0,0 +1,64 @@
+Index: ../trunk-jpl/examples/Greenland/Greenland.par
+===================================================================
+--- ../trunk-jpl/examples/Greenland/Greenland.par	(revision 18204)
++++ ../trunk-jpl/examples/Greenland/Greenland.par	(revision 18205)
+@@ -57,7 +57,8 @@
+ 
+ disp('   Set other boundary conditions');
+ md.mask.ice_levelset(md.mesh.vertexonboundary==1)=0;
+-md.basalforcings.melting_rate = zeros(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate = zeros(md.mesh.numberofvertices,1);
++md.basalforcings.groundedice_melting_rate = zeros(md.mesh.numberofvertices,1);
+ md.thermal.spctemperature     = [md.initialization.temperature;1]; %impose observed temperature on surface
+ md.masstransport.spcthickness    = NaN*ones(md.mesh.numberofvertices,1);
+ 
+Index: ../trunk-jpl/examples/Greenland/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Greenland/runme.m	(revision 18204)
++++ ../trunk-jpl/examples/Greenland/runme.m	(revision 18205)
+@@ -1,5 +1,5 @@
+ clear all;
+-steps=[ 1 ];
++steps=[1];
+ 
+ %Location of SeaRISE dataset
+ ncdata='../Data/Greenland_5km_dev1.2.nc';
+@@ -8,7 +8,7 @@
+ 	disp('   Step 1: Mesh creation');
+ 
+ 	%Generate initial uniform mesh (resolution = 20000 m)
+-	md=triangle(model,'./Exp_Par/DomainOutline.exp',20000);
++	md=triangle(model,'./DomainOutline.exp',20000);
+ 
+ 	% Get velocities (Note: You can use ncdisp('file') to see an ncdump)
+ 	x1   = ncread(ncdata,'x1');
+@@ -35,7 +35,7 @@
+ 	md = loadmodel('./Models/Greenland.Mesh_generation');
+ 
+ 	md = setmask(md,'','');
+-	md = parameterize(md,'./Exp_Par/Greenland.par');
++	md = parameterize(md,'./Greenland.par');
+ 	md = setflowequation(md,'SSA','all');
+ 
+ 	save ./Models/Greenland.Parameterization md; 
+Index: ../trunk-jpl/examples/Pig/Pig.par
+===================================================================
+--- ../trunk-jpl/examples/Pig/Pig.par	(revision 18204)
++++ ../trunk-jpl/examples/Pig/Pig.par	(revision 18205)
+@@ -129,6 +129,7 @@
+ disp('   Set boundary conditions');
+ md=SetMarineIceSheetBC(md);
+ md.basalforcings.floatingice_melting_rate = zeros(md.mesh.numberofvertices,1);
++md.basalforcings.groundedice_melting_rate = zeros(md.mesh.numberofvertices,1);
+ md.thermal.spctemperature     = [md.initialization.temperature;1]; %impose observed temperature on surface
+ md.masstransport.spcthickness    = NaN*ones(md.mesh.numberofvertices,1);
+ 
+Index: ../trunk-jpl/examples/Jakobshavn/Jks.par
+===================================================================
+--- ../trunk-jpl/examples/Jakobshavn/Jks.par	(revision 18204)
++++ ../trunk-jpl/examples/Jakobshavn/Jks.par	(revision 18205)
+@@ -58,3 +58,4 @@
+ disp('   Set other boundary conditions');
+ md=SetMarineIceSheetBC(md,'./Front.exp');
+ md.basalforcings.floatingice_melting_rate=zeros(md.mesh.numberofvertices,1);
++md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18205-18206.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18205-18206.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18205-18206.diff	(revision 18296)
@@ -0,0 +1,30 @@
+Index: ../trunk-jpl/externalpackages/autotools/install.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/autotools/install.sh	(revision 18205)
++++ ../trunk-jpl/externalpackages/autotools/install.sh	(revision 18206)
+@@ -9,9 +9,9 @@
+ #install autoconf
+ echo " === INSTALLING AUTOCONF =="
+ rm -rf src
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/autoconf-2.68.tar.gz' 'autoconf-2.68.tar.gz'
+-tar -zxvf autoconf-2.68.tar.gz
+-mv autoconf-2.68 src
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/autoconf-2.69.tar.gz' 'autoconf-2.69.tar.gz'
++tar -zxvf autoconf-2.69.tar.gz
++mv autoconf-2.69 src
+ cd src 
+ ./configure --prefix="$ISSM_DIR/externalpackages/autotools/install" 
+ make  
+@@ -21,9 +21,9 @@
+ #install automake
+ echo " === INSTALLING AUTOMAKE =="
+ rm -rf src
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/automake-1.11.3.tar.gz' 'automake-1.11.3.tar.gz'
+-tar -zxvf  automake-1.11.3.tar.gz
+-mv automake-1.11.3 src
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/automake-1.14.tar.gz' 'automake-1.14.tar.gz'
++tar -zxvf  automake-1.14.tar.gz
++mv automake-1.14 src
+ cd src 
+ ./configure --prefix="$ISSM_DIR/externalpackages/autotools/install" 
+ make  
Index: /issm/oecreview/Archive/17984-18295/ISSM-18206-18207.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18206-18207.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18206-18207.diff	(revision 18296)
@@ -0,0 +1,187 @@
+Index: ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 18206)
++++ ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 18207)
+@@ -91,22 +91,24 @@
+ 	/*Intermediaries*/
+ 	int          dim;
+ 	IssmDouble   Jdet,r,divu;
+-	IssmDouble   dvx[3],dvy[3],dvz[3];
+ 	IssmDouble   *xyz_list = NULL;
+ 	int numnodes = element->GetNumberOfNodes();
+ 
+-	/*Initialize Element matrix and vectors*/
+-	ElementVector* pe   = element->NewElementVector();
+-	IssmDouble*    basis = xNew<IssmDouble>(numnodes);
+-
+ 	/*Retrieve all inputs and parameters*/
+ 	element->FindParam(&dim,DomainDimensionEnum);
+ 	element->FindParam(&r,AugmentedLagrangianREnum);
+ 	element->GetVerticesCoordinates(&xyz_list);
+ 
++	/*Initialize Element matrix and vectors*/
++	ElementVector* pe    = element->NewElementVector();
++	IssmDouble*    basis = xNew<IssmDouble>(numnodes);
++	IssmDouble*    dvx   = xNew<IssmDouble>(dim);
++	IssmDouble*    dvy   = xNew<IssmDouble>(dim);
++	IssmDouble*    dvz   = xNew<IssmDouble>(dim);
++
+ 	Input* vx_input=element->GetInput(VxEnum);     _assert_(vx_input);
+ 	Input* vy_input=element->GetInput(VyEnum);     _assert_(vy_input);
+-	Input* vz_input;
++	Input* vz_input = NULL;
+ 	if(dim==3){vz_input=element->GetInput(VzEnum); _assert_(vz_input);}
+ 
+ 	Gauss* gauss = element->NewGauss(5);
+@@ -121,10 +123,11 @@
+ 			vz_input->GetInputDerivativeValue(&dvz[0],xyz_list,gauss);
+ 		}
+ 
++		divu=dvx[0]+dvy[1];
++		if (dim==3) divu=divu+dvz[2];
++
+ 		for(int i=0;i<numnodes;i++){
+-			divu=dvx[0]+dvy[1];
+-			if (dim==3) divu=divu+dvz[2];
+-			pe->values[i]+=divu*r*Jdet*gauss->weight*basis[i];
++			pe->values[i] += - r * divu * Jdet * gauss->weight * basis[i];
+ 		}
+ 	}
+ 
+@@ -132,6 +135,9 @@
+ 	delete gauss;
+ 	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(basis);
++	xDelete<IssmDouble>(dvx);
++	xDelete<IssmDouble>(dvy);
++	xDelete<IssmDouble>(dvz);
+ 	return pe;
+ }/*}}}*/
+ void UzawaPressureAnalysis::GetM(IssmDouble* M,Element* element,Gauss* gauss){/*{{{*/
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_la.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_la.cpp	(revision 18206)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_la.cpp	(revision 18207)
+@@ -12,7 +12,6 @@
+ 	/*intermediary: */
+ 	Matrix<IssmDouble>*  Kff     = NULL;
+ 	Matrix<IssmDouble>*  Kfs     = NULL;
+-	Vector<IssmDouble>*  ug_old  = NULL;
+ 	Vector<IssmDouble>*  ug      = NULL;
+ 	Vector<IssmDouble>*  uf      = NULL;
+ 	Vector<IssmDouble>*  pf      = NULL;
+@@ -22,6 +21,8 @@
+ 	Vector<IssmDouble>*  pug_old = NULL;
+ 	IssmDouble           eps_rel,r,theta; // 0<theta<.5   -> .15<theta<.45
+ 	int                  configuration_type,max_nonlinear_iterations;
++	bool                 vel_converged      = false;
++	bool                 pressure_converged = false;
+ 
+ 	/*Create analysis*/
+ 	StressbalanceAnalysis* stressanalysis   = new StressbalanceAnalysis();
+@@ -39,21 +40,22 @@
+ 
+ 	/*Convergence criterion*/
+ 	int  count = 0;
+-	GetSolutionFromInputsx(&ug,femmodel);
+-	Vector<IssmDouble>* vx     = NULL;
+-	Vector<IssmDouble>* vx_old = NULL;
+-	GetVectorFromInputsx(&vx,femmodel,VxEnum,VertexEnum);
++	Vector<IssmDouble>* vel     = NULL;
++	Vector<IssmDouble>* vel_old = NULL;
++	GetVectorFromInputsx(&vel,femmodel,VxEnum,VertexEnum);
++	GetVectorFromInputsx(&pug,femmodel,PressureEnum,VertexEnum);
+ 
+ 	while(true){
+ 		count++;
+ 
+ 		/*save pointer to old velocity*/
+-		delete ug_old;ug_old=ug;
+-		delete vx_old;vx_old=vx;
+-		delete pug_old;pug_old=pug;
++		delete vel_old;vel_old=vel;
++		delete pug_old;pug_old=pug; 
++		pressure_converged=false; vel_converged=false;
+ 
+ 		/*Solve KU=F*/
+ 		femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
++		femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
+ 		SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel);
+ 		CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
+ 		Reduceloadx(pf, Kfs, ys); delete Kfs;
+@@ -62,36 +64,49 @@
+ 		Mergesolutionfromftogx(&ug, uf,ys,femmodel->nodes,femmodel->parameters);delete uf; delete ys;
+ 
+ 		/*Update solution*/
+-		InputUpdateFromSolutionx(femmodel,ug); 
+-		GetVectorFromInputsx(&vx,femmodel,VxEnum,VertexEnum);
++		InputUpdateFromSolutionx(femmodel,ug); delete ug;
++		GetVectorFromInputsx(&vel,femmodel,VxEnum,VertexEnum);
+ 
+ 		femmodel->SetCurrentConfiguration(UzawaPressureAnalysisEnum);
++		femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
+ 		SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel);
+ 		CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
+ 		Reduceloadx(pf, Kfs, ys); delete Kfs;
+ 		Solverx(&uf, Kff, pf, NULL, df, femmodel->parameters); 
+ 		delete Kff; delete pf; delete df;
+-		Mergesolutionfromftogx(&pug, uf,ys,femmodel->nodes,femmodel->parameters);delete uf; delete ys;
++		Mergesolutionfromftogx(&pug, uf,ys,femmodel->nodes,femmodel->parameters); delete uf; delete ys;
+ 
+ 		/*Update solution*/
+-		InputUpdateFromSolutionx(femmodel,pug); 
++		InputUpdateFromSolutionx(femmodel,pug); delete pug;
++		GetVectorFromInputsx(&pug,femmodel,PressureEnum,VertexEnum);
+ 
+ 		/*Check for convergence*/
+-		//Vector<IssmDouble>* dug=ug_old->Duplicate(); ug_old->Copy(dug); dug->AYPX(ug,-1.0);
+-		//IssmDouble ndu=dug->Norm(NORM_TWO);   delete dug;
+-		//IssmDouble nu =ug_old->Norm(NORM_TWO);
+-		Vector<IssmDouble>* dvx=vx_old->Duplicate(); vx_old->Copy(dvx); dvx->AYPX(vx,-1.0);
+-		IssmDouble ndu=dvx->Norm(NORM_TWO);   delete dvx;
+-		IssmDouble nu =vx_old->Norm(NORM_TWO);
++		Vector<IssmDouble>* dvel=vel_old->Duplicate(); vel_old->Copy(dvel); dvel->AYPX(vel,-1.0);
++		IssmDouble ndu=dvel->Norm(NORM_TWO);   delete dvel;
++		IssmDouble nu =vel_old->Norm(NORM_TWO);
+ 		if (xIsNan<IssmDouble>(ndu) || xIsNan<IssmDouble>(nu)) _error_("convergence criterion is NaN!");
+ 		if((ndu/nu)<eps_rel){
+ 			if(VerboseConvergence()) _printf0_(setw(50) << left << "   Convergence criterion: norm(du)/norm(u)" << ndu/nu*100 << " < " << eps_rel*100 << " %\n");
+-			break;
++			vel_converged=true;
+ 		}
+ 		else{ 
+ 			if(VerboseConvergence()) _printf0_(setw(50) << left << "   Convergence criterion: norm(du)/norm(u)" << ndu/nu*100 << " > " << eps_rel*100 << " %\n");
++			vel_converged=false;
+ 		}
++		Vector<IssmDouble>* dup=pug_old->Duplicate(); pug_old->Copy(dup); dup->AYPX(pug,-1.0);
++		IssmDouble ndp=dup->Norm(NORM_TWO);   delete dup;
++		IssmDouble np =pug_old->Norm(NORM_TWO);
++		if (xIsNan<IssmDouble>(ndp) || xIsNan<IssmDouble>(np)) _error_("convergence criterion is NaN!");
++		if((ndp/np)<eps_rel){
++			if(VerboseConvergence()) _printf0_(setw(50) << left << "   Convergence criterion: norm(dp)/norm(p)" << ndp/np*100 << " < " << eps_rel*100 << " %\n");
++			pressure_converged=true;
++		}
++		else{ 
++			if(VerboseConvergence()) _printf0_(setw(50) << left << "   Convergence criterion: norm(dp/)/norm(p)" << ndp/np*100 << " > " << eps_rel*100 << " %\n");
++			pressure_converged=false;
++		}
+ 
++		if(pressure_converged && vel_converged) break;
+ 		if(count>=max_nonlinear_iterations){
+ 			_printf0_("   maximum number of nonlinear iterations (" << max_nonlinear_iterations << ") exceeded\n"); 
+ 			break;
+@@ -100,12 +115,10 @@
+ 
+ 	if(VerboseConvergence()) _printf0_("\n   total number of iterations: " << count-1 << "\n");
+ 
+-	delete ug;  
+-	delete ug_old;  
+ 	delete pug;  
+ 	delete pug_old;  
+-	delete vx;  
+-	delete vx_old;  
++	delete vel;  
++	delete vel_old;  
+ 	delete stressanalysis;
+ 	delete pressureanalysis;
+ }
Index: /issm/oecreview/Archive/17984-18295/ISSM-18207-18208.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18207-18208.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18207-18208.diff	(revision 18296)
@@ -0,0 +1,232 @@
+Index: ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 18207)
++++ ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 18208)
+@@ -10,7 +10,7 @@
+ }/*}}}*/
+ void UzawaPressureAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+ 
+-	parameters->AddObject(iomodel->CopyConstantObject(AugmentedLagrangianREnum));
++	parameters->AddObject(iomodel->CopyConstantObject(AugmentedLagrangianRhopEnum));
+ }/*}}}*/
+ void UzawaPressureAnalysis::UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
+ 
+@@ -90,13 +90,13 @@
+ 
+ 	/*Intermediaries*/
+ 	int          dim;
+-	IssmDouble   Jdet,r,divu;
++	IssmDouble   Jdet,rhop,divu;
+ 	IssmDouble   *xyz_list = NULL;
+ 	int numnodes = element->GetNumberOfNodes();
+ 
+ 	/*Retrieve all inputs and parameters*/
+ 	element->FindParam(&dim,DomainDimensionEnum);
+-	element->FindParam(&r,AugmentedLagrangianREnum);
++	element->FindParam(&rhop,AugmentedLagrangianRhopEnum);
+ 	element->GetVerticesCoordinates(&xyz_list);
+ 
+ 	/*Initialize Element matrix and vectors*/
+@@ -127,7 +127,7 @@
+ 		if (dim==3) divu=divu+dvz[2];
+ 
+ 		for(int i=0;i<numnodes;i++){
+-			pe->values[i] += - r * divu * Jdet * gauss->weight * basis[i];
++			pe->values[i] += - rhop * divu * Jdet * gauss->weight * basis[i];
+ 		}
+ 	}
+ 
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18207)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18208)
+@@ -667,6 +667,7 @@
+ 	AbsoluteEnum,
+ 	IncrementalEnum,
+ 	AugmentedLagrangianREnum,
++	AugmentedLagrangianRhopEnum,
+ 	AugmentedLagrangianThetaEnum,
+ 	/*}}}*/
+ 	/*Grounding Line{{{*/
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18207)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18208)
+@@ -648,6 +648,7 @@
+ 		case AbsoluteEnum : return "Absolute";
+ 		case IncrementalEnum : return "Incremental";
+ 		case AugmentedLagrangianREnum : return "AugmentedLagrangianR";
++		case AugmentedLagrangianRhopEnum : return "AugmentedLagrangianRhop";
+ 		case AugmentedLagrangianThetaEnum : return "AugmentedLagrangianTheta";
+ 		case NoneEnum : return "None";
+ 		case AggressiveMigrationEnum : return "AggressiveMigration";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18207)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18208)
+@@ -663,6 +663,7 @@
+ 	      else if (strcmp(name,"Absolute")==0) return AbsoluteEnum;
+ 	      else if (strcmp(name,"Incremental")==0) return IncrementalEnum;
+ 	      else if (strcmp(name,"AugmentedLagrangianR")==0) return AugmentedLagrangianREnum;
++	      else if (strcmp(name,"AugmentedLagrangianRhop")==0) return AugmentedLagrangianRhopEnum;
+ 	      else if (strcmp(name,"AugmentedLagrangianTheta")==0) return AugmentedLagrangianThetaEnum;
+ 	      else if (strcmp(name,"None")==0) return NoneEnum;
+ 	      else if (strcmp(name,"AggressiveMigration")==0) return AggressiveMigrationEnum;
+Index: ../trunk-jpl/src/c/solutionsequences/solutionsequence_la.cpp
+===================================================================
+--- ../trunk-jpl/src/c/solutionsequences/solutionsequence_la.cpp	(revision 18207)
++++ ../trunk-jpl/src/c/solutionsequences/solutionsequence_la.cpp	(revision 18208)
+@@ -33,7 +33,6 @@
+ 	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
+ 	femmodel->parameters->FindParam(&eps_rel,StressbalanceReltolEnum);
+ 	femmodel->parameters->FindParam(&max_nonlinear_iterations,StressbalanceMaxiterEnum);
+-	femmodel->parameters->FindParam(&r,AugmentedLagrangianREnum);
+ 
+ 	/*Update constraints*/
+ 	femmodel->UpdateConstraintsx();
+Index: ../trunk-jpl/src/m/classes/flowequation.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.py	(revision 18207)
++++ ../trunk-jpl/src/m/classes/flowequation.py	(revision 18208)
+@@ -16,21 +16,22 @@
+ 
+ 	def __init__(self): # {{{
+ 		
+-		self.isSIA                   = 0
+-		self.isSSA                   = 0
+-		self.isL1L2                  = 0
+-		self.isHO                    = 0
+-		self.isFS                    = 0
+-		self.fe_SSA                  = ''
+-		self.fe_HO                   = ''
+-		self.fe_FS                   = ''
+-		self.augmented_lagrangian_r  = 1.
+-		self.XTH_theta               = 0.
+-		self.vertex_equation         = float('NaN')
+-		self.element_equation        = float('NaN')
+-		self.borderSSA               = float('NaN')
+-		self.borderHO                = float('NaN')
+-		self.borderFS                = float('NaN')
++		self.isSIA                     = 0
++		self.isSSA                     = 0
++		self.isL1L2                    = 0
++		self.isHO                      = 0
++		self.isFS                      = 0
++		self.fe_SSA                    = ''
++		self.fe_HO                     = ''
++		self.fe_FS                     = ''
++		self.augmented_lagrangian_r    = 1.
++		self.augmented_lagrangian_rhop = 1.
++		self.XTH_theta                 = 0.
++		self.vertex_equation           = float('NaN')
++		self.element_equation          = float('NaN')
++		self.borderSSA                 = float('NaN')
++		self.borderHO                  = float('NaN')
++		self.borderFS                  = float('NaN')
+ 
+ 		#set defaults
+ 		self.setdefaultparameters()
+@@ -82,6 +83,7 @@
+ 			md = checkfield(md,'fieldname','flowequation.borderHO','size',[md.mesh.numberofvertices],'values',[0,1])
+ 			md = checkfield(md,'fieldname','flowequation.borderFS','size',[md.mesh.numberofvertices],'values',[0,1])
+ 			md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_r','numel',[1],'>',0.)
++			md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rhop','numel',[1],'>',0.)
+ 			md = checkfield(md,'fieldname','flowequation.XTH_theta','numel',[1],'>=',0.,'<',.5)
+ 			if m.strcmp(md.mesh.domaintype(),'2Dhorizontal'):
+ 				md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices],'values',[1,2])
+@@ -111,6 +113,7 @@
+ 		WriteData(fid,'enum',FlowequationFeHOEnum() ,'data',StringToEnum(self.fe_HO)[0] ,'format','Integer')
+ 		WriteData(fid,'enum',FlowequationFeFSEnum() ,'data',StringToEnum(self.fe_FS)[0] ,'format','Integer')
+ 		WriteData(fid,'enum',AugmentedLagrangianREnum(),'data',self.augmented_lagrangian_r ,'format','Double')
++		WriteData(fid,'enum',AugmentedLagrangianRhopEnum(),'data',self.augmented_lagrangian_rhop ,'format','Double')
+ 		WriteData(fid,'enum',AugmentedLagrangianThetaEnum() ,'data',self.XTH_theta ,'format','Double')
+ 		WriteData(fid,'object',self,'fieldname','borderSSA','format','DoubleMat','mattype',1)
+ 		WriteData(fid,'object',self,'fieldname','borderHO','format','DoubleMat','mattype',1)
+Index: ../trunk-jpl/src/m/classes/flowequation.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.m	(revision 18207)
++++ ../trunk-jpl/src/m/classes/flowequation.m	(revision 18208)
+@@ -5,21 +5,22 @@
+ 
+ classdef flowequation
+ 	properties (SetAccess=public) 
+-		isSIA                  = 0;
+-		isSSA                  = 0;
+-		isL1L2                 = 0;
+-		isHO                   = 0;
+-		isFS                   = 0;
+-		fe_SSA                 = '';
+-		fe_HO                  = '';
+-		fe_FS                  = '';
+-		augmented_lagrangian_r = 1.;
+-		XTH_theta              = 0.;
+-		vertex_equation        = NaN;
+-		element_equation       = NaN;
+-		borderSSA              = NaN;
+-		borderHO               = NaN;
+-		borderFS               = NaN;
++		isSIA                     = 0;
++		isSSA                     = 0;
++		isL1L2                    = 0;
++		isHO                      = 0;
++		isFS                      = 0;
++		fe_SSA                    = '';
++		fe_HO                     = '';
++		fe_FS                     = '';
++		augmented_lagrangian_r    = 1.;
++		augmented_lagrangian_rhop = 1.;
++		XTH_theta                 = 0.;
++		vertex_equation           = NaN;
++		element_equation          = NaN;
++		borderSSA                 = NaN;
++		borderHO                  = NaN;
++		borderFS                  = NaN;
+ 	end
+ 	methods (Static)
+ 		function obj = loadobj(obj) % {{{
+@@ -134,7 +135,8 @@
+ 				md = checkfield(md,'fieldname','flowequation.fe_SSA','values',{'P1','P1bubble','P1bubblecondensed','P2','P2bubble'});
+ 				md = checkfield(md,'fieldname','flowequation.fe_HO' ,'values',{'P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P2bubble','P1xP3','P2xP4'});
+ 				md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',{'P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','LATaylorHood','XTaylorHood','OneLayerP4z','CrouzeixRaviart'});
+-				md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_r','numel',[1],'>=',0.);
++				md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_r','numel',[1],'>',0.);
++				md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rhop','numel',[1],'>',0.);
+ 				md = checkfield(md,'fieldname','flowequation.XTH_theta','numel',[1],'>=',0.,'<',0.5);
+ 				md = checkfield(md,'fieldname','flowequation.borderSSA','size',[md.mesh.numberofvertices 1],'values',[0 1]);
+ 				md = checkfield(md,'fieldname','flowequation.borderHO','size',[md.mesh.numberofvertices 1],'values',[0 1]);
+@@ -192,6 +194,7 @@
+ 			WriteData(fid,'enum',FlowequationFeHOEnum() ,'data',StringToEnum(obj.fe_HO) ,'format','Integer');
+ 			WriteData(fid,'enum',FlowequationFeFSEnum() ,'data',StringToEnum(obj.fe_FS) ,'format','Integer');
+ 			WriteData(fid,'enum',AugmentedLagrangianREnum(),'data',obj.augmented_lagrangian_r ,'format','Double');
++			WriteData(fid,'enum',AugmentedLagrangianRhopEnum(),'data',obj.augmented_lagrangian_rhop ,'format','Double');
+ 			WriteData(fid,'enum',AugmentedLagrangianThetaEnum() ,'data',obj.XTH_theta ,'format','Double');
+ 			WriteData(fid,'object',obj,'fieldname','borderSSA','format','DoubleMat','mattype',1);
+ 			WriteData(fid,'object',obj,'fieldname','borderHO','format','DoubleMat','mattype',1);
+Index: ../trunk-jpl/src/m/enum/AugmentedLagrangianRhopEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/AugmentedLagrangianRhopEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/AugmentedLagrangianRhopEnum.m	(revision 18208)
+@@ -0,0 +1,11 @@
++function macro=AugmentedLagrangianRhopEnum()
++%AUGMENTEDLAGRANGIANRHOPENUM - Enum of AugmentedLagrangianRhop
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=AugmentedLagrangianRhopEnum()
++
++macro=StringToEnum('AugmentedLagrangianRhop');
+Index: ../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- ../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 18207)
++++ ../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 18208)
+@@ -640,6 +640,7 @@
+ def AbsoluteEnum(): return StringToEnum("Absolute")[0]
+ def IncrementalEnum(): return StringToEnum("Incremental")[0]
+ def AugmentedLagrangianREnum(): return StringToEnum("AugmentedLagrangianR")[0]
++def AugmentedLagrangianRhopEnum(): return StringToEnum("AugmentedLagrangianRhop")[0]
+ def AugmentedLagrangianThetaEnum(): return StringToEnum("AugmentedLagrangianTheta")[0]
+ def NoneEnum(): return StringToEnum("None")[0]
+ def AggressiveMigrationEnum(): return StringToEnum("AggressiveMigration")[0]
Index: /issm/oecreview/Archive/17984-18295/ISSM-18208-18209.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18208-18209.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18208-18209.diff	(revision 18296)
@@ -0,0 +1,40 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18208)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18209)
+@@ -6,7 +6,7 @@
+ #include "../solutionsequences/solutionsequences.h"
+ #include "../cores/cores.h"
+ 
+-//#define FSANALYTICAL 21
++#define FSANALYTICAL 2
+ 
+ /*Model processing*/
+ int  StressbalanceAnalysis::DofsPerNode(int** pdoftype,int domaintype,int approximation){/*{{{*/
+@@ -3214,9 +3214,9 @@
+ 	for(int ig=gauss->begin();ig<gauss->end();ig++){
+ 		gauss->GaussPoint(ig);
+ 
+-		x_coord=element->GetXcoord(xyz_list,gauss);
+-		y_coord=element->GetYcoord(xyz_list,gauss);
+-		if(dim==3) z_coord=element->GetZcoord(xyz_list,gauss);
++		x_coord=element->GetXcoord(xyz_list_base,gauss);
++		y_coord=element->GetYcoord(xyz_list_base,gauss);
++		if(dim==3) z_coord=element->GetZcoord(xyz_list_base,gauss);
+ 		else z_coord=0.;
+ 
+ 		alpha2=alpha(x_coord,y_coord,z_coord,FSANALYTICAL);
+@@ -3306,6 +3306,13 @@
+ 		delete pe2;
+ 		return pe3;
+ 	}
++	else if(fe_FS==LATaylorHoodEnum){
++		ElementVector* pe2=CreatePVectorFSViscousLATH(element);
++		ElementVector* pe3 = new ElementVector(pe,pe2);
++		delete pe;
++		delete pe2;
++		return pe3;
++	}
+ 	return pe;
+ }/*}}}*/
+ #else
Index: /issm/oecreview/Archive/17984-18295/ISSM-18209-18210.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18209-18210.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18209-18210.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18209)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18210)
+@@ -6,7 +6,7 @@
+ #include "../solutionsequences/solutionsequences.h"
+ #include "../cores/cores.h"
+ 
+-#define FSANALYTICAL 2
++//#define FSANALYTICAL 2
+ 
+ /*Model processing*/
+ int  StressbalanceAnalysis::DofsPerNode(int** pdoftype,int domaintype,int approximation){/*{{{*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18210-18211.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18210-18211.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18210-18211.diff	(revision 18296)
@@ -0,0 +1,31 @@
+Index: ../trunk-jpl/src/m/exp/exp2shp.m
+===================================================================
+--- ../trunk-jpl/src/m/exp/exp2shp.m	(revision 0)
++++ ../trunk-jpl/src/m/exp/exp2shp.m	(revision 18211)
+@@ -0,0 +1,26 @@
++function exp2shp(shapefilename,expfilename)
++%SHPWRITE - write a shape file from a contour structure
++%
++%   Usage:
++%      exp2shp(shapefilename,expfilename)
++%
++%   Example:
++%      exp2shp('domainoutline.shp','domainoutline.exp')
++%
++%   See also SHPREAD, SHPWRITE, SHP2EXP
++
++shp=expread(expfilename);
++
++%initialize number of profile
++count=0;
++
++contours=struct([]);
++for i=1:length(shp),
++	contours(i).Geometry='Polygon';
++	contours(i).id=i;
++	contours(i).X=shp(i).x;
++	contours(i).Y=shp(i).y;
++end
++	
++shapewrite(contours,shapefilename);
++end
Index: /issm/oecreview/Archive/17984-18295/ISSM-18211-18212.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18211-18212.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18211-18212.diff	(revision 18296)
@@ -0,0 +1,46 @@
+Index: ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp	(revision 18211)
++++ ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp	(revision 18212)
+@@ -996,7 +996,7 @@
+ 		case MINIcondensedEnum:  return P1Enum;
+ 		case MINIEnum:           return P1Enum;
+ 		case TaylorHoodEnum:     return P1Enum;
+-		case LATaylorHoodEnum:   return P1Enum;
++		case LATaylorHoodEnum:   return NoneEnum;
+ 		case OneLayerP4zEnum:    return P1Enum;
+ 		case CrouzeixRaviartEnum:return P1DGEnum;
+ 		default:       _error_("Element type "<<EnumToStringx(fe_stokes)<<" not supported yet");
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18211)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18212)
+@@ -2272,6 +2272,28 @@
+ 			penta_node_ids[22]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->elements[6*index+4];
+ 			penta_node_ids[23]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->numberoffaces+iomodel->elements[6*index+5];
+ 			break;
++		case LATaylorHoodEnum:
++			numnodes         = 18;
++			penta_node_ids   = xNew<int>(numnodes);
++			penta_node_ids[ 0]=iomodel->nodecounter+iomodel->elements[6*index+0];
++			penta_node_ids[ 1]=iomodel->nodecounter+iomodel->elements[6*index+1];
++			penta_node_ids[ 2]=iomodel->nodecounter+iomodel->elements[6*index+2];
++			penta_node_ids[ 3]=iomodel->nodecounter+iomodel->elements[6*index+3];
++			penta_node_ids[ 4]=iomodel->nodecounter+iomodel->elements[6*index+4];
++			penta_node_ids[ 5]=iomodel->nodecounter+iomodel->elements[6*index+5];
++			penta_node_ids[ 6]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+0]+1;
++			penta_node_ids[ 7]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+1]+1;
++			penta_node_ids[ 8]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+2]+1;
++			penta_node_ids[ 9]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+3]+1;
++			penta_node_ids[10]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+4]+1;
++			penta_node_ids[11]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+5]+1;
++			penta_node_ids[12]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+6]+1;
++			penta_node_ids[13]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+7]+1;
++			penta_node_ids[14]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->elementtoedgeconnectivity[9*index+8]+1;
++			penta_node_ids[15]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+2]+1;
++			penta_node_ids[16]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+3]+1;
++			penta_node_ids[17]=iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofedges+iomodel->elementtofaceconnectivity[5*index+4]+1;
++			break;
+ 		case OneLayerP4zEnum:
+ 			numnodes         = 30+6;
+ 			penta_node_ids   = xNew<int>(numnodes);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18212-18213.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18212-18213.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18212-18213.diff	(revision 18296)
@@ -0,0 +1,38 @@
+Index: ../trunk-jpl/src/m/exp/exp2shp.m
+===================================================================
+--- ../trunk-jpl/src/m/exp/exp2shp.m	(revision 18212)
++++ ../trunk-jpl/src/m/exp/exp2shp.m	(revision 18213)
+@@ -1,11 +1,13 @@
+-function exp2shp(shapefilename,expfilename)
++function exp2shp(shapefilename,expfilename,geometry)
+ %SHPWRITE - write a shape file from a contour structure
+ %
+ %   Usage:
+-%      exp2shp(shapefilename,expfilename)
++%      exp2shp(shapefilename,expfilename,geometry)
+ %
+ %   Example:
+ %      exp2shp('domainoutline.shp','domainoutline.exp')
++%      exp2shp('domainoutline.shp','domainoutline.exp','Polygon')
++%      exp2shp('massfluxgate.shp','massfluxgate.exp','Line')
+ %
+ %   See also SHPREAD, SHPWRITE, SHP2EXP
+ 
+@@ -16,7 +18,16 @@
+ 
+ contours=struct([]);
+ for i=1:length(shp),
+-	contours(i).Geometry='Polygon';
++	if nargin < 3
++		if length(shp(1).x) == 1
++			geometry = 'Point';
++		elseif length(shp(1).x) < 3
++			geometry = 'Line';
++		else
++			geometry = 'Polygon';
++		end
++	end
++	contours(i).Geometry=geometry;
+ 	contours(i).id=i;
+ 	contours(i).X=shp(i).x;
+ 	contours(i).Y=shp(i).y;
Index: /issm/oecreview/Archive/17984-18295/ISSM-18213-18214.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18213-18214.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18213-18214.diff	(revision 18296)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/examples/Greenland/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Greenland/runme.m	(revision 18213)
++++ ../trunk-jpl/examples/Greenland/runme.m	(revision 18214)
+@@ -173,7 +173,7 @@
+ 
+ 	%Set transient options, run for 20 years, saving every timestep
+ 	md.timestepping.time_step=0.2;
+-	md.timestepping.final_time=20;
++	md.timestepping.final_time=200;
+ 	md.settings.output_frequency=1;
+ 
+ 	%Additional options
+@@ -191,7 +191,7 @@
+ 
+ if any(steps==7)
+ 	disp('   Step 7: Box Transient run');
+-	md = loadmodel('../Data/Greenland.HistoricTransient_1000yr');
++	md = loadmodel('./Models/Greenland.HistoricTransient');
+ 
+ 	%load past transient results
+ 	md.geometry.base=md.results.TransientSolution(end).Base;
Index: /issm/oecreview/Archive/17984-18295/ISSM-18216-18217.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18216-18217.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18216-18217.diff	(revision 18296)
@@ -0,0 +1,117 @@
+Index: ../trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64_mavericks.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64_mavericks.sh	(revision 18216)
++++ ../trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64_mavericks.sh	(revision 18217)
+@@ -1,50 +0,0 @@
+-#!/bin/bash
+-set -eu
+-
+-#Some cleanup
+-rm -rf Dakota
+-rm -rf src 
+-rm -rf build 
+-rm -rf install 
+-mkdir src build install 
+-
+-#Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
+-
+-#Untar 
+-tar -zxvf dakota-5.3.1-public-src.tar.gz
+-
+-#Move Dakota to src directory
+-mv dakota-5.3.1.src/* src
+-rm -rf dakota-5.3.1.src
+-
+-#Set up Dakota cmake variables and config
+-export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
+-export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
+-cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
+-patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/5.3.1/BuildDakotaCustom.cmake.patch
+-patch $DAK_SRC/cmake/DakotaDev.cmake configs/5.3.1/DakotaDev.cmake.patch
+-
+-#Apply patches
+-patch src/src/ParallelLibrary.cpp configs/5.3.1/ParallelLibrary.cpp.patch
+-patch src/src/ParallelLibrary.hpp configs/5.3.1/ParallelLibrary.hpp.patch
+-patch src/src/NonDSampling.cpp configs/5.3.1/NonDSampling.cpp.patch
+-patch src/src/NonDLocalReliability.cpp configs/5.3.1/NonDLocalReliability.cpp.patch
+-patch src/packages/pecos/src/pecos_global_defs.hpp configs/5.3.1/pecos_global_defs.hpp.patch
+-
+-#Configure dakota
+-cd $DAK_BUILD
+-cmake -D CMAKE_C_COMPILER=/usr/local/gfortran/bin/gcc -D CMAKE_CXX_COMPILER=/usr/local/gfortran/bin/g++ -C $DAK_SRC/cmake/BuildDakotaCustom.cmake -C $DAK_SRC/cmake/DakotaDev.cmake $DAK_SRC
+-cd ..
+-
+-#Compile and install dakota
+-cd $DAK_BUILD
+-if [ $# -eq 0 ];
+-then
+-	make
+-	make install
+-else
+-	make -j $1
+-	make -j $1 install
+-fi
+-cd ..
+Index: ../trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64.sh	(revision 0)
++++ ../trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64.sh	(revision 18217)
+@@ -0,0 +1,50 @@
++#!/bin/bash
++set -eu
++
++#Some cleanup
++rm -rf Dakota
++rm -rf src 
++rm -rf build 
++rm -rf install 
++mkdir src build install 
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/dakota-5.3.1-public-src.tar.gz' 'dakota-5.3.1-public-src.tar.gz'
++
++#Untar 
++tar -zxvf dakota-5.3.1-public-src.tar.gz
++
++#Move Dakota to src directory
++mv dakota-5.3.1.src/* src
++rm -rf dakota-5.3.1.src
++
++#Set up Dakota cmake variables and config
++export DAK_SRC=$ISSM_DIR/externalpackages/dakota/src
++export DAK_BUILD=$ISSM_DIR/externalpackages/dakota/build
++cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
++patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/5.3.1/BuildDakotaCustom.cmake.patch
++patch $DAK_SRC/cmake/DakotaDev.cmake configs/5.3.1/DakotaDev.cmake.patch
++
++#Apply patches
++patch src/src/ParallelLibrary.cpp configs/5.3.1/ParallelLibrary.cpp.patch
++patch src/src/ParallelLibrary.hpp configs/5.3.1/ParallelLibrary.hpp.patch
++patch src/src/NonDSampling.cpp configs/5.3.1/NonDSampling.cpp.patch
++patch src/src/NonDLocalReliability.cpp configs/5.3.1/NonDLocalReliability.cpp.patch
++patch src/packages/pecos/src/pecos_global_defs.hpp configs/5.3.1/pecos_global_defs.hpp.patch
++
++#Configure dakota
++cd $DAK_BUILD
++cmake -D CMAKE_C_COMPILER=/usr/local/gfortran/bin/gcc -D CMAKE_CXX_COMPILER=/usr/local/gfortran/bin/g++ -C $DAK_SRC/cmake/BuildDakotaCustom.cmake -C $DAK_SRC/cmake/DakotaDev.cmake $DAK_SRC
++cd ..
++
++#Compile and install dakota
++cd $DAK_BUILD
++if [ $# -eq 0 ];
++then
++	make
++	make install
++else
++	make -j $1
++	make -j $1 install
++fi
++cd ..
+
+Property changes on: ../trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/17984-18295/ISSM-18217-18218.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18217-18218.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18217-18218.diff	(revision 18296)
@@ -0,0 +1,50 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18217)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18218)
+@@ -6,7 +6,7 @@
+ #include "../solutionsequences/solutionsequences.h"
+ #include "../cores/cores.h"
+ 
+-//#define FSANALYTICAL 2
++//#define FSANALYTICAL 24
+ 
+ /*Model processing*/
+ int  StressbalanceAnalysis::DofsPerNode(int** pdoftype,int domaintype,int approximation){/*{{{*/
+@@ -3187,6 +3187,7 @@
+ 	IssmDouble  alpha2,Jdet;
+ 	IssmDouble  x_coord,y_coord,z_coord;
+ 	IssmDouble *xyz_list_base = NULL;
++	IssmDouble *xyz_list      = NULL;
+ 	Gauss*      gauss         = NULL;
+ 
+ 	/*Get problem dimension*/
+@@ -3204,6 +3205,7 @@
+ 
+ 	/*Retrieve all inputs and parameters*/
+ 	element->GetVerticesCoordinatesBase(&xyz_list_base);
++	element->GetVerticesCoordinates(&xyz_list);
+ 	Input* vx_input         = element->GetInput(VxEnum);      _assert_(vx_input);
+ 	Input* vy_input         = element->GetInput(VyEnum);      _assert_(vy_input);
+ 	Input* vz_input         = NULL;
+@@ -3214,9 +3216,9 @@
+ 	for(int ig=gauss->begin();ig<gauss->end();ig++){
+ 		gauss->GaussPoint(ig);
+ 
+-		x_coord=element->GetXcoord(xyz_list_base,gauss);
+-		y_coord=element->GetYcoord(xyz_list_base,gauss);
+-		if(dim==3) z_coord=element->GetZcoord(xyz_list_base,gauss);
++		x_coord=element->GetXcoord(xyz_list,gauss);
++		y_coord=element->GetYcoord(xyz_list,gauss);
++		if(dim==3) z_coord=element->GetZcoord(xyz_list,gauss);
+ 		else z_coord=0.;
+ 
+ 		alpha2=alpha(x_coord,y_coord,z_coord,FSANALYTICAL);
+@@ -3235,6 +3237,7 @@
+ 
+ 	/*Clean up and return*/
+ 	delete gauss;
++	xDelete<IssmDouble>(xyz_list);
+ 	xDelete<IssmDouble>(xyz_list_base);
+ 	xDelete<IssmDouble>(B);
+ 	xDelete<IssmDouble>(D);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18218-18219.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18218-18219.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18218-18219.diff	(revision 18296)
@@ -0,0 +1,46 @@
+Index: ../trunk-jpl/externalpackages/petsc/install-3.5-macosx64.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.5-macosx64.sh	(revision 0)
++++ ../trunk-jpl/externalpackages/petsc/install-3.5-macosx64.sh	(revision 18219)
+@@ -0,0 +1,34 @@
++#!/bin/bash
++set -eu
++
++#Some cleanup
++rm -rf install petsc-3.5.0 src
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.0.tar.gz' 'petsc-3.5.0.tar.gz'
++
++#Untar and move petsc to install directory
++tar -zxvf  petsc-3.5.0.tar.gz
++mv petsc-3.5.0/* src/
++rm -rf petsc-3.5.0
++
++#configure
++cd src
++./config/configure.py \
++	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
++	--with-mpi-dir="$ISSM_DIR/externalpackages/mpich/install" \
++	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
++	--with-debugging=0 \
++	--with-valgrind=0 \
++	--with-shared-libraries=1 \
++	--download-metis=1 \
++	--download-parmetis=1 \
++	--download-mumps=1 \
++	--download-scalapack=1 \
++	--download-blas=1 \
++	--download-fblaslapack=1 
++
++#Compile and intall
++make
++make install
+
+Property changes on: ../trunk-jpl/externalpackages/petsc/install-3.5-macosx64.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/17984-18295/ISSM-18219-18220.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18219-18220.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18219-18220.diff	(revision 18296)
@@ -0,0 +1,17 @@
+Index: ../trunk-jpl/etc/environment.sh
+===================================================================
+--- ../trunk-jpl/etc/environment.sh	(revision 18219)
++++ ../trunk-jpl/etc/environment.sh	(revision 18220)
+@@ -140,9 +140,9 @@
+ if [ -d "$BOOST_DIR" ]; then
+ 	export BOOSTROOT
+ 	export BOOST_DIR
+-	libpathappend   "$BOOST_DIR/lib"
+-	dylibpathappend "$BOOST_DIR/lib"
+-	pathappend      "$BOOST_DIR/bin"
++	libpathprepend   "$BOOST_DIR/lib"
++	dylibpathprepend "$BOOST_DIR/lib"
++	pathprepend      "$BOOST_DIR/bin"
+ fi
+ 
+ XERCESROOT="$ISSM_DIR/externalpackages/xerces/install"
Index: /issm/oecreview/Archive/17984-18295/ISSM-18220-18221.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18220-18221.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18220-18221.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64.sh	(revision 18220)
++++ ../trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64.sh	(revision 18221)
+@@ -34,7 +34,7 @@
+ 
+ #Configure dakota
+ cd $DAK_BUILD
+-cmake -D CMAKE_C_COMPILER=/usr/local/gfortran/bin/gcc -D CMAKE_CXX_COMPILER=/usr/local/gfortran/bin/g++ -C $DAK_SRC/cmake/BuildDakotaCustom.cmake -C $DAK_SRC/cmake/DakotaDev.cmake $DAK_SRC
++cmake -D CMAKE_C_COMPILER=/usr/local/gfortran/bin/x86_64-apple-darwin10-gcc -D CMAKE_CXX_COMPILER=/usr/local/gfortran/bin/x86_64-apple-darwin10-g++ -D CMAKE_Fortran_COMPILER=/usr/local/gfortran/bin/x86_64-apple-darwin10-gfortran -C $DAK_SRC/cmake/BuildDakotaCustom.cmake -C $DAK_SRC/cmake/DakotaDev.cmake $DAK_SRC
+ cd ..
+ 
+ #Compile and install dakota
Index: /issm/oecreview/Archive/17984-18295/ISSM-18221-18222.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18221-18222.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18221-18222.diff	(revision 18296)
@@ -0,0 +1,50 @@
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18221)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18222)
+@@ -1206,6 +1206,7 @@
+ 	IssmDouble J_sum;
+ 
+ 	IssmDouble  weight,thicknessobs,thickness,potential;
++	IssmDouble  vx,vy,vxbar,vybar,vxobs,vyobs,vxbarobs,vybarobs,nux,nuy;
+ 	IssmDouble  Jdet;
+ 	IssmDouble* xyz_list = NULL;
+ 
+@@ -1222,6 +1223,12 @@
+ 		Input* thickness_input   =element->GetInput(ThicknessEnum);                          _assert_(thickness_input);
+ 		Input* thicknessobs_input=element->GetInput(InversionThicknessObsEnum);              _assert_(thicknessobs_input);
+ 		Input* potential_input   =element->GetInput(PotentialEnum);                          _assert_(potential_input);
++		Input* vxobs_input       =element->GetInput(BalancethicknessVxObsEnum); _assert_(vxobs_input);
++		Input* vyobs_input       =element->GetInput(BalancethicknessVyObsEnum); _assert_(vyobs_input);
++		Input* vx_input          =element->GetInput(VxEnum); _assert_(vx_input);
++		Input* vy_input          =element->GetInput(VyEnum); _assert_(vy_input);
++		Input* nux_input       = element->GetInput(BalancethicknessNuxEnum);   _assert_(nux_input);
++		Input* nuy_input       = element->GetInput(BalancethicknessNuyEnum);   _assert_(nuy_input);
+ 
+ 		/* Start  looping on the number of gaussian points: */
+ 		Gauss* gauss=element->NewGauss(2);
+@@ -1237,10 +1244,22 @@
+ 			thickness_input->GetInputValue(&thickness,gauss);
+ 			thicknessobs_input->GetInputValue(&thicknessobs,gauss);
+ 			potential_input->GetInputValue(&potential,gauss);
+-			gauss->GaussPoint(ig);
++			vxobs_input->GetInputValue(&vxobs,gauss);
++			vyobs_input->GetInputValue(&vyobs,gauss);
++			vx_input->GetInputValue(&vxbar,gauss);
++			vy_input->GetInputValue(&vybar,gauss);
++			nux_input->GetInputValue(&nux,gauss);
++			nuy_input->GetInputValue(&nuy,gauss);
+ 
++			vxbarobs = nux*vxobs;
++			vybarobs = nuy*vyobs;
++
++			/*J = (H^2 - Hobs^2)^2*/
+ 			//J +=0.5*(thickness*thickness - thicknessobs*thicknessobs)*(thickness*thickness - thicknessobs*thicknessobs)*weight*Jdet*gauss->weight;
+-			J +=.5*potential*potential*weight*Jdet*gauss->weight;
++			/*J = phi^2*/
++			//J +=.5*potential*potential*weight*Jdet*gauss->weight; OK
++			/*J = (ubar - nux*uobs)^2*/
++			J +=0.5*((vxbarobs - vxbar)*(vxbarobs - vxbar) + (vybarobs - vybar)*(vybarobs - vybar))*weight*Jdet*gauss->weight;
+ 		}
+ 
+ 		/*clean up and Return: */
Index: /issm/oecreview/Archive/17984-18295/ISSM-18222-18223.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18222-18223.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18222-18223.diff	(revision 18296)
@@ -0,0 +1,17 @@
+Index: ../trunk-jpl/src/c/toolkits/petsc/objects/PetscSolver.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/objects/PetscSolver.cpp	(revision 18222)
++++ ../trunk-jpl/src/c/toolkits/petsc/objects/PetscSolver.cpp	(revision 18223)
+@@ -103,7 +103,11 @@
+ 
+ 	/*Prepare solver*/
+ 	KSPCreate(IssmComm::GetComm(),&ksp);
+-	KSPSetOperators(ksp,Kff,Kff,DIFFERENT_NONZERO_PATTERN);
++	#if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=5)
++		KSPSetOperators(ksp,Kff,Kff);
++	#else
++		KSPSetOperators(ksp,Kff,Kff,DIFFERENT_NONZERO_PATTERN);
++	#endif
+ 	KSPSetFromOptions(ksp);
+ 
+ 	#if _PETSC_MAJOR_==3
Index: /issm/oecreview/Archive/17984-18295/ISSM-18223-18224.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18223-18224.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18223-18224.diff	(revision 18296)
@@ -0,0 +1,82 @@
+Index: ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 18223)
++++ ../trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp	(revision 18224)
+@@ -47,8 +47,11 @@
+ 
+ 	/*Intermediaries */
+ 	int         num_responses,i;
+-	IssmDouble  hobs,hu2,weight,NUMx,NUMy,DEN,Jdet;
+-	IssmDouble  vx,vy,vbar2,nux,nuy,phi,dphi[2];
++	IssmDouble  hobs,hu2,weight,Jdet;
++	IssmDouble  NUMxH2,NUMyH2,DENH2;
++	IssmDouble  NUMxUbar,NUMyUbar,DENUbar;
++	IssmDouble  vxobs,vyobs,vxobsbar,vyobsbar,vbarobs2,vbarobs;
++	IssmDouble  nux,nuy,phi,dphi[2];
+ 	int        *responses = NULL;
+ 	IssmDouble *xyz_list  = NULL;
+ 
+@@ -67,8 +70,8 @@
+ 	Input* thicknessobs_input = element->GetInput(InversionThicknessObsEnum);              _assert_(thicknessobs_input);
+ 	Input* weights_input      = element->GetInput(InversionCostFunctionsCoefficientsEnum); _assert_(weights_input);
+ 	Input* potential_input = element->GetInput(PotentialEnum);             _assert_(potential_input);
+-	Input* vx_input        = element->GetInput(BalancethicknessVxObsEnum); _assert_(vx_input);
+-	Input* vy_input        = element->GetInput(BalancethicknessVyObsEnum); _assert_(vy_input);
++	Input* vxobs_input     = element->GetInput(BalancethicknessVxObsEnum); _assert_(vxobs_input);
++	Input* vyobs_input     = element->GetInput(BalancethicknessVyObsEnum); _assert_(vyobs_input);
+ 	Input* nux_input       = element->GetInput(BalancethicknessNuxEnum);   _assert_(nux_input);
+ 	Input* nuy_input       = element->GetInput(BalancethicknessNuyEnum);   _assert_(nuy_input);
+ 
+@@ -81,29 +84,43 @@
+ 		element->NodalFunctions(basis,gauss);
+ 		element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
+ 
+-		vx_input->GetInputValue(&vx,gauss);
+-		vy_input->GetInputValue(&vy,gauss);
++		vxobs_input->GetInputValue(&vxobs,gauss);
++		vyobs_input->GetInputValue(&vyobs,gauss);
+ 		nux_input->GetInputValue(&nux,gauss);
+ 		nuy_input->GetInputValue(&nuy,gauss);
+ 		potential_input->GetInputValue(&phi,gauss);
+ 		potential_input->GetInputDerivativeValue(&dphi[0],xyz_list,gauss);
+ 		thicknessobs_input->GetInputValue(&hobs,gauss);
+ 
+-		vbar2 = (nux*nux*vx*vx + nuy*nuy*vy*vy);
+-		hu2 = hobs*hobs*vbar2;
++		vxobsbar = nux*vxobs;
++		vyobsbar = nuy*vyobs;
+ 
+-		NUMx = 2.*dbasis[0]*dphi[0]*(dphi[0]*dphi[0] + dphi[1]*dphi[1] - hu2);
+-		NUMy = 2.*dbasis[1]*dphi[1]*(dphi[0]*dphi[0] + dphi[1]*dphi[1] - hu2);
+-		DEN = vbar2*vbar2+1.e-14;
++		vbarobs2 = (nux*nux*vxobs*vxobs + nuy*nuy*vyobs*vyobs);
++		vbarobs  = sqrt(vbarobs2);
++		hu2 = hobs*hobs*vbarobs2;
+ 
++		/*H^2 - Hobs^2*/
++		NUMxH2 = 2.*dbasis[0]*dphi[0]*(dphi[0]*dphi[0] + dphi[1]*dphi[1] - hu2);
++		NUMyH2 = 2.*dbasis[1]*dphi[1]*(dphi[0]*dphi[0] + dphi[1]*dphi[1] - hu2);
++		DENH2 = vbarobs2*vbarobs2+1.e-14;
++
++		/*Ubar-Ubar_obs*/
++		NUMxUbar = (vyobsbar*dphi[0]*dphi[1] - vxobsbar*dphi[1]*dphi[1])*vbarobs*dbasis[0];
++		NUMyUbar = (vyobsbar*dphi[0]*dphi[0] - vxobsbar*dphi[0]*dphi[1])*vbarobs*dbasis[1];
++		DENUbar  = pow(dphi[0]*dphi[0] + dphi[1]*dphi[1],3./2.)+1.e-14;
++
+ 		/*Loop over all requested responses*/
+ 		for(int resp=0;resp<num_responses;resp++){
+ 			weights_input->GetInputValue(&weight,gauss,responses[resp]);
+ 
+ 			switch(responses[resp]){
+ 				case Balancethickness2MisfitEnum:
+-					//for(i=0;i<numnodes;i++) pe->values[i]+=(NUMx+NUMy)/DEN *weight*Jdet*gauss->weight;
+-					for(i=0;i<numnodes;i++) pe->values[i]+= phi*basis[i]*weight*Jdet*gauss->weight;
++					/*J = (H^2 - Hobs^2)^2*/
++					//for(i=0;i<numnodes;i++) pe->values[i]+=(NUMxH2+NUMyH2)/DENH2 *weight*Jdet*gauss->weight; NOT WORKING
++					/*J = phi^2*/
++					//for(i=0;i<numnodes;i++) pe->values[i]+= phi*basis[i]*weight*Jdet*gauss->weight; OK
++					/*J = (ubar - nux*uobs)^2*/
++					for(i=0;i<numnodes;i++) pe->values[i]+=(NUMxUbar-NUMyUbar)/DENUbar *weight*Jdet*gauss->weight;
+ 					break;
+ 				default:
+ 					_error_("response " << EnumToStringx(responses[resp]) << " not supported yet");
Index: /issm/oecreview/Archive/17984-18295/ISSM-18224-18225.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18224-18225.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18224-18225.diff	(revision 18296)
@@ -0,0 +1,81 @@
+Index: ../trunk-jpl/src/c/cores/controltao_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/controltao_core.cpp	(revision 18224)
++++ ../trunk-jpl/src/c/cores/controltao_core.cpp	(revision 18225)
+@@ -9,12 +9,21 @@
+ #include "../modules/modules.h"
+ #include "../solutionsequences/solutionsequences.h"
+ 
+-#if defined (_HAVE_TAO_) && defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ > 1)
++#if defined (_HAVE_TAO_)
++#if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)
+ #include <tao.h>
++#else
++#include <petsctao.h>
++#endif
+ 
+ /*Local prototype*/
++#if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)
+ int FormFunctionGradient(TaoSolver,Vec,IssmDouble*,Vec,void*);
+ int IssmMonitor(TaoSolver,void*);
++#else
++int FormFunctionGradient(Tao,Vec,IssmDouble*,Vec,void*);
++int IssmMonitor(Tao,void*);
++#endif
+ typedef struct {
+ 	FemModel* femmodel;
+ 	double*   J;
+@@ -28,7 +37,11 @@
+ 	int                 maxsteps,maxiter;
+ 	IssmDouble          fatol,frtol,gatol,grtol,gttol;
+ 	AppCtx              user;
++	#if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)
+ 	TaoSolver           tao = 0;
++	#else
++	Tao                 tao = 0;
++	#endif
+ 	int                *control_list = NULL;
+ 	char               *algorithm    = NULL;
+ 	Vector<IssmDouble> *X            = NULL;
+@@ -37,10 +50,12 @@
+ 	Vector<IssmDouble> *XU           = NULL;
+ 
+ 	/*Initialize TAO*/
++	#if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)
+ 	int argc; char **args=NULL;
+ 	PetscGetArgs(&argc,&args);
+ 	ierr = TaoInitialize(&argc,&args,(char*)0,"");
+ 	if(ierr) _error_("Could not initialize Tao");
++	#endif
+ 
+ 	/*Recover some parameters*/
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+@@ -110,9 +125,16 @@
+ 	xDelete<double>(user.J);
+ 	delete X;
+ 	TaoDestroy(&tao);
++	#if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)
+ 	TaoFinalize();
++	#endif
+ }
++
++#if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)
+ int FormFunctionGradient(TaoSolver tao, Vec Xpetsc, IssmDouble *fcn,Vec G,void *uservoid){
++#else
++int FormFunctionGradient(Tao tao, Vec Xpetsc, IssmDouble *fcn,Vec G,void *uservoid){
++#endif
+ 
+ 	/*Retreive arguments*/
+ 	int                  solution_type;
+@@ -151,7 +173,11 @@
+ 	/*Clean-up and return*/
+ 	return 0;
+ }
++#if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)
+ int IssmMonitor(TaoSolver tao, void *userCtx){
++#else
++int IssmMonitor(Tao tao, void *userCtx){
++#endif
+ 
+ 	int         its,num_responses;
+ 	IssmDouble  f,gnorm,cnorm,xdiff;
Index: /issm/oecreview/Archive/17984-18295/ISSM-18225-18226.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18225-18226.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18225-18226.diff	(revision 18296)
@@ -0,0 +1,53 @@
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 18225)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 18226)
+@@ -938,24 +938,33 @@
+ 
+ 	dnl Check whether tao is enabled
+ 	AC_MSG_CHECKING([for tao])
+-	if test "x$TAO_ROOT" = "xno" ; then
+-		HAVE_TAO=no
++
++	if test "$HAVE_PETSC" = "yes" && test "x$PETSC_MAJOR" = "x3" && test $PETSC_MINOR -ge 5; then
++		dnl in petsc >=3.5, tao is provided
++		HAVE_TAO="yes"
++		AC_DEFINE([_HAVE_TAO_],[1],[with Tao in ISSM src])
++		AC_MSG_RESULT($HAVE_TAO)
+ 	else
+-		HAVE_TAO=yes
+-		if ! test -d "$TAO_ROOT"; then
+-			AC_MSG_ERROR([tao directory provided ($TAO_ROOT) does not exist]);
++
++		if test "x$TAO_ROOT" = "xno" ; then
++			HAVE_TAO=no
++		else
++			HAVE_TAO=yes
++			if ! test -d "$TAO_ROOT"; then
++				AC_MSG_ERROR([tao directory provided ($TAO_ROOT) does not exist]);
++			fi
+ 		fi
++		AC_MSG_RESULT($HAVE_TAO)
++
++		dnl tao headers and libraries
++		if test "x$HAVE_TAO" == "xyes"; then
++		  TAOINCL="-I$TAO_ROOT/ -I$TAO_ROOT/include -I$TAO_ROOT/bmake/ "
++		  TAOLIB="-L$TAO_ROOT/lib -ltao -lpetsc"
++		  AC_DEFINE([_HAVE_TAO_],[1],[with Tao in ISSM src])
++		  AC_SUBST([TAOINCL])
++		  AC_SUBST([TAOLIB])
++		fi
+ 	fi
+-	AC_MSG_RESULT($HAVE_TAO)
+-	
+-	dnl tao headers and libraries
+-	if test "x$HAVE_TAO" == "xyes"; then
+-	  TAOINCL="-I$TAO_ROOT/ -I$TAO_ROOT/include -I$TAO_ROOT/bmake/ "
+-	  TAOLIB="-L$TAO_ROOT/lib -ltao -lpetsc"
+-	  AC_DEFINE([_HAVE_TAO_],[1],[with Tao in ISSM src])
+-	  AC_SUBST([TAOINCL])
+-	  AC_SUBST([TAOLIB])
+-	fi
+ 	dnl }}}
+ 	dnl m1qn3{{{
+ 	AC_ARG_WITH([m1qn3-dir],
Index: /issm/oecreview/Archive/17984-18295/ISSM-18226-18227.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18226-18227.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18226-18227.diff	(revision 18296)
@@ -0,0 +1,383 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h	(revision 18226)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h	(revision 18227)
+@@ -85,6 +85,8 @@
+ 		void GetBFSFriction(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBFSUzawa(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBFSprimeUzawa(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
++		void GetCFS(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
++		void GetCFSprime(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetSolutionFromInputsFS(Vector<IssmDouble>* solution,Element* element);
+ 		void InputUpdateFromSolutionFS(IssmDouble* solution,Element* element);
+ 		void InputUpdateFromSolutionFSXTH_d(Elements* elements,Parameters* parameters);
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18226)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18227)
+@@ -111,6 +111,7 @@
+ 	iomodel->Constant(&fe_FS,FlowequationFeFSEnum);
+ 	if(fe_FS==XTaylorHoodEnum || fe_FS==LATaylorHoodEnum){
+ 		parameters->AddObject(iomodel->CopyConstantObject(AugmentedLagrangianREnum));
++		parameters->AddObject(iomodel->CopyConstantObject(AugmentedLagrangianRlambdaEnum));
+ 		parameters->AddObject(iomodel->CopyConstantObject(AugmentedLagrangianThetaEnum));
+ 	}
+ 
+@@ -2878,8 +2879,9 @@
+ 
+ 	/*Intermediaries*/
+ 	int         i,dim,epssize;
+-	IssmDouble  r,Jdet,viscosity,DU;
++	IssmDouble  r,rl,Jdet,viscosity,DU,DUl;
+ 	IssmDouble *xyz_list = NULL;
++	IssmDouble *xyz_list_base = NULL;
+ 
+ 	/*Get problem dimension*/
+ 	element->FindParam(&dim,DomainDimensionEnum);
+@@ -2892,9 +2894,13 @@
+ 	int pnumnodes;
+ 	if(dim==2) pnumnodes=3;
+ 	else pnumnodes=6;
++	int lnumnodes;
++	if(dim==2) lnumnodes=2;
++	else lnumnodes=3;
+ 	//int pnumnodes = element->NumberofNodes(P1Enum);
+ 	int numdof    = vnumnodes*dim;
+ 	int pnumdof   = pnumnodes;
++	int lnumdof   = lnumnodes;
+ 
+ 	/*Prepare coordinate system list*/
+ 	int* cs_list = xNew<int>(vnumnodes);
+@@ -2909,6 +2915,9 @@
+ 	IssmDouble*    BU       = xNew<IssmDouble>(pnumdof);
+ 	IssmDouble*    BprimeU  = xNew<IssmDouble>(numdof);
+ 	IssmDouble*    D        = xNewZeroInit<IssmDouble>(epssize*epssize);
++	IssmDouble*    CtCUzawa = xNewZeroInit<IssmDouble>(numdof*pnumdof);
++	IssmDouble*    C        = xNew<IssmDouble>(lnumdof);
++	IssmDouble*    Cprime   = xNew<IssmDouble>(numdof);
+ 
+ 	/*Retrieve all inputs and parameters*/
+ 	element->GetVerticesCoordinates(&xyz_list);
+@@ -2946,6 +2955,26 @@
+ 
+ 	}
+ 
++	if(element->IsOnBase()){ 
++		element->FindParam(&rl,AugmentedLagrangianRlambdaEnum);
++		element->GetVerticesCoordinatesBase(&xyz_list_base);
++
++		delete gauss;
++		Gauss* gauss=element->NewGaussBase(5);
++		for(int ig=gauss->begin();ig<gauss->end();ig++){
++			gauss->GaussPoint(ig);
++
++			element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
++			this->GetCFS(C,element,dim,xyz_list_base,gauss);
++			this->GetCFSprime(Cprime,element,dim,xyz_list_base,gauss);
++			DUl = gauss->weight*Jdet*sqrt(rl);
++			TripleMultiply(C,1,lnumdof,1,
++						&DU,1,1,0,
++						Cprime,1,numdof,0,
++						CtCUzawa,1);
++		}
++	}
++
+ 	/*Transform Coordinate System*/
+ 	element->TransformStiffnessMatrixCoord(Ke,cs_list);
+ 
+@@ -2954,6 +2983,11 @@
+ 				BtBUzawa,pnumdof,numdof,0,
+ 				&Ke->values[0],1);
+ 
++	/*The sigma naugmentation should not be transformed*/
++	MatrixMultiply(CtCUzawa,lnumdof,numdof,1,
++				CtCUzawa,lnumdof,numdof,0,
++				&Ke->values[0],1);
++
+ 	/*Clean up and return*/
+ 	delete gauss;
+ 	xDelete<IssmDouble>(xyz_list);
+@@ -2963,6 +2997,9 @@
+ 	xDelete<IssmDouble>(BprimeU);
+ 	xDelete<IssmDouble>(BU);
+ 	xDelete<IssmDouble>(BtBUzawa);
++	xDelete<IssmDouble>(Cprime);
++	xDelete<IssmDouble>(C);
++	xDelete<IssmDouble>(CtCUzawa);
+ 	xDelete<int>(cs_list);
+ 	return Ke;
+ }/*}}}*/
+@@ -4371,6 +4408,62 @@
+ 	/*Clean-up*/
+ 	xDelete<IssmDouble>(vbasis);
+ }/*}}}*/
++void StressbalanceAnalysis::GetCFS(IssmDouble* C,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
++	/*Compute C  matrix. C=[Cp1 Cp2 ...] where Cpi=phi_pi. 
++	 */
++
++	/*Fetch number of nodes for this finite element*/
++	int lnumnodes;
++	if(dim==2) lnumnodes=3;
++	else lnumnodes=6;
++	//int pnumnodes = element->NumberofNodes(P1Enum);
++
++	/*Get nodal functions derivatives*/
++	IssmDouble* basis =xNew<IssmDouble>(lnumnodes);
++	element->NodalFunctionsP1(basis,gauss);
++
++	/*Build B: */
++	for(int i=0;i<lnumnodes;i++){
++		C[i] = basis[i];
++	}
++
++	/*Clean up*/
++	xDelete<IssmDouble>(basis);
++}/*}}}*/
++void StressbalanceAnalysis::GetCFSprime(IssmDouble* Cprime,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
++	/*	Compute C'  matrix. C'=[C1' C2' C3'] 
++	 *			Ci' = [  dphi/dx   dphi/dy ]
++	 *
++	 *	In 3d
++	 *     	   Ci=[ dh/dx   dh/dy    dh/dz  ]
++	 *	where phi is the finiteelement function for node i.
++	 */
++
++	/*Fetch number of nodes for this finite element*/
++	int lnumnodes = element->GetNumberOfNodes();
++
++	/*Get nodal functions derivatives*/
++	IssmDouble* dbasis=xNew<IssmDouble>(dim*lnumnodes);
++	element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
++
++	/*Build C_prime: */
++	if(dim==2){
++		for(int i=0;i<lnumnodes;i++){
++			Cprime[dim*i+0] = dbasis[0*lnumnodes+i];
++			Cprime[dim*i+1] = dbasis[1*lnumnodes+i];
++		}
++	}
++	else{
++		for(int i=0;i<lnumnodes;i++){
++			Cprime[dim*i+0] = dbasis[0*lnumnodes+i];
++			Cprime[dim*i+1] = dbasis[1*lnumnodes+i];
++			Cprime[dim*i+2] = dbasis[2*lnumnodes+i];
++		}
++	}
++
++	/*Clean up*/
++	xDelete<IssmDouble>(dbasis);
++}/*}}}*/
+ void StressbalanceAnalysis::GetSolutionFromInputsFS(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 
+ 	int*         vdoflist=NULL;
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18226)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18227)
+@@ -668,6 +668,8 @@
+ 	IncrementalEnum,
+ 	AugmentedLagrangianREnum,
+ 	AugmentedLagrangianRhopEnum,
++	AugmentedLagrangianRlambdaEnum,
++	AugmentedLagrangianRholambdaEnum,
+ 	AugmentedLagrangianThetaEnum,
+ 	/*}}}*/
+ 	/*Grounding Line{{{*/
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18226)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18227)
+@@ -649,6 +649,8 @@
+ 		case IncrementalEnum : return "Incremental";
+ 		case AugmentedLagrangianREnum : return "AugmentedLagrangianR";
+ 		case AugmentedLagrangianRhopEnum : return "AugmentedLagrangianRhop";
++		case AugmentedLagrangianRlambdaEnum : return "AugmentedLagrangianRlambda";
++		case AugmentedLagrangianRholambdaEnum : return "AugmentedLagrangianRholambda";
+ 		case AugmentedLagrangianThetaEnum : return "AugmentedLagrangianTheta";
+ 		case NoneEnum : return "None";
+ 		case AggressiveMigrationEnum : return "AggressiveMigration";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18226)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18227)
+@@ -664,6 +664,8 @@
+ 	      else if (strcmp(name,"Incremental")==0) return IncrementalEnum;
+ 	      else if (strcmp(name,"AugmentedLagrangianR")==0) return AugmentedLagrangianREnum;
+ 	      else if (strcmp(name,"AugmentedLagrangianRhop")==0) return AugmentedLagrangianRhopEnum;
++	      else if (strcmp(name,"AugmentedLagrangianRlambda")==0) return AugmentedLagrangianRlambdaEnum;
++	      else if (strcmp(name,"AugmentedLagrangianRholambda")==0) return AugmentedLagrangianRholambdaEnum;
+ 	      else if (strcmp(name,"AugmentedLagrangianTheta")==0) return AugmentedLagrangianThetaEnum;
+ 	      else if (strcmp(name,"None")==0) return NoneEnum;
+ 	      else if (strcmp(name,"AggressiveMigration")==0) return AggressiveMigrationEnum;
+Index: ../trunk-jpl/src/m/classes/flowequation.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.py	(revision 18226)
++++ ../trunk-jpl/src/m/classes/flowequation.py	(revision 18227)
+@@ -16,22 +16,24 @@
+ 
+ 	def __init__(self): # {{{
+ 		
+-		self.isSIA                     = 0
+-		self.isSSA                     = 0
+-		self.isL1L2                    = 0
+-		self.isHO                      = 0
+-		self.isFS                      = 0
+-		self.fe_SSA                    = ''
+-		self.fe_HO                     = ''
+-		self.fe_FS                     = ''
+-		self.augmented_lagrangian_r    = 1.
+-		self.augmented_lagrangian_rhop = 1.
+-		self.XTH_theta                 = 0.
+-		self.vertex_equation           = float('NaN')
+-		self.element_equation          = float('NaN')
+-		self.borderSSA                 = float('NaN')
+-		self.borderHO                  = float('NaN')
+-		self.borderFS                  = float('NaN')
++		self.isSIA                          = 0
++		self.isSSA                          = 0
++		self.isL1L2                         = 0
++		self.isHO                           = 0
++		self.isFS                           = 0
++		self.fe_SSA                         = ''
++		self.fe_HO                          = ''
++		self.fe_FS                          = ''
++		self.augmented_lagrangian_r         = 1.
++		self.augmented_lagrangian_rhop      = 1.
++		self.augmented_lagrangian_rlambda   = 1.
++		self.augmented_lagrangian_rholambda = 1.
++		self.XTH_theta                      = 0.
++		self.vertex_equation                = float('NaN')
++		self.element_equation               = float('NaN')
++		self.borderSSA                      = float('NaN')
++		self.borderHO                       = float('NaN')
++		self.borderFS                       = float('NaN')
+ 
+ 		#set defaults
+ 		self.setdefaultparameters()
+@@ -84,6 +86,8 @@
+ 			md = checkfield(md,'fieldname','flowequation.borderFS','size',[md.mesh.numberofvertices],'values',[0,1])
+ 			md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_r','numel',[1],'>',0.)
+ 			md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rhop','numel',[1],'>',0.)
++			md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rlambda','numel',[1],'>',0.)
++			md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rholambda','numel',[1],'>',0.)
+ 			md = checkfield(md,'fieldname','flowequation.XTH_theta','numel',[1],'>=',0.,'<',.5)
+ 			if m.strcmp(md.mesh.domaintype(),'2Dhorizontal'):
+ 				md = checkfield(md,'fieldname','flowequation.vertex_equation','size',[md.mesh.numberofvertices],'values',[1,2])
+@@ -114,6 +118,8 @@
+ 		WriteData(fid,'enum',FlowequationFeFSEnum() ,'data',StringToEnum(self.fe_FS)[0] ,'format','Integer')
+ 		WriteData(fid,'enum',AugmentedLagrangianREnum(),'data',self.augmented_lagrangian_r ,'format','Double')
+ 		WriteData(fid,'enum',AugmentedLagrangianRhopEnum(),'data',self.augmented_lagrangian_rhop ,'format','Double')
++		WriteData(fid,'enum',AugmentedLagrangianRlambdaEnum(),'data',self.augmented_lagrangian_rlambda ,'format','Double')
++		WriteData(fid,'enum',AugmentedLagrangianRholambdaEnum(),'data',self.augmented_lagrangian_rholambda ,'format','Double')
+ 		WriteData(fid,'enum',AugmentedLagrangianThetaEnum() ,'data',self.XTH_theta ,'format','Double')
+ 		WriteData(fid,'object',self,'fieldname','borderSSA','format','DoubleMat','mattype',1)
+ 		WriteData(fid,'object',self,'fieldname','borderHO','format','DoubleMat','mattype',1)
+Index: ../trunk-jpl/src/m/classes/flowequation.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/flowequation.m	(revision 18226)
++++ ../trunk-jpl/src/m/classes/flowequation.m	(revision 18227)
+@@ -5,22 +5,24 @@
+ 
+ classdef flowequation
+ 	properties (SetAccess=public) 
+-		isSIA                     = 0;
+-		isSSA                     = 0;
+-		isL1L2                    = 0;
+-		isHO                      = 0;
+-		isFS                      = 0;
+-		fe_SSA                    = '';
+-		fe_HO                     = '';
+-		fe_FS                     = '';
+-		augmented_lagrangian_r    = 1.;
+-		augmented_lagrangian_rhop = 1.;
+-		XTH_theta                 = 0.;
+-		vertex_equation           = NaN;
+-		element_equation          = NaN;
+-		borderSSA                 = NaN;
+-		borderHO                  = NaN;
+-		borderFS                  = NaN;
++		isSIA                          = 0;
++		isSSA                          = 0;
++		isL1L2                         = 0;
++		isHO                           = 0;
++		isFS                           = 0;
++		fe_SSA                         = '';
++		fe_HO                          = '';
++		fe_FS                          = '';
++		augmented_lagrangian_r         = 1.;
++		augmented_lagrangian_rhop      = 1.;
++		augmented_lagrangian_rlambda   = 1.;
++		augmented_lagrangian_rholambda = 1.;
++		XTH_theta                      = 0.;
++		vertex_equation                = NaN;
++		element_equation               = NaN;
++		borderSSA                      = NaN;
++		borderHO                       = NaN;
++		borderFS                       = NaN;
+ 	end
+ 	methods (Static)
+ 		function obj = loadobj(obj) % {{{
+@@ -136,7 +138,9 @@
+ 				md = checkfield(md,'fieldname','flowequation.fe_HO' ,'values',{'P1','P1bubble','P1bubblecondensed','P1xP2','P2xP1','P2','P2bubble','P1xP3','P2xP4'});
+ 				md = checkfield(md,'fieldname','flowequation.fe_FS' ,'values',{'P1P1','P1P1GLS','MINIcondensed','MINI','TaylorHood','LATaylorHood','XTaylorHood','OneLayerP4z','CrouzeixRaviart'});
+ 				md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_r','numel',[1],'>',0.);
++				md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rlambda','numel',[1],'>',0.);
+ 				md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rhop','numel',[1],'>',0.);
++				md = checkfield(md,'fieldname','flowequation.augmented_lagrangian_rholambda','numel',[1],'>',0.);
+ 				md = checkfield(md,'fieldname','flowequation.XTH_theta','numel',[1],'>=',0.,'<',0.5);
+ 				md = checkfield(md,'fieldname','flowequation.borderSSA','size',[md.mesh.numberofvertices 1],'values',[0 1]);
+ 				md = checkfield(md,'fieldname','flowequation.borderHO','size',[md.mesh.numberofvertices 1],'values',[0 1]);
+@@ -195,6 +199,8 @@
+ 			WriteData(fid,'enum',FlowequationFeFSEnum() ,'data',StringToEnum(obj.fe_FS) ,'format','Integer');
+ 			WriteData(fid,'enum',AugmentedLagrangianREnum(),'data',obj.augmented_lagrangian_r ,'format','Double');
+ 			WriteData(fid,'enum',AugmentedLagrangianRhopEnum(),'data',obj.augmented_lagrangian_rhop ,'format','Double');
++			WriteData(fid,'enum',AugmentedLagrangianRlambdaEnum(),'data',obj.augmented_lagrangian_rlambda ,'format','Double');
++			WriteData(fid,'enum',AugmentedLagrangianRholambdaEnum(),'data',obj.augmented_lagrangian_rholambda ,'format','Double');
+ 			WriteData(fid,'enum',AugmentedLagrangianThetaEnum() ,'data',obj.XTH_theta ,'format','Double');
+ 			WriteData(fid,'object',obj,'fieldname','borderSSA','format','DoubleMat','mattype',1);
+ 			WriteData(fid,'object',obj,'fieldname','borderHO','format','DoubleMat','mattype',1);
+Index: ../trunk-jpl/src/m/enum/AugmentedLagrangianRlambdaEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/AugmentedLagrangianRlambdaEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/AugmentedLagrangianRlambdaEnum.m	(revision 18227)
+@@ -0,0 +1,11 @@
++function macro=AugmentedLagrangianRlambdaEnum()
++%AUGMENTEDLAGRANGIANRLAMBDAENUM - Enum of AugmentedLagrangianRlambda
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=AugmentedLagrangianRlambdaEnum()
++
++macro=StringToEnum('AugmentedLagrangianRlambda');
+Index: ../trunk-jpl/src/m/enum/AugmentedLagrangianRholambdaEnum.m
+===================================================================
+--- ../trunk-jpl/src/m/enum/AugmentedLagrangianRholambdaEnum.m	(revision 0)
++++ ../trunk-jpl/src/m/enum/AugmentedLagrangianRholambdaEnum.m	(revision 18227)
+@@ -0,0 +1,11 @@
++function macro=AugmentedLagrangianRholambdaEnum()
++%AUGMENTEDLAGRANGIANRHOLAMBDAENUM - Enum of AugmentedLagrangianRholambda
++%
++%   WARNING: DO NOT MODIFY THIS FILE
++%            this file has been automatically generated by src/c/shared/Enum/Synchronize.sh
++%            Please read src/c/shared/Enum/README for more information
++%
++%   Usage:
++%      macro=AugmentedLagrangianRholambdaEnum()
++
++macro=StringToEnum('AugmentedLagrangianRholambda');
+Index: ../trunk-jpl/src/m/enum/EnumDefinitions.py
+===================================================================
+--- ../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 18226)
++++ ../trunk-jpl/src/m/enum/EnumDefinitions.py	(revision 18227)
+@@ -641,6 +641,8 @@
+ def IncrementalEnum(): return StringToEnum("Incremental")[0]
+ def AugmentedLagrangianREnum(): return StringToEnum("AugmentedLagrangianR")[0]
+ def AugmentedLagrangianRhopEnum(): return StringToEnum("AugmentedLagrangianRhop")[0]
++def AugmentedLagrangianRlambdaEnum(): return StringToEnum("AugmentedLagrangianRlambda")[0]
++def AugmentedLagrangianRholambdaEnum(): return StringToEnum("AugmentedLagrangianRholambda")[0]
+ def AugmentedLagrangianThetaEnum(): return StringToEnum("AugmentedLagrangianTheta")[0]
+ def NoneEnum(): return StringToEnum("None")[0]
+ def AggressiveMigrationEnum(): return StringToEnum("AggressiveMigration")[0]
Index: /issm/oecreview/Archive/17984-18295/ISSM-18227-18228.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18227-18228.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18227-18228.diff	(revision 18296)
@@ -0,0 +1,619 @@
+Index: ../trunk-jpl/externalpackages/gsl/finite.patch
+===================================================================
+--- ../trunk-jpl/externalpackages/gsl/finite.patch	(revision 0)
++++ ../trunk-jpl/externalpackages/gsl/finite.patch	(revision 18228)
+@@ -0,0 +1,354 @@
++diff -ruN src/gsl_math.h src-mod/gsl_math.h
++--- src/gsl_math.h	2010-12-26 09:57:08.000000000 -0800
+++++ src-mod/gsl_math.h	2014-05-27 18:47:26.000000000 -0700
++@@ -116,7 +116,7 @@
++ #define GSL_SIGN(x)    ((x) >= 0.0 ? 1 : -1)
++ 
++ /* Return nonzero if x is a real number, i.e. non NaN or infinite. */
++-#define GSL_IS_REAL(x) (gsl_finite(x))
+++#define GSL_IS_REAL(x) (isfinite(x))
++ 
++ /* Definition of an arbitrary function with parameters */
++ 
++diff -ruN src/integration/cquad.c src-mod/integration/cquad.c
++--- src/integration/cquad.c	2011-05-01 11:46:28.000000000 -0700
+++++ src-mod/integration/cquad.c	2014-05-27 18:47:26.000000000 -0700
++@@ -235,7 +235,7 @@
++     {
++       iv->fx[i] = GSL_FN_EVAL (f, m + xi[i] * h);
++       neval++;
++-      if (!finite (iv->fx[i]))
+++      if (!isfinite (iv->fx[i]))
++ 	{
++ 	  nans[nnans++] = i;
++ 	  iv->fx[i] = 0.0;
++@@ -319,7 +319,7 @@
++ 	  nnans = 0;
++ 	  for (i = 0; i <= 32; i += skip[d])
++ 	    {
++-	      if (!finite (iv->fx[i]))
+++	      if (!isfinite (iv->fx[i]))
++ 		{
++ 		  nans[nnans++] = i;
++ 		  iv->fx[i] = 0.0;
++@@ -444,7 +444,7 @@
++ 	  nnans = 0;
++ 	  for (i = 0; i <= 32; i += skip[0])
++ 	    {
++-	      if (!finite (ivl->fx[i]))
+++	      if (!isfinite (ivl->fx[i]))
++ 		{
++ 		  nans[nnans++] = i;
++ 		  ivl->fx[i] = 0.0;
++@@ -510,7 +510,7 @@
++ 	  nnans = 0;
++ 	  for (i = 0; i <= 32; i += skip[0])
++ 	    {
++-	      if (!finite (ivr->fx[i]))
+++	      if (!isfinite (ivr->fx[i]))
++ 		{
++ 		  nans[nnans++] = i;
++ 		  ivr->fx[i] = 0.0;
++diff -ruN src/linalg/balance.c src-mod/linalg/balance.c
++--- src/linalg/balance.c	2010-12-26 09:57:08.000000000 -0800
+++++ src-mod/linalg/balance.c	2014-05-27 18:47:27.000000000 -0700
++@@ -54,7 +54,7 @@
++       
++       double f = 1.0;
++       
++-      if (s == 0.0 || !gsl_finite(s))
+++      if (s == 0.0 || !isfinite(s))
++         {
++           gsl_vector_set (D, j, f);
++           continue;
++diff -ruN src/min/min.h src-mod/min/min.h
++--- src/min/min.h	2010-12-26 09:57:08.000000000 -0800
+++++ src-mod/min/min.h	2014-05-27 18:47:27.000000000 -0700
++@@ -20,6 +20,6 @@
++ #define SAFE_FUNC_CALL(f, x, yp) \
++ do { \
++   *yp = GSL_FN_EVAL(f,x); \
++-  if (!gsl_finite(*yp)) \
+++  if (!isfinite(*yp)) \
++     GSL_ERROR("computed function value is infinite or NaN", GSL_EBADFUNC); \
++ } while (0)
++diff -ruN src/multimin/simplex.c src-mod/multimin/simplex.c
++--- src/multimin/simplex.c	2010-12-26 09:57:08.000000000 -0800
+++++ src-mod/multimin/simplex.c	2014-05-27 18:47:27.000000000 -0700
++@@ -122,7 +122,7 @@
++ 	     we finish the contraction (and do not abort) to allow the user
++ 	     to handle the situation */
++ 
++-          if(!gsl_finite(newval))
+++          if(!isfinite(newval))
++ 	    {
++ 	      status = GSL_EBADFUNC;
++ 	    }
++@@ -260,7 +260,7 @@
++ 
++   val = GSL_MULTIMIN_FN_EVAL (f, x);
++   
++-  if (!gsl_finite(val))
+++  if (!isfinite(val))
++     {
++       GSL_ERROR("non-finite function value encountered", GSL_EBADFUNC);
++     }
++@@ -283,7 +283,7 @@
++       gsl_vector_set (xtemp, i, val);
++       val = GSL_MULTIMIN_FN_EVAL (f, xtemp);
++   
++-      if (!gsl_finite(val))
+++      if (!isfinite(val))
++         {
++           GSL_ERROR("non-finite function value encountered", GSL_EBADFUNC);
++         }
++@@ -374,14 +374,14 @@
++ 
++   val = nmsimplex_move_corner (-1.0, state, hi, xc, f);
++ 
++-  if (gsl_finite(val) && val < gsl_vector_get (y1, lo))
+++  if (isfinite(val) && val < gsl_vector_get (y1, lo))
++     {
++ 
++       /* reflected point becomes lowest point, try expansion */
++ 
++       val2 = nmsimplex_move_corner (-2.0, state, hi, xc2, f);
++ 
++-      if (gsl_finite(val2) && val2 < gsl_vector_get (y1, lo))
+++      if (isfinite(val2) && val2 < gsl_vector_get (y1, lo))
++         {
++           gsl_matrix_set_row (x1, hi, xc2);
++           gsl_vector_set (y1, hi, val2);
++@@ -397,9 +397,9 @@
++      or
++      we got a non-finite (illegal) function value */
++ 
++-  else if (!gsl_finite(val) || val > gsl_vector_get (y1, s_hi))
+++  else if (!isfinite(val) || val > gsl_vector_get (y1, s_hi))
++     {
++-      if (gsl_finite(val) && val <= gsl_vector_get (y1, hi))
+++      if (isfinite(val) && val <= gsl_vector_get (y1, hi))
++         {
++ 
++           /* if trial point is better than highest point, replace 
++@@ -413,7 +413,7 @@
++ 
++       val2 = nmsimplex_move_corner (0.5, state, hi, xc2, f);
++ 
++-      if (gsl_finite(val2) && val2 <= gsl_vector_get (y1, hi))
+++      if (isfinite(val2) && val2 <= gsl_vector_get (y1, hi))
++         {
++           gsl_matrix_set_row (state->x1, hi, xc2);
++           gsl_vector_set (y1, hi, val2);
++diff -ruN src/multimin/simplex2.c src-mod/multimin/simplex2.c
++--- src/multimin/simplex2.c	2010-12-26 09:57:08.000000000 -0800
+++++ src-mod/multimin/simplex2.c	2014-05-27 18:47:27.000000000 -0700
++@@ -171,7 +171,7 @@
++ 	     we finish the contraction (and do not abort) to allow the user
++ 	     to handle the situation */
++ 
++-	  if (!gsl_finite (newval))
+++	  if (!isfinite (newval))
++ 	    {
++ 	      status = GSL_EBADFUNC;
++ 	    }
++@@ -367,7 +367,7 @@
++ 
++   val = GSL_MULTIMIN_FN_EVAL (f, x);
++ 
++-  if (!gsl_finite (val))
+++  if (!isfinite (val))
++     {
++       GSL_ERROR ("non-finite function value encountered", GSL_EBADFUNC);
++     }
++@@ -394,7 +394,7 @@
++ 	val = GSL_MULTIMIN_FN_EVAL (f, xtemp);
++       }
++ 
++-      if (!gsl_finite (val))
+++      if (!isfinite (val))
++ 	{
++ 	  GSL_ERROR ("non-finite function value encountered", GSL_EBADFUNC);
++ 	}
++@@ -477,13 +477,13 @@
++ 
++   val = try_corner_move (-1.0, state, hi, xc, f);
++ 
++-  if (gsl_finite (val) && val < gsl_vector_get (y1, lo))
+++  if (isfinite (val) && val < gsl_vector_get (y1, lo))
++     {
++       /* reflected point is lowest, try expansion */
++ 
++       val2 = try_corner_move (-2.0, state, hi, xc2, f);
++ 
++-      if (gsl_finite (val2) && val2 < gsl_vector_get (y1, lo))
+++      if (isfinite (val2) && val2 < gsl_vector_get (y1, lo))
++ 	{
++ 	  update_point (state, hi, xc2, val2);
++ 	}
++@@ -492,12 +492,12 @@
++ 	  update_point (state, hi, xc, val);
++ 	}
++     }
++-  else if (!gsl_finite (val) || val > gsl_vector_get (y1, s_hi))
+++  else if (!isfinite (val) || val > gsl_vector_get (y1, s_hi))
++     {
++       /* reflection does not improve things enough, or we got a
++          non-finite function value */
++ 
++-      if (gsl_finite (val) && val <= gsl_vector_get (y1, hi))
+++      if (isfinite (val) && val <= gsl_vector_get (y1, hi))
++ 	{
++ 	  /* if trial point is better than highest point, replace
++ 	     highest point */
++@@ -509,7 +509,7 @@
++ 
++       val2 = try_corner_move (0.5, state, hi, xc2, f);
++ 
++-      if (gsl_finite (val2) && val2 <= gsl_vector_get (y1, hi))
+++      if (isfinite (val2) && val2 <= gsl_vector_get (y1, hi))
++ 	{
++ 	  update_point (state, hi, xc2, val2);
++ 	}
++@@ -605,7 +605,7 @@
++ 
++   val = GSL_MULTIMIN_FN_EVAL (f, x);
++ 
++-  if (!gsl_finite (val))
+++  if (!isfinite (val))
++     {
++       GSL_ERROR ("non-finite function value encountered", GSL_EBADFUNC);
++     }
++@@ -669,7 +669,7 @@
++ 
++ 	val = GSL_MULTIMIN_FN_EVAL (f, &r_i.vector);
++ 
++-	if (!gsl_finite (val))
+++	if (!isfinite (val))
++ 	  {
++ 	    GSL_ERROR ("non-finite function value encountered", GSL_EBADFUNC);
++ 	  }
++diff -ruN src/roots/newton.c src-mod/roots/newton.c
++--- src/roots/newton.c	2010-12-26 09:57:08.000000000 -0800
+++++ src-mod/roots/newton.c	2014-05-27 18:47:27.000000000 -0700
++@@ -83,12 +83,12 @@
++   state->f = f_new ;
++   state->df = df_new ;
++ 
++-  if (!gsl_finite(f_new))
+++  if (!isfinite(f_new))
++     {
++       GSL_ERROR ("function value is not finite", GSL_EBADFUNC);
++     }
++ 
++-  if (!gsl_finite (df_new))
+++  if (!isfinite (df_new))
++     {
++       GSL_ERROR ("derivative value is not finite", GSL_EBADFUNC);
++     }
++diff -ruN src/roots/roots.h src-mod/roots/roots.h
++--- src/roots/roots.h	2010-12-26 09:57:08.000000000 -0800
+++++ src-mod/roots/roots.h	2014-05-27 18:47:27.000000000 -0700
++@@ -28,7 +28,7 @@
++ #define SAFE_FUNC_CALL(f, x, yp) \
++ do { \
++   *yp = GSL_FN_EVAL(f,x); \
++-  if (!gsl_finite(*yp)) \
+++  if (!isfinite(*yp)) \
++     GSL_ERROR("function value is not finite", GSL_EBADFUNC); \
++ } while (0)
++ 
++diff -ruN src/roots/secant.c src-mod/roots/secant.c
++--- src/roots/secant.c	2010-12-26 09:57:08.000000000 -0800
+++++ src-mod/roots/secant.c	2014-05-27 18:47:27.000000000 -0700
++@@ -94,12 +94,12 @@
++   state->f = f_new ;
++   state->df = df_new ;
++ 
++-  if (!gsl_finite (f_new))
+++  if (!isfinite (f_new))
++     {
++       GSL_ERROR ("function value is not finite", GSL_EBADFUNC);
++     }
++ 
++-  if (!gsl_finite (df_new))
+++  if (!isfinite (df_new))
++     {
++       GSL_ERROR ("derivative value is not finite", GSL_EBADFUNC);
++     }
++diff -ruN src/roots/steffenson.c src-mod/roots/steffenson.c
++--- src/roots/steffenson.c	2010-12-26 09:57:08.000000000 -0800
+++++ src-mod/roots/steffenson.c	2014-05-27 18:47:27.000000000 -0700
++@@ -105,7 +105,7 @@
++   state->f = f_new ;
++   state->df = df_new ;
++ 
++-  if (!gsl_finite (f_new))
+++  if (!isfinite (f_new))
++     {
++       GSL_ERROR ("function value is not finite", GSL_EBADFUNC);
++     }
++@@ -126,7 +126,7 @@
++         *root = x_1 - u * u / v ;  /* accelerated value */
++     }
++ 
++-  if (!gsl_finite (df_new))
+++  if (!isfinite (df_new))
++     {
++       GSL_ERROR ("derivative value is not finite", GSL_EBADFUNC);
++     }
++diff -ruN src/specfunc/hyperg_U.c src-mod/specfunc/hyperg_U.c
++--- src/specfunc/hyperg_U.c	2010-12-26 09:57:08.000000000 -0800
+++++ src-mod/specfunc/hyperg_U.c	2014-05-27 18:47:28.000000000 -0700
++@@ -524,7 +524,7 @@
++         t_err = a0_err + b0_err;
++         dchu_val += t_val;
++         dchu_err += t_err;
++-        if(!finite(t_val) || fabs(t_val) < EPS*fabs(dchu_val)) break;
+++        if(!isfinite(t_val) || fabs(t_val) < EPS*fabs(dchu_val)) break;
++       }
++ 
++       result->val  = dchu_val;
++diff -ruN src/sys/ldfrexp.c src-mod/sys/ldfrexp.c
++--- src/sys/ldfrexp.c	2010-12-26 09:57:08.000000000 -0800
+++++ src-mod/sys/ldfrexp.c	2014-05-27 18:47:28.000000000 -0700
++@@ -60,7 +60,7 @@
++       *e = 0;
++       return 0.0;
++     }
++-  else if (!finite (x))
+++  else if (!isfinite (x))
++     {
++       *e = 0;
++       return x;
++@@ -85,7 +85,7 @@
++ 
++       f = x * pow (2.0, -ei);
++ 
++-      if (!finite (f))
+++      if (!isfinite (f))
++         {
++           /* This should not happen */
++           *e = 0;
++diff -ruN src/test/results.c src-mod/test/results.c
++--- src/test/results.c	2010-12-26 09:57:08.000000000 -0800
+++++ src-mod/test/results.c	2014-05-27 18:47:28.000000000 -0700
++@@ -24,7 +24,10 @@
++ #include <stdlib.h>
++ #include <gsl/gsl_sys.h>
++ #include <gsl/gsl_machine.h>
+++#include <stdarg.h>
+++#define STDC_HEADERS
++ 
+++/*
++ #if HAVE_VPRINTF
++ #ifdef STDC_HEADERS
++ #include <stdarg.h>
++@@ -32,6 +35,7 @@
++ #include <varargs.h>
++ #endif
++ #endif
+++*/
++ 
++ #include <gsl/gsl_test.h>
++ 
+Index: ../trunk-jpl/externalpackages/triangle/install-iosi386.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/install-iosi386.sh	(revision 0)
++++ ../trunk-jpl/externalpackages/triangle/install-iosi386.sh	(revision 18228)
+@@ -0,0 +1,27 @@
++#!/bin/bash
++set -eu
++
++host_triplet="i386-apple-darwin13.1.0"
++
++#cleanup
++rm -rf install triangle
++mkdir install
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
++
++#untar
++cd install
++cp ../triangle.zip ./
++unzip triangle.zip
++rm triangle.zip
++
++#copy new makefile
++cp ../configs/ios/configure.make ./
++cp ../makefile ./
++
++#compile triangle
++make
++
++#patch triangle.h
++patch triangle.h ../triangle.h.patch
+
+Property changes on: ../trunk-jpl/externalpackages/triangle/install-iosi386.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/triangle/install-iosarmv7.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/install-iosarmv7.sh	(revision 0)
++++ ../trunk-jpl/externalpackages/triangle/install-iosarmv7.sh	(revision 18228)
+@@ -0,0 +1,27 @@
++#!/bin/bash
++set -eu
++
++host_triplet="armv7-apple-darwin14.0.0"
++
++#cleanup
++rm -rf install triangle
++mkdir install
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
++
++#untar
++cd install
++cp ../triangle.zip ./
++unzip triangle.zip
++rm triangle.zip
++
++#copy new makefile
++cp ../configs/ios/configure.make ./
++cp ../makefile ./
++
++#compile triangle
++make
++
++#patch triangle.h
++patch triangle.h ../triangle.h.patch
+
+Property changes on: ../trunk-jpl/externalpackages/triangle/install-iosarmv7.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/triangle/install-iosarmv7s.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/install-iosarmv7s.sh	(revision 0)
++++ ../trunk-jpl/externalpackages/triangle/install-iosarmv7s.sh	(revision 18228)
+@@ -0,0 +1,27 @@
++#!/bin/bash
++set -eu
++
++host_triplet="armv7s-apple-darwin14.0.0"
++
++#cleanup
++rm -rf install triangle
++mkdir install
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
++
++#untar
++cd install
++cp ../triangle.zip ./
++unzip triangle.zip
++rm triangle.zip
++
++#copy new makefile
++cp ../configs/ios/configure.make ./
++cp ../makefile ./
++
++#compile triangle
++make
++
++#patch triangle.h
++patch triangle.h ../triangle.h.patch
+
+Property changes on: ../trunk-jpl/externalpackages/triangle/install-iosarmv7s.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/externalpackages/triangle/configs/ios/configure.make
+===================================================================
+--- ../trunk-jpl/externalpackages/triangle/configs/ios/configure.make	(revision 0)
++++ ../trunk-jpl/externalpackages/triangle/configs/ios/configure.make	(revision 18228)
+@@ -0,0 +1,7 @@
++CC=${host_triplet}-clang
++AR=${host-triplet}-ar
++RANLIB=${host-triplet}-ranlib
++CSWITCHES = $(CFLAGS) -DNO_TIMER
++TRILIBDEFS = -DTRILIBRARY
++OBJ_EXT=o
++LIB_EXT=a
+Index: ../trunk-jpl/configs/config-ios-armv7.sh
+===================================================================
+--- ../trunk-jpl/configs/config-ios-armv7.sh	(revision 0)
++++ ../trunk-jpl/configs/config-ios-armv7.sh	(revision 18228)
+@@ -0,0 +1,32 @@
++#!/bin/sh
++set -eu
++
++export DEVROOT=`xcode-select --print-path`
++export SDKROOT="$DEVROOT/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk"
++export CLANG="$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
++export CLANGXX="$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
++export CC=$CLANG
++export LD=$DEVROOT/usr/bin/ld
++export CPPFLAGS="-isysroot $SDKROOT/usr/include"
++export CXX=$CLANGXX
++export CXXFLAGS="-O -arch armv7 -isysroot $SDKROOT -I$SDKROOT/usr/include" 
++export CFLAGS="-O -arch armv7 -isysroot $SDKROOT -I$SDKROOT/usr/include"
++export AR=$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar
++export AS=$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/as
++export LDFLAGS="-lstdc++ -arch armv7 -isysroot $SDKROOT" 
++export LIBTOOL=$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
++export STRIP=$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip
++export RANLIB=$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib
++
++./configure                                                        \
++	--prefix=$ISSM_DIR                                              \
++   --build="i386-apple-darwin13.1.0"                               \
++   --host="armv7-apple-darwin14.0.0"                               \
++   --enable-shared                                                 \
++   --with-ios=yes                                                  \
++   --with-Gia=no                                                   \
++   --without-fortran                                               \
++	--without-wrappers                                              \
++	--without-kriging                                               \
++	--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install           \
++	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+
+Property changes on: ../trunk-jpl/configs/config-ios-armv7.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/configs/config-ios-simulator.sh
+===================================================================
+--- ../trunk-jpl/configs/config-ios-simulator.sh	(revision 0)
++++ ../trunk-jpl/configs/config-ios-simulator.sh	(revision 18228)
+@@ -0,0 +1,31 @@
++#!/bin/sh
++set -eu
++
++export DEVROOT=`xcode-select --print-path`
++export SDKROOT="$DEVROOT/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk"
++export CLANG="$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
++export CLANGXX="$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
++export CC=$CLANG
++export CXX=$CLANGXX
++export LD=$DEVROOT/usr/bin/ld
++export CPPFLAGS="-isysroot $SDKROOT/usr/include"
++export CXXFLAGS="-O -arch i386 -miphoneos-version-min=7.1 -isysroot $SDKROOT -I$SDKROOT/usr/include"
++export CFLAGS="-O -arch i386 -miphoneos-version-min=7.1  -isysroot $SDKROOT -I$SDKROOT/usr/include"
++export AR=$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar
++export AS=$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/as
++export LDFLAGS="-lstdc++ -arch i386 -isysroot $SDKROOT" 
++export LIBTOOL=$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
++export STRIP=$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip
++export RANLIB=$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib
++
++./configure                                                        \
++	--prefix=$ISSM_DIR                                              \
++   --target="i386-apple-darwin13.1.0"                              \
++   --enable-shared                                                 \
++   --with-ios=yes                                                  \
++   --with-Gia=no                                                   \
++   --without-fortran                                               \
++	--without-wrappers                                              \
++	--without-kriging                                               \
++	--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install           \
++	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+
+Property changes on: ../trunk-jpl/configs/config-ios-simulator.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/configs/config-ios-armv7s.sh
+===================================================================
+--- ../trunk-jpl/configs/config-ios-armv7s.sh	(revision 0)
++++ ../trunk-jpl/configs/config-ios-armv7s.sh	(revision 18228)
+@@ -0,0 +1,32 @@
++#!/bin/sh
++set -eu
++
++export DEVROOT=`xcode-select --print-path`
++export SDKROOT="$DEVROOT/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk"
++export CLANG="$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
++export CLANGXX="$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
++export CC=$CLANG
++export LD=$DEVROOT/usr/bin/ld
++export CPPFLAGS="-isysroot $SDKROOT/usr/include"
++export CXX=$CLANGXX
++export CXXFLAGS="-O -arch armv7s -isysroot $SDKROOT -I$SDKROOT/usr/include" 
++export CFLAGS="-O -arch armv7s -isysroot $SDKROOT -I$SDKROOT/usr/include"
++export AR=$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar
++export AS=$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/as
++export LDFLAGS="-lstdc++ -arch armv7s -isysroot $SDKROOT" 
++export LIBTOOL=$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
++export STRIP=$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip
++export RANLIB=$DEVROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib
++
++./configure                                                        \
++	--prefix=$ISSM_DIR                                              \
++   --build="i386-apple-darwin13.1.0"                               \
++   --host="armv7s-apple-darwin14.0.0"                               \
++   --enable-shared                                                 \
++   --with-ios=yes                                                  \
++   --with-Gia=no                                                   \
++   --without-fortran                                               \
++	--without-wrappers                                              \
++	--without-kriging                                               \
++	--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install           \
++	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+
+Property changes on: ../trunk-jpl/configs/config-ios-armv7s.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/17984-18295/ISSM-18228-18229.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18228-18229.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18228-18229.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/NightlyRun/test701.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test701.m	(revision 18228)
++++ ../trunk-jpl/test/NightlyRun/test701.m	(revision 18229)
+@@ -52,7 +52,7 @@
+ 	md.flowequation.fe_FS=i{1};
+ 	md=solve(md,StressbalanceSolutionEnum());
+ 	field_names     ={field_names{:},['Vx' i{1}],['Vy' i{1}],['Vel' i{1}],['Pressure' i{1}]};
+-	field_tolerances={field_tolerances{:},1e-5,1e-5,1e-5,1e-10};
++	field_tolerances={field_tolerances{:},7e-5,7e-5,7e-5,1e-10};
+ 	field_values={field_values{:},...
+ 		(md.results.StressbalanceSolution.Vx),...
+ 		(md.results.StressbalanceSolution.Vy),...
Index: /issm/oecreview/Archive/17984-18295/ISSM-18229-18230.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18229-18230.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18229-18230.diff	(revision 18296)
@@ -0,0 +1,148 @@
+Index: ../trunk-jpl/externalpackages/petsc/install-3.5-linux64.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.5-linux64.sh	(revision 0)
++++ ../trunk-jpl/externalpackages/petsc/install-3.5-linux64.sh	(revision 18230)
+@@ -0,0 +1,35 @@
++#!/bin/bash
++set -eu
++
++#Some cleanup
++rm -rf install petsc-3.5.0 src
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.0.tar.gz' 'petsc-3.5.0.tar.gz'
++
++#Untar and move petsc to install directory
++tar -zxvf  petsc-3.5.0.tar.gz
++mv petsc-3.5.0/* src/
++rm -rf petsc-3.5.0
++
++#configure
++cd src
++./config/configure.py \
++	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
++	--with-mpi-dir="$ISSM_DIR/externalpackages/mpich/install" \
++	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
++	--with-debugging=0 \
++	--with-valgrind=0 \
++	--with-shared-libraries=1 \
++	--download-metis=1 \
++	--download-parmetis=1 \
++	--download-mumps=1 \
++	--download-scalapack=1 \
++	--download-blas=1 \
++	--download-fblaslapack=1 \
++	--with-pic=1
++
++#Compile and intall
++make
++make install
+
+Property changes on: ../trunk-jpl/externalpackages/petsc/install-3.5-linux64.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/jenkins/linux64_murdo
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_murdo	(revision 18229)
++++ ../trunk-jpl/jenkins/linux64_murdo	(revision 18230)
+@@ -19,18 +19,15 @@
+ 	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
+ 	--with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib/ -lmpich" \
+ 	--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
+-	--with-petsc-arch=$ISSM_ARCH \
+ 	--with-python-dir=$ISSM_DIR/externalpackages/python/install\
+ 	--with-python-numpy-dir=$ISSM_DIR/externalpackages/python/install/lib/python2.7/site-packages/numpy/core/include/numpy\
+ 	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ 	--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+ 	--with-chaco-dir="$ISSM_DIR/externalpackages/chaco/install" \
+-	--with-numthreads=18 \
+-	--with-cxxoptflags="-mtune=barcelona -ffast-math -O3 -msse4.2 -Wno-write-strings "\
+ 	--with-graphics-lib="/usr/lib/x86_64-linux-gnu/libX11.so" \
+ 	--with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
+ 	--with-boost-dir=$ISSM_DIR/externalpackages/boost/install/ \
+-	--with-tao-dir=$ISSM_DIR/externalpackages/tao/install \
++	--with-numthreads=18 \
+ 	--enable-development \
+ 	--enable-debugging '
+ 
+@@ -64,11 +61,10 @@
+ 						matlab    install.sh                
+ 						mpich     install-3.0-linux64.sh    
+ 						cmake     install.sh                
+-						petsc     install-3.4-linux64.sh    
++						petsc     install-3.5-linux64.sh    
+ 						triangle  install-linux64.sh        
+ 						boost     install.sh                
+ 						dakota    install-5.3.1-linux64.sh  
+-						tao       install-2.2.sh
+ 						chaco     install.sh 
+ 						python        install-2.7.3-linux64.sh    
+ 						nose          install-linux64-python2.sh  
+Index: ../trunk-jpl/jenkins/imac-012301-gil
+===================================================================
+--- ../trunk-jpl/jenkins/imac-012301-gil	(revision 18229)
++++ ../trunk-jpl/jenkins/imac-012301-gil	(revision 18230)
+@@ -21,14 +21,11 @@
+ 	--with-fortran-lib="/usr/local/gfortran/lib/libgfortran.a" \
+ 	--with-math-lib="/usr/lib/libm.dylib" \
+ 	--with-graphics-lib="/usr/X11/lib/libX11.dylib" \
+-	--with-cxxoptflags=" -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -mmacosx-version-min=10.5  -O3 -DNDEBUG -w "\
+ 	--with-numthreads=8 \
+ 	--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  \
+-	--with-petsc-arch=$ISSM_ARCH \
+ 	--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+ 	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ 	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
+-	--with-tao-dir=$ISSM_DIR/externalpackages/tao/install \
+ 	--enable-development'
+ 
+ #MATLAB path
+@@ -61,8 +58,7 @@
+ 						matlab    install.sh                
+ 						mpich     install-3.0-macosx64.sh    
+ 						cmake     install.sh                
+-						petsc     install-3.4-macosx64.sh    
+-						tao       install-2.2.sh
++						petsc     install-3.5-macosx64.sh    
+ 						triangle  install-macosx64.sh 
+ 						shell2junit  install.sh "
+ 
+Index: ../trunk-jpl/jenkins/linux64_larsen
+===================================================================
+--- ../trunk-jpl/jenkins/linux64_larsen	(revision 18229)
++++ ../trunk-jpl/jenkins/linux64_larsen	(revision 18230)
+@@ -19,16 +19,13 @@
+ 	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
+ 	--with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib/ -lmpich" \
+ 	--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
+-	--with-petsc-arch=$ISSM_ARCH \
+ 	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ 	--with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
+ 	--with-boost-dir=$ISSM_DIR/externalpackages/boost/install/ \
+ 	--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+ 	--with-chaco-dir="$ISSM_DIR/externalpackages/chaco/install" \
++	--with-graphics-lib="/usr/lib/x86_64-linux-gnu/libX11.so" \
+ 	--with-numthreads=18 \
+-	--with-cxxoptflags="-mtune=barcelona -ffast-math -O3 -msse4.2 -Wno-write-strings "\
+-	--with-graphics-lib="/usr/lib/x86_64-linux-gnu/libX11.so" \
+-	--with-tao-dir=$ISSM_DIR/externalpackages/tao/install \
+ 	--enable-development \
+ 	--enable-debugging '
+ 
+@@ -62,11 +59,10 @@
+ 						matlab    install.sh                
+ 						mpich     install-3.0-linux64.sh    
+ 						cmake     install.sh                
+-						petsc     install-3.4-linux64.sh    
++						petsc     install-3.5-linux64.sh    
+ 						triangle  install-linux64.sh        
+ 						boost     install.sh                
+ 						dakota    install-5.3.1-linux64.sh  
+-						tao       install-2.2.sh
+ 						chaco     install.sh 
+ 						shell2junit install.sh"
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18232-18233.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18232-18233.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18232-18233.diff	(revision 18296)
@@ -0,0 +1,72 @@
+Index: ../trunk-jpl/externalpackages/petsc/install-3.5-pleiades.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.5-pleiades.sh	(revision 0)
++++ ../trunk-jpl/externalpackages/petsc/install-3.5-pleiades.sh	(revision 18233)
+@@ -0,0 +1,60 @@
++#!/bin/bash
++set -eu
++
++#Some cleanup
++rm -rf install petsc-3.5.0 src
++mkdir install src
++
++#Download from ISSM server
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.0.tar.gz' 'petsc-3.5.0.tar.gz'
++
++#Untar and move petsc to install directory
++tar -zxvf  petsc-3.5.0.tar.gz
++mv petsc-3.5.0/* src/
++rm -rf petsc-3.5.0
++
++#configure
++cd src
++./config/configure.py \
++	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
++	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
++	--with-blas-lapack-dir="/nasa/intel/mkl/10.0.011/" \
++	--with-mpi-lib="/nasa/sgi/mpt/2.06rp16/lib/libmpi.so" \
++	--with-mpi-include="/nasa/sgi/mpt/2.06rp16/include" \
++	--known-mpi-shared-libraries=1 \
++	--with-debugging=0 \
++	--with-valgrind=0 \
++	--with-batch=1  \
++	--with-shared-libraries=1 \
++	--download-metis=1 \
++	--download-parmetis=1 \
++	--download-mumps=1 \
++	--download-scalapack=1 \
++	--download-blas=1 \
++	--download-fblaslapack=1 \
++	--COPTFLAGS="-lmpi -O3" \
++	--FOPTFLAGS="-lmpi -O3" \
++	--CXXOPTFLAGS="-lmpi -O3"
++
++#prepare script to reconfigure petsc
++cat > script.queue << EOF
++#PBS -S /bin/bash
++#PBS -l select=1:ncpus=1:model=wes 
++#PBS -l walltime=200 
++#PBS -W group_list=s1010
++#PBS -m e 
++
++. /usr/share/modules/init/bash 
++module load comp-intel/11.1.046
++module load math/intel_mkl_64_10.0.011
++module load mpi-sgi/mpt.2.06rp16
++
++export PATH="$PATH:." 
++export MPI_GROUP_MAX=64 
++mpiexec -np 1 ./conftest-arch-linux2-c-opt
++EOF
++
++#print instructions
++echo "== Now: cd src/ "
++echo "== qsub -q devel script.queue "
++echo "== Then run reconfigure script generated by PETSc and follow instructions"
+
+Property changes on: ../trunk-jpl/externalpackages/petsc/install-3.5-pleiades.sh
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
Index: /issm/oecreview/Archive/17984-18295/ISSM-18233-18234.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18233-18234.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18233-18234.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/test/NightlyRun/test701.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test701.m	(revision 18233)
++++ ../trunk-jpl/test/NightlyRun/test701.m	(revision 18234)
+@@ -52,7 +52,7 @@
+ 	md.flowequation.fe_FS=i{1};
+ 	md=solve(md,StressbalanceSolutionEnum());
+ 	field_names     ={field_names{:},['Vx' i{1}],['Vy' i{1}],['Vel' i{1}],['Pressure' i{1}]};
+-	field_tolerances={field_tolerances{:},7e-5,7e-5,7e-5,1e-10};
++	field_tolerances={field_tolerances{:},8e-5,8e-5,8e-5,1e-10};
+ 	field_values={field_values{:},...
+ 		(md.results.StressbalanceSolution.Vx),...
+ 		(md.results.StressbalanceSolution.Vy),...
Index: /issm/oecreview/Archive/17984-18295/ISSM-18234-18235.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18234-18235.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18234-18235.diff	(revision 18296)
@@ -0,0 +1,280 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18234)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18235)
+@@ -2880,6 +2880,7 @@
+ 	/*Intermediaries*/
+ 	int         i,dim,epssize;
+ 	IssmDouble  r,rl,Jdet,viscosity,DU,DUl;
++	IssmDouble	normal[3];
+ 	IssmDouble *xyz_list = NULL;
+ 	IssmDouble *xyz_list_base = NULL;
+ 
+@@ -2958,21 +2959,32 @@
+ 	if(element->IsOnBase()){ 
+ 		element->FindParam(&rl,AugmentedLagrangianRlambdaEnum);
+ 		element->GetVerticesCoordinatesBase(&xyz_list_base);
++		element->NormalBase(&normal[0],xyz_list_base);
+ 
++		int         lsize;
++		IssmDouble* Dlambda = xNewZeroInit<IssmDouble>(dim*dim);
++		IssmDouble* C       = xNewZeroInit<IssmDouble>(dim*lnumdof);
++		IssmDouble* Cprime  = xNewZeroInit<IssmDouble>(dim*numdof);
++
+ 		delete gauss;
+ 		Gauss* gauss=element->NewGaussBase(5);
+ 		for(int ig=gauss->begin();ig<gauss->end();ig++){
+ 			gauss->GaussPoint(ig);
+ 
+ 			element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
+-			this->GetCFS(C,element,dim,xyz_list_base,gauss);
+-			this->GetCFSprime(Cprime,element,dim,xyz_list_base,gauss);
+-			DUl = gauss->weight*Jdet*sqrt(rl);
+-			TripleMultiply(C,1,lnumdof,1,
+-						&DU,1,1,0,
+-						Cprime,1,numdof,0,
++			this->GetCFS(C,element,dim,xyz_list,gauss);
++			this->GetCFSprime(Cprime,element,dim,xyz_list,gauss);
++			for(i=0;i<dim;i++)   Dlambda[i*epssize+i] = gauss->weight*Jdet*sqrt(normal[i]*normal[i])*sqrt(rl);
++			TripleMultiply(C,dim,lnumdof,1,
++						Dlambda,dim,dim,0,
++						Cprime,dim,numdof,0,
+ 						CtCUzawa,1);
+ 		}
++		/*Delete base part*/
++		xDelete<IssmDouble>(xyz_list_base);
++		xDelete<IssmDouble>(Dlambda);
++		xDelete<IssmDouble>(C);
++		xDelete<IssmDouble>(Cprime);
+ 	}
+ 
+ 	/*Transform Coordinate System*/
+@@ -3732,8 +3744,10 @@
+ 
+ 	int         i,dim;
+ 	IssmDouble  Jdet,r,pressure;
+-	IssmDouble *xyz_list = NULL;
+-	Gauss*      gauss    = NULL;
++	IssmDouble  bed_normal[3];
++	IssmDouble *xyz_list      = NULL;
++	IssmDouble *xyz_list_base = NULL;
++	Gauss*      gauss         = NULL;
+ 
+ 	/*Get problem dimension*/
+ 	element->FindParam(&dim,DomainDimensionEnum);
+@@ -3756,6 +3770,7 @@
+ 
+ 	/*Get d and tau*/
+ 	Input* pressure_input=element->GetInput(PressureEnum); _assert_(pressure_input);
++	Input* sigmann_input =element->GetInput(SigmaNNEnum);  _assert_(sigmann_input);
+ 
+ 	gauss=element->NewGauss(5);
+ 	for(int ig=gauss->begin();ig<gauss->end();ig++){
+@@ -3774,6 +3789,35 @@
+ 		}
+ 	}
+ 
++	if(element->IsOnBase()){ 
++
++		IssmDouble   sigmann;
++		IssmDouble*  vbasis = xNew<IssmDouble>(numnodes);
++
++		element->GetVerticesCoordinatesBase(&xyz_list_base);
++		element->NormalBase(&bed_normal[0],xyz_list_base);
++
++		delete gauss;
++		Gauss* gauss=element->NewGaussBase(5);
++		for(int ig=gauss->begin();ig<gauss->end();ig++){
++			gauss->GaussPoint(ig);
++
++			element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
++			element->NodalFunctionsVelocity(vbasis,gauss);
++			sigmann_input->GetInputValue(&sigmann, gauss);
++
++			for(i=0;i<numnodes;i++){
++				pe->values[i*dim+0] += - sigmann*bed_normal[0]*gauss->weight*Jdet*vbasis[i];
++				pe->values[i*dim+1] += - sigmann*bed_normal[1]*gauss->weight*Jdet*vbasis[i];
++				if(dim==3){
++					pe->values[i*dim+2]+= - sigmann*bed_normal[2]*gauss->weight*Jdet*vbasis[i];
++				}
++			}
++		}
++		xDelete<IssmDouble>(xyz_list_base);
++		xDelete<IssmDouble>(vbasis);
++	}
++
+ 	/*Transform coordinate system*/
+ 	//element->TransformLoadVectorCoord(pe,cs_list); Do not transform pressure augmentation
+ 
+@@ -4409,7 +4453,8 @@
+ 	xDelete<IssmDouble>(vbasis);
+ }/*}}}*/
+ void StressbalanceAnalysis::GetCFS(IssmDouble* C,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+-	/*Compute C  matrix. C=[Cp1 Cp2 ...] where Cpi=phi_pi. 
++	/*Compute C  matrix. C=[Cp1 Cp2 ...] where:
++	 *     Cpi=[phi phi]. 
+ 	 */
+ 
+ 	/*Fetch number of nodes for this finite element*/
+@@ -4420,49 +4465,64 @@
+ 
+ 	/*Get nodal functions derivatives*/
+ 	IssmDouble* basis =xNew<IssmDouble>(lnumnodes);
+-	element->NodalFunctionsP1(basis,gauss);
++	element->NodalFunctions(basis,gauss);
+ 
+ 	/*Build B: */
+ 	for(int i=0;i<lnumnodes;i++){
+-		C[i] = basis[i];
++		C[i*lnumnodes+0] = basis[i];
++		C[i*lnumnodes+1] = basis[i];
+ 	}
+ 
+ 	/*Clean up*/
+ 	xDelete<IssmDouble>(basis);
+ }/*}}}*/
+ void StressbalanceAnalysis::GetCFSprime(IssmDouble* Cprime,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+-	/*	Compute C'  matrix. C'=[C1' C2' C3'] 
+-	 *			Ci' = [  dphi/dx   dphi/dy ]
++	/*	Compute C'  matrix. C'=[C1' C2' ...] 
++	 *			Ci' = [  phi  0  ]
++	 *			      [   0  phi ]
+ 	 *
+ 	 *	In 3d
+-	 *     	   Ci=[ dh/dx   dh/dy    dh/dz  ]
++	 *			Ci' = [  phi  0   0  ]
++	 *			      [   0  phi  0  ]
++	 *			      [   0   0  phi ]
+ 	 *	where phi is the finiteelement function for node i.
+ 	 */
+ 
+ 	/*Fetch number of nodes for this finite element*/
+-	int lnumnodes = element->GetNumberOfNodes();
++	int vnumnodes = element->GetNumberOfNodes();
++	int vnumdof   = vnumnodes*dim;
+ 
+-	/*Get nodal functions derivatives*/
+-	IssmDouble* dbasis=xNew<IssmDouble>(dim*lnumnodes);
+-	element->NodalFunctionsDerivatives(dbasis,xyz_list,gauss);
++	IssmDouble* vbasis=xNew<IssmDouble>(vnumnodes);
++	element->NodalFunctionsVelocity(vbasis,gauss);
+ 
+-	/*Build C_prime: */
+-	if(dim==2){
+-		for(int i=0;i<lnumnodes;i++){
+-			Cprime[dim*i+0] = dbasis[0*lnumnodes+i];
+-			Cprime[dim*i+1] = dbasis[1*lnumnodes+i];
++	/*Build B: */
++	if(dim==3){
++		for(int i=0;i<vnumnodes;i++){
++			Cprime[vnumdof*0+3*i+0] = vbasis[i];
++			Cprime[vnumdof*0+3*i+1] = 0.;
++			Cprime[vnumdof*0+3*i+2] = 0.;
++
++			Cprime[vnumdof*1+3*i+0] = 0.;
++			Cprime[vnumdof*1+3*i+1] = vbasis[i];
++			Cprime[vnumdof*1+3*i+2] = 0.;
++
++			Cprime[vnumdof*2+3*i+0] = 0.;
++			Cprime[vnumdof*2+3*i+1] = 0.;
++			Cprime[vnumdof*2+3*i+2] = vbasis[i];
+ 		}
+ 	}
+ 	else{
+-		for(int i=0;i<lnumnodes;i++){
+-			Cprime[dim*i+0] = dbasis[0*lnumnodes+i];
+-			Cprime[dim*i+1] = dbasis[1*lnumnodes+i];
+-			Cprime[dim*i+2] = dbasis[2*lnumnodes+i];
++		for(int i=0;i<vnumnodes;i++){
++			Cprime[vnumdof*0+2*i+0] = vbasis[i];
++			Cprime[vnumdof*0+2*i+1] = 0.;
++
++			Cprime[vnumdof*1+2*i+0] = 0.;
++			Cprime[vnumdof*1+2*i+1] = vbasis[i];
+ 		}
+ 	}
+ 
+-	/*Clean up*/
+-	xDelete<IssmDouble>(dbasis);
++	/*Clean-up*/
++	xDelete<IssmDouble>(vbasis);
+ }/*}}}*/
+ void StressbalanceAnalysis::GetSolutionFromInputsFS(Vector<IssmDouble>* solution,Element* element){/*{{{*/
+ 
+Index: ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 18234)
++++ ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 18235)
+@@ -11,6 +11,7 @@
+ void UzawaPressureAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/
+ 
+ 	parameters->AddObject(iomodel->CopyConstantObject(AugmentedLagrangianRhopEnum));
++	parameters->AddObject(iomodel->CopyConstantObject(AugmentedLagrangianRholambdaEnum));
+ }/*}}}*/
+ void UzawaPressureAnalysis::UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type){/*{{{*/
+ 
+@@ -166,25 +167,61 @@
+ }/*}}}*/
+ void UzawaPressureAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
++	int        dim;
+ 	int        *doflist   = NULL;
++	IssmDouble rholambda,un;
++	IssmDouble bed_normal[3];
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+-	int numnodes = element->GetNumberOfNodes();
++	int numnodes       = element->GetNumberOfNodes();
++	int numnodessigma  = element->NumberofNodes(P2Enum);
++	element->FindParam(&dim,DomainDimensionEnum);
+ 
+ 	/*Fetch dof list and allocate solution vector*/
+ 	element->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+ 	IssmDouble* values    = xNew<IssmDouble>(numnodes);
+-	IssmDouble* pressure = xNew<IssmDouble>(numnodes);
++	IssmDouble* pressure  = xNew<IssmDouble>(numnodes);
++	Input* vx_input=    element->GetInput(VxEnum);       _assert_(vx_input);
++	Input* vy_input=    element->GetInput(VyEnum);       _assert_(vy_input);
++	Input* vz_input     = NULL;
++	if(dim==3){vz_input =element->GetInput(VzEnum);      _assert_(vz_input);}
++	Input* sigmann_input=element->GetInput(SigmaNNEnum); _assert_(vy_input);
+ 	element->GetInputListOnNodes(&pressure[0],PressureEnum);
+ 
++	/*Update pressure enum first*/
+ 	for(int i=0;i<numnodes;i++){
+ 		values[i]   = pressure[i] + solution[doflist[i]];
+ 	}
+-
+ 	element->AddInput(PressureEnum,values,element->GetElementType());
+ 
++	/*Now compute sigmann if on base*/
++	element->GetInputListOnNodes(&sigmann[0],SigmaNNEnum);
++
++	if(element->IsOnBase()){ 
++
++		element->NormalBase(&bed_normal[0],xyz_list_tria);
++		element->FindParam(&rholambda,AugmentedLagrangianRholambdaEnum);
++
++		Gauss* gauss = element->NewGauss();
++		for(int i=0;i<numnodessigma;i++){
++			gauss->GaussNode(P2Enum,i);
++
++			vx_input->GetInputValue(&vx, gauss);
++			vy_input->GetInputValue(&vy, gauss);
++			un=bed_normal[0]*vx[i] + bed_normal[1]*vy[i];
++			if(dim==3){
++			   vz_input->GetInputValue(&vz, gauss);
++				un = un + bed_normal[2]*vz[i];
++			}
++			values[i] = sigmann[i] + rholambda*un;
++		}
++	}
++	element->AddInput(SigmaNNEnum,values,P2Enum));
++
+ 	/*Free ressources:*/
++	delete gauss;
+ 	xDelete<IssmDouble>(values);
++	xDelete<IssmDouble>(sigmann);
+ 	xDelete<IssmDouble>(pressure);
+ 	xDelete<int>(doflist);
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18235-18236.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18235-18236.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18235-18236.diff	(revision 18296)
@@ -0,0 +1,68 @@
+Index: ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 18235)
++++ ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 18236)
+@@ -168,13 +168,17 @@
+ void UzawaPressureAnalysis::InputUpdateFromSolution(IssmDouble* solution,Element* element){/*{{{*/
+ 
+ 	int        dim;
+-	int        *doflist   = NULL;
+-	IssmDouble rholambda,un;
++	int        *doflist       = NULL;
++	IssmDouble rholambda,un,vx,vy,vz,sigmann;
+ 	IssmDouble bed_normal[3];
++	IssmDouble *xyz_list_base = NULL;
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int numnodes       = element->GetNumberOfNodes();
+-	int numnodessigma  = element->NumberofNodes(P2Enum);
++	//int numnodessigma  = element->NumberofNodes(P2Enum);
++	int numnodessigma;
++	if(dim==2) numnodessigma=3;
++	else numnodessigma=6;
+ 	element->FindParam(&dim,DomainDimensionEnum);
+ 
+ 	/*Fetch dof list and allocate solution vector*/
+@@ -195,33 +199,33 @@
+ 	element->AddInput(PressureEnum,values,element->GetElementType());
+ 
+ 	/*Now compute sigmann if on base*/
+-	element->GetInputListOnNodes(&sigmann[0],SigmaNNEnum);
+-
+ 	if(element->IsOnBase()){ 
+ 
+-		element->NormalBase(&bed_normal[0],xyz_list_tria);
++		element->GetVerticesCoordinatesBase(&xyz_list_base);
++		element->NormalBase(&bed_normal[0],xyz_list_base);
+ 		element->FindParam(&rholambda,AugmentedLagrangianRholambdaEnum);
+ 
+ 		Gauss* gauss = element->NewGauss();
+ 		for(int i=0;i<numnodessigma;i++){
+ 			gauss->GaussNode(P2Enum,i);
+ 
++			sigmann_input->GetInputValue(&sigmann, gauss);
+ 			vx_input->GetInputValue(&vx, gauss);
+ 			vy_input->GetInputValue(&vy, gauss);
+-			un=bed_normal[0]*vx[i] + bed_normal[1]*vy[i];
++			un=bed_normal[0]*vx + bed_normal[1]*vy;
+ 			if(dim==3){
+ 			   vz_input->GetInputValue(&vz, gauss);
+-				un = un + bed_normal[2]*vz[i];
++				un = un + bed_normal[2]*vz;
+ 			}
+-			values[i] = sigmann[i] + rholambda*un;
++			values[i] = sigmann + rholambda*un;
+ 		}
++		delete gauss;
++		xDelete<IssmDouble>(xyz_list_base);
+ 	}
+-	element->AddInput(SigmaNNEnum,values,P2Enum));
++	element->AddInput(SigmaNNEnum,values,P2Enum);
+ 
+ 	/*Free ressources:*/
+-	delete gauss;
+ 	xDelete<IssmDouble>(values);
+-	xDelete<IssmDouble>(sigmann);
+ 	xDelete<IssmDouble>(pressure);
+ 	xDelete<int>(doflist);
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18236-18237.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18236-18237.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18236-18237.diff	(revision 18296)
@@ -0,0 +1,2631 @@
+Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp	(revision 18237)
+@@ -72,14 +72,6 @@
+ 		iomodel->FetchDataToInput(elements,MasstransportSpcthicknessEnum); //for DG, we need the spc in the element
+ 	}
+ 
+-	if(dakota_analysis){
+-		elements->InputDuplicate(BaseEnum,QmuBaseEnum);
+-		elements->InputDuplicate(ThicknessEnum,QmuThicknessEnum);
+-		elements->InputDuplicate(SurfaceEnum,QmuSurfaceEnum);
+-		elements->InputDuplicate(MaskIceLevelsetEnum,QmuMaskIceLevelsetEnum);
+-		if(isgroundingline) elements->InputDuplicate(MaskGroundediceLevelsetEnum,QmuMaskGroundediceLevelsetEnum);
+-	}
+-
+ 	if(iomodel->domaintype!=Domain2DhorizontalEnum){
+ 		iomodel->FetchDataToInput(elements,MeshVertexonbaseEnum);
+ 		iomodel->FetchDataToInput(elements,MeshVertexonsurfaceEnum);
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18237)
+@@ -212,9 +212,7 @@
+ 	iomodel->FetchDataToInput(elements,MaterialsRheologyBEnum);
+ 	iomodel->FetchDataToInput(elements,MaterialsRheologyNEnum);
+ 	iomodel->FetchDataToInput(elements,VxEnum,0.);
+-	if(dakota_analysis)elements->InputDuplicate(VxEnum,QmuVxEnum);
+ 	iomodel->FetchDataToInput(elements,VyEnum,0.);
+-	if(dakota_analysis)elements->InputDuplicate(VyEnum,QmuVyEnum);
+ 	iomodel->FetchDataToInput(elements,LoadingforceXEnum);
+ 	iomodel->FetchDataToInput(elements,LoadingforceYEnum);
+ 	if(isdamage)iomodel->FetchDataToInput(elements,DamageDEnum);
+@@ -227,12 +225,10 @@
+ 		iomodel->FetchDataToInput(elements,FlowequationBorderFSEnum);
+ 		iomodel->FetchDataToInput(elements,LoadingforceZEnum);
+ 		iomodel->FetchDataToInput(elements,VzEnum,0.);
+-		if(dakota_analysis)elements->InputDuplicate(VzEnum,QmuVzEnum);
+ 	}
+ 	if(isFS){
+ 		iomodel->FetchDataToInput(elements,PressureEnum,0.);
+ 		iomodel->FetchDataToInput(elements,BasalforcingsFloatingiceMeltingRateEnum,0.);
+-		if(dakota_analysis)elements->InputDuplicate(PressureEnum,QmuPressureEnum);
+ 	}
+ 	if(islevelset){
+ 		iomodel->FetchDataToInput(elements,IceMaskNodeActivationEnum);
+Index: ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/analyses/ThermalAnalysis.cpp	(revision 18237)
+@@ -74,13 +74,6 @@
+ 	InputUpdateFromConstantx(elements,0.,VxMeshEnum);
+ 	InputUpdateFromConstantx(elements,0.,VyMeshEnum);
+ 	InputUpdateFromConstantx(elements,0.,VzMeshEnum);
+-	if(dakota_analysis){
+-		elements->InputDuplicate(TemperatureEnum,QmuTemperatureEnum);
+-		elements->InputDuplicate(BasalforcingsGroundediceMeltingRateEnum,QmuMeltingEnum);
+-		elements->InputDuplicate(VxMeshEnum,QmuVxMeshEnum);
+-		elements->InputDuplicate(VxMeshEnum,QmuVyMeshEnum);
+-		elements->InputDuplicate(VxMeshEnum,QmuVzMeshEnum);
+-	}
+ 	if(islevelset){
+ 		iomodel->FetchDataToInput(elements,IceMaskNodeActivationEnum);
+ 		iomodel->FetchDataToInput(elements,MeshVertexonbaseEnum); // required for updating active nodes
+Index: ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 18237)
+@@ -68,11 +68,6 @@
+ 	iomodel->FetchDataToInput(elements,MaskIceLevelsetEnum);
+ 	iomodel->FetchDataToInput(elements,PressureEnum);
+ 
+-	bool dakota_analysis;
+-	iomodel->Constant(&dakota_analysis,QmuIsdakotaEnum);
+-	if(dakota_analysis){
+-		elements->InputDuplicate(DamageDEnum, QmuDamageDEnum);
+-	}
+ }/*}}}*/
+ void DamageEvolutionAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+ 
+Index: ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp	(revision 18237)
+@@ -77,13 +77,6 @@
+ 	InputUpdateFromConstantx(elements,0.,VxMeshEnum);
+ 	InputUpdateFromConstantx(elements,0.,VyMeshEnum);
+ 	InputUpdateFromConstantx(elements,0.,VzMeshEnum);
+-	if(dakota_analysis){
+-		elements->InputDuplicate(TemperatureEnum,QmuTemperatureEnum);
+-		elements->InputDuplicate(BasalforcingsGroundediceMeltingRateEnum,QmuMeltingEnum);
+-		elements->InputDuplicate(VxMeshEnum,QmuVxMeshEnum);
+-		elements->InputDuplicate(VxMeshEnum,QmuVyMeshEnum);
+-		elements->InputDuplicate(VxMeshEnum,QmuVzMeshEnum);
+-	}
+ 	if(islevelset){
+ 		iomodel->FetchDataToInput(elements,IceMaskNodeActivationEnum);
+ 		iomodel->FetchDataToInput(elements,MeshVertexonbaseEnum); // required for updating active nodes
+Index: ../trunk-jpl/src/c/main/issm.cpp
+===================================================================
+--- ../trunk-jpl/src/c/main/issm.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/main/issm.cpp	(revision 18237)
+@@ -22,6 +22,9 @@
+ 	OutputResultsx(femmodel);
+ 
+ 	/*Wrap up: */
++	femmodel->CleanUp();
++
++	/*Delete Model: */
+ 	delete femmodel;
+ 
+ 	/*Finalize environment:*/
+Index: ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp	(revision 18237)
+@@ -55,10 +55,8 @@
+ 			switch(iomodel->domaindim){
+ 				case 2:
+ 					elements->InputDuplicate(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum);
+-					if(dakota_analysis) elements->InputDuplicate(MaterialsRheologyBbarEnum,QmuMaterialsRheologyBEnum);
+ 					break;
+ 				case 3:
+-					if(dakota_analysis) elements->InputDuplicate(MaterialsRheologyBEnum,QmuMaterialsRheologyBEnum); 
+ 					break;
+ 				default:
+ 					_error_("Mesh not supported yet");
+@@ -73,10 +71,8 @@
+ 				case 2:
+ 					elements->InputDuplicate(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum);
+ 					elements->InputDuplicate(DamageDEnum,DamageDbarEnum);
+-					if(dakota_analysis) elements->InputDuplicate(MaterialsRheologyBbarEnum,QmuMaterialsRheologyBEnum);
+ 					break;
+ 				case 3:
+-					if(dakota_analysis) elements->InputDuplicate(MaterialsRheologyBEnum,QmuMaterialsRheologyBEnum); 
+ 					break;
+ 				default:
+ 					_error_("Mesh not supported yet");
+Index: ../trunk-jpl/src/c/toolkits/issm/Bucket.h
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/issm/Bucket.h	(revision 18236)
++++ ../trunk-jpl/src/c/toolkits/issm/Bucket.h	(revision 18237)
+@@ -124,7 +124,9 @@
+ 			return -1;
+ 		} /*}}}*/
+ 		Object *copy()        {/*{{{*/
+-			_error_("Not implemented yet (similar to Elements)"); };
++			if (this->type==MATRIX_BUCKET) return new Bucket(this->m,this->idxm,this->n,this->idxn,this->values,this->mode);
++			else if (this->type==VECTOR_BUCKET) return new Bucket(this->m,this->idxm,this->values,this->mode);
++			else _error_("No Copy of Bucket because its type is invalid."); };
+ 		/*}}}*/
+ 
+ 		/*specific routines of Bucket: */
+Index: ../trunk-jpl/src/c/cores/thermal_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/thermal_core.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/cores/thermal_core.cpp	(revision 18237)
+@@ -21,23 +21,11 @@
+ 
+ 	/*first recover parameters common to all solutions*/
+ 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+-	femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+ 	femmodel->parameters->FindParam(&isenthalpy,ThermalIsenthalpyEnum);
+ 	femmodel->parameters->FindParam(&numoutputs,ThermalNumRequestedOutputsEnum);
+ 	if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,ThermalRequestedOutputsEnum);
+ 
+-	if(dakota_analysis && solution_type!=TransientSolutionEnum){
+-		InputDuplicatex(femmodel,QmuVxMeshEnum,VxMeshEnum);
+-		InputDuplicatex(femmodel,QmuVyMeshEnum,VyMeshEnum);
+-		InputDuplicatex(femmodel,QmuVzMeshEnum,VzMeshEnum);
+-		InputDuplicatex(femmodel,QmuTemperatureEnum,TemperatureEnum);
+-		InputDuplicatex(femmodel,QmuMeltingEnum,BasalforcingsGroundediceMeltingRateEnum);
+-		InputDuplicatex(femmodel,QmuMaterialsRheologyBEnum,MaterialsRheologyBEnum);
+-		femmodel->SetCurrentConfiguration(ThermalAnalysisEnum);
+-		ResetConstraintsx(femmodel);
+-	}
+-
+ 	if(isenthalpy){
+ 
+ 		if(VerboseSolution()) _printf0_("   computing enthalpy\n");
+Index: ../trunk-jpl/src/c/cores/transient_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/cores/transient_core.cpp	(revision 18237)
+@@ -60,39 +60,6 @@
+ 	step=0;
+ 	time=starttime;
+ 
+-	/*for qmu analysis, reinitialize velocity so that fake sensitivities do not show up as a result of a different restart of the convergence at each trial.*/
+-	if(dakota_analysis){
+-		if(isstressbalance){
+-			InputDuplicatex(femmodel,QmuVxEnum,VxEnum);
+-			InputDuplicatex(femmodel,QmuVyEnum,VyEnum);
+-			if(domaintype==Domain3DEnum){
+-				InputDuplicatex(femmodel,QmuVzEnum,VzEnum);
+-				if(isFS)InputDuplicatex(femmodel,QmuPressureEnum,PressureEnum);
+-			}
+-		}
+-		if(ismasstransport || isgroundingline){
+-			InputDuplicatex(femmodel,QmuThicknessEnum,ThicknessEnum);
+-			InputDuplicatex(femmodel,QmuSurfaceEnum,SurfaceEnum);
+-			InputDuplicatex(femmodel,QmuBaseEnum,BaseEnum);
+-			InputDuplicatex(femmodel,QmuMaskIceLevelsetEnum,MaskIceLevelsetEnum);
+-		}
+-		if(isgroundingline) InputDuplicatex(femmodel,QmuMaskGroundediceLevelsetEnum,MaskGroundediceLevelsetEnum);
+-		if(isthermal && domaintype==Domain3DEnum){
+-			//Update Vertex Position after updating Thickness and Bed
+-			femmodel->SetCurrentConfiguration(MasstransportAnalysisEnum);
+-			femmodel->UpdateVertexPositionsx();
+-			InputDuplicatex(femmodel,QmuVxMeshEnum,VxMeshEnum);
+-			InputDuplicatex(femmodel,QmuVyMeshEnum,VyMeshEnum);
+-			InputDuplicatex(femmodel,QmuVzMeshEnum,VzMeshEnum);
+-			InputDuplicatex(femmodel,QmuTemperatureEnum,TemperatureEnum);
+-			InputDuplicatex(femmodel,QmuMeltingEnum,BasalforcingsGroundediceMeltingRateEnum);
+-			InputDuplicatex(femmodel,QmuMaterialsRheologyBEnum,MaterialsRheologyBEnum);
+-			//Reset Thermal Constraints
+-			femmodel->SetCurrentConfiguration(ThermalAnalysisEnum);
+-			ResetConstraintsx(femmodel);
+-		}
+-	}
+-
+ 	while(time < finaltime - (yts*DBL_EPSILON)){ //make sure we run up to finaltime.
+ 		/*Increment*/
+ 		if(time_adapt){
+Index: ../trunk-jpl/src/c/cores/damage_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/damage_core.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/cores/damage_core.cpp	(revision 18237)
+@@ -21,16 +21,10 @@
+ 	
+ 	//first recover parameters common to all solutions
+ 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+-	femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+ 	femmodel->parameters->FindParam(&numoutputs,DamageEvolutionNumRequestedOutputsEnum);
+ 	if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,DamageEvolutionRequestedOutputsEnum);
+ 
+-	if(dakota_analysis && solution_type!=TransientSolutionEnum){
+-		femmodel->SetCurrentConfiguration(DamageEvolutionAnalysisEnum);
+-		ResetConstraintsx(femmodel);
+-	}
+-
+ 	if(VerboseSolution()) _printf0_("   computing damage\n");
+ 	femmodel->SetCurrentConfiguration(DamageEvolutionAnalysisEnum);
+ 	solutionsequence_linear(femmodel);
+Index: ../trunk-jpl/src/c/cores/masstransport_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/masstransport_core.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/cores/masstransport_core.cpp	(revision 18237)
+@@ -25,19 +25,11 @@
+ 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+ 	femmodel->parameters->FindParam(&isFS,FlowequationIsFSEnum);
+ 	femmodel->parameters->FindParam(&isfreesurface,MasstransportIsfreesurfaceEnum);
+-	femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+ 	femmodel->parameters->FindParam(&domaintype,DomainTypeEnum);
+ 	femmodel->parameters->FindParam(&numoutputs,MasstransportNumRequestedOutputsEnum);
+ 	if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,MasstransportRequestedOutputsEnum);
+ 
+-	/*for qmu analysis, reinitialize velocity so that fake sensitivities do not show up as a result of a different restart of the convergence at each trial.*/
+-	if(dakota_analysis && solution_type==MasstransportSolutionEnum){
+-		InputDuplicatex(femmodel,QmuSurfaceEnum,SurfaceEnum);
+-		InputDuplicatex(femmodel,QmuThicknessEnum,ThicknessEnum);
+-		InputDuplicatex(femmodel,QmuBaseEnum,BaseEnum);
+-	}
+-
+ 	/*Calculate new Surface Mass Balance (SMB)*/
+ 	SurfaceMassBalancex(femmodel);
+ 
+Index: ../trunk-jpl/src/c/cores/stressbalance_core.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/stressbalance_core.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/cores/stressbalance_core.cpp	(revision 18237)
+@@ -29,20 +29,11 @@
+ 	femmodel->parameters->FindParam(&isL1L2,FlowequationIsL1L2Enum);
+ 	femmodel->parameters->FindParam(&isHO,FlowequationIsHOEnum);
+ 	femmodel->parameters->FindParam(&isFS,FlowequationIsFSEnum);
+-	femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);
+ 	femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
+ 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+ 	femmodel->parameters->FindParam(&numoutputs,StressbalanceNumRequestedOutputsEnum);
+ 	if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,StressbalanceRequestedOutputsEnum);
+ 
+-	/*for qmu analysis, reinitialize velocity so that fake sensitivities do not show up as a result of a different restart of the convergence at each trial.*/
+-	if(dakota_analysis && solution_type==StressbalanceSolutionEnum){
+-		InputDuplicatex(femmodel,QmuVxEnum,VxEnum);
+-		InputDuplicatex(femmodel,QmuVyEnum,VyEnum);
+-		if(domaintype==Domain3DEnum) InputDuplicatex(femmodel,QmuVzEnum,VzEnum);
+-		if(isFS) InputDuplicatex(femmodel,QmuPressureEnum,PressureEnum);
+-	}
+-
+ 	/*Compute slopes if necessary */
+ 	if(isSIA || (isFS && domaintype==Domain2DverticalEnum)) surfaceslope_core(femmodel);
+ 	if(isFS){
+Index: ../trunk-jpl/src/c/cores/DakotaSpawnCore.cpp
+===================================================================
+--- ../trunk-jpl/src/c/cores/DakotaSpawnCore.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/cores/DakotaSpawnCore.cpp	(revision 18237)
+@@ -50,8 +50,9 @@
+ 	ISSM_MPI_Bcast(&counter,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 
+ 	if(counter==-1)return 0;
+ 
+-	/*cast void_femmodel to FemModel: */
+-	femmodel=reinterpret_cast<FemModel*>(void_femmodel);
++	/*cast void_femmodel to FemModel, and at the same time, make a copy, so we start this new core run for this specific sample 
++	 *with a brand new copy of the model, which has not been tempered with by previous dakota runs: */
++	femmodel=(reinterpret_cast<FemModel*>(void_femmodel))->copy();
+ 
+ 	/*retrieve parameters: */
+ 	femmodel->parameters->FindParam(&responses_descriptors,&numresponsedescriptors,QmuResponsedescriptorsEnum);
+@@ -80,6 +81,9 @@
+ 	/*Free ressources:*/
+ 	DakotaFree(&d_variables,&d_variables_descriptors,&responses_descriptors, d_numvariables, numresponsedescriptors);
+ 
++	/*Avoid leaks here: */
++	delete femmodel;
++
+ 	return 1; //this is critical! do not return 0, otherwise, dakota_core will stop running!
+ }
+ 
+Index: ../trunk-jpl/src/c/classes/Contour.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Contour.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Contour.h	(revision 18237)
+@@ -76,7 +76,10 @@
+ 		}
+ 		/*}}}*/
+ 		Object* copy() {/*{{{*/
+-			return new Contour(*this); 
++
++			Contour* contour = new Contour(this->id,this->nods,this->x,this->y,this->closed);
++
++			return (Object*) contour;
+ 		}
+ 		/*}}}*/
+ };
+Index: ../trunk-jpl/src/c/classes/DofIndexing.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/DofIndexing.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/DofIndexing.cpp	(revision 18237)
+@@ -54,7 +54,12 @@
+ 		this->f_set=xNew<bool>(this->gsize);
+ 		this->s_set=xNew<bool>(this->gsize);
+ 		this->svalues=xNew<IssmDouble>(this->gsize);
+-		if(in->doftype)this->doftype=xNew<int>(this->gsize); 
++		if(in->doftype){
++			this->doftype=xNew<int>(this->gsize); 
++		}
++		else{
++			this->doftype=NULL;
++		}
+ 		this->gdoflist=xNew<int>(this->gsize); 
+ 	}
+ 	else{
+@@ -64,8 +69,8 @@
+ 		this->doftype  = NULL;
+ 		this->gdoflist = NULL;
+ 	}
+-	if(this->fsize>0 && this->fsize!=UNDEF)this->fdoflist=xNew<int>(this->fsize); else this->fdoflist=NULL;
+-	if(this->ssize>0 && this->ssize!=UNDEF)this->sdoflist=xNew<int>(this->ssize); else this->sdoflist=NULL;
++	if(this->fsize>0)this->fdoflist=xNew<int>(this->fsize); else this->fdoflist=NULL;
++	if(this->ssize>0)this->sdoflist=xNew<int>(this->ssize); else this->sdoflist=NULL;
+ 
+ 	if(this->gsize>0){
+ 		memcpy(this->f_set,in->f_set,this->gsize*sizeof(bool));
+@@ -74,23 +79,73 @@
+ 		if(this->doftype)memcpy(this->doftype,in->doftype,this->gsize*sizeof(int));
+ 		memcpy(this->gdoflist,in->gdoflist,this->gsize*sizeof(int));
+ 	}
+-	if(this->fsize>0 && this->fsize!=UNDEF)memcpy(this->fdoflist,in->fdoflist,this->fsize*sizeof(int));
+-	if(this->ssize>0 && this->ssize!=UNDEF)memcpy(this->sdoflist,in->sdoflist,this->ssize*sizeof(int));
++	if(this->fsize>0)memcpy(this->fdoflist,in->fdoflist,this->fsize*sizeof(int));
++	if(this->ssize>0)memcpy(this->sdoflist,in->sdoflist,this->ssize*sizeof(int));
+ 
+ }
+ /*}}}*/
+ DofIndexing::~DofIndexing(){ //destructor/*{{{*/
+ 
+-	xDelete<bool>(f_set); 
+-	xDelete<bool>(s_set); 
+-	xDelete<IssmDouble>(svalues);
+-	xDelete<int>(doftype); 
+-	xDelete<int>(gdoflist);
+-	xDelete<int>(fdoflist);
+-	xDelete<int>(sdoflist);
++	if(this->f_set) xDelete<bool>(f_set); 
++	if(this->s_set) xDelete<bool>(s_set); 
++	if(this->svalues) xDelete<IssmDouble>(svalues);
++	if(this->doftype) xDelete<int>(doftype); 
++	if(this->gdoflist) xDelete<int>(gdoflist);
++	if(this->fdoflist) xDelete<int>(fdoflist);
++	if(this->sdoflist) xDelete<int>(sdoflist);
+ 
+ }
+ /*}}}*/
++DofIndexing DofIndexing::operator=( const DofIndexing& in ){/*{{{*/
++
++	this->copy(in);
++
++	return this;
++}
++/*}}}*/
++void DofIndexing::copy(const DofIndexing& in ){/*{{{*/
++
++	this->gsize  = in.gsize;
++	this->fsize  = in.fsize;
++	this->ssize  = in.ssize;
++	this->clone  = in.clone;
++	this->active = in.active;
++
++	if(this->gsize>0){
++		this->f_set=xNew<bool>(this->gsize);
++		this->s_set=xNew<bool>(this->gsize);
++		this->svalues=xNew<IssmDouble>(this->gsize);
++		if(in.doftype){
++			this->doftype=xNew<int>(this->gsize);
++		}
++		else{
++			this->doftype=NULL;
++		}
++		this->gdoflist=xNew<int>(this->gsize);
++	}
++	else{
++		this->f_set    = NULL;
++		this->s_set    = NULL;
++		this->svalues  = NULL;
++		this->doftype  = NULL;
++		this->gdoflist = NULL;
++	}
++	if(this->fsize>0)this->fdoflist=xNew<int>(this->fsize); else this->fdoflist=NULL;
++	if(this->ssize>0)this->sdoflist=xNew<int>(this->ssize); else this->sdoflist=NULL;
++
++	if(this->gsize>0){
++		memcpy(this->f_set,in.f_set,this->gsize*sizeof(bool));
++		memcpy(this->s_set,in.s_set,this->gsize*sizeof(bool));
++		xMemCpy<IssmDouble>(this->svalues,in.svalues,this->gsize);
++		if(this->doftype)memcpy(this->doftype,in.doftype,this->gsize*sizeof(int));
++		memcpy(this->gdoflist,in.gdoflist,this->gsize*sizeof(int));
++	}
++	if(this->fsize>0)memcpy(this->fdoflist,in.fdoflist,this->fsize*sizeof(int));
++	if(this->ssize>0)memcpy(this->sdoflist,in.sdoflist,this->ssize*sizeof(int));
++
++	return;
++}
++/*}}}*/
+ void DofIndexing::Init(int in_gsize,int* in_doftype){/*{{{*/
+ 
+ 	this->gsize = in_gsize;
+@@ -100,13 +155,13 @@
+ 
+ 	/*memory allocation */
+ 	if(this->gsize>0){
+-		this->f_set    = xNew<bool>(this->gsize);
+-		this->s_set    = xNew<bool>(this->gsize);
+-		this->svalues  = xNew<IssmDouble>(this->gsize);
+-		this->gdoflist = xNew<int>(this->gsize);
++		this->f_set    = xNew<bool>((unsigned int)in_gsize);
++		this->s_set    = xNew<bool>((unsigned int)in_gsize);
++		this->svalues  = xNew<IssmDouble>((unsigned int)in_gsize);
++		this->gdoflist = xNew<int>((unsigned int)in_gsize);
+ 
+-		if(in_doftype)
+-		 this->doftype = xNew<int>(this->gsize);
++		if(in_doftype) this->doftype = xNew<int>((unsigned int)in_gsize);
++		else this->doftype = NULL;
+ 	}
+ 
+ 	/*Assign values assuming no Dirichlet at this point*/
+@@ -116,8 +171,7 @@
+ 		this->svalues[i]  = 0.;      //0 constraint is the default value
+ 		this->gdoflist[i] = UNDEF;
+ 
+-		if(this->doftype)
+-		 this->doftype[i]=in_doftype[i];
++		if(this->doftype) this->doftype[i]=in_doftype[i];
+ 	}
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Materials/Materials.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Materials.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Materials/Materials.cpp	(revision 18237)
+@@ -43,3 +43,17 @@
+ 
+ }
+ /*}}}*/
++void Materials::ResetHooks(){/*{{{*/
++
++	vector<Object*>::iterator object;
++	Material* material=NULL;
++
++	for ( object=objects.begin() ; object < objects.end(); object++ ){
++
++		material=dynamic_cast<Material*>((*object));
++		material->ResetHooks();
++
++	}
++
++}
++/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Materials/Matice.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Materials/Matice.cpp	(revision 18237)
+@@ -566,3 +566,12 @@
+ 	/*Nothing updated yet*/
+ }
+ /*}}}*/
++void  Matice::ResetHooks(){/*{{{*/
++
++	this->element=NULL;
++
++	/*Get Element type*/
++	this->helement->reset();
++
++}
++/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Materials/Material.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Material.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Materials/Material.h	(revision 18237)
+@@ -40,6 +40,7 @@
+ 		virtual IssmDouble GetD()=0;
+ 		virtual IssmDouble GetDbar()=0;
+ 		virtual bool       IsDamage()=0;
++		virtual void       ResetHooks()=0;
+ 
+ };
+ #endif
+Index: ../trunk-jpl/src/c/classes/Materials/Matpar.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matpar.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Materials/Matpar.cpp	(revision 18237)
+@@ -134,7 +134,49 @@
+ }
+ /*}}}*/
+ Object* Matpar::copy() {/*{{{*/
+-	return new Matpar(*this); 
++
++	/*Output*/
++	Matpar* matpar;
++
++	/*Initialize output*/
++	matpar=new Matpar(*this);
++
++	/*copy fields: */
++	matpar->mid=this->mid;
++	matpar->rho_ice=this->rho_ice;
++	matpar->rho_water=this->rho_water;
++	matpar->rho_freshwater=this->rho_freshwater;
++	matpar->mu_water=this->mu_water;
++	matpar->heatcapacity=this->heatcapacity;
++	matpar->thermalconductivity=this->thermalconductivity;
++	matpar->temperateiceconductivity=this->temperateiceconductivity;
++	matpar->latentheat=this->latentheat;
++	matpar->beta=this->beta;
++	matpar->meltingpoint=this->meltingpoint;
++	matpar->referencetemperature=this->referencetemperature;
++	matpar->mixed_layer_capacity=this->mixed_layer_capacity;
++	matpar->thermal_exchange_velocity=this->thermal_exchange_velocity;
++	matpar->g=this->g;
++	matpar->desfac=this->desfac;
++	matpar->s0p=this->s0p;
++
++	matpar->sediment_compressibility=this->sediment_compressibility;
++	matpar->sediment_porosity=this->sediment_porosity;
++	matpar->sediment_thickness=this->sediment_thickness;
++	matpar->water_compressibility=this->water_compressibility;
++
++	matpar->epl_compressibility=this->epl_compressibility;
++	matpar->epl_porosity=this->epl_porosity;
++	matpar->epl_init_thickness=this->epl_init_thickness;
++	matpar->epl_max_thickness=this->epl_max_thickness;
++	matpar->epl_conductivity=this->epl_conductivity;
++
++	matpar->lithosphere_shear_modulus=this->lithosphere_shear_modulus;
++	matpar->lithosphere_density=this->lithosphere_density;
++	matpar->mantle_shear_modulus=this->mantle_shear_modulus;
++	matpar->mantle_density=this->mantle_density;
++
++	return matpar;
+ }
+ /*}}}*/
+ 
+@@ -400,3 +442,9 @@
+ 	return mantle_shear_modulus;			 
+ }		 
+ /*}}}*/ 
++void  Matpar::ResetHooks(){/*{{{*/
++
++	//Nothing to be done
++	return;
++}
++/*}}}*/
+Index: ../trunk-jpl/src/c/classes/Materials/Materials.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Materials.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Materials/Materials.h	(revision 18237)
+@@ -23,6 +23,7 @@
+ 
+ 		/*numerics*/
+ 		void  Configure(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters);
++		void  ResetHooks();
+ 
+ };
+ 
+Index: ../trunk-jpl/src/c/classes/Materials/Matice.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matice.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Materials/Matice.h	(revision 18237)
+@@ -40,7 +40,7 @@
+ 		int   ObjectEnum();
+ 		Object* copy();
+ 		/*}}}*/
+-		/*Update virtual functions definitions: {{{*/
++		/*Update virtual funictions definitions: {{{*/
+ 		void  InputUpdateFromVector(IssmDouble* vector, int name, int type);
+ 		void  InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrow, int ncols, int name, int type);
+ 		void  InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
+@@ -69,6 +69,7 @@
+ 		IssmDouble GetDbar();
+ 		IssmDouble GetN();
+ 		bool       IsDamage();
++		void       ResetHooks();
+ 		/*}}}*/
+ };
+ 
+Index: ../trunk-jpl/src/c/classes/Materials/Matpar.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Materials/Matpar.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Materials/Matpar.h	(revision 18237)
+@@ -90,6 +90,7 @@
+ 		IssmDouble GetD(){_error_("not supported");};
+ 		IssmDouble GetDbar(){_error_("not supported");};
+ 		bool       IsDamage(){_error_("not supported");};
++		void       ResetHooks();
+ 		/*}}}*/
+ 		/*Numerics: {{{*/
+ 		IssmDouble GetG();
+Index: ../trunk-jpl/src/c/classes/Params/Parameters.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/Parameters.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Params/Parameters.cpp	(revision 18237)
+@@ -107,7 +107,7 @@
+ 			return;
+ 		}
+ 	}
+-	_error_("could not find parameter " << EnumToStringx(enum_type));
++	_error_("could not find parameter " <<  EnumToStringx(enum_type));
+ }
+ /*}}}*/
+ void Parameters::FindParam(IssmDouble* pscalar, int enum_type,IssmDouble time){ _assert_(this);/*{{{*/
+Index: ../trunk-jpl/src/c/classes/Params/DoubleParam.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Params/DoubleParam.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Params/DoubleParam.cpp	(revision 18237)
+@@ -37,9 +37,9 @@
+ 	_printf_(setw(22)<<"   DoubleParam "<<setw(35)<<left<<EnumToStringx(this->enum_type)<<" "<<this->value<<"\n");
+ }
+ /*}}}*/
+-int    DoubleParam::Id(void){ return -1; }/*{{{*/
++int  DoubleParam::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-int DoubleParam::ObjectEnum(void){/*{{{*/
++int  DoubleParam::ObjectEnum(void){/*{{{*/
+ 
+ 	return DoubleParamEnum;
+ 
+Index: ../trunk-jpl/src/c/classes/Hook.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Hook.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Hook.h	(revision 18237)
+@@ -38,6 +38,7 @@
+ 		Object*    delivers(void); //single object deliver
+ 		Object**   deliverp(void); //deliver all objects
+ 		void       configure(DataSet* dataset);
++		void       reset(void);
+ 		Hook*      Spawn(int* indices, int numindices);
+ 		int*       Ids(void);
+ 		int        GetNum(void);
+Index: ../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.cpp	(revision 18237)
+@@ -48,6 +48,10 @@
+ 	_printf_("   range : " << this->range << "\n");
+ }
+ /*}}}*/
++Object* ExponentialVariogram::copy(void){/*{{{*/
++	   return new ExponentialVariogram(*this);
++}
++/*}}}*/
+ 
+ /*Variogram function*/
+ double ExponentialVariogram::Covariance(double deltax,double deltay){/*{{{*/
+Index: ../trunk-jpl/src/c/classes/kriging/Observation.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/Observation.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/kriging/Observation.h	(revision 18237)
+@@ -26,7 +26,7 @@
+ 		void    DeepEcho()  {_error_("Not implemented yet"); };
+ 		int     Id()        {_error_("Not implemented yet"); };
+ 		int     ObjectEnum(){_error_("Not implemented yet"); };
+-		Object *copy()      {_error_("Not implemented yet"); };
++		Object *copy();
+ 
+ 		/*Management*/
+ 		void WriteXYObs(double* px,double* py,double* pobs);
+Index: ../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h	(revision 18237)
+@@ -25,7 +25,7 @@
+ 		void  DeepEcho(){_error_("Not implemented yet");};
+ 		int   Id(){_error_("Not implemented yet");}; 
+ 		int   ObjectEnum(){_error_("Not implemented yet");};
+-		Object* copy(){_error_("Not implemented yet");};
++		Object* copy();
+ 
+ 		/*Variogram functions*/
+ 		double SemiVariogram(double deltax,double deltay);
+Index: ../trunk-jpl/src/c/classes/kriging/PowerVariogram.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/PowerVariogram.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/kriging/PowerVariogram.cpp	(revision 18237)
+@@ -49,6 +49,10 @@
+ 	_printf_("   power : " << this->power << "\n");
+ }
+ /*}}}*/
++Object* PowerVariogram::copy(void){/*{{{*/
++	   return new PowerVariogram(*this);
++}
++/*}}}*/
+ 
+ /*Variogram function*/
+ double PowerVariogram::Covariance(double deltax,double deltay){/*{{{*/
+Index: ../trunk-jpl/src/c/classes/kriging/PowerVariogram.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/PowerVariogram.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/kriging/PowerVariogram.h	(revision 18237)
+@@ -25,7 +25,7 @@
+ 		void  DeepEcho(){_error_("Not implemented yet");};
+ 		int   Id(){_error_("Not implemented yet");}; 
+ 		int   ObjectEnum(){_error_("Not implemented yet");};
+-		Object* copy(){_error_("Not implemented yet");};
++		Object* copy();
+ 
+ 		/*Variogram functions*/
+ 		double SemiVariogram(double deltax,double deltay);
+Index: ../trunk-jpl/src/c/classes/kriging/Quadtree.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/Quadtree.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/kriging/Quadtree.cpp	(revision 18237)
+@@ -497,6 +497,26 @@
+ 	_printf_("   length  = " << this->length << "\n");
+ 
+ }/*}}}*/
++Object* Quadtree::QuadtreeBox::copy(void){/*{{{*/
++
++	   QuadtreeBox* qtreebox = new QuadtreeBox(*this);
++
++		if (this->box){	
++			for (int i=0; i<4; ++i){
++				if(this->box[i]) qtreebox->box[i] = reinterpret_cast<QuadtreeBox*>(this->box[i]->copy());
++				else qtreebox->box[i] = NULL;
++			}
++		}
++		if (this->obs){
++			for (int i=0; i<4; ++i){
++				if(this->obs[i]) qtreebox->obs[i] = reinterpret_cast<Observation*>(this->obs[i]->copy());
++				else qtreebox->obs[i] = NULL;
++			}
++		}
++
++		return (Object*) qtreebox;
++}
++/*}}}*/
+ int Quadtree::QuadtreeBox::IsWithinRange(double x,double y,double range){/*{{{*/
+ 
+ 	/*Return 0 if the 2 boxes do not overlap*/
+Index: ../trunk-jpl/src/c/classes/kriging/Quadtree.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/Quadtree.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/kriging/Quadtree.h	(revision 18237)
+@@ -29,7 +29,7 @@
+ 				void    DeepEcho()  {_error_("not implemented yet"); };
+ 				int     Id()        {_error_("not implemented yet"); };
+ 				int     ObjectEnum(){_error_("not implemented yet"); };
+-				Object *copy()      {_error_("not implemented yet"); };
++				Object *copy();
+ 
+ 				/*Methods*/
+ 				int          IsWithinRange(double  x,double y,double range);
+Index: ../trunk-jpl/src/c/classes/kriging/GaussianVariogram.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/GaussianVariogram.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/kriging/GaussianVariogram.cpp	(revision 18237)
+@@ -48,6 +48,10 @@
+ 	_printf_("   range : " << this->range << "\n");
+ }
+ /*}}}*/
++Object* GaussianVariogram::copy(void){/*{{{*/
++	   return new GaussianVariogram(*this);
++}
++/*}}}*/
+ 
+ /*Variogram function*/
+ double GaussianVariogram::Covariance(double deltax,double deltay){/*{{{*/
+Index: ../trunk-jpl/src/c/classes/kriging/SphericalVariogram.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/SphericalVariogram.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/kriging/SphericalVariogram.cpp	(revision 18237)
+@@ -48,6 +48,10 @@
+ 	_printf_("   range : " << this->range << "\n");
+ }
+ /*}}}*/
++Object* SphericalVariogram::copy(void){/*{{{*/
++	return new SphericalVariogram(*this);
++}
++/*}}}*/
+ 
+ /*Variogram function*/
+ double SphericalVariogram::Covariance(double deltax,double deltay){/*{{{*/
+Index: ../trunk-jpl/src/c/classes/kriging/GaussianVariogram.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/GaussianVariogram.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/kriging/GaussianVariogram.h	(revision 18237)
+@@ -26,7 +26,7 @@
+ 		void  DeepEcho(){_error_("Not implemented yet");};
+ 		int   Id(){_error_("Not implemented yet");}; 
+ 		int   ObjectEnum(){_error_("Not implemented yet");};
+-		Object* copy(){_error_("Not implemented yet");};
++		Object* copy();
+ 
+ 		/*Variogram functions*/
+ 		double SemiVariogram(double deltax,double deltay);
+Index: ../trunk-jpl/src/c/classes/kriging/SphericalVariogram.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/SphericalVariogram.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/kriging/SphericalVariogram.h	(revision 18237)
+@@ -25,7 +25,7 @@
+ 		void  DeepEcho(){_error_("Not implemented yet");};
+ 		int   Id(){_error_("Not implemented yet");}; 
+ 		int   ObjectEnum(){_error_("Not implemented yet");};
+-		Object* copy(){_error_("Not implemented yet");};
++		Object* copy();
+ 
+ 		/*Variogram functions*/
+ 		double SemiVariogram(double deltax,double deltay);
+Index: ../trunk-jpl/src/c/classes/kriging/Observation.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/kriging/Observation.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/kriging/Observation.cpp	(revision 18237)
+@@ -40,7 +40,17 @@
+ 	_printf_("   value : " << this->value << "\n");
+ }
+ /*}}}*/
++Object* Observation::copy(void){/*{{{*/
+ 
++	Observation* observation = new Observation(this->x,this->y,this->xi,this->yi,this->index,this->value);
++
++	observation->weight = this->weight;
++
++	return (Object*) observation;
++
++}
++/*}}}*/
++
+ /*Observations functions*/
+ void Observation::WriteXYObs(double* px,double* py,double* pobs){/*{{{*/
+ 	*px   = this->x;
+Index: ../trunk-jpl/src/c/classes/Loads/Numericalflux.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Numericalflux.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Loads/Numericalflux.cpp	(revision 18237)
+@@ -157,7 +157,7 @@
+ 	 _printf_("      NULL\n");
+ }		
+ /*}}}*/
+-int    Numericalflux::Id(void){/*{{{*/
++int Numericalflux::Id(void){/*{{{*/
+ 	return id;
+ }
+ /*}}}*/
+@@ -217,6 +217,20 @@
+ 
+ }
+ /*}}}*/
++void  Numericalflux::ResetHooks(){/*{{{*/
++
++	this->nodes=NULL;
++	this->vertices=NULL;
++	this->element=NULL;
++	this->parameters=NULL;
++
++	/*Get Element type*/
++	this->hnodes->reset();
++	this->hvertices->reset();
++	this->helement->reset();
++
++}
++/*}}}*/
+ void  Numericalflux::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){/*{{{*/
+ 
+ 	/*recover some parameters*/
+@@ -276,7 +290,7 @@
+ 
+ }
+ /*}}}*/
+-void Numericalflux::GetNodesSidList(int* sidlist){/*{{{*/
++void  Numericalflux::GetNodesSidList(int* sidlist){/*{{{*/
+ 
+ 	_assert_(sidlist);
+ 	_assert_(nodes);
+@@ -293,7 +307,7 @@
+ 	}
+ }
+ /*}}}*/
+-void Numericalflux::GetNodesLidList(int* lidlist){/*{{{*/
++void  Numericalflux::GetNodesLidList(int* lidlist){/*{{{*/
+ 
+ 	_assert_(lidlist);
+ 	_assert_(nodes);
+@@ -310,7 +324,7 @@
+ 	}
+ }
+ /*}}}*/
+-int Numericalflux::GetNumberOfNodes(void){/*{{{*/
++int   Numericalflux::GetNumberOfNodes(void){/*{{{*/
+ 
+ 	switch(this->flux_type){
+ 		case InternalEnum:
+@@ -323,7 +337,7 @@
+ 
+ }
+ /*}}}*/
+-bool Numericalflux::IsPenalty(void){/*{{{*/
++bool  Numericalflux::IsPenalty(void){/*{{{*/
+ 	return false;
+ }
+ /*}}}*/
+@@ -341,12 +355,12 @@
+ 
+ }
+ /*}}}*/
+-bool Numericalflux::InAnalysis(int in_analysis_type){/*{{{*/
++bool  Numericalflux::InAnalysis(int in_analysis_type){/*{{{*/
+ 	if (in_analysis_type==this->analysis_type) return true;
+ 	else return false;
+ }
+ /*}}}*/
+-void Numericalflux::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/
++void  Numericalflux::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/
+ 
+ 	/*Output */
+ 	int d_nz = 0;
+Index: ../trunk-jpl/src/c/classes/Loads/Penpair.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Penpair.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Loads/Penpair.cpp	(revision 18237)
+@@ -64,9 +64,9 @@
+ 	return;
+ }		
+ /*}}}*/
+-int    Penpair::Id(void){ return id; }/*{{{*/
++int  Penpair::Id(void){ return id; }/*{{{*/
+ /*}}}*/
+-int Penpair::ObjectEnum(void){/*{{{*/
++int  Penpair::ObjectEnum(void){/*{{{*/
+ 
+ 	return PenpairEnum;
+ }
+@@ -112,6 +112,16 @@
+ 
+ }
+ /*}}}*/
++void  Penpair::ResetHooks(){/*{{{*/
++
++	this->nodes=NULL;
++	this->parameters=NULL;
++
++	/*Get Element type*/
++	this->hnodes->reset();
++
++}
++/*}}}*/
+ void  Penpair::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){/*{{{*/
+ 	/*If you code this piece, don't forget that a penalty will be inactive if it is dealing with clone nodes*/
+ 	/*No loads applied, do nothing: */
+@@ -130,7 +140,7 @@
+ 	this->CreateKMatrix(Jff,NULL);
+ }
+ /*}}}*/
+-void Penpair::GetNodesSidList(int* sidlist){/*{{{*/
++void  Penpair::GetNodesSidList(int* sidlist){/*{{{*/
+ 
+ 	_assert_(sidlist);
+ 	_assert_(nodes);
+@@ -138,7 +148,7 @@
+ 	for(int i=0;i<NUMVERTICES;i++) sidlist[i]=nodes[i]->Sid();
+ }
+ /*}}}*/
+-void Penpair::GetNodesLidList(int* lidlist){/*{{{*/
++void  Penpair::GetNodesLidList(int* lidlist){/*{{{*/
+ 
+ 	_assert_(lidlist);
+ 	_assert_(nodes);
+@@ -146,12 +156,12 @@
+ 	for(int i=0;i<NUMVERTICES;i++) lidlist[i]=nodes[i]->Lid();
+ }
+ /*}}}*/
+-int Penpair::GetNumberOfNodes(void){/*{{{*/
++int   Penpair::GetNumberOfNodes(void){/*{{{*/
+ 
+ 	return NUMVERTICES;
+ }
+ /*}}}*/
+-bool Penpair::IsPenalty(void){/*{{{*/
++bool  Penpair::IsPenalty(void){/*{{{*/
+ 	return true;
+ }
+ /*}}}*/
+@@ -189,12 +199,12 @@
+ 	this->PenaltyCreateKMatrix(Jff,NULL,kmax);
+ }
+ /*}}}*/
+-bool Penpair::InAnalysis(int in_analysis_type){/*{{{*/
++bool  Penpair::InAnalysis(int in_analysis_type){/*{{{*/
+ 	if (in_analysis_type==this->analysis_type)return true;
+ 	else return false;
+ }
+ /*}}}*/
+-void Penpair::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/
++void  Penpair::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/
+ 
+ 	/*Output */
+ 	int d_nz = 0;
+Index: ../trunk-jpl/src/c/classes/Loads/Loads.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Loads.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Loads/Loads.cpp	(revision 18237)
+@@ -47,6 +47,20 @@
+ 
+ }
+ /*}}}*/
++void Loads::ResetHooks(){/*{{{*/
++
++	vector<Object*>::iterator object;
++	Load* load=NULL;
++
++	for ( object=objects.begin() ; object < objects.end(); object++ ){
++
++		load=dynamic_cast<Load*>((*object));
++		load->ResetHooks();
++
++	}
++
++}
++/*}}}*/
+ bool Loads::IsPenalty(int analysis_type){/*{{{*/
+ 
+ 	int ispenalty=0;
+Index: ../trunk-jpl/src/c/classes/Loads/Riftfront.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Riftfront.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Loads/Riftfront.h	(revision 18237)
+@@ -73,6 +73,7 @@
+ 		/*}}}*/
+ 		/*Load virtual functions definitions: {{{*/
+ 		void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
++		void  ResetHooks();
+ 		void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
+ 		void  CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
+ 		void  CreatePVector(Vector<IssmDouble>* pf);
+Index: ../trunk-jpl/src/c/classes/Loads/Numericalflux.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Numericalflux.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Loads/Numericalflux.h	(revision 18237)
+@@ -57,6 +57,7 @@
+ 		/*Load virtual functions definitions: {{{*/
+ 		void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
+ 		void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
++		void ResetHooks();
+ 		void CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
+ 		void CreatePVector(Vector<IssmDouble>* pf);
+ 		void GetNodesSidList(int* sidlist);
+Index: ../trunk-jpl/src/c/classes/Loads/Penpair.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Penpair.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Loads/Penpair.h	(revision 18237)
+@@ -47,6 +47,7 @@
+ 		/*}}}*/
+ 			/*Load virtual functions definitions: {{{*/
+ 		void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
++		void  ResetHooks();
+ 		void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
+ 		void  CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
+ 		void  CreatePVector(Vector<IssmDouble>* pf);
+Index: ../trunk-jpl/src/c/classes/Loads/Load.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Load.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Loads/Load.h	(revision 18237)
+@@ -25,6 +25,7 @@
+ 	public: 
+ 		virtual       ~Load(){};
+ 		virtual void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
++		virtual void  ResetHooks()=0;
+ 		virtual bool  IsPenalty(void)=0;
+ 		virtual int   GetNumberOfNodes(void)=0;
+ 		virtual void  GetNodesSidList(int* sidlist)=0;
+Index: ../trunk-jpl/src/c/classes/Loads/Loads.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Loads.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Loads/Loads.h	(revision 18237)
+@@ -23,6 +23,7 @@
+ 
+ 		/*numerics*/
+ 		void  Configure(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters);
++		void  ResetHooks();
+ 		bool  IsPenalty(int analysis);
+ 		int   MaxNumNodes(int analysis);
+ 		int   NumberOfLoads(void);
+Index: ../trunk-jpl/src/c/classes/Loads/Pengrid.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Pengrid.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Loads/Pengrid.cpp	(revision 18237)
+@@ -159,6 +159,20 @@
+ 
+ }
+ /*}}}*/
++void  Pengrid::ResetHooks(){/*{{{*/
++
++	this->node=NULL;
++	this->element=NULL;
++	this->matpar=NULL;
++	this->parameters=NULL;
++
++	/*Get Element type*/
++	this->hnode->reset();
++	this->helement->reset();
++	this->hmatpar->reset();
++
++}
++/*}}}*/
+ void  Pengrid::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){/*{{{*/
+ 
+ 	/*No loads applied, do nothing: */
+@@ -188,7 +202,7 @@
+ 
+ }
+ /*}}}*/
+-void Pengrid::GetNodesSidList(int* sidlist){/*{{{*/
++void  Pengrid::GetNodesSidList(int* sidlist){/*{{{*/
+ 
+ 	_assert_(sidlist);
+ 	_assert_(node);
+@@ -196,7 +210,7 @@
+ 	sidlist[0]=node->Sid();
+ }
+ /*}}}*/
+-void Pengrid::GetNodesLidList(int* lidlist){/*{{{*/
++void  Pengrid::GetNodesLidList(int* lidlist){/*{{{*/
+ 
+ 	_assert_(lidlist);
+ 	_assert_(node);
+@@ -204,7 +218,7 @@
+ 	lidlist[0]=node->Lid();
+ }
+ /*}}}*/
+-int Pengrid::GetNumberOfNodes(void){/*{{{*/
++int   Pengrid::GetNumberOfNodes(void){/*{{{*/
+ 
+ 	return NUMVERTICES;
+ }
+@@ -267,16 +281,16 @@
+ 	}
+ }
+ /*}}}*/
+-bool Pengrid::InAnalysis(int in_analysis_type){/*{{{*/
++bool  Pengrid::InAnalysis(int in_analysis_type){/*{{{*/
+ 	if (in_analysis_type==this->analysis_type)return true;
+ 	else return false;
+ }
+ /*}}}*/
+-bool Pengrid::IsPenalty(void){/*{{{*/
++bool  Pengrid::IsPenalty(void){/*{{{*/
+ 	return true;
+ }
+ /*}}}*/
+-void Pengrid::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/
++void  Pengrid::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/
+ 
+ 	/*Output */
+ 	int d_nz = 0;
+Index: ../trunk-jpl/src/c/classes/Loads/Pengrid.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Pengrid.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Loads/Pengrid.h	(revision 18237)
+@@ -67,6 +67,7 @@
+ 		/*Load virtual functions definitions: {{{*/
+ 		void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
+ 		void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
++		void  ResetHooks();
+ 		void  CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
+ 		void  CreatePVector(Vector<IssmDouble>* pf);
+ 		void  CreateJacobianMatrix(Matrix<IssmDouble>* Jff){_error_("Not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Loads/Riftfront.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Loads/Riftfront.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Loads/Riftfront.cpp	(revision 18237)
+@@ -207,7 +207,7 @@
+ 
+ }
+ /*}}}*/
+-void    Riftfront::InputUpdateFromVector(IssmDouble* vector, int name, int type){/*{{{*/
++void  Riftfront::InputUpdateFromVector(IssmDouble* vector, int name, int type){/*{{{*/
+ 
+ 	_error_("not implemented yet");
+ 
+@@ -215,7 +215,7 @@
+ /*}}}*/
+ 
+ /*Load virtual functions definitions:*/
+-void  Riftfront::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/
++void  Riftfront::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/	
+ 
+ 	/*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 
+ 	 * datasets, using internal ids and offsets hidden in hooks: */
+@@ -233,7 +233,21 @@
+ 
+ }
+ /*}}}*/
+-bool Riftfront::IsPenalty(void){/*{{{*/
++void  Riftfront::ResetHooks(){/*{{{*/
++
++	this->nodes=NULL;
++	this->elements=NULL;
++	this->matpar=NULL;
++	this->parameters=NULL;
++
++	/*Get Element type*/
++	this->hnodes->reset();
++	this->helements->reset();
++	this->hmatpar->reset();
++
++}
++/*}}}*/
++bool  Riftfront::IsPenalty(void){/*{{{*/
+ 	return true;
+ }
+ /*}}}*/
+@@ -301,7 +315,7 @@
+ 	return;
+ }
+ /*}}}*/
+-void Riftfront::GetNodesSidList(int* sidlist){/*{{{*/
++void  Riftfront::GetNodesSidList(int* sidlist){/*{{{*/
+ 
+ 	_assert_(sidlist);
+ 	_assert_(nodes);
+@@ -309,7 +323,7 @@
+ 	for(int i=0;i<NUMVERTICES;i++) sidlist[i]=nodes[i]->Sid();
+ }
+ /*}}}*/
+-void Riftfront::GetNodesLidList(int* lidlist){/*{{{*/
++void  Riftfront::GetNodesLidList(int* lidlist){/*{{{*/
+ 
+ 	_assert_(lidlist);
+ 	_assert_(nodes);
+@@ -317,17 +331,17 @@
+ 	for(int i=0;i<NUMVERTICES;i++) lidlist[i]=nodes[i]->Lid();
+ }
+ /*}}}*/
+-int Riftfront::GetNumberOfNodes(void){/*{{{*/
++int   Riftfront::GetNumberOfNodes(void){/*{{{*/
+ 
+ 	return NUMVERTICES;
+ }
+ /*}}}*/
+-bool Riftfront::InAnalysis(int in_analysis_type){/*{{{*/
++bool  Riftfront::InAnalysis(int in_analysis_type){/*{{{*/
+ 	if (in_analysis_type==this->analysis_type) return true;
+ 	else return false;
+ }
+ /*}}}*/
+-void Riftfront::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/
++void  Riftfront::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/
+ 
+ 	/*Output */
+ 	int d_nz = 0;
+@@ -555,7 +569,7 @@
+ }
+ /*}}}*/
+ #define _ZIGZAGCOUNTER_
+-int Riftfront::Constrain(int* punstable){/*{{{*/
++int    Riftfront::Constrain(int* punstable){/*{{{*/
+ 
+ 	IssmDouble  penetration;
+ 	bool        activate;
+Index: ../trunk-jpl/src/c/classes/Profiler.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Profiler.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Profiler.cpp	(revision 18237)
+@@ -28,7 +28,22 @@
+ 	delete memory;
+ }
+ /*}}}*/
++Object* Profiler::copy(){/*{{{*/
++	/*First do simple copy: */
++	Profiler* output=new Profiler();
++	delete output->time;
++	delete output->flops;
++	delete output->memory;
+ 
++	/*Now for deep copy: */
++	output->time=(Parameters*)this->time->Copy();
++	output->flops=(Parameters*)this->flops->Copy();
++	output->memory=(Parameters*)this->memory->Copy();
++
++	return (Object*)output;
++}
++/*}}}*/
++
+ /*Object virtual functions definitions:*/
+ void Profiler::Echo(void){/*{{{*/
+ 
+@@ -46,9 +61,9 @@
+ 
+ }
+ /*}}}*/
+-int    Profiler::Id(void){ return -1; }/*{{{*/
++int  Profiler::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-int Profiler::ObjectEnum(void){/*{{{*/
++int  Profiler::ObjectEnum(void){/*{{{*/
+ 
+ 	return ProfilerEnum;
+ 
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18237)
+@@ -105,20 +105,9 @@
+ 	FILE *output_fid;
+ 	char *outbinfilename = NULL;
+ 	char *lockfilename   = NULL;
+-	bool  waitonlock     = false;
+ 
+-	/*Close output file: */
+-	this->parameters->FindParam(&output_fid,OutputFilePointerEnum); 
+-	this->parameters->FindParam(&outbinfilename,OutputFileNameEnum); 
+-	pfclose(output_fid,outbinfilename);
+-
+-	/*Write lock file if requested: */
+-	this->parameters->FindParam(&waitonlock,SettingsWaitonlockEnum);
++	this->parameters->FindParam(&outbinfilename,OutputFileNameEnum);
+ 	this->parameters->FindParam(&lockfilename,LockFileNameEnum);
+-	if(waitonlock){
+-		_printf0_("write lock file:\n");
+-		WriteLockFile(lockfilename);
+-	}
+ 
+ 	/*Delete all the datasets: */
+ 	xDelete<int>(analysis_type_list);
+@@ -133,28 +122,9 @@
+ 	delete parameters;
+ 	delete results;
+ 
+-	/*Before we delete the profiler, report statistics for this run: */
+-	profiler->Tag(Finish);  //final tagging
+-	_printf0_("\n");
+-	_printf0_("   "<<setw(40)<<left<<"FemModel initialization elapsed time:"<<profiler->DeltaTime(StartInit,FinishInit) << "\n");
+-	_printf0_("   "<<setw(40)<<left<<"Core solution elapsed time:"<<profiler->DeltaTime(StartCore,FinishCore) << "\n");
+-	_printf0_("\n");
+-	_printf0_("   Total elapsed time:"
+-			<<profiler->DeltaTimeModHour(Start,Finish)<<" hrs "
+-			<<profiler->DeltaTimeModMin(Start,Finish)<<" min "
+-			<<profiler->DeltaTimeModSec(Start,Finish)<<" sec"
+-			);
+-	_printf0_("\n");
+-
+ 	/*Now delete: */
+ 	delete profiler;
+ 
+-	/*Finalize PETSC for this model: */
+-	#ifdef _HAVE_PETSC_
+-	_printf0_("closing PETSc\n");
+-	PetscFinalize(); 
+-	#endif
+-
+ }
+ /*}}}*/
+ 
+@@ -240,6 +210,48 @@
+ 
+ 	}
+ /*}}}*/
++void FemModel::CleanUp(void){/*{{{*/
++
++	/*Intermediary*/
++	FILE *output_fid;
++	char *outbinfilename = NULL;
++	char *lockfilename   = NULL;
++	bool  waitonlock     = false;
++
++	/*Close output file: */
++	this->parameters->FindParam(&output_fid,OutputFilePointerEnum);
++	this->parameters->FindParam(&outbinfilename,OutputFileNameEnum);
++	pfclose(output_fid,outbinfilename);
++
++	/*Write lock file if requested: */
++	this->parameters->FindParam(&waitonlock,SettingsWaitonlockEnum);
++	this->parameters->FindParam(&lockfilename,LockFileNameEnum);
++	if(waitonlock){
++		_printf0_("write lock file:\n");
++		WriteLockFile(lockfilename);
++	}
++
++	/*Before we delete the profiler, report statistics for this run: */
++	profiler->Tag(Finish);  //final tagging
++	_printf0_("\n");
++	_printf0_("   "<<setw(40)<<left<<"FemModel initialization elapsed time:"<<profiler->DeltaTime(StartInit,FinishInit) << "\n");
++	_printf0_("   "<<setw(40)<<left<<"Core solution elapsed time:"<<profiler->DeltaTime(StartCore,FinishCore) << "\n");
++	_printf0_("\n");
++	_printf0_("   Total elapsed time:"
++				<<profiler->DeltaTimeModHour(Start,Finish)<<" hrs "
++				<<profiler->DeltaTimeModMin(Start,Finish)<<" min "
++				<<profiler->DeltaTimeModSec(Start,Finish)<<" sec"
++				);
++	_printf0_("\n");
++
++	/*Finalize PETSC for this model: */
++	#ifdef _HAVE_PETSC_
++	_printf0_("closing PETSc\n");
++	PetscFinalize();
++	#endif
++
++}
++/*}}}*/
+ void FemModel::SetStaticComm(void){/*{{{*/
+ 
+ 	/*This routine sets the global communicator variable hidden inside the IssmComm 
+@@ -347,6 +359,54 @@
+ 			}
+ }
+ /*}}}*/
++FemModel* FemModel::copy(void){/*{{{*/
++
++	FemModel* output=NULL;
++	int       i;
++	int       analysis_type;
++
++	output=new FemModel(*this); //Use default copy constructor.
++
++	output->comm = this->comm;
++	output->nummodels = this->nummodels;
++	output->solution_type = this->solution_type;
++	output->analysis_counter = this->analysis_counter;
++
++	/*Now, deep copy arrays: */
++	output->analysis_type_list=xNew<int>(nummodels);
++	xMemCpy<int>(output->analysis_type_list,this->analysis_type_list,this->nummodels);
++
++	output->profiler=static_cast<Profiler*>(this->profiler->copy());
++
++	output->loads=static_cast<Loads*>(this->loads->Copy());
++	output->materials=static_cast<Materials*>(this->materials->Copy());
++	output->parameters=static_cast<Parameters*>(this->parameters->Copy());
++	output->constraints=static_cast<Constraints*>(this->constraints->Copy());
++	output->results=static_cast<Results*>(this->results->Copy());
++
++	output->nodes=static_cast<Nodes*>(this->nodes->Copy());
++	output->vertices=static_cast<Vertices*>(this->vertices->Copy());
++	output->elements=static_cast<Elements*>(this->elements->Copy());
++
++	/*reset hooks for elements, loads and nodes: */
++	output->elements->ResetHooks();
++	output->loads->ResetHooks();
++	output->materials->ResetHooks();
++
++	/*do the post-processing of the datasets to get an FemModel that can actually run analyses: */
++	for(i=0;i<nummodels;i++){
++		analysis_type=output->analysis_type_list[i];
++		output->SetCurrentConfiguration(analysis_type);
++		if(i==0) VerticesDofx(output->vertices,output->parameters); //only call once, we only have one set of vertices
++		SpcNodesx(output->nodes,output->constraints,output->parameters,analysis_type);
++		NodesDofx(output->nodes,output->parameters,analysis_type);
++		ConfigureObjectsx(output->elements,output->loads,output->nodes,output->vertices,output->materials,output->parameters);
++	}
++
++	return output;
++}
++/*}}}*/
++
+ /*Modules:*/
+ int  FemModel::UpdateVertexPositionsx(void){ /*{{{*/
+ 
+Index: ../trunk-jpl/src/c/classes/Node.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Node.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Node.h	(revision 18237)
+@@ -48,7 +48,7 @@
+ 		void    DeepEcho();
+ 		int     Id();
+ 		int     ObjectEnum();
+-		Object *copy(){_error_("Not implemented yet (similar to Elements)"); };
++		Object *copy();
+ 
+ 		/*Node numerical routines*/
+ 		void  CreateNodalConstraints(Vector<IssmDouble>* ys);
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18237)
+@@ -164,6 +164,7 @@
+ 		virtual IssmDouble CharacteristicLength(void)=0;
+ 		virtual void       Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
+ 		virtual void       SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters)=0;
++		virtual void       ResetHooks()=0;
+ 		virtual void   ElementSizes(IssmDouble* phx,IssmDouble* phy,IssmDouble* phz)=0;
+ 
+ 		virtual int    FiniteElement(void)=0;
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18237)
+@@ -41,7 +41,12 @@
+ 		this->vertices = NULL;
+ 		this->material = NULL;
+ 		this->matpar   = NULL;
+-		this->element_type_list=xNew<int>(nummodels);
++		if(nummodels>0){
++			this->element_type_list=xNew<int>(nummodels);
++			for(int i=0;i<nummodels;i++) this->element_type_list[i] = NULL;
++		}
++		else this->element_type_list = NULL;
++
+ }
+ /*}}}*/
+ Tria::~Tria(){/*{{{*/
+@@ -56,36 +61,54 @@
+ 	tria=new Tria();
+ 
+ 	//deal with TriaRef mother class
+-	tria->element_type_list=xNew<int>(this->numanalyses);
+-	for(i=0;i<this->numanalyses;i++) tria->element_type_list[i]=this->element_type_list[i];
++	int nanalyses = this->numanalyses;
++	if(nanalyses > 0){
++		tria->element_type_list=xNew<int>(nanalyses);
++		for(i=0;i<nanalyses;i++){
++			if (this->element_type_list[i]) tria->element_type_list[i]=this->element_type_list[i];
++			else tria->element_type_list[i] = NULL;
++		}
++	}
++	else tria->element_type_list = NULL;
++	tria->element_type=this->element_type;
++	tria->numanalyses=nanalyses;
+ 
+ 	//deal with ElementHook mother class
+-	tria->numanalyses=this->numanalyses;
+-	tria->hnodes=new Hook*[tria->numanalyses];
+-	for(i=0;i<tria->numanalyses;i++)tria->hnodes[i]=(Hook*)this->hnodes[i]->copy();
++	if (this->hnodes){
++		tria->hnodes=xNew<Hook*>(tria->numanalyses);
++		for(i=0;i<tria->numanalyses;i++){
++			if (this->hnodes[i]) tria->hnodes[i] = (Hook*)(this->hnodes[i]->copy());
++			else tria->hnodes[i] = NULL;
++		}
++	}
++	else tria->hnodes = NULL;
++
+ 	tria->hvertices = (Hook*)this->hvertices->copy();
+ 	tria->hmaterial = (Hook*)this->hmaterial->copy();
+ 	tria->hmatpar   = (Hook*)this->hmatpar->copy();
++	tria->hneighbors = NULL;
+ 
+ 	/*deal with Tria fields: */
+ 	tria->id  = this->id;
+ 	tria->sid = this->sid;
+-	if(this->inputs){
+-		tria->inputs=(Inputs*)this->inputs->Copy();
+-	}
+-	else{
+-		tria->inputs=new Inputs();
+-	}
++	if(this->inputs) tria->inputs = (Inputs*)(this->inputs->Copy());
++	else tria->inputs=new Inputs();
++
+ 	/*point parameters: */
+ 	tria->parameters=this->parameters;
+ 
+ 	/*recover objects: */
+-	tria->nodes = xNew<Node*>(3); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes.
+-	for(i=0;i<3;i++)tria->nodes[i]=this->nodes[i];
++	if (this->nodes){
++		unsigned int num_nodes = 3;
++		tria->nodes = xNew<Node*>(num_nodes); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes.
++		for(i=0;i<num_nodes;i++) if(this->nodes[i]) tria->nodes[i]=this->nodes[i]; else tria->nodes[i] = NULL;
++	}
++	else tria->nodes = NULL;
++	
+ 
+-	tria->vertices = (Vertex**)tria->hvertices->deliverp();
+-	tria->material = (Material*)tria->hmaterial->delivers();
+-	tria->matpar   = (Matpar*)tria->hmatpar->delivers();
++	tria->vertices = (Vertex**)this->hvertices->deliverp();
++	tria->material = (Material*)this->hmaterial->delivers();
++	tria->matpar   = (Matpar*)this->hmatpar->delivers();
+ 
+ 	return tria;
+ }
+@@ -306,17 +329,21 @@
+ 	parametersin->FindParam(&analysis_counter,AnalysisCounterEnum);
+ 
+ 	/*Get Element type*/
+-	this->element_type=this->element_type_list[analysis_counter];
++	if (this->element_type_list) this->element_type=this->element_type_list[analysis_counter];
+ 
+ 	/*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 
+ 	 * datasets, using internal ids and offsets hidden in hooks: */
+-	if(this->hnodes[analysis_counter]) this->hnodes[analysis_counter]->configure(nodesin);
++	if(this->hnodes){
++		if (this->hnodes[analysis_counter]) this->hnodes[analysis_counter]->configure(nodesin);
++		else this->hnodes[analysis_counter] = NULL;
++	}
++	else this->hnodes = NULL; 
+ 	this->hvertices->configure(verticesin);
+ 	this->hmaterial->configure(materialsin);
+ 	this->hmatpar->configure(materialsin);
+ 
+ 	/*Now, go pick up the objects inside the hooks: */
+-	if(this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp();
++	if(this->hnodes && this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp();
+ 	else this->nodes=NULL;
+ 	this->vertices = (Vertex**)this->hvertices->deliverp();
+ 	this->material = (Material*)this->hmaterial->delivers();
+@@ -326,7 +353,7 @@
+ 	this->parameters=parametersin;
+ 
+ 	/*get inputs configured too: */
+-	this->inputs->Configure(parameters);
++	this->inputs->Configure(this->parameters);
+ 
+ }
+ /*}}}*/
+@@ -855,7 +882,8 @@
+ }
+ /*}}}*/
+ int        Tria::GetNumberOfNodes(void){/*{{{*/
+-	return this->NumberofNodes(this->element_type);
++	if (this->nodes) return this->NumberofNodes(this->element_type);
++	else return 0;
+ }
+ /*}}}*/
+ int        Tria::GetNumberOfVertices(void){/*{{{*/
+@@ -1683,6 +1711,23 @@
+ 	delete gauss;
+ }
+ /*}}}*/
++void       Tria::ResetHooks(){/*{{{*/
++
++	this->nodes=NULL;
++	this->vertices=NULL;
++	this->material=NULL;
++	this->matpar=NULL;
++	this->parameters=NULL;
++
++	//deal with ElementHook mother class
++	for(int i=0;i<this->numanalyses;i++) if(this->hnodes[i]) this->hnodes[i]->reset();
++	this->hvertices->reset();
++	this->hmaterial->reset();
++	this->hmatpar->reset();
++	if(this->hneighbors) this->hneighbors->reset();
++
++}
++/*}}}*/
+ void       Tria::SetClone(int* minranks){/*{{{*/
+ 
+ 	_error_("not implemented yet");
+@@ -1758,11 +1803,12 @@
+ 	parametersin->FindParam(&analysis_counter,AnalysisCounterEnum);
+ 
+ 	/*Get Element type*/
+-	this->element_type=this->element_type_list[analysis_counter];
++	if(this->element_type_list) this->element_type=this->element_type_list[analysis_counter];
+ 
+ 	/*Pick up nodes*/
+-	if(this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp();
+-	else this->nodes=NULL;
++	if(this->hnodes && this->hnodes[analysis_counter]){
++		this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp();
++	}
+ 
+ }
+ /*}}}*/
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18237)
+@@ -57,6 +57,7 @@
+ 		void        ComputeSurfaceNormalVelocity();
+ 		void        Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters);
+ 		void        SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters);
++		void        ResetHooks();
+ 		void        Delta18oParameterization(void);
+ 		void        ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
+ 		void        FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating);
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18237)
+@@ -63,45 +63,63 @@
+ Object* Penta::copy() {/*{{{*/
+ 
+ 	int i;
+-
+ 	Penta* penta=NULL;
+ 
+ 	penta=new Penta();
+ 
+ 	//deal with PentaRef mother class
+-	penta->element_type_list=xNew<int>(this->numanalyses);
+-	for(i=0;i<this->numanalyses;i++) penta->element_type_list[i]=this->element_type_list[i];
++	int nanalyses = this->numanalyses;
++	if(nanalyses > 0){
++		penta->element_type_list=xNew<int>(nanalyses);
++		for(i=0;i<nanalyses;i++) {
++			if (this->element_type_list[i]) penta->element_type_list[i]=this->element_type_list[i];
++			else penta->element_type_list[i] = NULL;
++		}
++	}
++	else penta->element_type_list = NULL;
++	penta->element_type=this->element_type;
++	penta->numanalyses=nanalyses;
+ 
+-	//deal with ElementHook
+-	penta->numanalyses=this->numanalyses;
+-	penta->hnodes=new Hook*[penta->numanalyses];
+-	for(i=0;i<penta->numanalyses;i++)penta->hnodes[i]=(Hook*)this->hnodes[i]->copy();
+-	penta->hvertices=(Hook*)this->hvertices->copy();
+-	penta->hmaterial=(Hook*)this->hmaterial->copy();
+-	penta->hmatpar=(Hook*)this->hmatpar->copy();
+-	penta->hneighbors=(Hook*)this->hneighbors->copy();
++	//deal with ElementHook mother class
++	if (this->hnodes){
++		penta->hnodes=xNew<Hook*>(penta->numanalyses);
++		for(i=0;i<penta->numanalyses;i++){
++			if (this->hnodes[i]) penta->hnodes[i] = (Hook*)(this->hnodes[i]->copy());
++			else penta->hnodes[i] = NULL;
++		}
++	}
++	else penta->hnodes = NULL;
+ 
+-	/*deal with Penta  copy fields: */
+-	penta->id=this->id;
+-	penta->sid=this->sid;
+-	if(this->inputs){
+-		penta->inputs=(Inputs*)this->inputs->Copy();
+-	}
+-	else{
+-		penta->inputs=new Inputs();
+-	}
++	penta->hvertices = (Hook*)this->hvertices->copy();
++	penta->hmaterial = (Hook*)this->hmaterial->copy();
++	penta->hmatpar   = (Hook*)this->hmatpar->copy();
++	if (this->hneighbors) penta->hneighbors = (Hook*)(this->hneighbors->copy());
++	else penta->hneighbors = NULL;
++
++	/*deal with Tria fields: */
++	penta->id  = this->id;
++	penta->sid = this->sid;
++	if(this->inputs) penta->inputs = (Inputs*)(this->inputs->Copy());
++	else penta->inputs=new Inputs();
++
+ 	/*point parameters: */
+ 	penta->parameters=this->parameters;
+ 
+ 	/*recover objects: */
+-	penta->nodes=xNew<Node*>(6); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes.
+-	for(i=0;i<6;i++)penta->nodes[i]=this->nodes[i];
+-	penta->vertices=(Vertex**)penta->hvertices->deliverp();
+-	penta->material=(Material*)penta->hmaterial->delivers();
+-	penta->matpar=(Matpar*)penta->hmatpar->delivers();
+-	penta->verticalneighbors=(Penta**)penta->hneighbors->deliverp();
++	if (this->nodes) {
++		unsigned int num_nodes = 6;
++		penta->nodes = xNew<Node*>(num_nodes); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes.
++		for(i=0;i<num_nodes;i++) if(this->nodes[i]) penta->nodes[i]=this->nodes[i]; else penta->nodes[i] = NULL;
++	}
++	else penta->nodes = NULL;
+ 
++	penta->vertices = (Vertex**)this->hvertices->deliverp();
++	penta->material = (Material*)this->hmaterial->delivers();
++	penta->matpar   = (Matpar*)this->hmatpar->delivers();
++	penta->verticalneighbors = (Penta**)this->hneighbors->deliverp();
++
+ 	return penta;
++
+ }
+ /*}}}*/
+ 
+@@ -1899,6 +1917,24 @@
+ 
+ }
+ /*}}}*/
++void       Penta::ResetHooks(){/*{{{*/
++
++	this->nodes=NULL;
++	this->vertices=NULL;
++	this->material=NULL;
++	this->matpar=NULL;
++	this->verticalneighbors=NULL;
++	this->parameters=NULL;
++
++	//deal with ElementHook mother class
++	for(int i=0;i<this->numanalyses;i++) if(this->hnodes[i]) this->hnodes[i]->reset();
++	this->hvertices->reset();
++	this->hmaterial->reset();
++	this->hmatpar->reset();
++	if(this->hneighbors) this->hneighbors->reset();
++
++}
++/*}}}*/
+ void       Penta::SetTemporaryElementType(int element_type_in){/*{{{*/
+ 	this->element_type=element_type_in;
+ }
+Index: ../trunk-jpl/src/c/classes/Elements/ElementHook.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/ElementHook.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Elements/ElementHook.cpp	(revision 18237)
+@@ -28,10 +28,7 @@
+ 
+ 	int i;
+ 
+-	for(i=0;i<this->numanalyses;i++){
+-		if (this->hnodes[i]) delete this->hnodes[i];
+-	}
+-	delete [] this->hnodes;
++	if (this->hnodes) delete [] this->hnodes;
+ 	delete hvertices;
+ 	delete hmaterial;
+ 	delete hmatpar;
+@@ -75,7 +72,7 @@
+ /*}}}*/
+ 
+ void ElementHook::SetHookNodes(int* node_ids,int numnodes,int analysis_counter){/*{{{*/
+-	this->hnodes[analysis_counter]= new Hook(node_ids,numnodes);
++	if(this->hnodes) this->hnodes[analysis_counter]= new Hook(node_ids,numnodes);
+ }
+ /*}}}*/
+ void ElementHook::InitHookNeighbors(int* element_ids){/*{{{*/
+Index: ../trunk-jpl/src/c/classes/Elements/Elements.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Elements.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Elements/Elements.cpp	(revision 18237)
+@@ -61,6 +61,20 @@
+ 
+ }
+ /*}}}*/
++void Elements::ResetHooks(){/*{{{*/
++
++	vector<Object*>::iterator object;
++	Element* element=NULL;
++
++	for ( object=objects.begin() ; object < objects.end(); object++ ){
++
++		element=dynamic_cast<Element*>((*object));
++		element->ResetHooks();
++
++	}
++
++}
++/*}}}*/
+ int  Elements::MaxNumNodes(void){/*{{{*/
+ 
+ 	int max=0;
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 18237)
+@@ -61,6 +61,7 @@
+ 		int    FiniteElement(void);
+ 		void   FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating);
+ 		void   SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters);
++		void   ResetHooks();
+ 		void   Delta18oParameterization(void);
+ 		Penta* GetUpperPenta(void);
+ 		Penta* GetLowerPenta(void);
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.cpp	(revision 18237)
+@@ -47,7 +47,59 @@
+ }
+ /*}}}*/
+ Object* Tetra::copy() {/*{{{*/
+-	_error_("not implemented yet");
++
++	int i;
++	Tetra* tetra=NULL;
++
++	tetra=new Tetra();
++
++	//deal with TetraRef mother class
++	int nanalyses = this->numanalyses;
++	if(nanalyses > 0){
++		tetra->element_type_list=xNew<int>(nanalyses);
++		for(i=0;i<nanalyses;i++){
++			if (this->element_type_list[i]) tetra->element_type_list[i]=this->element_type_list[i];
++			else tetra->element_type_list[i] = NULL;
++		}
++	}
++	else tetra->element_type_list = NULL;
++	tetra->element_type=this->element_type;
++	tetra->numanalyses=nanalyses;
++
++	//deal with ElementHook mother class
++	if (this->hnodes){
++		tetra->hnodes=xNew<Hook*>(tetra->numanalyses);
++		for(i=0;i<tetra->numanalyses;i++){
++			if (this->hnodes[i]) tetra->hnodes[i] = (Hook*)(this->hnodes[i]->copy());
++			else tetra->hnodes[i] = NULL;
++		}
++	}
++	else tetra->hnodes = NULL;
++
++	tetra->hvertices = (Hook*)this->hvertices->copy();
++	tetra->hmaterial = (Hook*)this->hmaterial->copy();
++	tetra->hmatpar   = (Hook*)this->hmatpar->copy();
++	tetra->hneighbors = NULL;
++
++	/*deal with Tria fields: */
++	tetra->id  = this->id;
++	tetra->sid = this->sid;
++	if(this->inputs) tetra->inputs = (Inputs*)(this->inputs->Copy());
++	else tetra->inputs=new Inputs();
++
++	/*point parameters: */
++	tetra->parameters=this->parameters;
++
++	/*recover objects: */
++	unsigned int num_nodes = 3;
++	tetra->nodes = xNew<Node*>(num_nodes); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes.
++	for(i=0;i<num_nodes;i++) if(this->nodes[i]) tetra->nodes[i]=this->nodes[i]; else tetra->nodes[i] = NULL;
++
++	tetra->vertices = (Vertex**)this->hvertices->deliverp();
++	tetra->material = (Material*)this->hmaterial->delivers();
++	tetra->matpar   = (Matpar*)this->hmatpar->delivers();
++
++	return tetra;
+ }
+ /*}}}*/
+ 
+@@ -726,6 +778,22 @@
+ 
+ }
+ /*}}}*/
++void     Tetra::ResetHooks(){/*{{{*/
++
++	this->nodes=NULL;
++	this->vertices=NULL;
++	this->material=NULL;
++	this->matpar=NULL;
++	this->parameters=NULL;
++
++	//deal with ElementHook mother class
++	for(int i=0;i<this->numanalyses;i++) if(this->hnodes[i]) this->hnodes[i]->reset();
++	this->hvertices->reset();
++	this->hmaterial->reset();
++	this->hmatpar->reset();
++	if(this->hneighbors) this->hneighbors->reset();
++}
++/*}}}*/
+ Element* Tetra::SpawnBasalElement(void){/*{{{*/
+ 
+ 	_assert_(HasFaceOnBase());
+Index: ../trunk-jpl/src/c/classes/Elements/Elements.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Elements.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Elements/Elements.h	(revision 18237)
+@@ -26,6 +26,7 @@
+ 		void   Configure(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters);
+ 		int    MaxNumNodes(void);
+ 		void   SetCurrentConfiguration(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters);
++		void   ResetHooks();
+ 		int    NumberOfElements(void);
+ 		void   InputDuplicate(int input_enum,int output_enum);
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 18237)
+@@ -58,6 +58,7 @@
+ 		void        ComputeDeviatoricStressTensor(){_error_("not implemented yet");};
+ 		void        Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters){_error_("not implemented yet");};
+ 		void        SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters){_error_("not implemented yet");};
++		void        ResetHooks(){_error_("not implemented yet");};
+ 		void        Delta18oParameterization(void){_error_("not implemented yet");};
+ 		void        ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz){_error_("not implemented yet");};
+ 		void        FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 18237)
+@@ -58,6 +58,7 @@
+ 		void        ComputeDeviatoricStressTensor(){_error_("not implemented yet");};
+ 		void        Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters);
+ 		void        SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters);
++		void        ResetHooks();
+ 		void        Delta18oParameterization(void){_error_("not implemented yet");};
+ 		void        ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz);
+ 		void        FaceOnFrontIndices(int* pindex1,int* pindex2,int* pindex3);
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18237)
+@@ -288,7 +288,10 @@
+ 
+ 	if(nodes){
+ 		int numnodes = this->GetNumberOfNodes();
+-		for(int i=0;i<numnodes;i++) nodes[i]->Echo();
++		for(int i=0;i<numnodes;i++) {
++			_printf_("nodes[" << i << "] = " << nodes[i]);	
++			nodes[i]->Echo();
++		}
+ 	}
+ 	else _printf_("nodes = NULL\n");
+ 
+Index: ../trunk-jpl/src/c/classes/Hook.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Hook.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Hook.cpp	(revision 18237)
+@@ -28,17 +28,18 @@
+ 	this->num=in_num;
+ 
+ 	/*Get out if num=0*/
+-	if (num==0){
++	if (this->num<=0){
+ 		/*Empty hook*/
+ 		this->ids     = NULL;
+ 		this->objects = NULL;
+ 		this->offsets = NULL;
++		this->num = 0;
+ 	}
+ 	else{
+ 		/*Allocate: */
+-		this->objects=xNew<Object*>(this->num);
+-		this->ids=xNew<int>(this->num);
+-		this->offsets=xNew<int>(this->num);
++		this->objects=xNew<Object*>(in_num);
++		this->ids=xNew<int>(in_num);
++		this->offsets=xNew<int>(in_num);
+ 
+ 		/*Copy ids: */
+ 		for(int i=0;i<this->num;i++){
+@@ -108,20 +109,11 @@
+ 	Hook* output=NULL;
+ 
+ 	/*initalize output: */
+-	output=new Hook();
++	output=new Hook(this->ids,this->num);
+ 
+-	/*copy in the fields: */
+-	output->num=this->num;
+-	if(output->num){
+-		output->objects = xNew<Object*>(output->num);
+-		output->ids     = xNew<int>(output->num);
+-		output->offsets = xNew<int>(output->num);
+-	}
+-
+ 	for(int i=0;i<output->num;i++){
+ 		output->objects[i] = this->objects[i];
+ 		output->offsets[i] = this->offsets[i];
+-		output->ids[i]     = this->ids[i];
+ 	}
+ 
+ 	return (Object*)output;
+@@ -129,6 +121,17 @@
+ /*}}}*/
+ 
+ /*Hook management: */
++void Hook::reset(){/*{{{*/
++
++	/*intermediary: */
++	Object* object=NULL;
++	int i;
++
++	for(i=0;i<this->num;i++){
++			this->objects[i]=NULL; //reset this node.
++	}
++}
++/*}}}*/
+ void Hook::configure(DataSet* dataset){/*{{{*/
+ 
+ 	/*intermediary: */
+@@ -160,6 +163,7 @@
+ 			}
+ 			else this->offsets[i]=UNDEF; //object offset was wrong, reset it.
+ 		}
++		else this->offsets[i]=UNDEF;
+ 
+ 		/*Now, for this->objects that did not get resolved, and for which we have no offset, chase them in the dataset, by id: */
+ 		if(this->objects[i]==NULL){
+@@ -173,7 +177,7 @@
+ Object* Hook::delivers(void){/*{{{*/
+ 
+ 	/*first, check that we only have one T object in our object list: */
+-	if (this->num!=1) _error_("trying to delivery a single hook object when hook holds " << this->num << " objects" << "\n");
++	if (this->num!=1) _error_("trying to deliver a single hook object when hook holds " << this->num << " objects" << "\n");
+ 
+ 	/*check NULL: */
+ 	if (this->objects==NULL) _error_("hook is not pointing to any object, objects pointer is NULL");
+Index: ../trunk-jpl/src/c/classes/Misfit.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Misfit.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Misfit.h	(revision 18237)
+@@ -87,7 +87,10 @@
+ 		}
+ 		/*}}}*/
+ 		Object* copy() {/*{{{*/
+-			return new Misfit(this->name,this->model_enum,this->observation_enum,this->timeinterpolation,this->weights_enum);
++			Misfit* mf = new Misfit(this->name,this->model_enum,this->observation_enum,this->timeinterpolation,this->weights_enum);
++			mf->misfit=this->misfit;
++			mf->lock=this->lock;
++			return (Object*) mf;
+ 		}
+ 		/*}}}*/
+ 		/*Definition virtual function resolutoin: */
+Index: ../trunk-jpl/src/c/classes/Inputs/TetraInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TetraInput.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Inputs/TetraInput.cpp	(revision 18237)
+@@ -19,12 +19,20 @@
+ TetraInput::TetraInput(int in_enum_type,IssmDouble* in_values,int interpolation_type_in){/*{{{*/
+ 
+ 	/*Set Enum*/
+-	enum_type=in_enum_type;
++	this->enum_type=in_enum_type;
+ 	this->interpolation_type=interpolation_type_in;
+ 
++	int numnodes = this->NumberofNodes(this->interpolation_type);
++
+ 	/*Set values*/
+-	this->values=xNew<IssmDouble>(this->NumberofNodes(this->interpolation_type));
+-	for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i];
++	if (numnodes > 0){
++		this->values=xNew<IssmDouble>((unsigned int)numnodes);
++		for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i];
++	}
++	else{
++		this->values = NULL;
++	}
++
+ }
+ /*}}}*/
+ TetraInput::~TetraInput(){/*{{{*/
+Index: ../trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp	(revision 18237)
+@@ -64,9 +64,12 @@
+ 
+ 	output = new DatasetInput();
+ 	output->enum_type=this->enum_type;
+-	output->inputs=(Inputs*)this->inputs->Copy();
++	output->numids=this->numids;
++	output->ids=xNew<int>(output->numids);
++	xMemCpy(output->ids,this->ids,output->numids);
++	output->inputs=static_cast<Inputs*>(this->inputs->Copy());
+ 
+-	return output;
++	return (Object*)output;
+ }
+ /*}}}*/
+ Input* DatasetInput::SpawnTriaInput(int index1,int index2,int index3){/*{{{*/
+@@ -151,7 +154,7 @@
+ 
+ 	/*Get requested input within dataset*/
+ 	for(int i=0;i<this->numids;i++) if(this->ids[i]==id) offset=i;
+-	if(offset<0) _error_("Could not find input of id "<<id);
++	if(offset<0) _error_("Could not find input of id "<<id );
+ 
+ 	Input* input=dynamic_cast<Input*>(this->inputs->GetObjectByOffset(offset));
+ 	input->GetInputValue(pvalue,gauss);
+Index: ../trunk-jpl/src/c/classes/Inputs/TriaInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TriaInput.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Inputs/TriaInput.cpp	(revision 18237)
+@@ -19,12 +19,19 @@
+ TriaInput::TriaInput(int in_enum_type,IssmDouble* in_values,int interpolation_type_in){/*{{{*/
+ 
+ 	/*Set Enum*/
+-	enum_type=in_enum_type;
++	this->enum_type=in_enum_type;
+ 	this->interpolation_type=interpolation_type_in;
+ 
++	int numnodes = this->NumberofNodes(this->interpolation_type);
++
+ 	/*Set values*/
+-	this->values=xNew<IssmDouble>(this->NumberofNodes(this->interpolation_type));
+-	for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i];
++	if (numnodes > 0){
++		this->values=xNew<IssmDouble>((unsigned int)numnodes);
++		for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i];
++	}
++	else{
++		this->values = NULL;
++	}
+ }
+ /*}}}*/
+ TriaInput::~TriaInput(){/*{{{*/
+@@ -44,9 +51,9 @@
+ 	_printf_("] ("<<EnumToStringx(this->interpolation_type)<<")\n");
+ }
+ /*}}}*/
+-int    TriaInput::Id(void){ return -1; }/*{{{*/
++int  TriaInput::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-int TriaInput::ObjectEnum(void){/*{{{*/
++int  TriaInput::ObjectEnum(void){/*{{{*/
+ 
+ 	return TriaInputEnum;
+ 
+Index: ../trunk-jpl/src/c/classes/Inputs/PentaInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/PentaInput.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Inputs/PentaInput.cpp	(revision 18237)
+@@ -19,12 +19,20 @@
+ PentaInput::PentaInput(int in_enum_type,IssmDouble* in_values,int interpolation_type_in){/*{{{*/
+ 
+ 	/*Set Enum*/
+-	enum_type=in_enum_type;
++	this->enum_type=in_enum_type;
+ 	this->interpolation_type=interpolation_type_in;
+ 
++	int numnodes = this->NumberofNodes(this->interpolation_type);
++
+ 	/*Set values*/
+-	this->values=xNew<IssmDouble>(this->NumberofNodes(this->interpolation_type));
+-	for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i];
++	if (numnodes > 0){
++		this->values=xNew<IssmDouble>((unsigned int)numnodes);
++		for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i];
++	}
++	else{
++		this->values = NULL;
++	}
++
+ }
+ /*}}}*/
+ PentaInput::~PentaInput(){/*{{{*/
+Index: ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Inputs/TransientInput.cpp	(revision 18237)
+@@ -79,9 +79,9 @@
+ 	}
+ }
+ /*}}}*/
+-int    TransientInput::Id(void){ return -1; }/*{{{*/
++int  TransientInput::Id(void){ return -1; }/*{{{*/
+ /*}}}*/
+-int TransientInput::ObjectEnum(void){/*{{{*/
++int  TransientInput::ObjectEnum(void){/*{{{*/
+ 
+ 	return TransientInputEnum;
+ 
+@@ -95,11 +95,11 @@
+ 	output->enum_type=this->enum_type;
+ 	output->numtimesteps=this->numtimesteps;
+ 	output->timesteps=xNew<IssmDouble>(this->numtimesteps);
+-        xMemCpy(output->timesteps,this->timesteps,this->numtimesteps);
+-	output->inputs=(Inputs*)this->inputs->Copy();
++	xMemCpy(output->timesteps,this->timesteps,this->numtimesteps);
++	output->inputs=static_cast<Inputs*>(this->inputs->Copy());
+ 	output->parameters=this->parameters;
+ 
+-	return output;
++	return (Object*)output;
+ 
+ }
+ /*}}}*/
+@@ -314,7 +314,7 @@
+ 
+ }
+ /*}}}*/
+-int TransientInput::GetResultInterpolation(void){/*{{{*/
++int  TransientInput::GetResultInterpolation(void){/*{{{*/
+ 
+ 	IssmDouble time;
+ 	int        output;
+@@ -329,7 +329,7 @@
+ 
+ }
+ /*}}}*/
+-int TransientInput::GetResultNumberOfNodes(void){/*{{{*/
++int  TransientInput::GetResultNumberOfNodes(void){/*{{{*/
+ 
+ 	IssmDouble time;
+ 	int        output;
+Index: ../trunk-jpl/src/c/classes/DofIndexing.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/DofIndexing.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/DofIndexing.h	(revision 18237)
+@@ -40,11 +40,12 @@
+ 		void InitSet(int setenum);
+ 		DofIndexing(DofIndexing* properties);
+ 		~DofIndexing();
++		DofIndexing operator=(const DofIndexing& in);
+ 		/*}}}*/
+ 		/*Object like functionality: {{{*/
+ 		void  Echo(void); 
+ 		void  DeepEcho(void); 
+-		void  copy(DofIndexing* properties);
++		void  copy(const DofIndexing& in);
+ 		/*}}}*/
+ 		/*DofIndexing management: {{{*/
+ 		DofIndexing* Spawn(int* indices, int numindices);
+Index: ../trunk-jpl/src/c/classes/Node.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Node.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Node.cpp	(revision 18237)
+@@ -124,7 +124,34 @@
+ 	return;
+ }
+ /*}}}*/
++Object* Node::copy(void){/*{{{*/
+ 
++	int k,l;
++
++	/*output: */
++	Node* output=NULL;
++
++	/*initalize output: */
++	output=new Node();
++
++	/*id: */
++	output->id  = this->id;
++	output->sid = this->sid;
++	output->lid = this->lid;
++	output->analysis_enum = this->analysis_enum;
++	output->approximation = this->approximation;
++
++	/*Initialize coord_system: */
++	for(k=0;k<3;k++) for(l=0;l<3;l++) output->coord_system[k][l]=this->coord_system[k][l];
++
++	/*indexing:*/
++	output->indexingupdate = this->indexingupdate;
++	output->indexing.copy(this->indexing);
++
++	return (Object*)output; 
++}
++/*}}}*/
++
+ /*Object virtual functions definitions:*/
+ void Node::Echo(void){/*{{{*/
+ 
+@@ -513,7 +540,7 @@
+ 		}
+ 		else if (setenum==SsetEnum){
+ 			if(this->indexing.doftype){
+-				numdofs=0;
++			numdofs=0;
+ 				for(i=0;i<this->indexing.gsize;i++){
+ 					if((this->indexing.doftype[i]==approximation_enum) && (this->indexing.s_set[i])) numdofs++;
+ 				}
+Index: ../trunk-jpl/src/c/classes/Constraints/SpcDynamic.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Constraints/SpcDynamic.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Constraints/SpcDynamic.cpp	(revision 18237)
+@@ -53,7 +53,7 @@
+ 	return;
+ }		
+ /*}}}*/
+-int    SpcDynamic::Id(void){ return sid; }/*{{{*/
++int SpcDynamic::Id(void){ return sid; }/*{{{*/
+ /*}}}*/
+ int SpcDynamic::ObjectEnum(void){/*{{{*/
+ 
+@@ -62,7 +62,17 @@
+ }
+ /*}}}*/
+ Object* SpcDynamic::copy() {/*{{{*/
+-	return new SpcDynamic(*this); 
++
++	SpcDynamic* spcdyn = new SpcDynamic(*this); 
++
++	spcdyn->sid=this->sid;
++	spcdyn->nodeid=this->nodeid;
++	spcdyn->dof=this->dof;
++	spcdyn->value=this->value;
++	spcdyn->analysis_type=this->analysis_type;
++	spcdyn->isset=this->isset;
++
++	return (Object*) spcdyn;
+ }
+ /*}}}*/
+ 
+Index: ../trunk-jpl/src/c/classes/Constraints/SpcStatic.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Constraints/SpcStatic.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Constraints/SpcStatic.cpp	(revision 18237)
+@@ -56,7 +56,7 @@
+ 	return;
+ }		
+ /*}}}*/
+-int    SpcStatic::Id(void){ return sid; }/*{{{*/
++int SpcStatic::Id(void){ return sid; }/*{{{*/
+ /*}}}*/
+ int SpcStatic::ObjectEnum(void){/*{{{*/
+ 
+@@ -65,7 +65,16 @@
+ }
+ /*}}}*/
+ Object* SpcStatic::copy() {/*{{{*/
+-	return new SpcStatic(*this); 
++	
++	SpcStatic* spcstat = new SpcStatic(*this); 
++
++	spcstat->sid=this->sid;
++	spcstat->nodeid=this->nodeid;
++	spcstat->dof=this->dof;
++	spcstat->value=this->value;
++	spcstat->analysis_type=this->analysis_type;
++
++	return (Object*) spcstat;
+ }
+ /*}}}*/
+ 
+Index: ../trunk-jpl/src/c/classes/Profiler.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Profiler.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/Profiler.h	(revision 18237)
+@@ -41,7 +41,7 @@
+ 		void    DeepEcho();
+ 		int     Id();
+ 		int     ObjectEnum();
+-		Object *copy()        {_error_("Not implemented yet"); };
++		Object *copy();
+ 		/*}}}*/
+ 		/*Profiler routines {{{*/
+ 		void    Tag(int tagenum,bool dontmpisync=false);
+Index: ../trunk-jpl/src/c/classes/FemModel.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.h	(revision 18236)
++++ ../trunk-jpl/src/c/classes/FemModel.h	(revision 18237)
+@@ -51,7 +51,9 @@
+ 
+ 		/*Methods:*/
+ 		void Echo();
++		FemModel* copy();
+ 		void InitFromFiles(char* rootpath, char* inputfilename, char* outputfilename, char* petscfilename, char* lockfilename, const int solution_type,const int* analyses,const int nummodels);
++		void CleanUp(void);
+ 		void Solve(void);
+ 		void SetStaticComm();
+ 		void SetCurrentConfiguration(int configuration_type);
+Index: ../trunk-jpl/src/c/datastructures/DataSet.cpp
+===================================================================
+--- ../trunk-jpl/src/c/datastructures/DataSet.cpp	(revision 18236)
++++ ../trunk-jpl/src/c/datastructures/DataSet.cpp	(revision 18237)
+@@ -26,6 +26,7 @@
+ DataSet::DataSet(){/*{{{*/
+ 
+ 	sorted=0;
++	numsorted=0;
+ 	sorted_ids=NULL;
+ 	id_offsets=NULL;
+ 
+@@ -40,31 +41,39 @@
+ 
+ }
+ /*}}}*/
+-DataSet*   DataSet::Copy(void){/*{{{*/
++DataSet* DataSet::Copy(void){/*{{{*/
+ 
+-	vector<Object*>::iterator object;
++	vector<Object*>::iterator obj;
+ 	Object* object_copy=NULL;
+ 
+-	DataSet* copy=new DataSet(enum_type);
++	DataSet* copy=new DataSet(this->enum_type);
+ 
+-	copy->sorted=sorted;
+-	copy->presorted=presorted;
+-	if(sorted_ids){
+-		copy->sorted_ids=xNew<int>(objects.size());
+-		xMemCpy<int>(copy->sorted_ids,sorted_ids,objects.size());
+-	}
+-	if(id_offsets){
+-		copy->id_offsets=xNew<int>(objects.size());
+-		xMemCpy<int>(copy->id_offsets,id_offsets,objects.size());
+-	}
++	copy->sorted=this->sorted;
++	copy->numsorted=this->numsorted;
++	copy->presorted=this->presorted;
+ 
+ 	/*Now we need to deep copy the objects: */
+-	for ( object=objects.begin() ; object < objects.end(); object++ ){
+-
+-		/*Call echo on object: */
+-		object_copy = (*object)->copy();
++	for ( obj=this->objects.begin() ; obj < this->objects.end(); obj++ ){
++		/*Call copy on object: */
++		object_copy = (*obj)->copy();
+ 		copy->AddObject(object_copy);
+ 	}
++
++	/*Build id_offsets and sorted_ids*/
++	int objsize = this->numsorted;
++	if(this->sorted && objsize>0 && this->id_offsets){	
++		/*Allocate new ids*/
++		copy->id_offsets=xNew<int>(objsize);
++		xMemCpy<int>(copy->id_offsets,this->id_offsets,objsize);
++	}
++	else copy->id_offsets=NULL;
++	if(this->sorted && objsize>0 && this->sorted_ids){
++		/*Allocate new ids*/
++		copy->sorted_ids=xNew<int>(objsize);
++		xMemCpy<int>(copy->sorted_ids,this->sorted_ids,objsize);
++	}
++	else copy->sorted_ids=NULL;
++
+ 	return copy;
+ }
+ /*}}}*/
+@@ -76,7 +85,7 @@
+ /*}}}*/
+ 
+ /*Specific methods*/
+-int  DataSet::AddObject(Object* object){/*{{{*/
++int   DataSet::AddObject(Object* object){/*{{{*/
+ 
+ 	_assert_(this);
+ 	objects.push_back(object);
+@@ -101,7 +110,7 @@
+ 	objects.clear();
+ }
+ /*}}}*/
+-int  DataSet::DeleteObject(Object* object){/*{{{*/
++int   DataSet::DeleteObject(Object* object){/*{{{*/
+ 
+ 	vector<Object*>::iterator iterator;
+ 
+@@ -115,7 +124,7 @@
+ 
+ }
+ /*}}}*/
+-void DataSet::DeepEcho(){/*{{{*/
++void  DataSet::DeepEcho(){/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 
+@@ -131,7 +140,7 @@
+ 	}
+ }
+ /*}}}*/
+-void DataSet::Echo(){/*{{{*/
++void  DataSet::Echo(){/*{{{*/
+ 
+ 	vector<Object*>::iterator object;
+ 
+@@ -148,7 +157,7 @@
+ 	return;
+ }
+ /*}}}*/
+-int  DataSet::GetEnum(){/*{{{*/
++int   DataSet::GetEnum(){/*{{{*/
+ 	return enum_type;
+ }
+ /*}}}*/
+@@ -175,7 +184,7 @@
+ 	int offset;
+ 
+ 	_assert_(this);
+-	if(!sorted)_error_("trying to binary search on a non-sorted dataset!");
++	if(!sorted || objects.size()>numsorted)_error_("trying to binary search on a non-sorted dataset!");
+ 
+ 	/*Carry out a binary search on the sorted_ids: */
+ 	if(!binary_search(&id_offset,eid,sorted_ids,objects.size())){
+@@ -192,15 +201,15 @@
+ 	return objects[offset];
+ }
+ /*}}}*/
+-void DataSet::Presort(){/*{{{*/
++void  DataSet::Presort(){/*{{{*/
+ 
+ 	/*vector of objects is already sorted, just allocate the sorted ids and their
+ 	 * offsets:*/
+ 	if(objects.size()){
+ 
+ 		/*Delete existing ids*/
+-		xDelete<int>(sorted_ids);
+-		xDelete<int>(id_offsets);
++		if(sorted_ids) xDelete<int>(sorted_ids);
++		if(id_offsets) xDelete<int>(id_offsets);
+ 
+ 		/*Allocate new ids*/
+ 		sorted_ids=xNew<int>(objects.size());
+@@ -214,16 +223,17 @@
+ 	}
+ 
+ 	/*set sorted flag: */
++	numsorted=objects.size();
+ 	sorted=1;
+ }
+ /*}}}*/
+-int  DataSet::Size(void){/*{{{*/
++int   DataSet::Size(void){/*{{{*/
+ 	_assert_(this!=NULL);
+ 
+ 	return objects.size();
+ }
+ /*}}}*/
+-void DataSet::Sort(){/*{{{*/
++void  DataSet::Sort(){/*{{{*/
+ 
+ 	/*Only sort if we are not already sorted: */
+ 	if(!sorted){
+Index: ../trunk-jpl/src/c/datastructures/DataSet.h
+===================================================================
+--- ../trunk-jpl/src/c/datastructures/DataSet.h	(revision 18236)
++++ ../trunk-jpl/src/c/datastructures/DataSet.h	(revision 18237)
+@@ -24,6 +24,7 @@
+ 		/*sorting: */
+ 		int             sorted;
+ 		int             presorted;
++		int             numsorted;
+ 		int*            sorted_ids;
+ 		int*            id_offsets;
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18237-18238.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18237-18238.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18237-18238.diff	(revision 18296)
@@ -0,0 +1,30 @@
+Index: ../trunk-jpl/test/NightlyRun/runme.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/runme.m	(revision 18237)
++++ ../trunk-jpl/test/NightlyRun/runme.m	(revision 18238)
+@@ -19,6 +19,7 @@
+ %                      'mesh'   : validation of mesh tests
+ %                      'adolc'   : validation of adolc tests
+ %                      'gia'   : validation of gia tests
++%                      'qmu'   : validation of dakota tests
+ %                      ...
+ %      'procedure'     'check' :   run the test (default)
+ %                      'update':   update the archive
+@@ -50,7 +51,7 @@
+ %Process options
+ %GET benchmark {{{
+ benchmark=getfieldvalue(options,'benchmark','nightly');
+-if ~ismember(benchmark,{'all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing','adolc','gia'})
++if ~ismember(benchmark,{'all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing','adolc','gia','qmu'})
+ 	disp('runme warning: benchmark not supported, defaulting to test ''nightly''')
+ 	benchmark='nightly';
+ end
+@@ -122,6 +123,8 @@
+ 	test_ids=intersect(test_ids,[2001:2100]);
+ elseif strcmpi(benchmark,'adolc'),
+ 	test_ids=intersect(test_ids,[3001:3200]);
++elseif strcmpi(benchmark,'qmu'),
++	test_ids=intersect(test_ids,[218 234 235 412:414 417 418 420]);
+ end
+ % }}}
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18238-18239.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18238-18239.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18238-18239.diff	(revision 18296)
@@ -0,0 +1,48 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18238)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18239)
+@@ -43,7 +43,7 @@
+ 		this->matpar   = NULL;
+ 		if(nummodels>0){
+ 			this->element_type_list=xNew<int>(nummodels);
+-			for(int i=0;i<nummodels;i++) this->element_type_list[i] = NULL;
++			for(int i=0;i<nummodels;i++) this->element_type_list[i] = 0;
+ 		}
+ 		else this->element_type_list = NULL;
+ 
+@@ -66,7 +66,7 @@
+ 		tria->element_type_list=xNew<int>(nanalyses);
+ 		for(i=0;i<nanalyses;i++){
+ 			if (this->element_type_list[i]) tria->element_type_list[i]=this->element_type_list[i];
+-			else tria->element_type_list[i] = NULL;
++			else tria->element_type_list[i] = 0;
+ 		}
+ 	}
+ 	else tria->element_type_list = NULL;
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18238)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18239)
+@@ -73,7 +73,7 @@
+ 		penta->element_type_list=xNew<int>(nanalyses);
+ 		for(i=0;i<nanalyses;i++) {
+ 			if (this->element_type_list[i]) penta->element_type_list[i]=this->element_type_list[i];
+-			else penta->element_type_list[i] = NULL;
++			else penta->element_type_list[i] = 0;
+ 		}
+ 	}
+ 	else penta->element_type_list = NULL;
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.cpp	(revision 18238)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.cpp	(revision 18239)
+@@ -59,7 +59,7 @@
+ 		tetra->element_type_list=xNew<int>(nanalyses);
+ 		for(i=0;i<nanalyses;i++){
+ 			if (this->element_type_list[i]) tetra->element_type_list[i]=this->element_type_list[i];
+-			else tetra->element_type_list[i] = NULL;
++			else tetra->element_type_list[i] = 0;
+ 		}
+ 	}
+ 	else tetra->element_type_list = NULL;
Index: /issm/oecreview/Archive/17984-18295/ISSM-18239-18240.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18239-18240.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18239-18240.diff	(revision 18296)
@@ -0,0 +1,42 @@
+Index: ../trunk-jpl/src/c/shared/FSanalyticals/fsanalyticals.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/FSanalyticals/fsanalyticals.cpp	(revision 18239)
++++ ../trunk-jpl/src/c/shared/FSanalyticals/fsanalyticals.cpp	(revision 18240)
+@@ -44,6 +44,9 @@
+ 			return 4*pow(PI, 2)*pow(p, 2)*(cos(PI*p*x) - 1)*sin(PI*p*y)*sin(PI*p*z) + 2*pow(PI, 2)*pow(p, 2)*sin(PI*p*y)*sin(PI*p*z)*cos(PI*p*x) + 2*x*z;
+ 		case 10:
+ 			return 4*pow(PI, 2)*pow(p, 2)*(cos(PI*p*x) - 1)*sin(PI*p*y)*sin(PI*p*z) + 2*pow(PI, 2)*pow(p, 2)*sin(PI*p*y)*sin(PI*p*z)*cos(PI*p*x) + PI*q*pow(z, a)*sin(PI*q*y)*cos(PI*q*x);
++		case 12:
++			z=y;
++			return 32.0/5.0*pow(PI, 2)*sin(8*PI*z);
+ 		case 21:
+ 			z=y;
+ 			return z - 4.0L/3.0L*pow(2, 1.0L/3.0L)*(pow(x, 2)*z*(x - 1)*(z - 1)*(2*z - 1) + x*z*pow(x - 1, 2)*(z - 1)*(2*z - 1))*(4*(pow(x, 2)*z*(x - 1)*(z - 1)*(2*z - 1) + x*z*pow(x - 1, 2)*(z - 1)*(2*z - 1))*(pow(x, 2)*z*(z - 1)*(2*z - 1) + 4*x*z*(x - 1)*(z - 1)*(2*z - 1) + z*pow(x - 1, 2)*(z - 1)*(2*z - 1)) + 4*(2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) - 3*pow(z, 2)*(6*pow(x, 2) - 6*x + 1) + z*(6*pow(x, 2) - 6*x + 1))*(2*pow(z, 3)*(2*pow(x, 3) - 3*pow(x, 2) + x) - 3*pow(z, 2)*(2*pow(x, 3) - 3*pow(x, 2) + x) + z*(2*pow(x, 3) - 3*pow(x, 2) + x)) + (2*pow(x, 2)*z*pow(x - 1, 2)*(z - 1) + pow(x, 2)*z*pow(x - 1, 2)*(2*z - 1) + pow(x, 2)*pow(x - 1, 2)*(z - 1)*(2*z - 1) - pow(z, 4)*(6*pow(x, 2) - 6*x + 1) + 2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) - pow(z, 2)*(6*pow(x, 2) - 6*x + 1))*(2*pow(x, 2)*z*(x - 1)*(z - 1) + pow(x, 2)*z*(x - 1)*(2*z - 1) + pow(x, 2)*(x - 1)*(z - 1)*(2*z - 1) + 2*x*z*pow(x - 1, 2)*(z - 1) + x*z*pow(x - 1, 2)*(2*z - 1) + x*pow(x - 1, 2)*(z - 1)*(2*z - 1) - 3*pow(z, 4)*(2*x - 1) + 6*pow(z, 3)*(2*x - 1) - 3*pow(z, 2)*(2*x - 1)))/pow(4*pow(pow(x, 2)*z*(x - 1)*(z - 1)*(2*z - 1) + x*z*pow(x - 1, 2)*(z - 1)*(2*z - 1), 2) + 4*pow(2*pow(z, 3)*(2*pow(x, 3) - 3*pow(x, 2) + x) - 3*pow(z, 2)*(2*pow(x, 3) - 3*pow(x, 2) + x) + z*(2*pow(x, 3) - 3*pow(x, 2) + x), 2) + (1.0L/2.0L)*pow(2*pow(x, 2)*z*pow(x - 1, 2)*(z - 1) + pow(x, 2)*z*pow(x - 1, 2)*(2*z - 1) + pow(x, 2)*pow(x - 1, 2)*(z - 1)*(2*z - 1) - pow(z, 4)*(6*pow(x, 2) - 6*x + 1) + 2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) - pow(z, 2)*(6*pow(x, 2) - 6*x + 1), 2), 4.0L/3.0L) - 1.0L/3.0L*pow(2, 1.0L/3.0L)*(4*(pow(x, 2)*z*(x - 1)*(z - 1)*(2*z - 1) + x*z*pow(x - 1, 2)*(z - 1)*(2*z - 1))*(2*pow(x, 2)*z*(x - 1)*(z - 1) + pow(x, 2)*z*(x - 1)*(2*z - 1) + pow(x, 2)*(x - 1)*(z - 1)*(2*z - 1) + 2*x*z*pow(x - 1, 2)*(z - 1) + x*z*pow(x - 1, 2)*(2*z - 1) + x*pow(x - 1, 2)*(z - 1)*(2*z - 1)) + 4*(2*pow(z, 3)*(2*pow(x, 3) - 3*pow(x, 2) + x) - 3*pow(z, 2)*(2*pow(x, 3) - 3*pow(x, 2) + x) + z*(2*pow(x, 3) - 3*pow(x, 2) + x))*(2*pow(x, 3) - 3*pow(x, 2) + x + 6*pow(z, 2)*(2*pow(x, 3) - 3*pow(x, 2) + x) - 6*z*(2*pow(x, 3) - 3*pow(x, 2) + x)) + (2*pow(x, 2)*z*pow(x - 1, 2) + 2*pow(x, 2)*pow(x - 1, 2)*(z - 1) + pow(x, 2)*pow(x - 1, 2)*(2*z - 1) - 2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) + 3*pow(z, 2)*(6*pow(x, 2) - 6*x + 1) - z*(6*pow(x, 2) - 6*x + 1))*(2*pow(x, 2)*z*pow(x - 1, 2)*(z - 1) + pow(x, 2)*z*pow(x - 1, 2)*(2*z - 1) + pow(x, 2)*pow(x - 1, 2)*(z - 1)*(2*z - 1) - pow(z, 4)*(6*pow(x, 2) - 6*x + 1) + 2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) - pow(z, 2)*(6*pow(x, 2) - 6*x + 1)))*(2*pow(x, 2)*z*pow(x - 1, 2)*(z - 1) + pow(x, 2)*z*pow(x - 1, 2)*(2*z - 1) + pow(x, 2)*pow(x - 1, 2)*(z - 1)*(2*z - 1) - pow(z, 4)*(6*pow(x, 2) - 6*x + 1) + 2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) - pow(z, 2)*(6*pow(x, 2) - 6*x + 1))/pow(4*pow(pow(x, 2)*z*(x - 1)*(z - 1)*(2*z - 1) + x*z*pow(x - 1, 2)*(z - 1)*(2*z - 1), 2) + 4*pow(2*pow(z, 3)*(2*pow(x, 3) - 3*pow(x, 2) + x) - 3*pow(z, 2)*(2*pow(x, 3) - 3*pow(x, 2) + x) + z*(2*pow(x, 3) - 3*pow(x, 2) + x), 2) + (1.0L/2.0L)*pow(2*pow(x, 2)*z*pow(x - 1, 2)*(z - 1) + pow(x, 2)*z*pow(x - 1, 2)*(2*z - 1) + pow(x, 2)*pow(x - 1, 2)*(z - 1)*(2*z - 1) - pow(z, 4)*(6*pow(x, 2) - 6*x + 1) + 2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) - pow(z, 2)*(6*pow(x, 2) - 6*x + 1), 2), 4.0L/3.0L) + 2*pow(2, 1.0L/3.0L)*(pow(x, 2)*z*(z - 1)*(2*z - 1) + 4*x*z*(x - 1)*(z - 1)*(2*z - 1) + z*pow(x - 1, 2)*(z - 1)*(2*z - 1))/pow(4*pow(pow(x, 2)*z*(x - 1)*(z - 1)*(2*z - 1) + x*z*pow(x - 1, 2)*(z - 1)*(2*z - 1), 2) + 4*pow(2*pow(z, 3)*(2*pow(x, 3) - 3*pow(x, 2) + x) - 3*pow(z, 2)*(2*pow(x, 3) - 3*pow(x, 2) + x) + z*(2*pow(x, 3) - 3*pow(x, 2) + x), 2) + (1.0L/2.0L)*pow(2*pow(x, 2)*z*pow(x - 1, 2)*(z - 1) + pow(x, 2)*z*pow(x - 1, 2)*(2*z - 1) + pow(x, 2)*pow(x - 1, 2)*(z - 1)*(2*z - 1) - pow(z, 4)*(6*pow(x, 2) - 6*x + 1) + 2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) - pow(z, 2)*(6*pow(x, 2) - 6*x + 1), 2), 1.0L/3.0L) - 1.0L/2.0L + pow(2, 1.0L/3.0L)*(2*pow(x, 2)*z*pow(x - 1, 2) + 2*pow(x, 2)*pow(x - 1, 2)*(z - 1) + pow(x, 2)*pow(x - 1, 2)*(2*z - 1) - 2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) + 3*pow(z, 2)*(6*pow(x, 2) - 6*x + 1) - z*(6*pow(x, 2) - 6*x + 1))/pow(4*pow(pow(x, 2)*z*(x - 1)*(z - 1)*(2*z - 1) + x*z*pow(x - 1, 2)*(z - 1)*(2*z - 1), 2) + 4*pow(2*pow(z, 3)*(2*pow(x, 3) - 3*pow(x, 2) + x) - 3*pow(z, 2)*(2*pow(x, 3) - 3*pow(x, 2) + x) + z*(2*pow(x, 3) - 3*pow(x, 2) + x), 2) + (1.0L/2.0L)*pow(2*pow(x, 2)*z*pow(x - 1, 2)*(z - 1) + pow(x, 2)*z*pow(x - 1, 2)*(2*z - 1) + pow(x, 2)*pow(x - 1, 2)*(z - 1)*(2*z - 1) - pow(z, 4)*(6*pow(x, 2) - 6*x + 1) + 2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) - pow(z, 2)*(6*pow(x, 2) - 6*x + 1), 2), 1.0L/3.0L);
+@@ -86,6 +89,9 @@
+ 			return -2*pow(PI, 2)*pow(p, 2)*(cos(PI*p*y) - 1)*sin(PI*p*x)*sin(PI*p*z) - pow(PI, 2)*pow(p, 2)*sin(PI*p*x)*sin(PI*p*z)*cos(PI*p*y) + 2*y*z;
+ 		case 10:
+ 			return -2*pow(PI, 2)*pow(p, 2)*(cos(PI*p*y) - 1)*sin(PI*p*x)*sin(PI*p*z) - pow(PI, 2)*pow(p, 2)*sin(PI*p*x)*sin(PI*p*z)*cos(PI*p*y) + PI*q*pow(z, a)*sin(PI*q*x)*cos(PI*q*y);
++		case 12:
++			z=y;
++			return 32.0/5.0*pow(PI, 2)*sin(8*PI*x) - 100;
+ 		case 21:
+ 			z=y;
+ 			return x + (4.0L/3.0L)*pow(2, 1.0L/3.0L)*(2*pow(z, 3)*(2*pow(x, 3) - 3*pow(x, 2) + x) - 3*pow(z, 2)*(2*pow(x, 3) - 3*pow(x, 2) + x) + z*(2*pow(x, 3) - 3*pow(x, 2) + x))*(4*(pow(x, 2)*z*(x - 1)*(z - 1)*(2*z - 1) + x*z*pow(x - 1, 2)*(z - 1)*(2*z - 1))*(2*pow(x, 2)*z*(x - 1)*(z - 1) + pow(x, 2)*z*(x - 1)*(2*z - 1) + pow(x, 2)*(x - 1)*(z - 1)*(2*z - 1) + 2*x*z*pow(x - 1, 2)*(z - 1) + x*z*pow(x - 1, 2)*(2*z - 1) + x*pow(x - 1, 2)*(z - 1)*(2*z - 1)) + 4*(2*pow(z, 3)*(2*pow(x, 3) - 3*pow(x, 2) + x) - 3*pow(z, 2)*(2*pow(x, 3) - 3*pow(x, 2) + x) + z*(2*pow(x, 3) - 3*pow(x, 2) + x))*(2*pow(x, 3) - 3*pow(x, 2) + x + 6*pow(z, 2)*(2*pow(x, 3) - 3*pow(x, 2) + x) - 6*z*(2*pow(x, 3) - 3*pow(x, 2) + x)) + (2*pow(x, 2)*z*pow(x - 1, 2) + 2*pow(x, 2)*pow(x - 1, 2)*(z - 1) + pow(x, 2)*pow(x - 1, 2)*(2*z - 1) - 2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) + 3*pow(z, 2)*(6*pow(x, 2) - 6*x + 1) - z*(6*pow(x, 2) - 6*x + 1))*(2*pow(x, 2)*z*pow(x - 1, 2)*(z - 1) + pow(x, 2)*z*pow(x - 1, 2)*(2*z - 1) + pow(x, 2)*pow(x - 1, 2)*(z - 1)*(2*z - 1) - pow(z, 4)*(6*pow(x, 2) - 6*x + 1) + 2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) - pow(z, 2)*(6*pow(x, 2) - 6*x + 1)))/pow(4*pow(pow(x, 2)*z*(x - 1)*(z - 1)*(2*z - 1) + x*z*pow(x - 1, 2)*(z - 1)*(2*z - 1), 2) + 4*pow(2*pow(z, 3)*(2*pow(x, 3) - 3*pow(x, 2) + x) - 3*pow(z, 2)*(2*pow(x, 3) - 3*pow(x, 2) + x) + z*(2*pow(x, 3) - 3*pow(x, 2) + x), 2) + (1.0L/2.0L)*pow(2*pow(x, 2)*z*pow(x - 1, 2)*(z - 1) + pow(x, 2)*z*pow(x - 1, 2)*(2*z - 1) + pow(x, 2)*pow(x - 1, 2)*(z - 1)*(2*z - 1) - pow(z, 4)*(6*pow(x, 2) - 6*x + 1) + 2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) - pow(z, 2)*(6*pow(x, 2) - 6*x + 1), 2), 4.0L/3.0L) - 1.0L/3.0L*pow(2, 1.0L/3.0L)*(4*(pow(x, 2)*z*(x - 1)*(z - 1)*(2*z - 1) + x*z*pow(x - 1, 2)*(z - 1)*(2*z - 1))*(pow(x, 2)*z*(z - 1)*(2*z - 1) + 4*x*z*(x - 1)*(z - 1)*(2*z - 1) + z*pow(x - 1, 2)*(z - 1)*(2*z - 1)) + 4*(2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) - 3*pow(z, 2)*(6*pow(x, 2) - 6*x + 1) + z*(6*pow(x, 2) - 6*x + 1))*(2*pow(z, 3)*(2*pow(x, 3) - 3*pow(x, 2) + x) - 3*pow(z, 2)*(2*pow(x, 3) - 3*pow(x, 2) + x) + z*(2*pow(x, 3) - 3*pow(x, 2) + x)) + (2*pow(x, 2)*z*pow(x - 1, 2)*(z - 1) + pow(x, 2)*z*pow(x - 1, 2)*(2*z - 1) + pow(x, 2)*pow(x - 1, 2)*(z - 1)*(2*z - 1) - pow(z, 4)*(6*pow(x, 2) - 6*x + 1) + 2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) - pow(z, 2)*(6*pow(x, 2) - 6*x + 1))*(2*pow(x, 2)*z*(x - 1)*(z - 1) + pow(x, 2)*z*(x - 1)*(2*z - 1) + pow(x, 2)*(x - 1)*(z - 1)*(2*z - 1) + 2*x*z*pow(x - 1, 2)*(z - 1) + x*z*pow(x - 1, 2)*(2*z - 1) + x*pow(x - 1, 2)*(z - 1)*(2*z - 1) - 3*pow(z, 4)*(2*x - 1) + 6*pow(z, 3)*(2*x - 1) - 3*pow(z, 2)*(2*x - 1)))*(2*pow(x, 2)*z*pow(x - 1, 2)*(z - 1) + pow(x, 2)*z*pow(x - 1, 2)*(2*z - 1) + pow(x, 2)*pow(x - 1, 2)*(z - 1)*(2*z - 1) - pow(z, 4)*(6*pow(x, 2) - 6*x + 1) + 2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) - pow(z, 2)*(6*pow(x, 2) - 6*x + 1))/pow(4*pow(pow(x, 2)*z*(x - 1)*(z - 1)*(2*z - 1) + x*z*pow(x - 1, 2)*(z - 1)*(2*z - 1), 2) + 4*pow(2*pow(z, 3)*(2*pow(x, 3) - 3*pow(x, 2) + x) - 3*pow(z, 2)*(2*pow(x, 3) - 3*pow(x, 2) + x) + z*(2*pow(x, 3) - 3*pow(x, 2) + x), 2) + (1.0L/2.0L)*pow(2*pow(x, 2)*z*pow(x - 1, 2)*(z - 1) + pow(x, 2)*z*pow(x - 1, 2)*(2*z - 1) + pow(x, 2)*pow(x - 1, 2)*(z - 1)*(2*z - 1) - pow(z, 4)*(6*pow(x, 2) - 6*x + 1) + 2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) - pow(z, 2)*(6*pow(x, 2) - 6*x + 1), 2), 4.0L/3.0L) - 1.0L/2.0L - 2*pow(2, 1.0L/3.0L)*(2*pow(x, 3) - 3*pow(x, 2) + x + 6*pow(z, 2)*(2*pow(x, 3) - 3*pow(x, 2) + x) - 6*z*(2*pow(x, 3) - 3*pow(x, 2) + x))/pow(4*pow(pow(x, 2)*z*(x - 1)*(z - 1)*(2*z - 1) + x*z*pow(x - 1, 2)*(z - 1)*(2*z - 1), 2) + 4*pow(2*pow(z, 3)*(2*pow(x, 3) - 3*pow(x, 2) + x) - 3*pow(z, 2)*(2*pow(x, 3) - 3*pow(x, 2) + x) + z*(2*pow(x, 3) - 3*pow(x, 2) + x), 2) + (1.0L/2.0L)*pow(2*pow(x, 2)*z*pow(x - 1, 2)*(z - 1) + pow(x, 2)*z*pow(x - 1, 2)*(2*z - 1) + pow(x, 2)*pow(x - 1, 2)*(z - 1)*(2*z - 1) - pow(z, 4)*(6*pow(x, 2) - 6*x + 1) + 2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) - pow(z, 2)*(6*pow(x, 2) - 6*x + 1), 2), 1.0L/3.0L) + pow(2, 1.0L/3.0L)*(2*pow(x, 2)*z*(x - 1)*(z - 1) + pow(x, 2)*z*(x - 1)*(2*z - 1) + pow(x, 2)*(x - 1)*(z - 1)*(2*z - 1) + 2*x*z*pow(x - 1, 2)*(z - 1) + x*z*pow(x - 1, 2)*(2*z - 1) + x*pow(x - 1, 2)*(z - 1)*(2*z - 1) - 3*pow(z, 4)*(2*x - 1) + 6*pow(z, 3)*(2*x - 1) - 3*pow(z, 2)*(2*x - 1))/pow(4*pow(pow(x, 2)*z*(x - 1)*(z - 1)*(2*z - 1) + x*z*pow(x - 1, 2)*(z - 1)*(2*z - 1), 2) + 4*pow(2*pow(z, 3)*(2*pow(x, 3) - 3*pow(x, 2) + x) - 3*pow(z, 2)*(2*pow(x, 3) - 3*pow(x, 2) + x) + z*(2*pow(x, 3) - 3*pow(x, 2) + x), 2) + (1.0L/2.0L)*pow(2*pow(x, 2)*z*pow(x - 1, 2)*(z - 1) + pow(x, 2)*z*pow(x - 1, 2)*(2*z - 1) + pow(x, 2)*pow(x - 1, 2)*(z - 1)*(2*z - 1) - pow(z, 4)*(6*pow(x, 2) - 6*x + 1) + 2*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) - pow(z, 2)*(6*pow(x, 2) - 6*x + 1), 2), 1.0L/3.0L);
+@@ -105,7 +111,7 @@
+ 	IssmDouble a = 1.0;
+ 
+ 	switch(testid){
+-		case 1: case 2: case 7: case 8: case 11: case 18: case 21:
++		case 1: case 2: case 7: case 8: case 11:  case 12: case 18: case 21:
+ 			return 0.;
+ 		case 3: 
+ 			return 2*pow(x, 2)*y*z*(x - 1)*(y - 1)*(2*y - 1) + 2*pow(x, 2)*y*(x - 1)*(y - 1)*(2*y - 1)*(z - 1) - 2*x*pow(y, 2)*z*(x - 1)*(2*x - 1)*(y - 1) - 2*x*pow(y, 2)*(x - 1)*(2*x - 1)*(y - 1)*(z - 1) + 2*x*y*z*pow(x - 1, 2)*(y - 1)*(2*y - 1) - 2*x*y*z*(x - 1)*(2*x - 1)*pow(y - 1, 2) + 2*x*y*pow(x - 1, 2)*(y - 1)*(2*y - 1)*(z - 1) - 2*x*y*(x - 1)*(2*x - 1)*pow(y - 1, 2)*(z - 1);
+@@ -131,7 +137,7 @@
+ 	IssmDouble q = 2.0;   
+ 
+ 	switch(testid){
+-		case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 21:
++		case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 12: case 21:
+ 			return 0.;
+ 		case 11:
+ 			z=y;
Index: /issm/oecreview/Archive/17984-18295/ISSM-18240-18241.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18240-18241.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18240-18241.diff	(revision 18296)
@@ -0,0 +1,92 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18240)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18241)
+@@ -6,7 +6,7 @@
+ #include "../solutionsequences/solutionsequences.h"
+ #include "../cores/cores.h"
+ 
+-//#define FSANALYTICAL 24
++//#define FSANALYTICAL 12
+ 
+ /*Model processing*/
+ int  StressbalanceAnalysis::DofsPerNode(int** pdoftype,int domaintype,int approximation){/*{{{*/
+@@ -3245,8 +3245,8 @@
+ 
+ 	/*Initialize Element matrix and vectors*/
+ 	ElementMatrix* Ke = element->NewElementMatrix(FSvelocityEnum);
+-	IssmDouble*    B  = xNew<IssmDouble>((dim-1)*numdof);
+-	IssmDouble*    D  = xNewZeroInit<IssmDouble>((dim-1)*(dim-1));
++	IssmDouble*    B  = xNew<IssmDouble>(dim*numdof);
++	IssmDouble*    D  = xNewZeroInit<IssmDouble>(dim*dim);
+ 
+ 	/*Retrieve all inputs and parameters*/
+ 	element->GetVerticesCoordinatesBase(&xyz_list_base);
+@@ -3270,11 +3270,11 @@
+ 
+ 		this->GetBFSFriction(B,element,dim,xyz_list_base,gauss);
+ 		element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
+-		for(int i=0;i<dim-1;i++) D[i*(dim-1)+i] = alpha2*gauss->weight*Jdet; //taub_x = -alpha2 v_x (same for y)
++		for(int i=0;i<dim;i++) D[i*dim+i] = alpha2*gauss->weight*Jdet; //taub_x = -alpha2 v_x (same for y)
+ 
+-		TripleMultiply(B,dim-1,numdof,1,
+-					D,dim-1,dim-1,0,
+-					B,dim-1,numdof,0,
++		TripleMultiply(B,dim,numdof,1,
++					D,dim,dim,0,
++					B,dim,numdof,0,
+ 					&Ke->values[0],1);
+ 	}
+ 
+@@ -3393,8 +3393,8 @@
+ 
+ 	/*Initialize Element matrix and vectors*/
+ 	ElementMatrix* Ke = element->NewElementMatrix(FSvelocityEnum);
+-	IssmDouble*    B  = xNew<IssmDouble>((dim-1)*numdof);
+-	IssmDouble*    D  = xNewZeroInit<IssmDouble>((dim-1)*(dim-1));
++	IssmDouble*    B  = xNew<IssmDouble>(dim*numdof);
++	IssmDouble*    D  = xNewZeroInit<IssmDouble>(dim*dim);
+ 
+ 	/*Retrieve all inputs and parameters*/
+ 	element->GetVerticesCoordinatesBase(&xyz_list_base);
+@@ -3430,11 +3430,11 @@
+ 
+ 		this->GetBFSFriction(B,element,dim,xyz_list_base,gauss);
+ 		element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
+-		for(int i=0;i<dim-1;i++) D[i*(dim-1)+i] = alpha2*gauss->weight*Jdet; //taub_x = -alpha2 v_x (same for y)
++		for(int i=0;i<dim;i++) D[i*dim+i] = alpha2*gauss->weight*Jdet; //taub_x = -alpha2 v_x (same for y)
+ 
+-		TripleMultiply(B,dim-1,numdof,1,
+-					D,dim-1,dim-1,0,
+-					B,dim-1,numdof,0,
++		TripleMultiply(B,dim,numdof,1,
++					D,dim,dim,0,
++					B,dim,numdof,0,
+ 					&Ke->values[0],1);
+ 	}
+ 
+@@ -4428,6 +4428,10 @@
+ 			B[(vnumdof+pnumdof)*1+3*i+0] = 0.;
+ 			B[(vnumdof+pnumdof)*1+3*i+1] = vbasis[i];
+ 			B[(vnumdof+pnumdof)*1+3*i+2] = 0.;
++
++			B[(vnumdof+pnumdof)*2+3*i+0] = 0.;
++			B[(vnumdof+pnumdof)*2+3*i+1] = 0.;
++			B[(vnumdof+pnumdof)*2+3*i+2] = vbasis[i];
+ 		}
+ 		for(int i=0;i<pnumnodes;i++){
+ 			B[(vnumdof+pnumdof)*0+i+vnumdof+0] = 0.;
+@@ -4436,8 +4440,11 @@
+ 	}
+ 	else{
+ 		for(int i=0;i<vnumnodes;i++){
+-			B[2*i+0] = vbasis[i];
+-			B[2*i+1] = 0.;
++			B[(vnumdof+pnumdof)*0+2*i+0] = vbasis[i];
++			B[(vnumdof+pnumdof)*0+2*i+1] = 0.;
++
++			B[(vnumdof+pnumdof)*1+2*i+0] = 0.;
++			B[(vnumdof+pnumdof)*1+2*i+1] = vbasis[i];
+ 		}
+ 
+ 		for(int i=0;i<pnumnodes;i++){
Index: /issm/oecreview/Archive/17984-18295/ISSM-18241-18242.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18241-18242.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18241-18242.diff	(revision 18296)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18241)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18242)
+@@ -4436,6 +4436,7 @@
+ 		for(int i=0;i<pnumnodes;i++){
+ 			B[(vnumdof+pnumdof)*0+i+vnumdof+0] = 0.;
+ 			B[(vnumdof+pnumdof)*1+i+vnumdof+0] = 0.;
++			B[(vnumdof+pnumdof)*2+i+vnumdof+0] = 0.;
+ 		}
+ 	}
+ 	else{
Index: /issm/oecreview/Archive/17984-18295/ISSM-18242-18243.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18242-18243.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18242-18243.diff	(revision 18296)
@@ -0,0 +1,20 @@
+Index: ../trunk-jpl/src/c/classes/Elements/ElementHook.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/ElementHook.cpp	(revision 18242)
++++ ../trunk-jpl/src/c/classes/Elements/ElementHook.cpp	(revision 18243)
+@@ -26,9 +26,12 @@
+ /*}}}*/
+ ElementHook::~ElementHook(){/*{{{*/
+ 
+-	int i;
+-
+-	if (this->hnodes) delete [] this->hnodes;
++	if(this->hnodes){
++		for(int i=0;i<this->numanalyses;i++){
++			if(this->hnodes[i]) delete this->hnodes[i]; 
++		}
++		delete [] this->hnodes;
++	}
+ 	delete hvertices;
+ 	delete hmaterial;
+ 	delete hmatpar;
Index: /issm/oecreview/Archive/17984-18295/ISSM-18243-18244.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18243-18244.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18243-18244.diff	(revision 18296)
@@ -0,0 +1,16 @@
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18243)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18244)
+@@ -250,6 +250,11 @@
+ 	PetscFinalize();
+ 	#endif
+ 
++
++	/*Clean up*/
++	xDelete<char>(outbinfilename);
++	xDelete<char>(lockfilename);
++
+ }
+ /*}}}*/
+ void FemModel::SetStaticComm(void){/*{{{*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18244-18245.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18244-18245.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18244-18245.diff	(revision 18296)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18244)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18245)
+@@ -4449,7 +4449,8 @@
+ 		}
+ 
+ 		for(int i=0;i<pnumnodes;i++){
+-			B[i+vnumdof+0] = 0.;
++			B[(vnumdof+pnumdof)*0+i+vnumdof+0] = 0.;
++			B[(vnumdof+pnumdof)*1+i+vnumdof+0] = 0.;
+ 		}
+ 	}
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18245-18246.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18245-18246.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18245-18246.diff	(revision 18296)
@@ -0,0 +1,279 @@
+Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18245)
++++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h	(revision 18246)
+@@ -166,7 +166,6 @@
+ 	InversionVyObsEnum,
+ 	InversionVzObsEnum,
+ 	MaskIceLevelsetEnum,
+-	QmuMaskIceLevelsetEnum,
+ 	MaterialsBetaEnum,
+ 	MaterialsHeatcapacityEnum,
+ 	MaterialsLatentheatEnum,
+@@ -179,7 +178,6 @@
+ 	DamageIsdamageEnum,
+ 	DamageDEnum,
+ 	DamageFEnum,
+-	QmuDamageDEnum,
+ 	DamageDbarEnum,
+ 	DamageLawEnum,
+ 	DamageC1Enum,
+@@ -253,7 +251,6 @@
+ 	QmuPartitionEnum,
+ 	QmuResponsedescriptorsEnum,
+ 	QmuVariabledescriptorsEnum,
+-	QmuMaterialsRheologyBEnum,
+ 	RiftsNumriftsEnum,
+ 	RiftsRiftstructEnum,
+ 	SettingsResultsOnNodesEnum,
+@@ -512,17 +509,6 @@
+ 	MisfitEnum,
+ 	PressureEnum,
+ 	PressurePicardEnum,
+-	QmuPressureEnum,
+-	QmuVxEnum,
+-	QmuVyEnum,
+-	QmuVzEnum,
+-	QmuThicknessEnum,
+-	QmuBaseEnum,
+-	QmuSurfaceEnum,
+-	QmuMeltingEnum,
+-	QmuVxMeshEnum,
+-	QmuVyMeshEnum,
+-	QmuVzMeshEnum,
+ 	AndroidFrictionCoefficientEnum,
+ 	ResetPenaltiesEnum,
+ 	SegmentOnIceShelfEnum,
+@@ -566,7 +552,6 @@
+ 	WatercolumnEnum,
+ 	BasalFrictionEnum,
+ 	ViscousHeatingEnum,
+-	QmuTemperatureEnum,
+ 	HydrologyWaterVxEnum,
+ 	HydrologyWaterVyEnum,
+ 	SigmaNNEnum,
+@@ -680,7 +665,6 @@
+ 	SubelementMigration2Enum,
+ 	ContactEnum,
+ 	MaskGroundediceLevelsetEnum,
+-	QmuMaskGroundediceLevelsetEnum,
+ 	/*}}}*/
+ 	/*Gauss{{{*/
+ 	GaussSegEnum,
+Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18245)
++++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp	(revision 18246)
+@@ -174,7 +174,6 @@
+ 		case InversionVyObsEnum : return "InversionVyObs";
+ 		case InversionVzObsEnum : return "InversionVzObs";
+ 		case MaskIceLevelsetEnum : return "MaskIceLevelset";
+-		case QmuMaskIceLevelsetEnum : return "QmuMaskIceLevelset";
+ 		case MaterialsBetaEnum : return "MaterialsBeta";
+ 		case MaterialsHeatcapacityEnum : return "MaterialsHeatcapacity";
+ 		case MaterialsLatentheatEnum : return "MaterialsLatentheat";
+@@ -187,7 +186,6 @@
+ 		case DamageIsdamageEnum : return "DamageIsdamage";
+ 		case DamageDEnum : return "DamageD";
+ 		case DamageFEnum : return "DamageF";
+-		case QmuDamageDEnum : return "QmuDamageD";
+ 		case DamageDbarEnum : return "DamageDbar";
+ 		case DamageLawEnum : return "DamageLaw";
+ 		case DamageC1Enum : return "DamageC1";
+@@ -261,7 +259,6 @@
+ 		case QmuPartitionEnum : return "QmuPartition";
+ 		case QmuResponsedescriptorsEnum : return "QmuResponsedescriptors";
+ 		case QmuVariabledescriptorsEnum : return "QmuVariabledescriptors";
+-		case QmuMaterialsRheologyBEnum : return "QmuMaterialsRheologyB";
+ 		case RiftsNumriftsEnum : return "RiftsNumrifts";
+ 		case RiftsRiftstructEnum : return "RiftsRiftstruct";
+ 		case SettingsResultsOnNodesEnum : return "SettingsResultsOnNodes";
+@@ -503,17 +500,6 @@
+ 		case MisfitEnum : return "Misfit";
+ 		case PressureEnum : return "Pressure";
+ 		case PressurePicardEnum : return "PressurePicard";
+-		case QmuPressureEnum : return "QmuPressure";
+-		case QmuVxEnum : return "QmuVx";
+-		case QmuVyEnum : return "QmuVy";
+-		case QmuVzEnum : return "QmuVz";
+-		case QmuThicknessEnum : return "QmuThickness";
+-		case QmuBaseEnum : return "QmuBase";
+-		case QmuSurfaceEnum : return "QmuSurface";
+-		case QmuMeltingEnum : return "QmuMelting";
+-		case QmuVxMeshEnum : return "QmuVxMesh";
+-		case QmuVyMeshEnum : return "QmuVyMesh";
+-		case QmuVzMeshEnum : return "QmuVzMesh";
+ 		case AndroidFrictionCoefficientEnum : return "AndroidFrictionCoefficient";
+ 		case ResetPenaltiesEnum : return "ResetPenalties";
+ 		case SegmentOnIceShelfEnum : return "SegmentOnIceShelf";
+@@ -557,7 +543,6 @@
+ 		case WatercolumnEnum : return "Watercolumn";
+ 		case BasalFrictionEnum : return "BasalFriction";
+ 		case ViscousHeatingEnum : return "ViscousHeating";
+-		case QmuTemperatureEnum : return "QmuTemperature";
+ 		case HydrologyWaterVxEnum : return "HydrologyWaterVx";
+ 		case HydrologyWaterVyEnum : return "HydrologyWaterVy";
+ 		case SigmaNNEnum : return "SigmaNN";
+@@ -659,7 +644,6 @@
+ 		case SubelementMigration2Enum : return "SubelementMigration2";
+ 		case ContactEnum : return "Contact";
+ 		case MaskGroundediceLevelsetEnum : return "MaskGroundediceLevelset";
+-		case QmuMaskGroundediceLevelsetEnum : return "QmuMaskGroundediceLevelset";
+ 		case GaussSegEnum : return "GaussSeg";
+ 		case GaussTriaEnum : return "GaussTria";
+ 		case GaussTetraEnum : return "GaussTetra";
+Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18245)
++++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp	(revision 18246)
+@@ -177,7 +177,6 @@
+ 	      else if (strcmp(name,"InversionVyObs")==0) return InversionVyObsEnum;
+ 	      else if (strcmp(name,"InversionVzObs")==0) return InversionVzObsEnum;
+ 	      else if (strcmp(name,"MaskIceLevelset")==0) return MaskIceLevelsetEnum;
+-	      else if (strcmp(name,"QmuMaskIceLevelset")==0) return QmuMaskIceLevelsetEnum;
+ 	      else if (strcmp(name,"MaterialsBeta")==0) return MaterialsBetaEnum;
+ 	      else if (strcmp(name,"MaterialsHeatcapacity")==0) return MaterialsHeatcapacityEnum;
+ 	      else if (strcmp(name,"MaterialsLatentheat")==0) return MaterialsLatentheatEnum;
+@@ -190,7 +189,6 @@
+ 	      else if (strcmp(name,"DamageIsdamage")==0) return DamageIsdamageEnum;
+ 	      else if (strcmp(name,"DamageD")==0) return DamageDEnum;
+ 	      else if (strcmp(name,"DamageF")==0) return DamageFEnum;
+-	      else if (strcmp(name,"QmuDamageD")==0) return QmuDamageDEnum;
+ 	      else if (strcmp(name,"DamageDbar")==0) return DamageDbarEnum;
+ 	      else if (strcmp(name,"DamageLaw")==0) return DamageLawEnum;
+ 	      else if (strcmp(name,"DamageC1")==0) return DamageC1Enum;
+@@ -259,15 +257,14 @@
+ 	      else if (strcmp(name,"MassFluxSegments")==0) return MassFluxSegmentsEnum;
+ 	      else if (strcmp(name,"MassFluxSegmentsPresent")==0) return MassFluxSegmentsPresentEnum;
+ 	      else if (strcmp(name,"QmuMassFluxSegmentsPresent")==0) return QmuMassFluxSegmentsPresentEnum;
++	      else if (strcmp(name,"QmuNumberofpartitions")==0) return QmuNumberofpartitionsEnum;
++	      else if (strcmp(name,"QmuNumberofresponses")==0) return QmuNumberofresponsesEnum;
+          else stage=3;
+    }
+    if(stage==3){
+-	      if (strcmp(name,"QmuNumberofpartitions")==0) return QmuNumberofpartitionsEnum;
+-	      else if (strcmp(name,"QmuNumberofresponses")==0) return QmuNumberofresponsesEnum;
+-	      else if (strcmp(name,"QmuPartition")==0) return QmuPartitionEnum;
++	      if (strcmp(name,"QmuPartition")==0) return QmuPartitionEnum;
+ 	      else if (strcmp(name,"QmuResponsedescriptors")==0) return QmuResponsedescriptorsEnum;
+ 	      else if (strcmp(name,"QmuVariabledescriptors")==0) return QmuVariabledescriptorsEnum;
+-	      else if (strcmp(name,"QmuMaterialsRheologyB")==0) return QmuMaterialsRheologyBEnum;
+ 	      else if (strcmp(name,"RiftsNumrifts")==0) return RiftsNumriftsEnum;
+ 	      else if (strcmp(name,"RiftsRiftstruct")==0) return RiftsRiftstructEnum;
+ 	      else if (strcmp(name,"SettingsResultsOnNodes")==0) return SettingsResultsOnNodesEnum;
+@@ -382,13 +379,13 @@
+ 	      else if (strcmp(name,"HydrologyShreveAnalysis")==0) return HydrologyShreveAnalysisEnum;
+ 	      else if (strcmp(name,"HydrologyDCInefficientAnalysis")==0) return HydrologyDCInefficientAnalysisEnum;
+ 	      else if (strcmp(name,"HydrologyDCEfficientAnalysis")==0) return HydrologyDCEfficientAnalysisEnum;
++	      else if (strcmp(name,"HydrologySolution")==0) return HydrologySolutionEnum;
++	      else if (strcmp(name,"MeltingAnalysis")==0) return MeltingAnalysisEnum;
++	      else if (strcmp(name,"MasstransportAnalysis")==0) return MasstransportAnalysisEnum;
+          else stage=4;
+    }
+    if(stage==4){
+-	      if (strcmp(name,"HydrologySolution")==0) return HydrologySolutionEnum;
+-	      else if (strcmp(name,"MeltingAnalysis")==0) return MeltingAnalysisEnum;
+-	      else if (strcmp(name,"MasstransportAnalysis")==0) return MasstransportAnalysisEnum;
+-	      else if (strcmp(name,"MasstransportSolution")==0) return MasstransportSolutionEnum;
++	      if (strcmp(name,"MasstransportSolution")==0) return MasstransportSolutionEnum;
+ 	      else if (strcmp(name,"FreeSurfaceBaseAnalysis")==0) return FreeSurfaceBaseAnalysisEnum;
+ 	      else if (strcmp(name,"FreeSurfaceTopAnalysis")==0) return FreeSurfaceTopAnalysisEnum;
+ 	      else if (strcmp(name,"SurfaceNormalVelocity")==0) return SurfaceNormalVelocityEnum;
+@@ -505,27 +502,16 @@
+ 	      else if (strcmp(name,"Converged")==0) return ConvergedEnum;
+ 	      else if (strcmp(name,"Fill")==0) return FillEnum;
+ 	      else if (strcmp(name,"FractionIncrement")==0) return FractionIncrementEnum;
++	      else if (strcmp(name,"Friction")==0) return FrictionEnum;
++	      else if (strcmp(name,"Internal")==0) return InternalEnum;
++	      else if (strcmp(name,"MassFlux")==0) return MassFluxEnum;
+          else stage=5;
+    }
+    if(stage==5){
+-	      if (strcmp(name,"Friction")==0) return FrictionEnum;
+-	      else if (strcmp(name,"Internal")==0) return InternalEnum;
+-	      else if (strcmp(name,"MassFlux")==0) return MassFluxEnum;
+-	      else if (strcmp(name,"MeltingOffset")==0) return MeltingOffsetEnum;
++	      if (strcmp(name,"MeltingOffset")==0) return MeltingOffsetEnum;
+ 	      else if (strcmp(name,"Misfit")==0) return MisfitEnum;
+ 	      else if (strcmp(name,"Pressure")==0) return PressureEnum;
+ 	      else if (strcmp(name,"PressurePicard")==0) return PressurePicardEnum;
+-	      else if (strcmp(name,"QmuPressure")==0) return QmuPressureEnum;
+-	      else if (strcmp(name,"QmuVx")==0) return QmuVxEnum;
+-	      else if (strcmp(name,"QmuVy")==0) return QmuVyEnum;
+-	      else if (strcmp(name,"QmuVz")==0) return QmuVzEnum;
+-	      else if (strcmp(name,"QmuThickness")==0) return QmuThicknessEnum;
+-	      else if (strcmp(name,"QmuBase")==0) return QmuBaseEnum;
+-	      else if (strcmp(name,"QmuSurface")==0) return QmuSurfaceEnum;
+-	      else if (strcmp(name,"QmuMelting")==0) return QmuMeltingEnum;
+-	      else if (strcmp(name,"QmuVxMesh")==0) return QmuVxMeshEnum;
+-	      else if (strcmp(name,"QmuVyMesh")==0) return QmuVyMeshEnum;
+-	      else if (strcmp(name,"QmuVzMesh")==0) return QmuVzMeshEnum;
+ 	      else if (strcmp(name,"AndroidFrictionCoefficient")==0) return AndroidFrictionCoefficientEnum;
+ 	      else if (strcmp(name,"ResetPenalties")==0) return ResetPenaltiesEnum;
+ 	      else if (strcmp(name,"SegmentOnIceShelf")==0) return SegmentOnIceShelfEnum;
+@@ -569,7 +555,6 @@
+ 	      else if (strcmp(name,"Watercolumn")==0) return WatercolumnEnum;
+ 	      else if (strcmp(name,"BasalFriction")==0) return BasalFrictionEnum;
+ 	      else if (strcmp(name,"ViscousHeating")==0) return ViscousHeatingEnum;
+-	      else if (strcmp(name,"QmuTemperature")==0) return QmuTemperatureEnum;
+ 	      else if (strcmp(name,"HydrologyWaterVx")==0) return HydrologyWaterVxEnum;
+ 	      else if (strcmp(name,"HydrologyWaterVy")==0) return HydrologyWaterVyEnum;
+ 	      else if (strcmp(name,"SigmaNN")==0) return SigmaNNEnum;
+@@ -628,10 +613,7 @@
+ 	      else if (strcmp(name,"StringExternalResult")==0) return StringExternalResultEnum;
+ 	      else if (strcmp(name,"Step")==0) return StepEnum;
+ 	      else if (strcmp(name,"Time")==0) return TimeEnum;
+-         else stage=6;
+-   }
+-   if(stage==6){
+-	      if (strcmp(name,"WaterColumnOld")==0) return WaterColumnOldEnum;
++	      else if (strcmp(name,"WaterColumnOld")==0) return WaterColumnOldEnum;
+ 	      else if (strcmp(name,"Outputdefinition")==0) return OutputdefinitionEnum;
+ 	      else if (strcmp(name,"OutputdefinitionList")==0) return OutputdefinitionListEnum;
+ 	      else if (strcmp(name,"Massfluxatgate")==0) return MassfluxatgateEnum;
+@@ -646,7 +628,10 @@
+ 	      else if (strcmp(name,"MisfitWeightsEnum")==0) return MisfitWeightsEnumEnum;
+ 	      else if (strcmp(name,"SurfaceObservation")==0) return SurfaceObservationEnum;
+ 	      else if (strcmp(name,"WeightsSurfaceObservation")==0) return WeightsSurfaceObservationEnum;
+-	      else if (strcmp(name,"MinVel")==0) return MinVelEnum;
++         else stage=6;
++   }
++   if(stage==6){
++	      if (strcmp(name,"MinVel")==0) return MinVelEnum;
+ 	      else if (strcmp(name,"MaxVel")==0) return MaxVelEnum;
+ 	      else if (strcmp(name,"MinVx")==0) return MinVxEnum;
+ 	      else if (strcmp(name,"MaxVx")==0) return MaxVxEnum;
+@@ -674,7 +659,6 @@
+ 	      else if (strcmp(name,"SubelementMigration2")==0) return SubelementMigration2Enum;
+ 	      else if (strcmp(name,"Contact")==0) return ContactEnum;
+ 	      else if (strcmp(name,"MaskGroundediceLevelset")==0) return MaskGroundediceLevelsetEnum;
+-	      else if (strcmp(name,"QmuMaskGroundediceLevelset")==0) return QmuMaskGroundediceLevelsetEnum;
+ 	      else if (strcmp(name,"GaussSeg")==0) return GaussSegEnum;
+ 	      else if (strcmp(name,"GaussTria")==0) return GaussTriaEnum;
+ 	      else if (strcmp(name,"GaussTetra")==0) return GaussTetraEnum;
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18245)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18246)
+@@ -995,21 +995,6 @@
+ 				name==GradientEnum ||
+ 				name==OldGradientEnum  ||
+ 				name==ConvergedEnum || 
+-				name==QmuVxEnum ||
+-				name==QmuVyEnum ||
+-				name==QmuVzEnum ||
+-				name==QmuVxMeshEnum ||
+-				name==QmuVyMeshEnum ||
+-				name==QmuVzMeshEnum ||
+-				name==QmuPressureEnum ||
+-				name==QmuBaseEnum ||
+-				name==QmuThicknessEnum ||
+-				name==QmuSurfaceEnum ||
+-				name==QmuTemperatureEnum ||
+-				name==QmuMeltingEnum ||
+-				name==QmuMaskGroundediceLevelsetEnum ||
+-				name==QmuMaskIceLevelsetEnum ||
+-				name==QmuMaterialsRheologyBEnum ||
+ 				name==MaterialsRheologyBEnum ||
+ 				name==MaterialsRheologyBbarEnum ||
+ 				name==MaterialsRheologyNEnum ||
Index: /issm/oecreview/Archive/17984-18295/ISSM-18246-18247.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18246-18247.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18246-18247.diff	(revision 18296)
@@ -0,0 +1,17 @@
+Index: ../trunk-jpl/test/NightlyRun/test417.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test417.m	(revision 18246)
++++ ../trunk-jpl/test/NightlyRun/test417.m	(revision 18247)
+@@ -37,9 +37,11 @@
+ 'sample_type','lhs');
+ 
+ %%  a variety of parameters
+-md.qmu.params.evaluation_concurrency=1;
++md.qmu.params.direct=true;
+ md.qmu.params.analysis_driver='';
+ md.qmu.params.analysis_components='';
++md.qmu.params.evaluation_concurrency=1;
++md.qmu.params.tabular_graphics_data=true;
+ 
+ %partitioning
+ md.qmu.numberofpartitions=20;
Index: /issm/oecreview/Archive/17984-18295/ISSM-18247-18248.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18247-18248.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18247-18248.diff	(revision 18296)
@@ -0,0 +1,37 @@
+Index: ../trunk-jpl/examples/UncertaintyQuantification/runme.m
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 18247)
++++ ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 18248)
+@@ -1,5 +1,5 @@
+ %PIG Uncertainty Quantification Application
+-steps=[1]; 
++steps=[1:3]; 
+ 
+ if any(steps==1) 
+ 	disp('   Step 1: plot flux gates'); 
+@@ -132,11 +132,11 @@
+ 	'sample_type','lhs'); %random or lhs
+ 
+ 	%%  a variety of parameters
+-	md.qmu.params.evaluation_concurrency=1;
++	md.qmu.params.direct=true;
+ 	md.qmu.params.analysis_driver='';
+ 	md.qmu.params.analysis_components='';
++	md.qmu.params.evaluation_concurrency=1;
+ 	md.qmu.params.tabular_graphics_data=true;
+-	md.verbose=verbose('qmu',true);
+ 
+ 	md.stressbalance.restol=10^-5; %tighten tolerances for UQ analyses
+ 	
+@@ -204,9 +204,10 @@
+ 	'output','quiet');
+ 
+ 	%parameters
+-	md.qmu.params.evaluation_concurrency=1;
++	md.qmu.params.direct=true;
+ 	md.qmu.params.analysis_driver='';
+ 	md.qmu.params.analysis_components='';
++	md.qmu.params.evaluation_concurrency=1;
+ 	md.qmu.params.tabular_graphics_data=false;
+ 
+ 	md.stressbalance.restol=10^-5; %tighten for qmu analyses
Index: /issm/oecreview/Archive/17984-18295/ISSM-18248-18249.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18248-18249.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18248-18249.diff	(revision 18296)
@@ -0,0 +1,36 @@
+Index: ../trunk-jpl/examples/Pig/CheatSheet.m
+===================================================================
+--- ../trunk-jpl/examples/Pig/CheatSheet.m	(revision 18248)
++++ ../trunk-jpl/examples/Pig/CheatSheet.m	(revision 18249)
+@@ -1,18 +1,18 @@
+-if perform(org,'ModelHO')
+-  % Load Model
+-  mdHO = loadmodel('./Models/PIG.Control_drag');
+-  md.inversion.iscontrol=0;
++if any(steps==6)
++	% Load Model
++	md = loadmodel('./Models/PIG.Control_drag');
++	md.inversion.iscontrol=0;
+ 
+-  disp('   Extruding mesh')
+-  number_of_layers=3;
+-  md=extrude(md,number_of_layers,0.9);
++	disp('   Extruding mesh')
++	number_of_layers=3;
++	md=extrude(md,number_of_layers,0.9);
+ 
+-  disp('   Using HO Ice Flow Model')
+-  md=setflowequation(md, 'HO', 'all');
++	disp('   Using HO Ice Flow Model')
++	md=setflowequation(md, 'HO', 'all');
+ 
+-  % Solve
+-  md=solve(md,StressbalanceSolutionEnum);
++	% Solve
++	md=solve(md,StressbalanceSolutionEnum);
+ 
+-  % Save Model
+-  save ./Models/PIG.ModelHO md;
++	% Save Model
++	save ./Models/PIG.ModelHO md;
+ end
Index: /issm/oecreview/Archive/17984-18295/ISSM-18249-18250.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18249-18250.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18249-18250.diff	(revision 18296)
@@ -0,0 +1,24 @@
+Index: ../trunk-jpl/src/m/plot/plot_scatter.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/plot_scatter.m	(revision 18249)
++++ ../trunk-jpl/src/m/plot/plot_scatter.m	(revision 18250)
+@@ -5,6 +5,7 @@
+ %      plot_scatter(x,y,level,options);
+ %
+ %   Available options:
++%      'caxis'      : default is full range
+ %      'MarkerSize' : default is 3
+ %      'Line'       : use line instead of circles
+ %      'Cutoff'     : cut the line if the distance between 2 points is
+@@ -24,6 +25,11 @@
+ %Some processing
+ Min=min(level);
+ Max=max(level);
++if exist(options,'caxis');
++	range=getfieldvalue(options,'caxis');
++	Min=min(range);
++	Max=max(range);
++end
+ Siz=length(level);
+ nlab=10;
+ %Min=0;
Index: /issm/oecreview/Archive/17984-18295/ISSM-18250-18251.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18250-18251.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18250-18251.diff	(revision 18296)
@@ -0,0 +1,109 @@
+Index: ../trunk-jpl/src/m/plot/plot_elementstype.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/plot_elementstype.m	(revision 18250)
++++ ../trunk-jpl/src/m/plot/plot_elementstype.m	(revision 18251)
+@@ -16,46 +16,36 @@
+ %plot
+ subplot(width,width,i);
+ 
++plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options);
++return;
+ if is2d
+-	%None elements
+ 	posNONE=find(data==0);
+ 	A=elements(posNONE,1); B=elements(posNONE,2); C=elements(posNONE,3); 
+ 	p1=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',0,'FaceColor','flat','EdgeColor',edgecolor);
+-	%SIA elements
+ 	posH=find(data==1);
+ 	A=elements(posH,1); B=elements(posH,2); C=elements(posH,3); 
+ 	p2=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',1,'FaceColor','flat','EdgeColor',edgecolor);
+-	%SSA element
+ 	posM=find(data==2);
+ 	A=elements(posM,1); B=elements(posM,2); C=elements(posM,3); 
+-	p3=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',2,'FaceColor','flat','EdgeColor',edgecolor);
+-	%L1L2 element
+ 	posM=find(data==3);
+ 	A=elements(posM,1); B=elements(posM,2); C=elements(posM,3); 
+ 	p4=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',2,'FaceColor','flat','EdgeColor',edgecolor);
+-	%HO element
+ 	posP=find(data==4);
+ 	A=elements(posP,1); B=elements(posP,2); C=elements(posP,3); 
+ 	p5=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',3,'FaceColor','flat','EdgeColor',edgecolor);
+-	%FS elements
+ 	posS=find(data==5);
+ 	A=elements(posS,1); B=elements(posS,2); C=elements(posS,3); 
+ 	p6=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',4,'FaceColor','flat','EdgeColor',edgecolor);
+-	%SSAHO element
+ 	posMP=find(data==6);
+ 	A=elements(posMP,1); B=elements(posMP,2); C=elements(posMP,3); 
+ 	p7=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',5,'FaceColor','flat','EdgeColor',edgecolor);
+-	%HOFS elements
+ 	posPS=find(data==7);
+ 	A=elements(posPS,1); B=elements(posPS,2); C=elements(posPS,3); 
+ 	p8=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',7,'FaceColor','flat','EdgeColor',edgecolor);
+-	%SSAFS elements
+ 	posMS=find(data==8);
+ 	A=elements(posMS,1); B=elements(posMS,2); C=elements(posMS,3); 
+ 	p9=patch( 'Faces', [A B C], 'Vertices', [x y z],'CData',6,'FaceColor','flat','EdgeColor',edgecolor);
+-
+ else
+-	%None elements
+ 	PosNONE=find(data==0);
+ 	A=elements(PosNONE,1); B=elements(PosNONE,2); C=elements(PosNONE,3); D=elements(PosNONE,4); E=elements(PosNONE,5); F=elements(PosNONE,6);
+ 	p1=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
+@@ -63,7 +53,6 @@
+ 	patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 0,'FaceColor','flat','EdgeColor',edgecolor);
+-	%SIA elements
+ 	posH=find(data==1);
+ 	A=elements(posH,1); B=elements(posH,2); C=elements(posH,3); D=elements(posH,4); E=elements(posH,5); F=elements(posH,6);
+ 	p2=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor);
+@@ -71,7 +60,6 @@
+ 	patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 1,'FaceColor','flat','EdgeColor',edgecolor);
+-	%SSA elements
+ 	posM=find(data==2);
+ 	A=elements(posM,1); B=elements(posM,2); C=elements(posM,3); D=elements(posM,4); E=elements(posM,5); F=elements(posM,6);
+ 	p3=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor);
+@@ -79,7 +67,6 @@
+ 	patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 2,'FaceColor','flat','EdgeColor',edgecolor);
+-	%L1L2 elements
+ 	posP=find(data==3);
+ 	A=elements(posP,1); B=elements(posP,2); C=elements(posP,3); D=elements(posP,4); E=elements(posP,5); F=elements(posP,6);
+ 	p4=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
+@@ -87,7 +74,6 @@
+ 	patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
+-	%HO elements
+ 	posP=find(data==3);
+ 	A=elements(posP,1); B=elements(posP,2); C=elements(posP,3); D=elements(posP,4); E=elements(posP,5); F=elements(posP,6);
+ 	p5=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
+@@ -95,7 +81,6 @@
+ 	patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 3,'FaceColor','flat','EdgeColor',edgecolor);
+-	%FS elements
+ 	posS=find(data==4);
+ 	A=elements(posS,1); B=elements(posS,2); C=elements(posS,3); D=elements(posS,4); E=elements(posS,5); F=elements(posS,6);
+ 	p6=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 4,'FaceColor','flat','EdgeColor',edgecolor);
+@@ -103,7 +88,6 @@
+ 	patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 4,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 4,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 4,'FaceColor','flat','EdgeColor',edgecolor);
+-	%SSAHO elements
+ 	posP=find(data==5);
+ 	A=elements(posP,1); B=elements(posP,2); C=elements(posP,3); D=elements(posP,4); E=elements(posP,5); F=elements(posP,6);
+ 	p7=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 5,'FaceColor','flat','EdgeColor',edgecolor);
+@@ -119,7 +103,6 @@
+ 	patch( 'Faces', [A B E D],'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [B E F C],'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor);
+ 	patch( 'Faces', [C A D F],'Vertices', [x y z],'CData', 7,'FaceColor','flat','EdgeColor',edgecolor);
+-	%SSAFS elements
+ 	PosMS=find(data==6);
+ 	A=elements(PosMS,1); B=elements(PosMS,2); C=elements(PosMS,3); D=elements(PosMS,4); E=elements(PosMS,5); F=elements(PosMS,6);
+ 	p9=patch( 'Faces', [A B C],'Vertices', [x y z],'CData', 6,'FaceColor','flat','EdgeColor',edgecolor);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18251-18252.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18251-18252.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18251-18252.diff	(revision 18296)
@@ -0,0 +1,22 @@
+Index: ../trunk-jpl/src/m/plot/processdata.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/processdata.m	(revision 18251)
++++ ../trunk-jpl/src/m/plot/processdata.m	(revision 18252)
+@@ -16,6 +16,17 @@
+ 	error('plotmodel error message: data provided is empty');
+ end
+ 
++%specials for struct
++if isstruct(data),
++	disp('data provided is a struct, please enter the number of the field you would like to display:');
++	F=fields(data);
++	for i=1:numel(F),
++		disp(['   ' num2str(i) ': ' F{i} ]);
++	end
++	choice=input(['please enter the field number? (between 1 and ' num2str(numel(F)) ')  ']);
++	[data datatype]=processdata(md,data.(F{choice}),options);
++end
++
+ %Process NaN if any (do not know before mask is applied)
+ if exist(options,'nan')
+ 	data(find(isnan(data)))=getfieldvalue(options,'nan',0);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18252-18253.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18252-18253.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18252-18253.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/m/plot/processdata.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/processdata.m	(revision 18252)
++++ ../trunk-jpl/src/m/plot/processdata.m	(revision 18253)
+@@ -18,7 +18,7 @@
+ 
+ %specials for struct
+ if isstruct(data),
+-	disp('data provided is a struct, please enter the number of the field you would like to display:');
++	disp('data provided is a struct with the following fields:');
+ 	F=fields(data);
+ 	for i=1:numel(F),
+ 		disp(['   ' num2str(i) ': ' F{i} ]);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18253-18254.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18253-18254.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18253-18254.diff	(revision 18296)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp
+===================================================================
+--- ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 18253)
++++ ../trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp	(revision 18254)
+@@ -41,7 +41,8 @@
+ 	MatCreate(IssmComm::GetComm(),&this->matrix);
+ 	MatSetSizes(this->matrix,m,n,M,N);
+ 	MatSetFromOptions(this->matrix);
+-	MatMPIAIJSetPreallocation(this->matrix,0,d_nnz,0,o_nnz);
++	PetscErrorCode ierr = MatMPIAIJSetPreallocation(this->matrix,0,d_nnz,0,o_nnz);
++	if(ierr) _error_("PETSc could not allocate matrix (probably not enough memory)");
+ //	MatSetOption(this->matrix,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_FALSE);
+ 
+ }
+@@ -159,9 +160,8 @@
+ /*}}}*/
+ void PetscMat::SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode){/*{{{*/
+ 
+-	PetscErrorCode ierr;
+-	ierr = MatSetValues(this->matrix,m,idxm,n,idxn,values,ISSMToPetscInsertMode(mode));
+-	if(ierr) _error_("PETSC's MatSetValues reported an error");
++	PetscErrorCode ierr = MatSetValues(this->matrix,m,idxm,n,idxn,values,ISSMToPetscInsertMode(mode));
++	if(ierr) _error_("PETSc's MatSetValues reported an error");
+ 
+ }
+ /*}}}*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18254-18255.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18254-18255.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18254-18255.diff	(revision 18296)
@@ -0,0 +1,45 @@
+Index: ../trunk-jpl/src/m/plot/plot_transient_movie.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/plot_transient_movie.m	(revision 18254)
++++ ../trunk-jpl/src/m/plot/plot_transient_movie.m	(revision 18255)
+@@ -12,7 +12,22 @@
+ 	if exist(options,'transient_movie_field'),
+ 		field=getfieldvalue(options,'transient_movie_field');
+ 	else
+-		error('specify transient_movie_field in options list');
++		disp('List of available fields:');
++		F=fields(md.results.TransientSolution(1));
++		num = [];
++		for i=1:numel(F),
++			if ~strcmp(F{i},'time') & ...
++				~strcmp(F{i},'step') & ...
++				~strcmp(F{i},'errlog') & ...
++				~strcmp(F{i},'outlog') & ...
++				~strcmp(F{i},'MaxIterationConvergenceFlag') & ...
++				~strcmp(F{i},'SolutionType'),
++				disp(['   ' num2str(i) ': ' F{i} ]);
++				num = [num i];
++			end
++		end
++		choice=input(['please enter the field number? (between ' num2str(min(num)) ' and ' num2str(max(num)) ')  ']);
++		field =  F{choice};
+ 	end
+ 
+ 	results=md.results.TransientSolution;
+@@ -32,6 +47,7 @@
+ 			[x y z elements is2d isplanet]=processmesh(md,results(i).(field),options);
+ 			[data datatype]=processdata(md,results(i).(field),options);
+ 
++			clf;
+ 			titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year'];
+ 			plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
+ 			apply_options_movie(md,options,titlestring);
+@@ -48,7 +64,7 @@
+ 					images(:,:,1,nstep) = rgb2ind(frame.cdata,map,'nodither');
+ 				end
+ 			else
+-				pause(0.1)
++				pause(0.5)
+ 			end
+ 			nstep=nstep+1;
+ 		end
Index: /issm/oecreview/Archive/17984-18295/ISSM-18255-18256.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18255-18256.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18255-18256.diff	(revision 18296)
@@ -0,0 +1,36 @@
+Index: ../trunk-jpl/src/m/plot/plot_transient_movie.m
+===================================================================
+--- ../trunk-jpl/src/m/plot/plot_transient_movie.m	(revision 18255)
++++ ../trunk-jpl/src/m/plot/plot_transient_movie.m	(revision 18256)
+@@ -38,8 +38,21 @@
+ 	else
+ 		steps=1:length(results);
+ 	end
+-	results=md.results.TransientSolution;
++
++	%calculate caxis
++	if ~exist(options,'caxis'),
++		range = [Inf -Inf];
++		for i=steps
++			[data datatype]=processdata(md,results(i).(field),options);
++			range(1) = min(range(1),min(data));
++			range(2) = max(range(2),max(data));
++		end
++		options=addfielddefault(options,'caxis',range);
++	end
++
++	%display movie
+ 	nstep=1;
++	deltat = getfieldvalue(options,'pause',.5);
+ 	for i=steps
+ 
+ 		if ~isempty(results(i).(field)),
+@@ -64,7 +77,7 @@
+ 					images(:,:,1,nstep) = rgb2ind(frame.cdata,map,'nodither');
+ 				end
+ 			else
+-				pause(0.5)
++				pause(deltat)
+ 			end
+ 			nstep=nstep+1;
+ 		end
Index: /issm/oecreview/Archive/17984-18295/ISSM-18256-18257.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18256-18257.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18256-18257.diff	(revision 18296)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.cpp	(revision 18256)
++++ ../trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.cpp	(revision 18257)
+@@ -24,6 +24,9 @@
+ 	int analysisenum;
+ 	femmodel->parameters->FindParam(&analysisenum,AnalysisTypeEnum);
+ 
++	/*Display message*/
++	if(VerboseModule()) _printf0_("   Updating inputs from solution\n");
++
+ 	Analysis* analysis = EnumToAnalysis(analysisenum);
+ 	for(int i=0;i<femmodel->elements->Size();i++){
+ 		Element* element=dynamic_cast<Element*>(femmodel->elements->GetObjectByOffset(i));
Index: /issm/oecreview/Archive/17984-18295/ISSM-18257-18258.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18257-18258.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18257-18258.diff	(revision 18296)
@@ -0,0 +1,14 @@
+Index: ../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 18257)
++++ ../trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp	(revision 18258)
+@@ -16,6 +16,9 @@
+ 	Vector<IssmDouble>  *gradient      = NULL;
+ 	Vector<IssmDouble> **gradient_list = NULL;
+ 
++	/*Display message*/
++	if(VerboseModule()) _printf0_("   Computing cost function gradient\n");
++
+ 	/*retrieve some parameters: */
+ 	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);   _assert_(num_controls);
+ 	parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18258-18259.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18258-18259.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18258-18259.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/classes/FemModel.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18258)
++++ ../trunk-jpl/src/c/classes/FemModel.cpp	(revision 18259)
+@@ -1376,7 +1376,7 @@
+ 			element->JacobianDeterminant(&Jdet,xyz_list,gauss);
+ 
+ 			/*Get all parameters at gaussian point*/
+-			weights_input->GetInputValue(&weight,gauss,ThicknessAcrossGradientEnum);
++			weights_input->GetInputValue(&weight,gauss,ThicknessAbsMisfitEnum);
+ 			thickness_input->GetInputDerivativeValue(&dp[0],xyz_list,gauss);
+ 
+ 			/*Tikhonov regularization: J = 1/2 ((dp/dx)^2 + (dp/dy)^2) */ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18259-18260.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18259-18260.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18259-18260.diff	(revision 18296)
@@ -0,0 +1,33 @@
+Index: ../trunk-jpl/examples/Pig/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Pig/runme.m	(revision 18259)
++++ ../trunk-jpl/examples/Pig/runme.m	(revision 18260)
+@@ -1,5 +1,5 @@
+ %Which steps to be performed
+-steps=[1:5] ;
++steps=[1] ;
+ 
+ %Run Steps
+ 
+@@ -190,7 +190,7 @@
+ 
+ 	% Disable inversion
+ 
+-	%Extrude Mesh
++	% Extrude Mesh
+ 
+ 	% Set Flowequation
+ 
+@@ -210,9 +210,9 @@
+ 	basal=find(mdHO.mesh.vertexonbase);
+ 	surf=find(mdHO.mesh.vertexonsurface);
+ 
+-	plotmodel(md,'nlines',3,'ncols',2,'unit#all','km','axis#all','equal',...
+-						'xlim#all',[min(md.mesh.x) max(md.mesh.x)]/10^3,...
+-						'ylim#all',[min(md.mesh.y) max(md.mesh.y)]/10^3,...
++	plotmodel(mdHO,'nlines',3,'ncols',2,'unit#all','km','axis#all','equal',...
++						'xlim#all',[min(mdHO.mesh.x) max(mdHO.mesh.x)]/10^3,...
++						'ylim#all',[min(mdHO.mesh.y) max(mdHO.mesh.y)]/10^3,...
+ 						'FontSize#all',12,...
+ 						'data',mdHO.initialization.vel,'title','Observed velocity',...
+ 						'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdHO.initialization.vel(surf)),'title','(HO-observed) velocities',...
Index: /issm/oecreview/Archive/17984-18295/ISSM-18260-18261.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18260-18261.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18260-18261.diff	(revision 18296)
@@ -0,0 +1,29 @@
+Index: ../trunk-jpl/m4/issm_options.m4
+===================================================================
+--- ../trunk-jpl/m4/issm_options.m4	(revision 18260)
++++ ../trunk-jpl/m4/issm_options.m4	(revision 18261)
+@@ -1635,24 +1635,6 @@
+ 	AM_CONDITIONAL([KRIGING], [test x$HAVE_KRIGING = xyes])
+ 	AC_MSG_RESULT($HAVE_KRIGING)
+ 	dnl }}}
+-	dnl with-gia{{{
+-		AC_ARG_WITH([gia],
+-		AS_HELP_STRING([--with-gia = YES], [compile with gia capabilities (default is no)]),
+-		[GIA=$withval],[GIA=no]) 
+-	   AC_MSG_CHECKING(for gia capability compilation)
+-
+-		HAVE_GIA=no
+-		if test "x$GIA" = "xyes"; then
+-			if test "x$HAVE_MATH77" = "xno"; then
+-				 AC_MSG_ERROR([gia requires compilation of math77 library! Reconfigure with --with-math77 option on]);
+-			else
+-				HAVE_GIA=yes
+-				AC_DEFINE([_HAVE_GIA_],[1],[with gia capability])
+-		   fi
+-		fi
+-		AM_CONDITIONAL([GIA], [test x$HAVE_GIA = xyes])
+-		AC_MSG_RESULT($HAVE_GIA)
+-		dnl }}}
+ 	AX_ANALYSES_SELECTION
+ 
+ 	dnl Platform specifics
Index: /issm/oecreview/Archive/17984-18295/ISSM-18261-18262.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18261-18262.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18261-18262.diff	(revision 18296)
@@ -0,0 +1,16 @@
+Index: ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 18261)
++++ ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 18262)
+@@ -177,9 +177,10 @@
+ 	int numnodes       = element->GetNumberOfNodes();
+ 	//int numnodessigma  = element->NumberofNodes(P2Enum);
+ 	int numnodessigma;
++
++	element->FindParam(&dim,DomainDimensionEnum);
+ 	if(dim==2) numnodessigma=3;
+ 	else numnodessigma=6;
+-	element->FindParam(&dim,DomainDimensionEnum);
+ 
+ 	/*Fetch dof list and allocate solution vector*/
+ 	element->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18262-18263.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18262-18263.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18262-18263.diff	(revision 18296)
@@ -0,0 +1,161 @@
+Index: ../trunk-jpl/examples/Greenland/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Greenland/runme.m	(revision 18262)
++++ ../trunk-jpl/examples/Greenland/runme.m	(revision 18263)
+@@ -114,7 +114,6 @@
+ if any(steps==5)
+ 	disp('   Step 5: Plotting'); 
+ 	md = loadmodel('./Models/Greenland.Transient');
+-	%md = loadmodel('./Models/Greenland.HistoricTransient');
+ 
+ 	%Planview plots
+ 	plotmodel(md,'data',md.results.TransientSolution(end).Vel,'caxis',[1e-1 6000],...
+@@ -145,8 +144,7 @@
+ end
+ 
+ if any(steps==6)
+-	disp('   Step 6: Historical Relaxation run');
+-	md = loadmodel('./Models/Greenland.Control_drag');
++	disp('   Step 6: Extract Box SMB');
+ 
+ 	ncbox='../Data/Box_Greenland_SMB_monthly_1840-2012_5km_ver20140421.nc';
+ 
+@@ -160,11 +158,30 @@
+ 	smbbox = ncread(ncbox,'SMB');
+ 	[x1 y1]=ll2xy(lat,lon,+1,45,70);
+ 
+-	%surface mass balance
++	years_of_simulation = 1840:2012;
++	t = [years_of_simulation(1):1/12:years_of_simulation(end)+11/12];
++
++	%Area of grid for 5km box
++	area_of_grid=5000*5000;
++	totalsmb=reshape(sum(sum(smbbox,1),2),length(t),1);
++
++	%save surface mass balance mat dataset
+ 	smbmean = mean(mean(smbbox,3),4);
+-	save -v7.3 smbbox smbbox x1 y1;
+-	clear smbbox
++	save -v7.3 smbbox smbmean totalsmb smbbox x1 y1 t;
+ 
++	%plot a time series of total SMB
++	plot(t,totalsmb); title('Total Surface mass balance, m^3');
++
++	clear smbbox smbmean totalsmb x1 y1 t
++
++end
++
++if any(steps==7)
++	disp('   Step 7: Historical Relaxation run');
++	md = loadmodel('./Models/Greenland.Control_drag');
++
++	load smbbox
++
+ 	%Interpolate and set surface mass balance
+ 	index = BamgTriangulate(x1(:),y1(:));
+ 	smb_mo = InterpFromMeshToMesh2d(index,x1(:),y1(:),smbmean(:),xi,yi);
+@@ -189,10 +206,48 @@
+ 	save ./Models/Greenland.HistoricTransient md;
+ end
+ 
+-if any(steps==7)
+-	disp('   Step 7: Box Transient run');
++if any(steps==8)
++	disp('   Step 8: Plotting exercise');
++
++	%load historic transient model
+ 	md = loadmodel('./Models/Greenland.HistoricTransient');
+ 
++	%Create Line Plots of relaxation run.  Create a figure.
++	figure
++
++	%Save surface mass balance, by looping through 200 years, or 1000 steps
++	surfmb=[]; for i=1:100; surfmb=[surfmb ...
++		md.results.TransientSolution(i).SurfaceforcingsMassBalance]; end
++
++	%Plot surface mass balance time series in first subplot
++	subplot(3,1,1); plot([0.2:0.2:200],mean(surfmb)); 
++	
++	%Title this plot Mean surface mass balance
++	title('Mean Surface mass balance');
++
++	%Save velocity by looping through 1000 steps
++	vel=[]; for i=1:100; vel=[vel md.results.TransientSolution(i).Vel]; end
++
++	%Plot velocity time series in second subplot
++	subplot(3,1,2); plot([0.2:0.2:200],mean(vel)); 
++	
++	%Title this plot Mean Velocity
++	title('Mean Velocity');
++
++	%Save Ice Volume by looping through 1000 steps
++	volume=[]; for i=1:100; volume=[volume md.results.TransientSolution(i).IceVolume]; end
++
++	%Plot volume time series in third subplot
++	subplot(3,1,3); plot([0.2:0.2:200],volume); 
++	
++	%Title this plot Mean Velocity and add an x label of years
++	title('Ice Volume'); xlabel('years');
++end
++
++if any(steps==9)
++	disp('   Step 9: Box Transient run');
++	md = loadmodel('./Models/Greenland.HistoricTransient');
++
+ 	%load past transient results
+ 	md.geometry.base=md.results.TransientSolution(end).Base;
+ 	md.geometry.thickness=md.results.TransientSolution(end).Thickness;
+@@ -245,8 +300,8 @@
+ 	save ./Models/Greenland.BoxTransient md;
+ end
+ 
+-if any(steps==8)
+-	disp('   Step 8: Plot Box Transient');
++if any(steps==10)
++	disp('   Step 10: Plot Box Transient');
+ 	md = loadmodel('./Models/Greenland.BoxTransient');
+ 
+ 	%Set years run
+Index: ../trunk-jpl/examples/Greenland/CheatSheet.m
+===================================================================
+--- ../trunk-jpl/examples/Greenland/CheatSheet.m	(revision 0)
++++ ../trunk-jpl/examples/Greenland/CheatSheet.m	(revision 18263)
+@@ -0,0 +1,38 @@
++if any(steps==8)
++	disp('   Step 8: Plotting exercise');
++
++	%load historic transient model
++	md = loadmodel('./Models/Greenland.HistoricTransient');
++
++	%Create Line Plots of relaxation run.  Create a figure.
++	figure
++
++	%Save surface mass balance, by looping through 200 years, or 1000 steps
++	surfmb=[]; for i=1:100; surfmb=[surfmb ...
++		md.results.TransientSolution(i).SurfaceforcingsMassBalance]; end
++
++	%Plot surface mass balance time series in first subplot
++	subplot(3,1,1); plot([0.2:0.2:200],mean(surfmb));
++
++	%Title this plot Mean surface mass balance
++	title('Mean Surface mass balance');
++
++	%Save velocity by looping through 1000 steps
++	vel=[]; for i=1:100; vel=[vel md.results.TransientSolution(i).Vel]; end
++
++	%Plot velocity time series in second subplot
++	subplot(3,1,2); plot([0.2:0.2:200],mean(vel));
++
++	%Title this plot Mean Velocity
++	title('Mean Velocity');
++
++	%Save Ice Volume by looping through 1000 steps
++	volume=[]; for i=1:100; volume=[volume md.results.TransientSolution(i).IceVolume]; end
++
++	%Plot volume time series in third subplot
++	subplot(3,1,3); plot([0.2:0.2:200],volume);
++
++	%Title this plot Mean Velocity and add an x label of years
++	title('Ice Volume'); xlabel('years');
++
++end
Index: /issm/oecreview/Archive/17984-18295/ISSM-18263-18264.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18263-18264.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18263-18264.diff	(revision 18296)
@@ -0,0 +1,117 @@
+Index: ../trunk-jpl/examples/Greenland/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Greenland/runme.m	(revision 18263)
++++ ../trunk-jpl/examples/Greenland/runme.m	(revision 18264)
+@@ -145,6 +145,7 @@
+ 
+ if any(steps==6)
+ 	disp('   Step 6: Extract Box SMB');
++	md = loadmodel('./Models/Greenland.Transient');
+ 
+ 	ncbox='../Data/Box_Greenland_SMB_monthly_1840-2012_5km_ver20140421.nc';
+ 
+@@ -163,16 +164,16 @@
+ 
+ 	%Area of grid for 5km box
+ 	area_of_grid=5000*5000;
+-	totalsmb=reshape(sum(sum(smbbox,1),2),length(t),1);
++	totalsmb=reshape(sum(sum(smbbox/1000,1),2),length(t),1)*area_of_grid;
+ 
+ 	%save surface mass balance mat dataset
+ 	smbmean = mean(mean(smbbox,3),4);
+ 	save -v7.3 smbbox smbmean totalsmb smbbox x1 y1 t;
+ 
+ 	%plot a time series of total SMB
+-	plot(t,totalsmb); title('Total Surface mass balance, m^3');
++	plot(t,totalsmb/1e9); title('Total Surface mass balance, Gt'); xlabel('year'); ylabel('Gt/yr');
+ 
+-	clear smbbox smbmean totalsmb x1 y1 t
++	clear smbbox
+ 
+ end
+ 
+@@ -210,38 +211,36 @@
+ 	disp('   Step 8: Plotting exercise');
+ 
+ 	%load historic transient model
+-	md = loadmodel('./Models/Greenland.HistoricTransient');
+ 
+ 	%Create Line Plots of relaxation run.  Create a figure.
+-	figure
+ 
++
+ 	%Save surface mass balance, by looping through 200 years, or 1000 steps
+-	surfmb=[]; for i=1:100; surfmb=[surfmb ...
+-		md.results.TransientSolution(i).SurfaceforcingsMassBalance]; end
+ 
++
+ 	%Plot surface mass balance time series in first subplot
+-	subplot(3,1,1); plot([0.2:0.2:200],mean(surfmb)); 
++
+ 	
+ 	%Title this plot Mean surface mass balance
+-	title('Mean Surface mass balance');
+ 
++
+ 	%Save velocity by looping through 1000 steps
+-	vel=[]; for i=1:100; vel=[vel md.results.TransientSolution(i).Vel]; end
+ 
++
+ 	%Plot velocity time series in second subplot
+-	subplot(3,1,2); plot([0.2:0.2:200],mean(vel)); 
++
+ 	
+ 	%Title this plot Mean Velocity
+-	title('Mean Velocity');
+ 
++
+ 	%Save Ice Volume by looping through 1000 steps
+-	volume=[]; for i=1:100; volume=[volume md.results.TransientSolution(i).IceVolume]; end
+ 
++
+ 	%Plot volume time series in third subplot
+-	subplot(3,1,3); plot([0.2:0.2:200],volume); 
++
+ 	
+ 	%Title this plot Mean Velocity and add an x label of years
+-	title('Ice Volume'); xlabel('years');
++
+ end
+ 
+ if any(steps==9)
+Index: ../trunk-jpl/examples/Greenland/CheatSheet.m
+===================================================================
+--- ../trunk-jpl/examples/Greenland/CheatSheet.m	(revision 18263)
++++ ../trunk-jpl/examples/Greenland/CheatSheet.m	(revision 18264)
+@@ -8,7 +8,7 @@
+ 	figure
+ 
+ 	%Save surface mass balance, by looping through 200 years, or 1000 steps
+-	surfmb=[]; for i=1:100; surfmb=[surfmb ...
++	surfmb=[]; for i=1:1000; surfmb=[surfmb ...
+ 		md.results.TransientSolution(i).SurfaceforcingsMassBalance]; end
+ 
+ 	%Plot surface mass balance time series in first subplot
+@@ -18,7 +18,7 @@
+ 	title('Mean Surface mass balance');
+ 
+ 	%Save velocity by looping through 1000 steps
+-	vel=[]; for i=1:100; vel=[vel md.results.TransientSolution(i).Vel]; end
++	vel=[]; for i=1:1000; vel=[vel md.results.TransientSolution(i).Vel]; end
+ 
+ 	%Plot velocity time series in second subplot
+ 	subplot(3,1,2); plot([0.2:0.2:200],mean(vel));
+@@ -27,12 +27,11 @@
+ 	title('Mean Velocity');
+ 
+ 	%Save Ice Volume by looping through 1000 steps
+-	volume=[]; for i=1:100; volume=[volume md.results.TransientSolution(i).IceVolume]; end
++	volume=[]; for i=1:1000; volume=[volume md.results.TransientSolution(i).IceVolume]; end
+ 
+ 	%Plot volume time series in third subplot
+ 	subplot(3,1,3); plot([0.2:0.2:200],volume);
+ 
+ 	%Title this plot Mean Velocity and add an x label of years
+ 	title('Ice Volume'); xlabel('years');
+-
+ end
Index: /issm/oecreview/Archive/17984-18295/ISSM-18264-18265.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18264-18265.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18264-18265.diff	(revision 18296)
@@ -0,0 +1,15 @@
+Index: ../trunk-jpl/src/m/classes/SMBgradients.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/SMBgradients.m	(revision 18264)
++++ ../trunk-jpl/src/m/classes/SMBgradients.m	(revision 18265)
+@@ -47,8 +47,8 @@
+ 			disp(sprintf('   surface forcings parameters:'));
+ 
+ 			disp(sprintf('\n   SMB gradients parameters:'));
+-			fielddisplay(obj,'href',' reference elevation from which deviation is used to calculate SMB adjustment in smb gradients method');
+-			fielddisplay(obj,'smbref',' reference smb from which deviation is calculated in smb gradients method');
++			fielddisplay(obj,'href',' reference elevation from which deviation is used to calculate SMB adjustment in smb gradients method [m]');
++			fielddisplay(obj,'smbref',' reference smb from which deviation is calculated in smb gradients method [mm/yr water equiv]');
+ 			fielddisplay(obj,'b_pos',' slope of hs - smb regression line for accumulation regime required if smb gradients is activated');
+ 			fielddisplay(obj,'b_neg',' slope of hs - smb regression line for ablation regime required if smb gradients is activated');
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18265-18266.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18265-18266.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18265-18266.diff	(revision 18296)
@@ -0,0 +1,39 @@
+Index: ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
+===================================================================
+--- ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 18265)
++++ ../trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp	(revision 18266)
+@@ -71,7 +71,6 @@
+ 		IssmDouble* Smbref      = xNew<IssmDouble>(numvertices); // reference SMB to which deviations are added
+ 		IssmDouble* b_pos       = xNew<IssmDouble>(numvertices); // Hs-SMB relation parameter
+ 		IssmDouble* b_neg       = xNew<IssmDouble>(numvertices); // Hs-SMB relation paremeter
+-		IssmDouble* h           = xNew<IssmDouble>(numvertices); // ice thickness (m)
+ 		IssmDouble* s           = xNew<IssmDouble>(numvertices); // surface elevation (m)
+ 		IssmDouble* smb         = xNew<IssmDouble>(numvertices);
+ 
+@@ -81,8 +80,7 @@
+ 		element->GetInputListOnVertices(b_pos,SurfaceforcingsBPosEnum);
+ 		element->GetInputListOnVertices(b_neg,SurfaceforcingsBNegEnum);
+ 
+-		/*Recover surface elevatio at vertices: */
+-		element->GetInputListOnVertices(h,ThicknessEnum);
++		/*Recover surface elevation at vertices: */
+ 		element->GetInputListOnVertices(s,SurfaceEnum);
+ 
+ 		/*Get material parameters :*/
+@@ -97,7 +95,7 @@
+ 			else{
+ 				smb[v]=Smbref[v]+b_neg[v]*(s[v]-Href[v]);
+ 			}
+-			smb[v]=smb[v]/rho_ice;      // SMB in m/y ice
++			smb[v]=smb[v]/1000*rho_water/rho_ice;      // SMB in m/y ice
+ 		}  //end of the loop over the vertices
+ 
+ 		/*Add input to element and Free memory*/
+@@ -106,7 +104,6 @@
+ 		xDelete<IssmDouble>(Smbref);
+ 		xDelete<IssmDouble>(b_pos);
+ 		xDelete<IssmDouble>(b_neg);
+-		xDelete<IssmDouble>(h);
+ 		xDelete<IssmDouble>(s);
+ 		xDelete<IssmDouble>(smb);
+ 	}
Index: /issm/oecreview/Archive/17984-18295/ISSM-18266-18267.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18266-18267.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18266-18267.diff	(revision 18296)
@@ -0,0 +1,1431 @@
+Index: ../trunk-jpl/examples/Pig/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Pig/runme.m	(revision 18266)
++++ ../trunk-jpl/examples/Pig/runme.m	(revision 18267)
+@@ -187,16 +187,20 @@
+ if any(steps==6)
+ 
+ 	% Load Model
++	md = loadmodel('./Models/PIG.Control_drag');
++	md.inversion.iscontrol=0;
+ 
+-	% Disable inversion
++	disp('   Extruding mesh')
++	number_of_layers=3;
++	md=extrude(md,number_of_layers,0.9);
+ 
+ 	% Extrude Mesh
+ 
+-	% Set Flowequation
+-
+ 	% Solve
++	md=solve(md,StressbalanceSolutionEnum);
+ 
+ 	% Save Model
++	save ./Models/PIG.ModelHO md;
+ 
+ end
+ % }}}
+@@ -214,15 +218,15 @@
+ 						'xlim#all',[min(mdHO.mesh.x) max(mdHO.mesh.x)]/10^3,...
+ 						'ylim#all',[min(mdHO.mesh.y) max(mdHO.mesh.y)]/10^3,...
+ 						'FontSize#all',12,...
+-						'data',mdHO.initialization.vel,'title','Observed velocity',...
++						'data',mdSSA.initialization.vel,'title','Observed velocity',...
+ 						'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdHO.initialization.vel(surf)),'title','(HO-observed) velocities',...
+ 						'data',mdSSA.results.StressbalanceSolution.Vel,'title','Modeled SSA Velocity',...
+ 						'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdSSA.results.StressbalanceSolution.Vel),'title','(HO-SSA) velocities',...
+-						'data',mdHO.results.StressbalanceSolution.Vel,'title','Modeled HO surface Velocities',...
++						'data',project2d(mdHO,mdHO.results.StressbalanceSolution.Vel,1),'title','Modeled HO surface Velocities',...
+ 						'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdHO.results.StressbalanceSolution.Vel(basal)),'title','(HOsurf-HO base) velocities',...
+ 						'caxis#1',([1.5,4000]),'caxis#3',([1.5,4000]),'caxis#5',([1.5,4000]),...
+ 						'colorbar#all','on','view#all',2,...
+ 						'colorbartitle#all','[m/yr]',...
+-						'layer#5',1, 'log#1', 10,'log#3', 10,'log#5', 10);
++						'log#1', 10,'log#3', 10,'log#5', 10,'gridded#all',1);
+ end
+ % }}}
+Index: ../trunk-jpl/examples/UncertaintyQuantification/runme.m
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 18266)
++++ ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 18267)
+@@ -1,5 +1,5 @@
+ %PIG Uncertainty Quantification Application
+-steps=[1:3]; 
++steps=[7]; 
+ 
+ if any(steps==1) 
+ 	disp('   Step 1: plot flux gates'); 
+@@ -161,11 +161,11 @@
+ 	%all types of variables and responses: scaled_Thickness, indexed_MassFlux_i,MaxVel,nodal_DragCoefficient_i. scaled variables are expanded.
+ 
+ 	%variables
++	md.qmu.variables.Thickness=normal_uncertain('scaled_Thickness',1,0.05);
+ 	md.qmu.variables.DragCoefficient=normal_uncertain(...
+ 	'scaled_FrictionCoefficient',1,0.05);
+ 	md.qmu.variables.rheology_B=normal_uncertain(...
+ 	'scaled_MaterialsRheologyB',1,0.05);
+-	md.qmu.variables.Thickness=normal_uncertain('scaled_Thickness',1,0.05);
+ 
+ 	%responses
+ 	md.qmu.responses.MassFlux1=response_function('indexed_MassFlux_1',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+Index: ../trunk-jpl/examples/IceBridge/Jak_outline.exp
+===================================================================
+--- ../trunk-jpl/examples/IceBridge/Jak_outline.exp	(revision 0)
++++ ../trunk-jpl/examples/IceBridge/Jak_outline.exp	(revision 18267)
+@@ -0,0 +1,17 @@
++## Name:Jak
++## Icon:0
++# Points Count Value
++11 1.000000
++# X pos Y pos
++-421561.7247949215 -2216716.3488182197
++-386019.6416099078 -2203459.4896082953
++-351446.8879663036 -2185999.2360147359
++-289086.6874689616 -2214129.6445821370
++-255160.1535196303 -2282353.9688088228
++-340138.0433165266 -2317597.8140254519
++-383306.1449952667 -2302506.6581698526
++-416391.9672407377 -2279120.5885137189
++-448056.7322601135 -2246463.4475331730
++-429126.8716234095 -2231167.6696134652
++-421561.7247949215 -2216716.3488182197
++
+Index: ../trunk-jpl/examples/IceBridge/Greenland.par
+===================================================================
+--- ../trunk-jpl/examples/IceBridge/Greenland.par	(revision 0)
++++ ../trunk-jpl/examples/IceBridge/Greenland.par	(revision 18267)
+@@ -0,0 +1,104 @@
++%Name and hemisphere
++md.miscellaneous.name='SeaRISEgreenland';
++md.mesh.hemisphere='n';
++
++disp('   Loading SeaRISE data from NetCDF');
++ncdata='../Data/Greenland_5km_dev1.2.nc';
++x1    = ncread(ncdata,'x1');
++y1    = ncread(ncdata,'y1');
++usrf  = ncread(ncdata,'usrf')';
++topg  = ncread(ncdata,'topg')';
++velx  = ncread(ncdata,'surfvelx')';
++vely  = ncread(ncdata,'surfvely')';
++temp  = ncread(ncdata,'airtemp2m')';
++smb   = ncread(ncdata,'smb')';
++gflux = ncread(ncdata,'bheatflx')';
++
++disp('   Interpolating surface and bedrock');
++md.geometry.base     = InterpFromGridToMesh(x1,y1,topg,md.mesh.x,md.mesh.y,0);
++md.geometry.surface = InterpFromGridToMesh(x1,y1,usrf,md.mesh.x,md.mesh.y,0);
++
++disp('   Constructing thickness');
++md.geometry.thickness=md.geometry.surface-md.geometry.base;
++
++%Set min thickness to 1 meter
++pos0=find(md.geometry.thickness<=0);
++md.geometry.thickness(pos0)=1;
++md.geometry.surface=md.geometry.thickness+md.geometry.base;
++
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++%Reading IceBridge data for Jakobshavn
++disp('      reading IceBridge Jakobshavn bedrock');
++fid  = fopen('../Data/Jakobshavn_2008_2011_Composite_XYZGrid.txt');
++titles = fgets(fid); data = fscanf(fid,'%g,%g,%g,%g,%g',[5 266400])';
++fclose(fid);
++
++[xi,yi]= ll2xy(md.mesh.lat,md.mesh.long,+1,45,70);
++bed  = flipud(reshape(data(:,5),[360 740])); bed(find(bed==-9999))=NaN;
++bedy = flipud(reshape(data(:,1),[360 740]));
++bedx = flipud(reshape(data(:,2),[360 740]));
++
++%Insert Icebridge bed and recalculate thickness
++bed_jks=InterpFromGridToMesh(bedx(1,:)',bedy(:,1),bed,xi,yi,NaN);
++in=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,...
++	'./Jak_grounded.exp','node',1);
++bed_jks(~in)=NaN;
++pos=find(~isnan(bed_jks));
++md.geometry.base(pos)=bed_jks(pos);
++md.geometry.thickness=md.geometry.surface-md.geometry.base;
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++
++disp('   Interpolating velocities ');
++md.inversion.vx_obs  = InterpFromGridToMesh(x1,y1,velx,md.mesh.x,md.mesh.y,0);
++md.inversion.vy_obs  = InterpFromGridToMesh(x1,y1,vely,md.mesh.x,md.mesh.y,0);
++md.inversion.vel_obs = sqrt(md.inversion.vx_obs.^2+md.inversion.vy_obs.^2);
++md.initialization.vx = md.inversion.vx_obs;
++md.initialization.vy = md.inversion.vy_obs;
++md.initialization.vz = zeros(md.mesh.numberofvertices,1);
++md.initialization.vel= md.inversion.vel_obs;
++
++disp('   Interpolating temperatures');
++md.initialization.temperature=InterpFromGridToMesh(x1,y1,temp,md.mesh.x,md.mesh.y,0)+273.15;
++
++disp('   Interpolating surface mass balance');
++md.surfaceforcings.mass_balance=InterpFromGridToMesh(x1,y1,smb,md.mesh.x,md.mesh.y,0);
++md.surfaceforcings.mass_balance=md.surfaceforcings.mass_balance*md.materials.rho_water/md.materials.rho_ice;
++
++disp('   Construct basal friction parameters');
++md.friction.coefficient=30*ones(md.mesh.numberofvertices,1);
++pos=find(md.mask.groundedice_levelset<0);
++md.friction.coefficient(pos)=0; %no friction applied on floating ice
++md.friction.p=ones(md.mesh.numberofelements,1);
++md.friction.q=ones(md.mesh.numberofelements,1);
++
++disp('   Construct ice rheological properties');
++md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
++md.materials.rheology_B=paterson(md.initialization.temperature);
++md.friction.q=ones(md.mesh.numberofelements,1);
++md.friction.p=ones(md.mesh.numberofelements,1);
++
++disp('   Set other boundary conditions');
++md.mask.ice_levelset(md.mesh.vertexonboundary==1)=0;
++md.basalforcings.groundedice_melting_rate = zeros(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate = zeros(md.mesh.numberofvertices,1);
++md.thermal.spctemperature     = [md.initialization.temperature;1]; %impose observed temperature on surface
++md.masstransport.spcthickness    = NaN*ones(md.mesh.numberofvertices,1);
++
++disp('   Set geothermal heat flux');
++md.basalforcings.geothermalflux=InterpFromGridToMesh(x1,y1,gflux,md.mesh.x,md.mesh.y,0);
++
++disp('   Set Pressure');
++md.initialization.pressure=md.materials.rho_ice*md.constants.g*md.geometry.thickness;
++
++disp('   Single point constraint for continental model');
++%Set at least one vertex to velocity 0 so as to not get a singular problem (point on the wet peninsula)
++md.stressbalance.referential=NaN*ones(md.mesh.numberofvertices,6);
++md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices,1);
++md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices,1);
++md.stressbalance.spcvz = NaN*ones(md.mesh.numberofvertices,1);
++location = 1.0e+06 *[.32011 -2.2039];
++[dist pos]=min(sqrt((md.mesh.x - location(1)).^2 + (md.mesh.y - location(2)).^2));
++md.stressbalance.spcvx(pos) = 0;
++md.stressbalance.spcvy(pos) = 0;
++md.stressbalance.spcvz(pos) = 0;
++
+
+Property changes on: ../trunk-jpl/examples/IceBridge/Greenland.par
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/IceBridge/runme.m
+===================================================================
+--- ../trunk-jpl/examples/IceBridge/runme.m	(revision 0)
++++ ../trunk-jpl/examples/IceBridge/runme.m	(revision 18267)
+@@ -0,0 +1,159 @@
++clear all;
++steps=[1];
++
++%Location of SeaRISE dataset
++ncdata='../Data/Greenland_5km_dev1.2.nc';
++
++if any(steps==1)
++	disp('   Step 1: Mesh creation');
++
++	%Generate initial uniform mesh (resolution = 20000 m)
++	md=triangle(model,'./DomainOutline.exp',20000);
++
++	% Get velocities (Note: You can use ncdisp('file') to see an ncdump)
++	x1   = ncread(ncdata,'x1');
++	y1   = ncread(ncdata,'y1');
++	velx = ncread(ncdata,'surfvelx');
++	vely = ncread(ncdata,'surfvely');
++	vx   = InterpFromGridToMesh(x1,y1,velx',md.mesh.x,md.mesh.y,0);
++	vy   = InterpFromGridToMesh(x1,y1,vely',md.mesh.x,md.mesh.y,0);
++	vel  = sqrt(vx.^2+vy.^2);
++
++	%Mesh greenland without refinement in Jak basin
++	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++	md=bamg(md,'hmax',400000,'hmin',5000,'gradation',1.7,'field',vel,'err',8);
++	save ./Models/Greenland.Mesh_generation_old md;
++	return;
++	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++
++	%Refine mesh in the region of Jakobshavn (resolution = 3000 m)
++	hmaxVertices=NaN*ones(md.mesh.numberofvertices,1);
++	in=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,...
++		'./Jak_outline.exp','node',1);
++	hmaxVertices(find(in))=3000;
++	md=bamg(md,'hmax',400000,'hmin',5000,'gradation',1.7,'field',vel,...
++		'err',8,'hmaxVertices',hmaxVertices);
++
++	%convert x,y coordinates (Polar stereo) to lat/lon
++	[md.mesh.lat,md.mesh.long]=xy2ll(md.mesh.x,md.mesh.y,+1,39,71);
++
++	save ./Models/Greenland.Mesh_generation md;
++end
++
++if any(steps==2)
++	disp('   Step 2: Parameterization');
++	md = loadmodel('./Models/Greenland.Mesh_generation');
++
++	md = setmask(md,'','');
++	md = parameterize(md,'./Greenland_cheatsheet.par');
++	%md = parameterize(md,'./Greenland_noOIB.par');
++	md = setflowequation(md,'SSA','all');
++
++	save ./Models/Greenland.Parameterization2 md; 
++end
++
++if any(steps==3)
++	disp('   Step 3: Control method friction');
++	md = loadmodel('./Models/Greenland.Parameterization2');
++
++	%Control general
++	md.inversion.iscontrol=1;
++	md.inversion.nsteps=30;
++	md.inversion.step_threshold=0.99*ones(md.inversion.nsteps,1);
++	md.inversion.maxiter_per_step=5*ones(md.inversion.nsteps,1);
++	md.verbose=verbose('solution',true,'control',true);
++
++	%Cost functions
++	md.inversion.cost_functions=[101 103 501];
++	md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,3);
++	md.inversion.cost_functions_coefficients(:,1)=350;
++	md.inversion.cost_functions_coefficients(:,2)=0.6;
++	md.inversion.cost_functions_coefficients(:,3)=2e-6;
++
++	%Controls
++	md.inversion.control_parameters={'FrictionCoefficient'};
++	md.inversion.gradient_scaling(1:md.inversion.nsteps)=50;
++	md.inversion.min_parameters=1*ones(md.mesh.numberofvertices,1);
++	md.inversion.max_parameters=200*ones(md.mesh.numberofvertices,1);
++	in=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,...
++		'./data_gaps.exp','node',1);
++	md.inversion.cost_functions_coefficients(find(in),1)=0.0;
++	md.inversion.cost_functions_coefficients(find(in),2)=0.0;
++
++	%Additional parameters
++	md.stressbalance.restol=0.01;
++	md.stressbalance.reltol=0.1;
++	md.stressbalance.abstol=NaN;
++
++	%Go solve
++	md.cluster=generic('name',oshostname,'np',2);
++
++	md.verbose=verbose('solution',true,'control',true);
++	md=solve(md,StressbalanceSolutionEnum);
++
++	%Update model friction fields accordingly
++	md.friction.coefficient=md.results.StressbalanceSolution.FrictionCoefficient;
++
++	save ./Models/Greenland.Control_drag md; 
++end
++
++if any(steps==4)
++	disp('   Step 4: Transient run');
++	md = loadmodel('./Models/Greenland.Control_drag');
++
++	%Set surface mass balance
++	x1  = ncread(ncdata,'x1');
++	y1  = ncread(ncdata,'y1');
++	smb = ncread(ncdata,'smb');
++	smb = InterpFromGridToMesh(x1,y1,smb',md.mesh.x,md.mesh.y,0)*1000/md.materials.rho_ice;
++	smb = [smb smb smb-1.0];
++	md.surfaceforcings.mass_balance = [smb;1 10 20];
++
++	%Set transient options, run for 20 years, saving every year
++	md.timestepping.time_step=0.2; %This must be reduced for finer resolutions
++	md.timestepping.final_time=20;
++	md.settings.output_frequency=1;
++
++	%Additional options
++	md.inversion.iscontrol=0;
++	md.transient.requested_outputs={'IceVolume','TotalSmb','SurfaceforcingsMassBalance'};
++	md.verbose=verbose('solution',true,'module',true,'convergence',true);
++
++	%Go solve
++	md.cluster=generic('name',oshostname,'np',2);
++	md=solve(md,TransientSolutionEnum);
++
++	save ./Models/Greenland.Transient md; 
++end
++
++if any(steps==5)
++	disp('   Step 5: Plotting'); 
++	md = loadmodel('./Models/Greenland.Transient');
++
++	%Planview plots
++	plotmodel(md,'data',md.results.TransientSolution(end).Vel,'caxis',[1e-1 6000],...
++		'log', 10, 'title', 'Velocity (m/y)','gridded',1, ...
++		'data', md.results.TransientSolution(end).SurfaceforcingsMassBalance, ...
++		'title', 'Surface mass balance (m/y)','gridded',1, ...
++		'data',md.results.TransientSolution(end).Thickness,...
++		'title','Thickness (m)','gridded',1, ...
++		'data',md.results.TransientSolution(end).Surface, ...
++		'title', 'Surface (m)','gridded',1);
++
++	%Line Plots
++	figure
++
++	%Plot surface mass balance
++	surfmb=[]; for i=1:100; surfmb=[surfmb ...
++		md.results.TransientSolution(i).SurfaceforcingsMassBalance]; end
++	subplot(3,1,1); plot([0.2:0.2:20],mean(surfmb)); title('Mean Surface mass balance');
++
++	%Plot velocity
++	vel=[]; for i=1:100; vel=[vel md.results.TransientSolution(i).Vel]; end
++	subplot(3,1,2); plot([0.2:0.2:20],mean(vel)); title('Mean Velocity');
++
++	%Plot Volume
++	volume=[]; for i=1:100; volume=[volume md.results.TransientSolution(i).IceVolume]; end
++	subplot(3,1,3); plot([0.2:0.2:20],volume); title('Ice Volume');
++	xlabel('years')
++end
+
+Property changes on: ../trunk-jpl/examples/IceBridge/runme.m
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/IceBridge/DomainOutline.exp
+===================================================================
+--- ../trunk-jpl/examples/IceBridge/DomainOutline.exp	(revision 0)
++++ ../trunk-jpl/examples/IceBridge/DomainOutline.exp	(revision 18267)
+@@ -0,0 +1,733 @@
++## Name:DomainOutline
++## Icon:0
++# Points Count Value
++727 1.000000
++# X pos Y pos
++47662.8073760000 -2621047.2585999998
++39869.9055420000 -2638077.6292949999
++26037.5047870000 -2644088.3483640002
++24868.5695120000 -2659115.1460360000
++25647.8596950000 -2674141.9437079998
++16880.8451320000 -2687666.0616130000
++515.7512810000 -2685662.4885900002
++-7666.7956450000 -2672639.2639410002
++-22083.6640370000 -2677147.3032430001
++-30071.3884170000 -2690170.5278920000
++-44683.0793550000 -2694678.5671930001
++-41760.7411680000 -2709705.3648660001
++-37669.4677050000 -2724231.2692820001
++-44488.2568100000 -2738757.1736989999
++-55787.9644690000 -2753283.0781149999
++-67672.1397650000 -2742263.4264890002
++-87154.3943500000 -2741762.5332330000
++-105078.0685680000 -2741011.1933490001
++-97090.3441880000 -2760546.0303230002
++-99817.8598300000 -2780581.7605530000
++-82478.6532500000 -2789096.9459000002
++-77218.4445120000 -2804123.7435730002
++-77023.6219660000 -2820152.3277560002
++-95336.9412760000 -2829669.2996149999
++-112870.9704020000 -2832674.6591500002
++-123196.5653320000 -2818649.6479890002
++-122417.2751480000 -2834177.3389170002
++-120274.2271440000 -2849204.1365890000
++-105662.5362060000 -2854713.9624020001
++-89492.2649000000 -2850706.8163560000
++-77997.7346950000 -2860724.6814710000
++-92024.9579960000 -2867737.1870519998
++-84816.5238000000 -2890277.3835600000
++-94752.4736380000 -2901797.9284419999
++-114234.7282230000 -2894284.5296060001
++-127677.4838860000 -2883765.7712349999
++-146964.9159250000 -2888774.7037930000
++-139951.3042750000 -2905805.0744880000
++-154173.3501210000 -2916824.7261140002
++-165667.8803260000 -2904302.3947210000
++-162550.7195930000 -2920330.9789040000
++-152809.5923000000 -2934355.9900650000
++-147744.2061080000 -2949883.6809930000
++-163719.6548680000 -2950384.5742489998
++-175603.8301650000 -2963908.6921540000
++-189825.8760110000 -2956896.1865730002
++-195670.5523870000 -2971422.0909899999
++-210282.2433250000 -2966413.1584319999
++-222750.8862590000 -2978301.3022220000
++-214763.1618800000 -2995247.5385030000
++-222750.8862590000 -3011386.8111520000
++-206970.2600460000 -3016228.5929470002
++-217295.8549760000 -3027122.6019839998
++-232686.8360980000 -3031964.3837790000
++-212035.6462380000 -3035192.2383090002
++-212814.9364210000 -3050928.0291410000
++-197229.1327540000 -3048910.6200600001
++-185344.9574570000 -3058190.7018329999
++-174824.5399810000 -3071102.1199520002
++-182812.2643610000 -3084820.5017030002
++-192163.7465610000 -3098942.3652710002
++-176577.9428940000 -3092486.6562120002
++-184955.3123650000 -3105801.5561469998
++-182617.4418150000 -3121537.3469790001
++-199372.1807580000 -3120326.9015310002
++-218464.7902510000 -3115888.6015519998
++-205022.0345870000 -3126782.6105900002
++-189825.8760110000 -3128800.0196710001
++-198592.8905740000 -3146149.7377680000
++-213009.7589670000 -3140904.4741580002
++-225283.5793550000 -3131220.9105679998
++-222750.8862590000 -3146149.7377680000
++-208334.0178670000 -3151395.0013790000
++-195670.5523870000 -3161078.5649680002
++-213009.7589670000 -3171569.0921900002
++-227621.4499060000 -3161078.5649680002
++-242622.7859360000 -3157850.7104389998
++-240090.0928400000 -3174393.4649040001
++-220023.3706180000 -3185690.9557579998
++-233076.4811890000 -3193357.1102660000
++-258013.7670580000 -3188111.8466550000
++-275158.1510920000 -3196181.4829790001
++-258208.5896040000 -3198198.8920600000
++-252753.5583200000 -3213127.7192600002
++-270482.4099920000 -3215952.0919740000
++-258793.0572410000 -3226442.6191960000
++-275547.7961840000 -3232969.1157640000
++-276521.9089130000 -3248275.5695210001
++-293276.6478560000 -3241868.2167850002
++-282561.4078340000 -3256818.7065010001
++-288211.2616640000 -3273549.0164200002
++-302433.3075110000 -3267141.6636850000
++-305745.2907900000 -3251479.2458879999
++-313733.0151700000 -3237596.6482950002
++-310810.6769820000 -3218018.6260489998
++-325812.0130120000 -3213747.0575589999
++-338280.6559470000 -3203780.0644160002
++-336527.2530340000 -3187761.6825779998
++-321720.7395500000 -3185269.9342919998
++-325812.0130120000 -3165691.9120459999
++-313538.1926240000 -3155368.9548610002
++-329708.4639290000 -3158928.5952699999
++-338085.8334010000 -3173167.1569030001
++-351723.4116100000 -3164268.0558819999
++-342566.7519550000 -3151809.3144530002
++-325812.0130120000 -3153233.1706160000
++-310615.8544360000 -3148249.6740450002
++-329123.9962920000 -3150029.4942490002
++-343151.2195930000 -3144334.0695949998
++-361854.1839940000 -3145401.9617180000
++-377634.8102080000 -3142910.2134320000
++-388350.0502290000 -3154657.0267800000
++-397701.5324300000 -3178150.6534750001
++-417573.4321060000 -3179930.4736790000
++-432720.8850460000 -3186308.0579260001
++-451813.4945390000 -3187438.8412219998
++-467788.9432980000 -3177261.7915590000
++-482985.1018740000 -3173492.5139070000
++-490583.1811620000 -3158792.3310610000
++-492726.2291670000 -3141453.6538590002
++-490193.5360710000 -3119214.9157079998
++-505389.6946470000 -3113560.9992289999
++-489803.8909790000 -3110922.5048719998
++-478309.3607740000 -3100368.5274439999
++-495648.5673540000 -3101122.3829750000
++-512792.9513890000 -3108660.9382799999
++-501103.5986380000 -3097353.1053220001
++-493895.1644420000 -3083783.7057719999
++-486491.9077000000 -3068329.6673960001
++-503636.2917340000 -3066068.1008040002
++-522728.9012270000 -3064183.4619780001
++-521559.9659520000 -3046467.8570099999
++-531301.0932440000 -3029506.1075729998
++-543769.7361790000 -3012167.4303710000
++-545912.7841830000 -2992944.1143419999
++-550004.0576459999 -2974474.6538439998
++-567538.0867720000 -2983897.8479749998
++-585851.4060810000 -2995959.5364640001
++-589942.6795440000 -2981259.3536189999
++-572213.8278720001 -2975982.3649050002
++-565200.2162220000 -2959397.5432330002
++-548055.8321870000 -2954120.5545190000
++-545717.9616370000 -2933389.5274290000
++-536561.3019820000 -2920197.0556450002
++-545523.1390910000 -2907758.4393910002
++-533444.1412490000 -2898335.2452590000
++-530568.0950890000 -2883304.2548420001
++-545624.1658510000 -2879383.1998239998
++-559750.8495300000 -2868110.1666489998
++-577223.3267109999 -2867129.9028940001
++-590606.5007220000 -2859287.7928590002
++-573319.9009570000 -2851445.6828239998
++-551572.2431889999 -2846054.2321750000
++-530939.8499220000 -2834781.1989989998
++-528337.5660870000 -2817626.5832969998
++-543765.3916830000 -2804883.1544900001
++-528151.6886699999 -2802432.4951040000
++-528151.6886699999 -2785768.0112790000
++-513467.3727410000 -2778416.0331210000
++-513839.1275750000 -2760771.2855420001
++-525735.2822510001 -2749498.2523670001
++-509563.9469880000 -2738225.2191909999
++-517184.9210780000 -2724501.5266300002
++-532240.9918400000 -2725971.9222610001
++-524248.2629170000 -2707837.0428050002
++-512537.9856570000 -2694113.3502429998
++-521088.3468310000 -2678429.1301730000
++-538189.0691780000 -2669606.7563829999
++-556033.3011930001 -2677448.8664190001
++-539676.0885130001 -2666175.8332429999
++-526664.6693360000 -2658333.7232080000
++-517556.6759110000 -2639708.7118739998
++-526107.0370850000 -2626965.2830670001
++-538932.5788460000 -2618142.9092779998
++-550456.9786890000 -2607360.0079790000
++-565698.9268680000 -2599517.8979440001
++-581126.7524640000 -2600988.2935759998
++-583110.5023000001 -2578346.1085480000
++-572583.8192940000 -2566324.6704099998
++-556315.3091930000 -2558811.2715739999
++-538132.8567270000 -2571333.6029679999
++-524735.2601730000 -2578346.1085480000
++-519759.0100240000 -2594875.5859869998
++-503107.7114500000 -2585859.5073839999
++-486456.4128760000 -2576342.5355250002
++-477843.6722340000 -2559312.1648300001
++-474015.7875040000 -2536771.9683220000
++-473441.6047950000 -2521244.2773940000
++-474972.7586870000 -2504714.7999539999
++-485690.8359300000 -2491691.5753049999
++-486073.6244030000 -2476664.7776330002
++-492581.0284430000 -2459634.4069380001
++-474207.1817410000 -2447112.0755440001
++-465594.4410990000 -2434589.7441509999
++-462340.7390790000 -2418060.2667109999
++-462914.9217880000 -2399026.3229930000
++-468465.3546460000 -2375484.3399729999
++-473058.8163220000 -2360457.5423010001
++-478417.8549440000 -2343427.1716060000
++-504256.0768690000 -2331405.7334679998
++-489901.5091330000 -2322389.6548649999
++-475164.1529230000 -2307863.7504480002
++-462577.4401970000 -2287577.5735909999
++-457317.2314590000 -2269044.5231289999
++-439783.2023330000 -2268042.7366169998
++-436666.0415990000 -2252014.1524330000
++-435886.7514160000 -2233481.1019710000
++-448550.2168960000 -2220457.8773220000
++-440172.8474240000 -2206933.7594170002
++-429262.7848570000 -2193409.6415120000
++-433743.7034120000 -2176880.1640720000
++-426730.0917610000 -2162354.2596560000
++-419716.4801110000 -2147327.4619840002
++-428678.3172200000 -2134805.1305900002
++-427314.5593990000 -2110762.2543150000
++-426535.2692150000 -2094733.6701310000
++-427509.3819440000 -2067184.5410650000
++-428093.8495820000 -2050655.0636260000
++-425366.3339400000 -2035628.2659539999
++-432379.9455910000 -2021102.3615369999
++-446017.5238000000 -2003571.0975860001
++-430821.3652240000 -2002569.3110750001
++-428678.3172200000 -1986039.8336360001
++-424197.3986650000 -1971013.0359630000
++-418060.4884710000 -1957238.4714309999
++-433451.4695930000 -1950225.9658500000
++-426243.0353960000 -1933696.4884110000
++-441634.0165180000 -1943714.3535259999
++-433841.1146840000 -1926683.9828300001
++-448647.6281690000 -1933696.4884110000
++-464428.2543820000 -1948222.3928270000
++-465402.3671120000 -1933195.5951550000
++-463843.7867450000 -1914662.5446929999
++-456245.7074570000 -1901138.4267879999
++-468714.3503910000 -1892122.3481840000
++-480208.8805960000 -1905646.4660890000
++-479429.5904130000 -1888616.0953939999
++-478455.4776830000 -1871585.7246989999
++-478650.3002290000 -1856558.9270270001
++-484494.9766050000 -1841031.2360990001
++-494430.9264430000 -1822498.1856370000
++-505925.4566480000 -1807972.2812200000
++-508847.7948350000 -1791442.8037810000
++-504172.0537350000 -1776416.0061079999
++-510990.8428400000 -1759886.5286689999
++-502223.8282770000 -1745861.5175079999
++-512939.0682980000 -1728330.2535570001
++-511964.9555690000 -1712802.5626300001
++-505340.9890100000 -1697775.7649570000
++-506315.1017390000 -1681747.1807740000
++-507289.2144690000 -1662713.2370559999
++-508446.9486300000 -1645056.7497910000
++-502180.9448550000 -1623518.3397939999
++-505662.0580630000 -1602480.8230530000
++-505836.1137240000 -1586953.1321250000
++-509317.2269320000 -1571425.4411970000
++-516105.3976870000 -1557400.4300360000
++-530552.0175000000 -1537865.5930620001
++-533336.9080660000 -1513321.8235309999
++-522719.5127820000 -1498295.0258589999
++-506532.3363650000 -1492284.3067900001
++-522893.5684430000 -1484770.9079539999
++-515757.2863660000 -1469744.1102819999
++-532118.5184440000 -1465236.0709800001
++-535947.7429720000 -1449708.3800520001
++-544476.4703320001 -1428670.8633109999
++-551960.8637290000 -1415146.7454059999
++-565363.1495800000 -1405629.7735470000
++-567277.7618440000 -1386094.9365729999
++-582420.6042990000 -1384091.3635499999
++-593212.0552430000 -1370066.3523899999
++-606266.2297730000 -1362052.0602980000
++-613793.7528780000 -1344395.5730330001
++-621618.1005840000 -1359923.2639609999
++-634079.0987820000 -1369440.2358200001
++-633354.6221430000 -1354413.4381480000
++-638860.6446030000 -1339386.6404760000
++-649438.0035390001 -1351908.9718690000
++-667405.0241970000 -1352409.8651250000
++-679431.3364110000 -1363429.5167510000
++-679721.1270670000 -1346900.0393119999
++-676533.4298540000 -1330370.5618720001
++-690008.6953470000 -1339386.6404760000
++-701165.6355950000 -1327365.2023380001
++-688994.4280520000 -1315844.6574560001
++-709279.7739560000 -1318349.1237339999
++-717249.0169900000 -1331372.3483839999
++-735216.0376480001 -1329869.6686160001
++-741420.6668040000 -1315969.8807699999
++-750947.3474350000 -1299440.4033299999
++-734597.5036490000 -1299440.4033299999
++-722496.0444700000 -1284413.6056580001
++-707948.5456690000 -1288420.7517039999
++-689023.9233340001 -1290424.3247270000
++-678209.8534290000 -1276399.3135660000
++-672545.3406220000 -1262374.3024060000
++-693401.0468670001 -1264377.8754280000
++-709493.4127980000 -1260871.6226379999
++-725971.9955110000 -1250853.7575240000
++-725714.5176560000 -1234825.1733400000
++-720951.1773400001 -1215290.3363659999
++-737172.2821980000 -1218295.6958999999
++-749402.4803050000 -1205272.4712510000
++-736399.8486340001 -1196757.2859040000
++-720822.4384130000 -1191247.4600899999
++-710652.0631450000 -1204771.5779949999
++-697906.9093280000 -1218796.5891559999
++-684131.8440910000 -1227812.6677590001
++-668940.6506530000 -1229816.2407819999
++-666237.1331770000 -1253358.2238020001
++-653620.7182870000 -1262374.3024060000
++-648471.1611900000 -1247347.5047330000
++-634696.0959530000 -1258868.0496149999
++-632625.0227419999 -1243541.0164699999
++-618416.8083510000 -1233878.1370890001
++-601000.2874830000 -1228080.4094600000
++-615361.2783740000 -1217451.2421410000
++-598861.4165000001 -1216968.0981719999
++-610625.2069099999 -1201990.6351310001
++-617652.9258560000 -1185080.5962139999
++-631708.3637490000 -1178799.7246160000
++-648666.5551200000 -1183631.1643070001
++-656458.1565610000 -1169136.8452349999
++-653708.1795820000 -1154159.3821950001
++-665166.4169950000 -1166237.9814210001
++-676166.3249110000 -1153193.0942569999
++-676166.3249110000 -1133384.1915249999
++-689305.1038110000 -1118406.7284850001
++-709013.2721609999 -1111159.5689490000
++-711610.4726409999 -1091833.8101870001
++-716346.5441050000 -1074440.6273010001
++-701527.2237180000 -1070092.3315790000
++-680291.2903790000 -1068642.8996720000
++-664096.9815030000 -1078788.9230219999
++-650958.2026030000 -1100530.4016300000
++-628041.7277770001 -1095698.9619390001
++-611236.3129050001 -1091350.6662170000
++-588930.9440750000 -1094732.6740009999
++-577319.9301640000 -1078305.7790530000
++-565250.5867559999 -1066710.3237960001
++-550431.2663680000 -1071541.7634860000
++-540042.4644469999 -1060429.4521979999
++-531203.6819710000 -1047613.0696300000
++-510357.6695660000 -1037937.0529810000
++-498473.4942690000 -1027821.2173940000
++-486199.6738810000 -1015066.4681760001
++-487953.0767930000 -994834.7970020000
++-464964.0163830000 -990876.4265550000
++-449378.2127160000 -998353.3485110000
++-430285.6032230000 -1001432.0810810000
++-417622.1377430000 -1012427.5545450000
++-399308.8184330000 -1004950.6325890000
++-384697.1274945000 -1000332.5337340001
++-370085.4365560000 -995714.4348789999
++-375540.4678400000 -980760.5909680000
++-380021.3863940000 -966246.5659950000
++-383528.1922200000 -949973.2652690000
++-383528.1922200000 -930181.4130330000
++-384112.6598570000 -911709.0176140000
++-380216.2089400000 -883560.6055450001
++-366919.5701860000 -892846.9764360000
++-353087.1694310000 -880338.0618260000
++-336527.2530340000 -873692.7009390000
++-322694.8522790000 -888547.0370390000
++-307888.3387940000 -897146.9158330000
++-294835.2282230000 -913564.8662580000
++-275937.4412760000 -919037.5164000000
++-252169.0906820000 -915128.4805850000
++-245350.3015780000 -901446.8552300000
++-244181.3663030000 -918646.6128190000
++-231615.3120950000 -930563.0925760000
++-215445.0407900000 -924017.9382920000
++-206872.8487730000 -937108.2468600000
++-190507.7549220000 -933426.5975750000
++-186611.3040050000 -912972.9904390000
++-185961.8955186667 -896882.8194913333
++-185312.4870323333 -880792.6485436666
++-184663.0785460000 -864702.4775960000
++-175311.5963460000 -883519.7961620000
++-174532.3061620000 -902337.1147280000
++-172584.0807040000 -918700.0004370000
++-168882.4523330000 -933835.6697180000
++-152322.5359360000 -933835.6697180000
++-142581.4086430000 -921563.5054359999
++-127969.7177050000 -912154.8461530000
++-131086.8784390000 -930563.0925760000
++-115501.0747710000 -924427.0104349999
++-112189.0914910000 -905609.6918690000
++-114916.6071330000 -887610.5175890001
++-101473.8514700000 -899882.6818710000
++-84329.4674350000 -896610.1047290000
++-100110.0936490000 -892110.3111590000
++-87836.2732610000 -879838.1468770000
++-74685.7514160000 -869305.2030530000
++-57541.3673810000 -863251.9975030000
++-49553.6430020000 -850388.9357080000
++-34357.4844260000 -846227.3568920000
++-47995.0626350000 -825797.7881600000
++-30071.3884170000 -835255.9218320000
++-18771.6807580000 -850767.2610550000
++-6303.0378240000 -859847.0693810000
++7139.7178400000 -852658.8877899999
++22141.0538700000 -862873.6721560000
++31297.7135250000 -877628.3606850000
++47662.8073760000 -874601.7579100000
++49611.0328340000 -893518.0252550000
++66365.7717770000 -886708.1690110000
++81123.5796250000 -882220.1151260000
++97683.4960220000 -884202.5846670000
++80149.4668960000 -888960.5115630000
++65537.7759570000 -896493.8958170000
++68460.1141450000 -914732.6155880000
++84435.5629050000 -917508.0729450000
++100605.8342100000 -907595.7252430000
++120282.9113400000 -911957.1582320000
++129049.9259030000 -927420.4206470000
++153402.7441340000 -925437.9511060000
++169767.8379850000 -920680.0242090001
++180677.9005530000 -910371.1825990001
++192367.2533040000 -899269.3531730000
++201134.2678670000 -912353.6521400000
++182626.1260110000 -920680.0242090001
++169183.3703480000 -936539.7805320000
++163338.6939720000 -950417.0673150000
++182820.9485570000 -955174.9942120000
++187301.8671120000 -970241.7627180000
++200744.6227750000 -980550.6043280000
++198796.3973170000 -995617.3728350000
++211118.9233410000 -983385.4589040000
++211508.5684330000 -999969.0227530000
++225146.1466420000 -1008484.9068910000
++240731.9503100000 -1009829.5201760000
++238588.9023060000 -1032239.7415930000
++253785.0608820000 -1029550.5150230000
++273072.4929210000 -1036273.5814480000
++281255.0398460000 -1056890.9851510001
++286320.4260380000 -1071681.7312860000
++305413.0355310000 -1086024.2729930000
++316907.5657360000 -1095884.7704169999
++326453.8704830000 -1081990.4331380001
++341260.3839670000 -1076611.9799980000
++355677.2523600000 -1064958.6648609999
++372319.0245690000 -1056006.2810410000
++387981.0391590000 -1068027.7191780000
++383779.0352450000 -1084056.3033620000
++366207.0188750000 -1085558.9831290001
++366971.0195860000 -1102088.4605690001
++352646.0062410000 -1113108.1121950001
++362960.0158500000 -1126131.3368440000
++380914.0325760000 -1133143.8424249999
++394093.0448530000 -1123626.8705660000
++409182.0589100000 -1113108.1121950001
++409182.0589100000 -1131641.1626569999
++404407.0544620000 -1158689.3984670001
++386262.0375580000 -1153179.5726540000
++374229.0263480000 -1166202.7973030000
++364488.0172730000 -1182732.2747430000
++377285.0291950000 -1191748.3533460000
++388172.0393370000 -1202768.0049719999
++392947.0437860000 -1219798.3756680000
++380341.0320420000 -1228814.4542710001
++383588.0350670000 -1251354.6507790000
++389509.0405830000 -1265880.5551960000
++389509.0405830000 -1282910.9258910001
++399632.0500130000 -1295934.1505400001
++408609.0583760000 -1313966.3077469999
++410137.0598000000 -1333000.2514650000
++413526.9681570000 -1350406.2921020000
++416526.2265730000 -1367436.6627970000
++415776.4119690000 -1385468.8200040001
++419900.3922910000 -1406005.4434890000
++430960.1577010000 -1421032.2411610000
++431897.4259560000 -1436059.0388330000
++448018.4399430000 -1436559.9320890000
++448580.8008960000 -1456094.7690630001
++438458.3037410000 -1469117.9937120001
++432459.7869090000 -1486148.3644069999
++449705.5228020000 -1494663.5497550000
++448393.3472450000 -1513196.6002170001
++463202.1856750000 -1521210.8923090000
++447830.9862920000 -1525218.0383550001
++458140.9370980000 -1539243.0495160001
++462639.8247220000 -1554269.8471880001
++473887.0437820000 -1564287.7123030000
++458703.2980510000 -1557275.2067219999
++463014.7320240000 -1574305.5774170000
++478948.2923600000 -1567293.0718370001
++484009.5409370000 -1584824.3357879999
++475011.7656880000 -1597346.6671819999
++484009.5409370000 -1614877.9311319999
++488508.4285610000 -1630906.5153160000
++470512.8780640000 -1618384.1839230000
++461702.5564670000 -1631407.4085720000
++474074.4974330000 -1641926.1669419999
++488883.3358630000 -1648938.6725230000
++495661.8324810000 -1662963.6836830000
++478923.6439970000 -1667471.7229849999
++463095.1396700000 -1663965.4701950001
++449449.8773190000 -1652945.8185690001
++455817.6664170000 -1670477.0825199999
++441626.5935720000 -1662963.6836830000
++433439.4361610000 -1648437.7792670000
++409690.0603430000 -1652315.3206390000
++394504.9542530000 -1655951.1781029999
++411243.1427370000 -1662462.7904280000
++426707.7734010000 -1676487.8015880000
++437260.1096190000 -1691514.5992610001
++455999.6032480000 -1702534.2508870000
++441626.5935720000 -1710047.6497229999
++428891.0153770000 -1692516.3857720001
++435076.8676430000 -1708544.9699560001
++419976.1106410000 -1704036.9306540000
++408696.0270980000 -1692516.3857720001
++395050.7647470000 -1701532.4643750000
++388501.0388190000 -1718562.8350710000
++378494.5130940000 -1731085.1664640000
++376129.3342870000 -1713553.9025129999
++361938.2614420000 -1720566.4080940001
++373582.2186480000 -1732086.9529760000
++358481.4616460000 -1738598.5652999999
++369397.6715270000 -1754627.1494839999
++352659.4830430000 -1751621.7899490001
++335805.3526830000 -1754501.9261700001
++338338.0457790000 -1777042.1226780000
++354897.9621760000 -1775539.4429110000
++349053.2858010000 -1792569.8136060000
++330739.9664910000 -1791568.0270950000
++344182.7221550000 -1806093.9315110000
++341455.2065130000 -1823625.1954620001
++351780.8014430000 -1809600.1843010001
++344377.5447010000 -1826129.6617409999
++356066.8974510000 -1836147.5268550001
++345546.4799760000 -1853678.7908059999
++363080.5091020000 -1853678.7908059999
++371847.5236650000 -1841156.4594129999
++370288.9432980000 -1859689.5098750000
++386848.8596950000 -1868204.6952229999
++404772.5339130000 -1856183.2570849999
++415098.1288430000 -1867703.8019669999
++428735.7070520000 -1860691.2963870000
++421137.6277640000 -1874215.4142920000
++413929.1935680000 -1888741.3187080000
++418799.7572140000 -1903768.1163800000
++428735.7070520000 -1916791.3410300000
++415098.1288430000 -1935825.2847480001
++398148.5673540000 -1926809.2061439999
++380030.0705910000 -1929814.5656790000
++364444.2669230000 -1929814.5656790000
++348468.8181630000 -1924304.7398659999
++333077.8370420000 -1919796.7005640001
++348079.1730720000 -1935825.2847480001
++332883.0144960000 -1939832.4307939999
++318855.7911950000 -1951853.8689309999
++331908.9017660000 -1964376.2003250001
++349442.9308930000 -1959868.1610230000
++358209.9454560000 -1943338.6835840000
++358404.7680020000 -1958365.4812560000
++345936.1250670000 -1971388.7059050000
++345351.6574300000 -1987918.1833450000
++330739.9664910000 -1991925.3293910001
++337753.5781420000 -2005449.4472960001
++353534.2043550000 -2007453.0203180001
++365223.5571060000 -1997435.1552040000
++385679.9244200000 -1986415.5035770000
++399317.5026290000 -1977399.4249740001
++399122.6800840000 -1993928.9024139999
++381393.8284120000 -1998436.9417150000
++399512.3251750000 -1999939.6214820000
++395615.8742580000 -2018973.5652000001
++387822.9724240000 -2032998.5763610001
++383975.2271440000 -2048275.8206610000
++398976.5631740000 -2062801.7250780000
++397223.1602620000 -2078830.3092610000
++379299.4860440000 -2080833.8822840001
++362739.5696470000 -2085842.8148419999
++374428.9223980000 -2097363.3597240001
++390599.1937030000 -2089849.9608880000
++379299.4860440000 -2103374.0787930000
++364492.9725590000 -2111388.3708839999
++355531.1354500000 -2097363.3597240001
++343257.3150620000 -2111889.2641400001
++351829.5070790000 -2127917.8483239999
++365661.9078340000 -2119402.6629760000
++357284.5383630000 -2133928.5673929998
++374039.2773060000 -2136933.9269269998
++385533.8075110000 -2147452.6852980000
++375792.6802180000 -2160976.8032030002
++390988.8387940000 -2162479.4829699998
++378520.1958600000 -2174000.0278520002
++394105.9995280000 -2164983.9492489998
++409107.3355580000 -2161978.5897140000
++421186.3334010000 -2149957.1515759998
++437941.0723440000 -2150958.9380879998
++450409.7152780000 -2171495.5615730002
++454695.8112860000 -2156969.6571570002
++471645.3727750000 -2159975.0166910002
++459566.3749330000 -2147452.6852980000
++465605.8738540000 -2132425.8876260002
++477490.0491500000 -2120404.4494880000
++485867.4186220000 -2133427.6741370000
++493264.3211700000 -2119402.6629760000
++495978.8328800000 -2102873.1855370002
++509098.9728100000 -2110386.5843730001
++523877.9810080000 -2104876.7585600000
++541371.5009160000 -2109885.6911169998
++529608.6168400000 -2096862.4664680001
++544990.8498620000 -2099366.9327469999
++561579.5325330000 -2107381.2248390000
++576509.3469370001 -2104876.7585600000
++596868.1847600000 -2102873.1855370002
++611948.8053700000 -2108883.9046060001
++597622.2157910001 -2119402.6629760000
++580430.3082950000 -2125413.3820449999
++599130.2778520000 -2126916.0618119999
++583144.8200050000 -2134930.3539040000
++568818.2304260000 -2148454.4718089998
++582843.2075930000 -2161477.6964580002
++566706.9435400000 -2162980.3762260000
++552983.5787850000 -2170994.6683180002
++543331.9815950000 -2188025.0390130002
++547554.5553660000 -2207058.9827310001
++538053.7643820000 -2193033.9715700001
++525084.4306570000 -2209062.5557539999
++516036.0582910000 -2221083.9938920001
++529910.2292520000 -2214572.3815669999
++541220.6947100000 -2225091.1399369999
++526140.0741000000 -2223087.5669140001
++526743.2989240000 -2239617.0443540001
++521615.8879170000 -2256647.4150490002
++506233.6548950000 -2255144.7352820002
++508194.1355740000 -2275681.3587670000
++489343.3598110000 -2268167.9599310001
++488740.1349870000 -2283695.6508590002
++475770.8012620000 -2293212.6227179999
++460539.3744460000 -2281692.0778359999
++449228.9089890000 -2296217.9822519999
++448022.4593400000 -2314250.1394590000
++440180.5366230000 -2298722.4485309999
++441085.3738600000 -2277184.0385340001
++426000.8914760000 -2286450.5637659999
++431125.9775380000 -2301477.3614380001
++426190.7094780000 -2317505.9456210001
++424672.1654600000 -2332532.7432940002
++421445.2594210000 -2313498.7995750001
++409296.9072740000 -2298472.0019029998
++411764.5413040000 -2318006.8388769999
++403222.7312010000 -2304983.6142279999
++411005.2692950000 -2289956.8165560002
++393542.0130840000 -2293463.0693460000
++378356.5729000000 -2295967.5356250000
++388416.9270220000 -2308489.8670180002
++405880.1832330000 -2317005.0523660001
++417838.7173770000 -2328525.5972480001
++402463.4591910000 -2342049.7151529999
++385000.2029800000 -2341047.9286409998
++375699.1208680000 -2327022.9174799998
++384240.9309710000 -2314500.5860870001
++368865.6727850000 -2321012.1984120002
++373421.3048400000 -2337541.6758510000
++363360.9507190000 -2353069.3667790000
++351402.4165740000 -2336539.8893400002
++340392.9724410000 -2324518.4512020000
++329573.3463100000 -2313999.6928309998
++335267.8863790000 -2329527.3837589999
++336216.9763910000 -2347058.6477100002
++337166.0664020000 -2362085.4453819999
++318374.0841750000 -2366593.4846839998
++303758.0979980000 -2362586.3386380002
++290314.2882280000 -2354697.2698599999
++292067.6911410000 -2339670.4721880001
++275702.5972900000 -2347684.7642799998
++277880.2580262116 -2321542.8592617917
++269420.4169677348 -2331176.2138948478
++260960.5759092579 -2323294.3782859840
++252500.7348507810 -2343436.8470641924
++254834.4841082919 -2357157.0794203631
++258918.5453089359 -2372336.9109633607
++266740.7601810000 -2359706.2024170002
++271754.1662252456 -2369125.7927523423
++266545.9376350000 -2379241.0393909998
++291483.2235030000 -2386253.5449720002
++275897.4198350000 -2396271.4100859999
++288755.7078610000 -2404786.5954339998
++276871.5325650000 -2415806.2470600000
++263818.4219930000 -2423820.5391520001
++259532.3259840000 -2445358.9491490000
++250570.4888750000 -2432836.6177559998
++248817.0859630000 -2452371.4547290001
++247258.5055960000 -2470403.6119360002
++229919.2990160000 -2474911.6512380000
++226022.8480990000 -2490439.3421660000
++239660.4263080000 -2499956.3140250002
++227776.2510110000 -2510975.9656509999
++220178.1717230000 -2523999.1902999999
++205761.3033310000 -2533015.2689029998
++210631.8669770000 -2560063.5047129998
++203228.6102350000 -2545036.7070410000
++194266.7731260000 -2558560.8249459998
++199624.3931360000 -2581101.0214539999
++185791.9923810000 -2568077.7968049999
++189493.6207520000 -2583104.5944770002
++186571.2825650000 -2601136.7516839998
++185207.5247440000 -2584106.3809890002
++169816.5436220000 -2595126.0326149999
++156568.6105040000 -2586610.8472679998
++134748.4853690000 -2581101.0214539999
++149749.8214000000 -2579598.3416869999
++136112.2431900000 -2592120.6730809999
++146437.8381200000 -2612657.2965660002
++130462.3893610000 -2620671.5886579999
++137281.1784650000 -2635197.4930739999
++125007.3580770000 -2621172.4819140001
++106888.8613130000 -2617666.2291230001
++91887.5252830000 -2609151.0437759999
++109031.9093180000 -2607648.3640089999
++92277.1703750000 -2603641.2179629998
++97537.3791130000 -2587111.7405229998
++88380.7194580000 -2573587.6226180000
++74743.1412490000 -2567076.0102940002
++61105.5630390000 -2577093.8754090001
++66950.2394150000 -2594124.2461040001
++57598.7572140000 -2581101.0214539999
++53117.8386600000 -2598131.3921500002
++41818.1310010000 -2586610.8472679998
++30810.6571600000 -2599133.1786610000
++44253.4128240000 -2608650.1505200001
++47662.8073760000 -2621047.2585999998
++
+Index: ../trunk-jpl/examples/IceBridge/Greenland_noOIB.par
+===================================================================
+--- ../trunk-jpl/examples/IceBridge/Greenland_noOIB.par	(revision 0)
++++ ../trunk-jpl/examples/IceBridge/Greenland_noOIB.par	(revision 18267)
+@@ -0,0 +1,82 @@
++%Name and hemisphere
++md.miscellaneous.name='SeaRISEgreenland';
++md.mesh.hemisphere='n';
++
++disp('   Loading SeaRISE data from NetCDF');
++ncdata='../Data/Greenland_5km_dev1.2.nc';
++x1    = ncread(ncdata,'x1');
++y1    = ncread(ncdata,'y1');
++usrf  = ncread(ncdata,'usrf')';
++topg  = ncread(ncdata,'topg')';
++velx  = ncread(ncdata,'surfvelx')';
++vely  = ncread(ncdata,'surfvely')';
++temp  = ncread(ncdata,'airtemp2m')';
++smb   = ncread(ncdata,'smb')';
++gflux = ncread(ncdata,'bheatflx')';
++
++disp('   Interpolating surface and bedrock');
++md.geometry.base     = InterpFromGridToMesh(x1,y1,topg,md.mesh.x,md.mesh.y,0);
++md.geometry.surface = InterpFromGridToMesh(x1,y1,usrf,md.mesh.x,md.mesh.y,0);
++
++disp('   Constructing thickness');
++md.geometry.thickness=md.geometry.surface-md.geometry.base;
++
++%Set min thickness to 1 meter
++pos0=find(md.geometry.thickness<=0);
++md.geometry.thickness(pos0)=1;
++md.geometry.surface=md.geometry.thickness+md.geometry.base;
++
++disp('   Interpolating velocities ');
++md.inversion.vx_obs  = InterpFromGridToMesh(x1,y1,velx,md.mesh.x,md.mesh.y,0);
++md.inversion.vy_obs  = InterpFromGridToMesh(x1,y1,vely,md.mesh.x,md.mesh.y,0);
++md.inversion.vel_obs = sqrt(md.inversion.vx_obs.^2+md.inversion.vy_obs.^2);
++md.initialization.vx = md.inversion.vx_obs;
++md.initialization.vy = md.inversion.vy_obs;
++md.initialization.vz = zeros(md.mesh.numberofvertices,1);
++md.initialization.vel= md.inversion.vel_obs;
++
++disp('   Interpolating temperatures');
++md.initialization.temperature=InterpFromGridToMesh(x1,y1,temp,md.mesh.x,md.mesh.y,0)+273.15;
++
++disp('   Interpolating surface mass balance');
++md.surfaceforcings.mass_balance=InterpFromGridToMesh(x1,y1,smb,md.mesh.x,md.mesh.y,0);
++md.surfaceforcings.mass_balance=md.surfaceforcings.mass_balance*md.materials.rho_water/md.materials.rho_ice;
++
++disp('   Construct basal friction parameters');
++md.friction.coefficient=30*ones(md.mesh.numberofvertices,1);
++pos=find(md.mask.groundedice_levelset<0);
++md.friction.coefficient(pos)=0; %no friction applied on floating ice
++md.friction.p=ones(md.mesh.numberofelements,1);
++md.friction.q=ones(md.mesh.numberofelements,1);
++
++disp('   Construct ice rheological properties');
++md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
++md.materials.rheology_B=paterson(md.initialization.temperature);
++md.friction.q=ones(md.mesh.numberofelements,1);
++md.friction.p=ones(md.mesh.numberofelements,1);
++
++disp('   Set other boundary conditions');
++md.mask.ice_levelset(md.mesh.vertexonboundary==1)=0;
++md.basalforcings.groundedice_melting_rate = zeros(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate = zeros(md.mesh.numberofvertices,1);
++md.thermal.spctemperature     = [md.initialization.temperature;1]; %impose observed temperature on surface
++md.masstransport.spcthickness    = NaN*ones(md.mesh.numberofvertices,1);
++
++disp('   Set geothermal heat flux');
++md.basalforcings.geothermalflux=InterpFromGridToMesh(x1,y1,gflux,md.mesh.x,md.mesh.y,0);
++
++disp('   Set Pressure');
++md.initialization.pressure=md.materials.rho_ice*md.constants.g*md.geometry.thickness;
++
++disp('   Single point constraint for continental model');
++%Set at least one vertex to velocity 0 so as to not get a singular problem (point on the wet peninsula)
++md.stressbalance.referential=NaN*ones(md.mesh.numberofvertices,6);
++md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices,1);
++md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices,1);
++md.stressbalance.spcvz = NaN*ones(md.mesh.numberofvertices,1);
++location = 1.0e+06 *[.32011 -2.2039];
++[dist pos]=min(sqrt((md.mesh.x - location(1)).^2 + (md.mesh.y - location(2)).^2));
++md.stressbalance.spcvx(pos) = 0;
++md.stressbalance.spcvy(pos) = 0;
++md.stressbalance.spcvz(pos) = 0;
++
+
+Property changes on: ../trunk-jpl/examples/IceBridge/Greenland_noOIB.par
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/IceBridge/Jak_grounded.exp
+===================================================================
+--- ../trunk-jpl/examples/IceBridge/Jak_grounded.exp	(revision 0)
++++ ../trunk-jpl/examples/IceBridge/Jak_grounded.exp	(revision 18267)
+@@ -0,0 +1,19 @@
++## Name:Jak_grouded
++## Icon:0
++# Points Count Value
++13 1.000000
++# X pos Y pos
++-414397.6663804040 -2243466.6708395295
++-421486.9037621063 -2215731.3059818177
++-342860.8164377716 -2178965.8223332223
++-275835.2993744044 -2209281.2211311869
++-226210.6377024883 -2262816.9253914217
++-228144.0660793162 -2295067.3496445753
++-333193.6745536321 -2328607.7908678548
++-379595.9555975018 -2325382.7484425395
++-422775.8560133249 -2285392.2223686292
++-427287.1888925899 -2265396.9593316740
++-411819.7618779668 -2254431.8150856020
++-413108.7141291854 -2243466.6708395295
++-414397.6663804040 -2243466.6708395295
++
+Index: ../trunk-jpl/examples/IceBridge/Greenland_cheatsheet.par
+===================================================================
+--- ../trunk-jpl/examples/IceBridge/Greenland_cheatsheet.par	(revision 0)
++++ ../trunk-jpl/examples/IceBridge/Greenland_cheatsheet.par	(revision 18267)
+@@ -0,0 +1,108 @@
++%Name and hemisphere
++md.miscellaneous.name='SeaRISEgreenland';
++md.mesh.hemisphere='n';
++
++disp('   Loading SeaRISE data from NetCDF');
++ncdata='../Data/Greenland_5km_dev1.2.nc';
++x1    = ncread(ncdata,'x1');
++y1    = ncread(ncdata,'y1');
++usrf  = ncread(ncdata,'usrf')';
++topg  = ncread(ncdata,'topg')';
++velx  = ncread(ncdata,'surfvelx')';
++vely  = ncread(ncdata,'surfvely')';
++temp  = ncread(ncdata,'airtemp2m')';
++smb   = ncread(ncdata,'smb')';
++gflux = ncread(ncdata,'bheatflx')';
++
++disp('   Interpolating surface and bedrock');
++md.geometry.base     = InterpFromGridToMesh(x1,y1,topg,md.mesh.x,md.mesh.y,0);
++md.geometry.surface = InterpFromGridToMesh(x1,y1,usrf,md.mesh.x,md.mesh.y,0);
++
++disp('   Constructing thickness');
++md.geometry.thickness=md.geometry.surface-md.geometry.base;
++
++%Set min thickness to 1 meter
++pos0=find(md.geometry.thickness<=0);
++md.geometry.thickness(pos0)=1;
++md.geometry.surface=md.geometry.thickness+md.geometry.base;
++
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++%Reading IceBridge data for Jakobshavn
++disp('      reading IceBridge Jakobshavn bedrock');
++fid  = fopen('../Data/Jakobshavn_2008_2011_Composite_XYZGrid.txt');
++titles = fgets(fid); data = fscanf(fid,'%g,%g,%g,%g,%g',[5 266400])';
++fclose(fid);
++
++[xi,yi]= ll2xy(md.mesh.lat,md.mesh.long,+1,45,70);
++bed  = flipud(reshape(data(:,5),[360 740])); bed(find(bed==-9999))=NaN;
++surf  = flipud(reshape(data(:,4),[360 740])); surf(find(surf==-9999))=NaN;
++bedy = flipud(reshape(data(:,1),[360 740]));
++bedx = flipud(reshape(data(:,2),[360 740]));
++
++%Insert Icebridge bed and recalculate thickness
++bed_jks=InterpFromGridToMesh(bedx(1,:)',bedy(:,1),bed,xi,yi,NaN);
++surf_jks=InterpFromGridToMesh(bedx(1,:)',bedy(:,1),surf,xi,yi,NaN);
++in=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,...
++	'./Jak_grounded.exp','node',1);
++bed_jks(~in)=NaN;
++surf_jks(~in)=NaN;
++pos=find(~isnan(bed_jks));
++md.geometry.base(pos)=bed_jks(pos);
++md.geometry.surface(pos)=surf_jks(pos);
++md.geometry.thickness=md.geometry.surface-md.geometry.base;
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++
++disp('   Interpolating velocities ');
++md.inversion.vx_obs  = InterpFromGridToMesh(x1,y1,velx,md.mesh.x,md.mesh.y,0);
++md.inversion.vy_obs  = InterpFromGridToMesh(x1,y1,vely,md.mesh.x,md.mesh.y,0);
++md.inversion.vel_obs = sqrt(md.inversion.vx_obs.^2+md.inversion.vy_obs.^2);
++md.initialization.vx = md.inversion.vx_obs;
++md.initialization.vy = md.inversion.vy_obs;
++md.initialization.vz = zeros(md.mesh.numberofvertices,1);
++md.initialization.vel= md.inversion.vel_obs;
++
++disp('   Interpolating temperatures');
++md.initialization.temperature=InterpFromGridToMesh(x1,y1,temp,md.mesh.x,md.mesh.y,0)+273.15;
++
++disp('   Interpolating surface mass balance');
++md.surfaceforcings.mass_balance=InterpFromGridToMesh(x1,y1,smb,md.mesh.x,md.mesh.y,0);
++md.surfaceforcings.mass_balance=md.surfaceforcings.mass_balance*md.materials.rho_water/md.materials.rho_ice;
++
++disp('   Construct basal friction parameters');
++md.friction.coefficient=30*ones(md.mesh.numberofvertices,1);
++pos=find(md.mask.groundedice_levelset<0);
++md.friction.coefficient(pos)=0; %no friction applied on floating ice
++md.friction.p=ones(md.mesh.numberofelements,1);
++md.friction.q=ones(md.mesh.numberofelements,1);
++
++disp('   Construct ice rheological properties');
++md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
++md.materials.rheology_B=paterson(md.initialization.temperature);
++md.friction.q=ones(md.mesh.numberofelements,1);
++md.friction.p=ones(md.mesh.numberofelements,1);
++
++disp('   Set other boundary conditions');
++md.mask.ice_levelset(md.mesh.vertexonboundary==1)=0;
++md.basalforcings.groundedice_melting_rate = zeros(md.mesh.numberofvertices,1);
++md.basalforcings.floatingice_melting_rate = zeros(md.mesh.numberofvertices,1);
++md.thermal.spctemperature     = [md.initialization.temperature;1]; %impose observed temperature on surface
++md.masstransport.spcthickness    = NaN*ones(md.mesh.numberofvertices,1);
++
++disp('   Set geothermal heat flux');
++md.basalforcings.geothermalflux=InterpFromGridToMesh(x1,y1,gflux,md.mesh.x,md.mesh.y,0);
++
++disp('   Set Pressure');
++md.initialization.pressure=md.materials.rho_ice*md.constants.g*md.geometry.thickness;
++
++disp('   Single point constraint for continental model');
++%Set at least one vertex to velocity 0 so as to not get a singular problem (point on the wet peninsula)
++md.stressbalance.referential=NaN*ones(md.mesh.numberofvertices,6);
++md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices,1);
++md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices,1);
++md.stressbalance.spcvz = NaN*ones(md.mesh.numberofvertices,1);
++location = 1.0e+06 *[.32011 -2.2039];
++[dist pos]=min(sqrt((md.mesh.x - location(1)).^2 + (md.mesh.y - location(2)).^2));
++md.stressbalance.spcvx(pos) = 0;
++md.stressbalance.spcvy(pos) = 0;
++md.stressbalance.spcvz(pos) = 0;
++
+
+Property changes on: ../trunk-jpl/examples/IceBridge/Greenland_cheatsheet.par
+___________________________________________________________________
+Added: svn:executable
+## -0,0 +1 ##
++*
+\ No newline at end of property
+Index: ../trunk-jpl/examples/IceBridge/data_gaps.exp
+===================================================================
+--- ../trunk-jpl/examples/IceBridge/data_gaps.exp	(revision 0)
++++ ../trunk-jpl/examples/IceBridge/data_gaps.exp	(revision 18267)
+@@ -0,0 +1,70 @@
++## Name:data_gaps
++## Icon:0
++# Points Count Value
++13 1.000000
++# X pos Y pos
++-183076.0390091268 -1794119.5324780210
++-233886.6983670916 -1838953.5447257366
++-239864.4229974404 -2006333.8571172084
++-299641.6693009282 -2081057.2108634012
++-269753.0461491842 -2116924.4206615738
++-257797.5968884868 -2185669.9061080711
++-278719.6330947075 -2248437.5232548732
++-254808.7345733123 -2266371.1281539593
++-224920.1114215683 -2167736.3012089850
++-198020.3505849990 -2093012.9474627920
++-123298.7927056390 -1967477.7131691882
++-180087.1766939524 -1797108.4666278686
++-183076.0390091268 -1794119.5324780210
++
++## Name:data_gaps
++## Icon:0
++# Points Count Value
++12 1.000000
++# X pos Y pos
++-90421.3072387208 -1824008.8739764981
++-117321.0680752902 -1946555.1741202541
++-156176.2781725575 -2075079.3425637058
++-177098.3143787782 -2203603.5110071572
++-174109.4520636038 -2314194.0745515227
++-72488.1333476745 -2293271.5355025884
++-93410.1695538952 -2203603.5110071572
++-30644.0609352330 -2206592.4451570050
++-6733.1624138379 -2081057.2108634012
++44077.4969441269 -1967477.7131691882
++-93410.1695538952 -1824008.8739764981
++-90421.3072387208 -1824008.8739764981
++
++## Name:data_gaps
++## Icon:0
++# Points Count Value
++15 1.000000
++# X pos Y pos
++-87432.4449235464 -2365005.9550989335
++-287686.2200402305 -2639987.8968849229
++-284697.3577250564 -2879102.6288727401
++-470006.8212658686 -2983715.3241174100
++-538750.6545148797 -3157073.5048085772
++-356430.0532892416 -3267664.0683529424
++-189053.7636394757 -3270653.0025027902
++-272741.9084643587 -3243752.5951541606
++-218942.3867912197 -3076372.2827626891
++-236875.5606822660 -3019582.5339155826
++-117321.0680752902 -2834268.6166250245
++20166.5984227317 -2669877.2383834003
++-12710.8870441865 -2469618.6503436035
++-87432.4449235464 -2367994.8892487814
++-87432.4449235464 -2365005.9550989335
++
++## Name:data_gaps
++## Icon:0
++# Points Count Value
++6 1.000000
++# X pos Y pos
++-186064.9013243013 -1555004.8004902040
++-177098.3143787782 -1695484.7055330465
++-81454.7202931975 -1698473.6396828941
++-36621.7855655816 -1513159.7223923360
++-186064.9013243013 -1552015.8663403564
++-186064.9013243013 -1555004.8004902040
++
Index: /issm/oecreview/Archive/17984-18295/ISSM-18267-18268.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18267-18268.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18267-18268.diff	(revision 18296)
@@ -0,0 +1,26 @@
+Index: ../trunk-jpl/examples/Greenland/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Greenland/runme.m	(revision 18267)
++++ ../trunk-jpl/examples/Greenland/runme.m	(revision 18268)
+@@ -149,10 +149,6 @@
+ 
+ 	ncbox='../Data/Box_Greenland_SMB_monthly_1840-2012_5km_ver20140421.nc';
+ 
+-	%convert mesh x,y into the Box projection
+-	[md.mesh.lat,md.mesh.long]  = xy2ll(md.mesh.x,md.mesh.y,+1,39,71);
+-	[xi,yi]= ll2xy(md.mesh.lat,md.mesh.long,+1,45,70);
+-
+ 	%Set surface mass balance
+ 	lat  = ncread(ncbox,'lat');
+ 	lon  = ncread(ncbox,'lon');
+@@ -183,6 +179,10 @@
+ 
+ 	load smbbox
+ 
++	%convert mesh x,y into the Box projection
++	[md.mesh.lat,md.mesh.long]  = xy2ll(md.mesh.x,md.mesh.y,+1,39,71);
++	[xi,yi]= ll2xy(md.mesh.lat,md.mesh.long,+1,45,70);
++
+ 	%Interpolate and set surface mass balance
+ 	index = BamgTriangulate(x1(:),y1(:));
+ 	smb_mo = InterpFromMeshToMesh2d(index,x1(:),y1(:),smbmean(:),xi,yi);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18268-18269.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18268-18269.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18268-18269.diff	(revision 18296)
@@ -0,0 +1,71 @@
+Index: ../trunk-jpl/examples/Pig/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Pig/runme.m	(revision 18268)
++++ ../trunk-jpl/examples/Pig/runme.m	(revision 18269)
+@@ -187,20 +187,16 @@
+ if any(steps==6)
+ 
+ 	% Load Model
+-	md = loadmodel('./Models/PIG.Control_drag');
+-	md.inversion.iscontrol=0;
+ 
+-	disp('   Extruding mesh')
+-	number_of_layers=3;
+-	md=extrude(md,number_of_layers,0.9);
++	% Disable inversion
+ 
+ 	% Extrude Mesh
+ 
++	% Set Flowequation
++
+ 	% Solve
+-	md=solve(md,StressbalanceSolutionEnum);
+ 
+ 	% Save Model
+-	save ./Models/PIG.ModelHO md;
+ 
+ end
+ % }}}
+@@ -218,15 +214,15 @@
+ 						'xlim#all',[min(mdHO.mesh.x) max(mdHO.mesh.x)]/10^3,...
+ 						'ylim#all',[min(mdHO.mesh.y) max(mdHO.mesh.y)]/10^3,...
+ 						'FontSize#all',12,...
+-						'data',mdSSA.initialization.vel,'title','Observed velocity',...
++						'data',mdHO.initialization.vel,'title','Observed velocity',...
+ 						'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdHO.initialization.vel(surf)),'title','(HO-observed) velocities',...
+ 						'data',mdSSA.results.StressbalanceSolution.Vel,'title','Modeled SSA Velocity',...
+ 						'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdSSA.results.StressbalanceSolution.Vel),'title','(HO-SSA) velocities',...
+-						'data',project2d(mdHO,mdHO.results.StressbalanceSolution.Vel,1),'title','Modeled HO surface Velocities',...
++						'data',mdHO.results.StressbalanceSolution.Vel,'title','Modeled HO surface Velocities',...
+ 						'data',(mdHO.results.StressbalanceSolution.Vel(surf)-mdHO.results.StressbalanceSolution.Vel(basal)),'title','(HOsurf-HO base) velocities',...
+ 						'caxis#1',([1.5,4000]),'caxis#3',([1.5,4000]),'caxis#5',([1.5,4000]),...
+ 						'colorbar#all','on','view#all',2,...
+ 						'colorbartitle#all','[m/yr]',...
+-						'log#1', 10,'log#3', 10,'log#5', 10,'gridded#all',1);
++						'layer#5',1, 'log#1', 10,'log#3', 10,'log#5', 10);
+ end
+ % }}}
+Index: ../trunk-jpl/examples/UncertaintyQuantification/runme.m
+===================================================================
+--- ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 18268)
++++ ../trunk-jpl/examples/UncertaintyQuantification/runme.m	(revision 18269)
+@@ -1,5 +1,5 @@
+ %PIG Uncertainty Quantification Application
+-steps=[7]; 
++steps=[1:3]; 
+ 
+ if any(steps==1) 
+ 	disp('   Step 1: plot flux gates'); 
+@@ -161,11 +161,11 @@
+ 	%all types of variables and responses: scaled_Thickness, indexed_MassFlux_i,MaxVel,nodal_DragCoefficient_i. scaled variables are expanded.
+ 
+ 	%variables
+-	md.qmu.variables.Thickness=normal_uncertain('scaled_Thickness',1,0.05);
+ 	md.qmu.variables.DragCoefficient=normal_uncertain(...
+ 	'scaled_FrictionCoefficient',1,0.05);
+ 	md.qmu.variables.rheology_B=normal_uncertain(...
+ 	'scaled_MaterialsRheologyB',1,0.05);
++	md.qmu.variables.Thickness=normal_uncertain('scaled_Thickness',1,0.05);
+ 
+ 	%responses
+ 	md.qmu.responses.MassFlux1=response_function('indexed_MassFlux_1',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18269-18270.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18269-18270.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18269-18270.diff	(revision 18296)
@@ -0,0 +1,28 @@
+Index: ../trunk-jpl/examples/Greenland/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Greenland/runme.m	(revision 18269)
++++ ../trunk-jpl/examples/Greenland/runme.m	(revision 18270)
+@@ -210,8 +210,9 @@
+ if any(steps==8)
+ 	disp('   Step 8: Plotting exercise');
+ 
+-	%load historic transient model
++	%Load historic transient model
+ 
++
+ 	%Create Line Plots of relaxation run.  Create a figure.
+ 
+ 
+Index: ../trunk-jpl/examples/Greenland/CheatSheet.m
+===================================================================
+--- ../trunk-jpl/examples/Greenland/CheatSheet.m	(revision 18269)
++++ ../trunk-jpl/examples/Greenland/CheatSheet.m	(revision 18270)
+@@ -1,7 +1,7 @@
+ if any(steps==8)
+ 	disp('   Step 8: Plotting exercise');
+ 
+-	%load historic transient model
++	%Load historic transient model
+ 	md = loadmodel('./Models/Greenland.HistoricTransient');
+ 
+ 	%Create Line Plots of relaxation run.  Create a figure.
Index: /issm/oecreview/Archive/17984-18295/ISSM-18270-18271.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18270-18271.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18270-18271.diff	(revision 18296)
@@ -0,0 +1,154 @@
+Index: ../trunk-jpl/examples/Inversion/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Inversion/runme.m	(revision 18270)
++++ ../trunk-jpl/examples/Inversion/runme.m	(revision 18271)
+@@ -1,30 +1,21 @@
+-step=3;
++step=1;
+ if step==1
+ 	%Generate observation
+ 	md = model;
+ 	md = triangle(md,'DomainOutline.exp',100000);
+-    
+-	md = setmask(md,'','');
+-    
++	md = setmask(md,'all','');
+ 	md = parameterize(md,'Square.par');
+ 	md = setflowequation(md,'SSA','all');
+ 	md.cluster = generic('np',2);
+-    
+-    md.geometry.surface=md.geometry.surface+100;
+-    md.geometry.base = md.geometry.base+100;
+-    md.materials.rheology_B(:)=1.8*10^8;
+-    md.friction.coefficient(:)=50;
+-    md.friction.coefficient(find(md.mesh.x>400000 & md.mesh.x<600000))=10;
+-    
+ 	md = solve(md,StressbalanceSolutionEnum);
+-	plotmodel(md,'data',md.friction.coefficient,'caxis',[0 100],'figure',1);
++	plotmodel(md,'data',md.materials.rheology_B,'caxis',[ 1.3 1.9]*10^8,'figure',1);
+ 	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
+ 	save model1 md
+ end
+ if step==2
+ 	%Modify rheology, now constant
+ 	loadmodel('model1.mat');
+-	md.friction.coefficient(:)=50;
++	md.materials.rheology_B(:) = 1.8*10^8;
+ 
+ 	%results of previous run are taken as observations
+ 	md.inversion=m1qn3inversion();
+@@ -33,7 +24,7 @@
+ 	md.inversion.vel_obs = md.results.StressbalanceSolution.Vel;
+ 
+ 	md = solve(md,StressbalanceSolutionEnum);
+-	plotmodel(md,'data',md.friction.coefficient,'caxis',[0 100],'figure',1);
++	plotmodel(md,'data',md.materials.rheology_B,'caxis',[ 1.3 1.9]*10^8,'figure',1);
+ 	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
+ 	save model2 md
+ end
+@@ -44,18 +35,37 @@
+ 	%Set up inversion parameters
+ 	maxsteps = 20;
+ 	md.inversion.iscontrol = 1;
+-	md.inversion.control_parameters = {'FrictionCoefficient'};
++	md.inversion.control_parameters = {'MaterialsRheologyBbar'};
+ 	md.inversion.maxsteps = maxsteps;
+-	md.inversion.dxmin=10^-6;
+-	md.inversion.cost_functions = [103 501];
+-	md.inversion.cost_functions_coefficients = ones(md.mesh.numberofvertices,2);
+-	md.inversion.cost_functions_coefficients(:,2)=0;
+-	md.inversion.min_parameters    = 10^-5*ones(md.mesh.numberofvertices,1);
+-	md.inversion.max_parameters    = 100*ones(md.mesh.numberofvertices,1);
++	md.inversion.cost_functions = 101;
++	md.inversion.cost_functions_coefficients = ones(md.mesh.numberofvertices,1);
++	md.inversion.min_parameters    = paterson(273)*ones(md.mesh.numberofvertices,1);
++	md.inversion.max_parameters    = paterson(200)*ones(md.mesh.numberofvertices,1);
+ 
+ 	%Go solve!
+ 	md.verbose=verbose(0);
+ 	md=solve(md,StressbalanceSolutionEnum);
+-	plotmodel(md,'data',md.results.StressbalanceSolution.FrictionCoefficient,'caxis',[0 100],'figure',1);
++	plotmodel(md,'data',md.results.StressbalanceSolution.MaterialsRheologyBbar,'caxis',[ 1.3 1.9]*10^8,'figure',1);
+ 	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
+ end
++if step==4
++	%invert for ice rigidity
++	loadmodel('model2.mat');
++
++	%Set up inversion parameters
++	maxsteps = 20;
++	md.inversion.iscontrol = 1;
++	md.inversion.control_parameters = {'MaterialsRheologyBbar'};
++	md.inversion.maxsteps = maxsteps;
++	md.inversion.cost_functions = [101 502];
++	md.inversion.cost_functions_coefficients      = ones(md.mesh.numberofvertices,1);
++	md.inversion.cost_functions_coefficients(:,2) = 10^-16*ones(md.mesh.numberofvertices,1);
++	md.inversion.min_parameters    = paterson(273)*ones(md.mesh.numberofvertices,1);
++	md.inversion.max_parameters    = paterson(200)*ones(md.mesh.numberofvertices,1);
++
++	%Go solve!
++	md.verbose=verbose(0);
++	md=solve(md,StressbalanceSolutionEnum);
++	plotmodel(md,'data',md.results.StressbalanceSolution.MaterialsRheologyBbar,'caxis',[ 1.3 1.9]*10^8,'figure',1);
++	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
++end
+Index: ../trunk-jpl/examples/Inversion/runme2.m
+===================================================================
+--- ../trunk-jpl/examples/Inversion/runme2.m	(revision 0)
++++ ../trunk-jpl/examples/Inversion/runme2.m	(revision 18271)
+@@ -0,0 +1,55 @@
++step=1;
++if step==1
++	%Generate observation
++	md = model;
++	md = triangle(md,'DomainOutline.exp',100000);
++	md = setmask(md,'','');
++	md = parameterize(md,'Square.par');
++	md = setflowequation(md,'SSA','all');
++	md.cluster = generic('np',2);
++
++	%START
++	md.geometry.base    = md.geometry.base+100;
++	md.geometry.surface = md.geometry.surface+100;
++	md.friction.coefficient(:)=50;
++	md.friction.coefficient(find(md.mesh.x<600000 & md.mesh.x>400000))=10;
++	%END
++
++	md = solve(md,StressbalanceSolutionEnum);
++
++	save model1 md
++end
++if step==2
++	loadmodel('model1.mat');
++
++	md.friction.coefficient(:)=50;
++
++	%results of previous run are taken as observations
++	md.inversion=m1qn3inversion();
++	md.inversion.vx_obs  = md.results.StressbalanceSolution.Vx;
++	md.inversion.vy_obs  = md.results.StressbalanceSolution.Vy;
++	md.inversion.vel_obs = md.results.StressbalanceSolution.Vel;
++
++	md = solve(md,StressbalanceSolutionEnum);
++	save model2 md
++end
++if step==3
++	%invert for ice rigidity
++	loadmodel('model2.mat');
++
++	%Set up inversion parameters
++	maxsteps = 20;
++	md.inversion.iscontrol = 1;
++	md.inversion.control_parameters = {'FrictionCoefficient'};
++	md.inversion.maxsteps = maxsteps;
++	md.inversion.cost_functions = 101;
++	md.inversion.cost_functions_coefficients = ones(md.mesh.numberofvertices,1);
++	md.inversion.min_parameters    = 1*ones(md.mesh.numberofvertices,1);
++	md.inversion.max_parameters    = 100*ones(md.mesh.numberofvertices,1);
++
++	%Go solve!
++	md.verbose=verbose(0);
++	md=solve(md,StressbalanceSolutionEnum);
++	plotmodel(md,'data',md.results.StressbalanceSolution.FrictionCoefficient,'figure',1);
++	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
++end
Index: /issm/oecreview/Archive/17984-18295/ISSM-18271-18272.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18271-18272.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18271-18272.diff	(revision 18296)
@@ -0,0 +1,179 @@
+Index: ../trunk-jpl/examples/Inversion/runme2.m
+===================================================================
+--- ../trunk-jpl/examples/Inversion/runme2.m	(revision 18271)
++++ ../trunk-jpl/examples/Inversion/runme2.m	(revision 18272)
+@@ -1,55 +0,0 @@
+-step=1;
+-if step==1
+-	%Generate observation
+-	md = model;
+-	md = triangle(md,'DomainOutline.exp',100000);
+-	md = setmask(md,'','');
+-	md = parameterize(md,'Square.par');
+-	md = setflowequation(md,'SSA','all');
+-	md.cluster = generic('np',2);
+-
+-	%START
+-	md.geometry.base    = md.geometry.base+100;
+-	md.geometry.surface = md.geometry.surface+100;
+-	md.friction.coefficient(:)=50;
+-	md.friction.coefficient(find(md.mesh.x<600000 & md.mesh.x>400000))=10;
+-	%END
+-
+-	md = solve(md,StressbalanceSolutionEnum);
+-
+-	save model1 md
+-end
+-if step==2
+-	loadmodel('model1.mat');
+-
+-	md.friction.coefficient(:)=50;
+-
+-	%results of previous run are taken as observations
+-	md.inversion=m1qn3inversion();
+-	md.inversion.vx_obs  = md.results.StressbalanceSolution.Vx;
+-	md.inversion.vy_obs  = md.results.StressbalanceSolution.Vy;
+-	md.inversion.vel_obs = md.results.StressbalanceSolution.Vel;
+-
+-	md = solve(md,StressbalanceSolutionEnum);
+-	save model2 md
+-end
+-if step==3
+-	%invert for ice rigidity
+-	loadmodel('model2.mat');
+-
+-	%Set up inversion parameters
+-	maxsteps = 20;
+-	md.inversion.iscontrol = 1;
+-	md.inversion.control_parameters = {'FrictionCoefficient'};
+-	md.inversion.maxsteps = maxsteps;
+-	md.inversion.cost_functions = 101;
+-	md.inversion.cost_functions_coefficients = ones(md.mesh.numberofvertices,1);
+-	md.inversion.min_parameters    = 1*ones(md.mesh.numberofvertices,1);
+-	md.inversion.max_parameters    = 100*ones(md.mesh.numberofvertices,1);
+-
+-	%Go solve!
+-	md.verbose=verbose(0);
+-	md=solve(md,StressbalanceSolutionEnum);
+-	plotmodel(md,'data',md.results.StressbalanceSolution.FrictionCoefficient,'figure',1);
+-	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
+-end
+Index: ../trunk-jpl/examples/Inversion/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Inversion/runme.m	(revision 18271)
++++ ../trunk-jpl/examples/Inversion/runme.m	(revision 18272)
+@@ -8,6 +8,7 @@
+ 	md = setflowequation(md,'SSA','all');
+ 	md.cluster = generic('np',2);
+ 	md = solve(md,StressbalanceSolutionEnum);
++
+ 	plotmodel(md,'data',md.materials.rheology_B,'caxis',[ 1.3 1.9]*10^8,'figure',1);
+ 	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
+ 	save model1 md
+@@ -24,8 +25,10 @@
+ 	md.inversion.vel_obs = md.results.StressbalanceSolution.Vel;
+ 
+ 	md = solve(md,StressbalanceSolutionEnum);
++
+ 	plotmodel(md,'data',md.materials.rheology_B,'caxis',[ 1.3 1.9]*10^8,'figure',1);
+-	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
++	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2, 'gridded#all',1);  
++
+ 	save model2 md
+ end
+ if step==3
+@@ -45,8 +48,9 @@
+ 	%Go solve!
+ 	md.verbose=verbose(0);
+ 	md=solve(md,StressbalanceSolutionEnum);
++
+ 	plotmodel(md,'data',md.results.StressbalanceSolution.MaterialsRheologyBbar,'caxis',[ 1.3 1.9]*10^8,'figure',1);
+-	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
++	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2,'gridded#all',1);  
+ end
+ if step==4
+ 	%invert for ice rigidity
+@@ -66,6 +70,7 @@
+ 	%Go solve!
+ 	md.verbose=verbose(0);
+ 	md=solve(md,StressbalanceSolutionEnum);
++
+ 	plotmodel(md,'data',md.results.StressbalanceSolution.MaterialsRheologyBbar,'caxis',[ 1.3 1.9]*10^8,'figure',1);
+ 	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
+ end
+Index: ../trunk-jpl/examples/Inversion/CheatSheet.m
+===================================================================
+--- ../trunk-jpl/examples/Inversion/CheatSheet.m	(revision 0)
++++ ../trunk-jpl/examples/Inversion/CheatSheet.m	(revision 18272)
+@@ -0,0 +1,71 @@
++step=1;
++if step==1
++	%Generate observation
++	md = model;
++	md = triangle(md,'DomainOutline.exp',100000);
++
++	%Hands on: STEP 1
++	md.geometry.base    = md.geometry.base+100;
++	md.geometry.surface = md.geometry.surface+100;
++
++	%Hands on: STEP 2
++	md = setmask(md,'','');
++
++	md = parameterize(md,'Square.par');
++	md = setflowequation(md,'SSA','all');
++	md.cluster = generic('np',2);
++
++	%Hands on: STEP 3
++	md.materials.rheology_B(:) = 1.8*10^8;
++
++	%Hands on: STEP 4
++	md.friction.coefficient(:)=50;
++	md.friction.coefficient(find(md.mesh.x<600000 & md.mesh.x>400000))=10;
++
++	md = solve(md,StressbalanceSolutionEnum);
++
++	save model1 md
++end
++if step==2
++	loadmodel('model1.mat');
++
++	%Hands on: STEP 1
++	md.friction.coefficient(:)=50;
++
++	%results of previous run are taken as observations
++	md.inversion=m1qn3inversion();
++	md.inversion.vx_obs  = md.results.StressbalanceSolution.Vx;
++	md.inversion.vy_obs  = md.results.StressbalanceSolution.Vy;
++	md.inversion.vel_obs = md.results.StressbalanceSolution.Vel;
++
++	md = solve(md,StressbalanceSolutionEnum);
++
++	save model2 md
++end
++if step==3
++	%invert for ice rigidity
++	loadmodel('model2.mat');
++
++	%Set up inversion parameters
++	maxsteps = 20;
++	md.inversion.iscontrol = 1;
++
++	%Hands on: STEP 1
++	md.inversion.control_parameters = {'FrictionCoefficient'};
++	md.inversion.maxsteps = maxsteps;
++
++	%Hands on: STEP 2
++	md.inversion.cost_functions = 101;
++	md.inversion.cost_functions_coefficients = ones(md.mesh.numberofvertices,1);
++
++	%Hands on: STEP 3
++	md.inversion.min_parameters    = 1*ones(md.mesh.numberofvertices,1);
++	md.inversion.max_parameters    = 100*ones(md.mesh.numberofvertices,1);
++
++	%Go solve!
++	md.verbose=verbose(0);
++	md=solve(md,StressbalanceSolutionEnum);
++
++	plotmodel(md,'data',md.results.StressbalanceSolution.FrictionCoefficient,'figure',1);
++	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
++end
Index: /issm/oecreview/Archive/17984-18295/ISSM-18272-18273.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18272-18273.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18272-18273.diff	(revision 18296)
@@ -0,0 +1,31 @@
+Index: ../trunk-jpl/examples/Inversion/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Inversion/runme.m	(revision 18272)
++++ ../trunk-jpl/examples/Inversion/runme.m	(revision 18273)
+@@ -7,10 +7,12 @@
+ 	md = parameterize(md,'Square.par');
+ 	md = setflowequation(md,'SSA','all');
+ 	md.cluster = generic('np',2);
++
+ 	md = solve(md,StressbalanceSolutionEnum);
+ 
+ 	plotmodel(md,'data',md.materials.rheology_B,'caxis',[ 1.3 1.9]*10^8,'figure',1);
+ 	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
++
+ 	save model1 md
+ end
+ if step==2
+Index: ../trunk-jpl/examples/Inversion/CheatSheet.m
+===================================================================
+--- ../trunk-jpl/examples/Inversion/CheatSheet.m	(revision 18272)
++++ ../trunk-jpl/examples/Inversion/CheatSheet.m	(revision 18273)
+@@ -24,6 +24,9 @@
+ 
+ 	md = solve(md,StressbalanceSolutionEnum);
+ 
++	plotmodel(md,'data',md.materials.rheology_B,'caxis',[ 1.3 1.9]*10^8,'figure',1);
++	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);
++
+ 	save model1 md
+ end
+ if step==2
Index: /issm/oecreview/Archive/17984-18295/ISSM-18273-18274.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18273-18274.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18273-18274.diff	(revision 18296)
@@ -0,0 +1,51 @@
+Index: ../trunk-jpl/examples/Inversion/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Inversion/runme.m	(revision 18273)
++++ ../trunk-jpl/examples/Inversion/runme.m	(revision 18274)
+@@ -29,7 +29,7 @@
+ 	md = solve(md,StressbalanceSolutionEnum);
+ 
+ 	plotmodel(md,'data',md.materials.rheology_B,'caxis',[ 1.3 1.9]*10^8,'figure',1);
+-	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2, 'gridded#all',1);  
++	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
+ 
+ 	save model2 md
+ end
+@@ -52,7 +52,7 @@
+ 	md=solve(md,StressbalanceSolutionEnum);
+ 
+ 	plotmodel(md,'data',md.results.StressbalanceSolution.MaterialsRheologyBbar,'caxis',[ 1.3 1.9]*10^8,'figure',1);
+-	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2,'gridded#all',1);  
++	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
+ end
+ if step==4
+ 	%invert for ice rigidity
+Index: ../trunk-jpl/examples/Inversion/CheatSheet.m
+===================================================================
+--- ../trunk-jpl/examples/Inversion/CheatSheet.m	(revision 18273)
++++ ../trunk-jpl/examples/Inversion/CheatSheet.m	(revision 18274)
+@@ -1,4 +1,4 @@
+-step=1;
++step=3;
+ if step==1
+ 	%Generate observation
+ 	md = model;
+@@ -24,7 +24,7 @@
+ 
+ 	md = solve(md,StressbalanceSolutionEnum);
+ 
+-	plotmodel(md,'data',md.materials.rheology_B,'caxis',[ 1.3 1.9]*10^8,'figure',1);
++	plotmodel(md,'data',md.friction.coefficient,'caxis',[ 1.3 1.9]*10^8,'figure',1);
+ 	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);
+ 
+ 	save model1 md
+@@ -43,6 +43,9 @@
+ 
+ 	md = solve(md,StressbalanceSolutionEnum);
+ 
++	plotmodel(md,'data',md.friction.coefficient,'caxis',[ 1.3 1.9]*10^8,'figure',1);
++	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);
++
+ 	save model2 md
+ end
+ if step==3
Index: /issm/oecreview/Archive/17984-18295/ISSM-18274-18275.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18274-18275.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18274-18275.diff	(revision 18296)
@@ -0,0 +1,43 @@
+Index: ../trunk-jpl/examples/Inversion/runme.m
+===================================================================
+--- ../trunk-jpl/examples/Inversion/runme.m	(revision 18274)
++++ ../trunk-jpl/examples/Inversion/runme.m	(revision 18275)
+@@ -10,8 +10,8 @@
+ 
+ 	md = solve(md,StressbalanceSolutionEnum);
+ 
+-	plotmodel(md,'data',md.materials.rheology_B,'caxis',[ 1.3 1.9]*10^8,'figure',1);
+-	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
++	plotmodel(md,'data',md.materials.rheology_B,'caxis',[ 1.3 1.9]*10^8,'figure',1,'gridded#all',1);
++	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2,'gridded#all',1);  
+ 
+ 	save model1 md
+ end
+Index: ../trunk-jpl/examples/Inversion/CheatSheet.m
+===================================================================
+--- ../trunk-jpl/examples/Inversion/CheatSheet.m	(revision 18274)
++++ ../trunk-jpl/examples/Inversion/CheatSheet.m	(revision 18275)
+@@ -1,4 +1,4 @@
+-step=3;
++step=1;
+ if step==1
+ 	%Generate observation
+ 	md = model;
+@@ -24,7 +24,7 @@
+ 
+ 	md = solve(md,StressbalanceSolutionEnum);
+ 
+-	plotmodel(md,'data',md.friction.coefficient,'caxis',[ 1.3 1.9]*10^8,'figure',1);
++	plotmodel(md,'data',md.friction.coefficient,'figure',1);
+ 	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);
+ 
+ 	save model1 md
+@@ -43,7 +43,7 @@
+ 
+ 	md = solve(md,StressbalanceSolutionEnum);
+ 
+-	plotmodel(md,'data',md.friction.coefficient,'caxis',[ 1.3 1.9]*10^8,'figure',1);
++	plotmodel(md,'data',md.friction.coefficient,'figure',1);
+ 	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);
+ 
+ 	save model2 md
Index: /issm/oecreview/Archive/17984-18295/ISSM-18275-18276.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18275-18276.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18275-18276.diff	(revision 18296)
@@ -0,0 +1,43 @@
+Index: ../trunk-jpl/examples/Inversion/CheatSheet.m
+===================================================================
+--- ../trunk-jpl/examples/Inversion/CheatSheet.m	(revision 18275)
++++ ../trunk-jpl/examples/Inversion/CheatSheet.m	(revision 18276)
+@@ -4,10 +4,6 @@
+ 	md = model;
+ 	md = triangle(md,'DomainOutline.exp',100000);
+ 
+-	%Hands on: STEP 1
+-	md.geometry.base    = md.geometry.base+100;
+-	md.geometry.surface = md.geometry.surface+100;
+-
+ 	%Hands on: STEP 2
+ 	md = setmask(md,'','');
+ 
+@@ -15,6 +11,10 @@
+ 	md = setflowequation(md,'SSA','all');
+ 	md.cluster = generic('np',2);
+ 
++	%Hands on: STEP 1
++	md.geometry.base    = md.geometry.base+100;
++	md.geometry.surface = md.geometry.surface+100;
++
+ 	%Hands on: STEP 3
+ 	md.materials.rheology_B(:) = 1.8*10^8;
+ 
+@@ -65,13 +65,13 @@
+ 	md.inversion.cost_functions_coefficients = ones(md.mesh.numberofvertices,1);
+ 
+ 	%Hands on: STEP 3
+-	md.inversion.min_parameters    = 1*ones(md.mesh.numberofvertices,1);
+-	md.inversion.max_parameters    = 100*ones(md.mesh.numberofvertices,1);
++	md.inversion.min_parameters = 1*ones(md.mesh.numberofvertices,1);
++	md.inversion.max_parameters = 100*ones(md.mesh.numberofvertices,1);
+ 
+ 	%Go solve!
+ 	md.verbose=verbose(0);
+ 	md=solve(md,StressbalanceSolutionEnum);
+ 
+-	plotmodel(md,'data',md.results.StressbalanceSolution.FrictionCoefficient,'figure',1);
++	plotmodel(md,'data',md.results.StressbalanceSolution.FrictionCoefficient,'figure',1,'caxis',[10 50]);
+ 	plotmodel(md,'data',md.results.StressbalanceSolution.Vel,'figure',2);  
+ end
Index: /issm/oecreview/Archive/17984-18295/ISSM-18276-18277.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18276-18277.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18276-18277.diff	(revision 18296)
@@ -0,0 +1,164 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18276)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18277)
+@@ -88,6 +88,7 @@
+ 	int     fe_FS;
+ 	int     numoutputs;
+ 	char**  requestedoutputs = NULL;
++	int     materials_type;
+ 
+ 	parameters->AddObject(iomodel->CopyConstantObject(FlowequationIsSIAEnum));
+ 	parameters->AddObject(iomodel->CopyConstantObject(FlowequationIsSSAEnum));
+@@ -115,6 +116,12 @@
+ 		parameters->AddObject(iomodel->CopyConstantObject(AugmentedLagrangianThetaEnum));
+ 	}
+ 
++	iomodel->Constant(&materials_type,MaterialsEnum);
++	if(materials_type==MatdamageiceEnum){
++		parameters->AddObject(iomodel->CopyConstantObject(DamageC1Enum));
++		parameters->AddObject(iomodel->CopyConstantObject(DamageStressThresholdEnum));
++	}
++
+ 	/*Requested outputs*/
+ 	iomodel->FetchData(&requestedoutputs,&numoutputs,StressbalanceRequestedOutputsEnum);
+ 	parameters->AddObject(new IntParam(StressbalanceNumRequestedOutputsEnum,numoutputs));
+Index: ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 18276)
++++ ../trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp	(revision 18277)
+@@ -547,7 +547,7 @@
+ 	element->FindParam(&damagelaw,DamageLawEnum);
+ 
+ 	/*Compute stress tensor: */
+-	element->ComputeDeviatoricStressTensor();
++	element->ComputeStrainRate();
+ 
+ 	/*retrieve what we need: */
+ 	Input* eps_xx_input  = element->GetInput(StrainRatexxEnum);     _assert_(eps_xx_input);
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18276)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18277)
+@@ -45,13 +45,18 @@
+ 	IssmDouble *xyz_list=NULL;
+ 	IssmDouble  eps_xx,eps_xy,eps_yy,eps_xz,eps_yz,eps_zz,eps_eff;
+ 	IssmDouble  epsmin=1.e-27;
+-	int         dim;
++	IssmDouble  eps_0,eps_f,sigma_0,B,D,n;
++	int         dim,counter=0;
++	IssmDouble  k1,k2,threshold=1.e-12;
+ 
+-	/*Retrieve all inputs we will be needing: */
+-	/* TODO: retrieve parameters eps_0 and eps_f and input DamageD(bar?) */
++	/* Retrieve parameters */
+ 	this->GetVerticesCoordinates(&xyz_list);
+ 	this->ComputeStrainRate();
+ 	parameters->FindParam(&dim,DomainDimensionEnum);
++	parameters->FindParam(&eps_f,DamageC1Enum);
++	parameters->FindParam(&sigma_0,DamageStressThresholdEnum);
++
++	/* Retrieve inputs */
+ 	Input* eps_xx_input=this->GetInput(StrainRatexxEnum); _assert_(eps_xx_input);
+ 	Input* eps_yy_input=this->GetInput(StrainRateyyEnum); _assert_(eps_yy_input);
+ 	Input* eps_xy_input=this->GetInput(StrainRatexyEnum); _assert_(eps_xy_input);
+@@ -64,11 +69,39 @@
+ 		eps_zz_input=this->GetInput(StrainRatezzEnum); _assert_(eps_zz_input);
+ 	}
+ 
+-	/* Start looping on the number of vertices: */
++	/* Fetch number of nodes and allocate output*/
++   int numnodes = this->GetNumberOfNodes();
++   IssmDouble* newD = xNew<IssmDouble>(numnodes);
++
++	/* Retrieve domain-dependent inputs */
++	Input* n_input=this->GetInput(MaterialsRheologyNEnum); _assert_(n_input);
++   Input* damage_input = NULL;
++   Input* B_input = NULL;
++	int domaintype;
++   parameters->FindParam(&domaintype,DomainTypeEnum);
++	if(domaintype==Domain2DhorizontalEnum){
++      damage_input = this->GetInput(DamageDbarEnum);  _assert_(damage_input);
++      B_input=this->GetInput(MaterialsRheologyBbarEnum); _assert_(B_input);
++   }
++   else{
++      damage_input = this->GetInput(DamageDEnum);   _assert_(damage_input);
++      B_input=this->GetInput(MaterialsRheologyBEnum); _assert_(B_input);
++   }
++	/* Get B and D inputs appropriate for the type of domain */
++	/*n=this->material->GetN();*/
++   /*if(domaintype==Domain2DhorizontalEnum){
++		B=this->material->GetBbar();
++		D=this->material->GetDbar();
++   }
++	else{
++		B=this->material->GetB();
++		D=this->material->GetD();
++	}*/
++	
++	/* Start looping on the number of nodes: */
+ 	Gauss* gauss=this->NewGauss();
+-	int numvertices = this->GetNumberOfVertices();
+-	for (int iv=0;iv<numvertices;iv++){
+-		gauss->GaussVertex(iv);
++	for (int i=0;i<numnodes;i++){
++		gauss->GaussNode(this->GetElementType(),i);
+ 
+ 		eps_xx_input->GetInputValue(&eps_xx,gauss);
+ 		eps_yy_input->GetInputValue(&eps_yy,gauss);
+@@ -81,16 +114,52 @@
+ 		else{eps_xz=0; eps_yz=0; eps_zz=0;}
+ 
+ 		/* eps_eff^2 = exx^2 + eyy^2 + exy^2 + exz^2 + eyz^2 + exx*eyy */
+-		eps_eff=sqrt(eps_xx*eps_xx+eps_yy*eps_yy+eps_xy*eps_xy+eps_xz*eps_xz+eps_yz*eps_yz+eps_xx*eps_xx*epsmin*epsmin);
++		eps_eff=sqrt(eps_xx*eps_xx+eps_yy*eps_yy+eps_xy*eps_xy+eps_xz*eps_xz+eps_yz*eps_yz+eps_xx*eps_yy+epsmin*epsmin);
+ 
+-		/*TODO: compute kappa from initial D, then compute new D */
++		B_input->GetInputValue(&B,gauss);
++      n_input->GetInputValue(&n,gauss);
++      damage_input->GetInputValue(&D,gauss);
+ 
++		/* Compute kappa (k) from pre-existing level of damage, using Newton-Raphson */
++		k1=exp(n*eps_0/(eps_f-eps_0)+n*log(1.-D)-log(eps_0)); /* initial guess */
++		
++		while(true){
++      	/*Newton step k2=k1-f(k1)/f'(k1) */
++      	k2=k1-(1.-D-pow(eps_0/k1,1./n)*exp(-(k1-eps_0)/(eps_f-eps_0)))/(pow(eps_0/k1,1./n)*exp(-(k1-eps_0)/(eps_f-eps_0))*(-1./(eps_f-eps_0)-1./n/k1));
++
++      	if( fabs(k2-k1)/(fabs(k2))<threshold ){
++         	break;
++      	}
++      	else{
++      	   k1=k2;
++      	   counter++;
++      	}
++
++      	if(counter>50) break;
++   	}
++
++		/* Compute threshold strain rate from threshold stress */
++		eps_0=pow(sigma_0/B,n); 
++		_assert_(eps_f>eps_0);
++
++		if(eps_eff>k2){
++			newD[i]=1.-pow(eps_0/k2,1./n)*exp(-(k2-eps_0)/(eps_f-eps_0));
++		}
++		else newD[i]=D;
+ 	}
+ 
+-	/* TODO: add newdamage input to DamageEnum and NewDamageEnum */
++	/* Add new damage input to DamageEnum and NewDamageEnum */
++	this->AddInput(NewDamageEnum,newD,this->GetElementType());
++	if(domaintype==Domain2DhorizontalEnum){
++		this->AddInput(DamageDbarEnum,newD,this->GetElementType());
++	}
++	else{
++		this->AddInput(DamageDEnum,newD,this->GetElementType());
++	}
+ 
+ 	/*Clean up and return*/
+ 	xDelete<IssmDouble>(xyz_list);
++	xDelete<IssmDouble>(newD);
+ 	delete gauss;
+ 
+ }/*}}}*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18277-18278.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18277-18278.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18277-18278.diff	(revision 18296)
@@ -0,0 +1,40 @@
+Index: ../trunk-jpl/src/m/classes/damage.py
+===================================================================
+--- ../trunk-jpl/src/m/classes/damage.py	(revision 18277)
++++ ../trunk-jpl/src/m/classes/damage.py	(revision 18278)
+@@ -62,8 +62,6 @@
+ 			s+="%s\n" % fielddisplay(self,"penalty_lock","stabilize unstable damage constraints that keep zigzagging after n iteration (default is 0, no stabilization)")
+ 			s+="%s\n" % fielddisplay(self,"penalty_threshold","threshold to declare convergence of damage evolution solution (default is 0)")
+ 			s+="%s\n" % fielddisplay(self,"penalty_factor","scaling exponent (default is 3)")
+-
+-		if self.law== 1 or self.law == 2:
+ 			s+="%s\n" % fielddisplay(self,"c1","damage parameter 1 ")
+ 			s+="%s\n" % fielddisplay(self,"c2","damage parameter 2 ")
+ 			s+="%s\n" % fielddisplay(self,"c3","damage parameter 3 ")
+@@ -131,7 +129,7 @@
+ 		if self.isdamage:
+ 			md = checkfield(md,'fieldname','damage.D','>=',0,'<=',self.max_damage,'size',[md.mesh.numberofvertices])
+ 			md = checkfield(md,'fieldname','damage.max_damage','<',1,'>=',0)
+-			md = checkfield(md,'fieldname','damage.law','numel',[1],'values',[0,1,2])
++			md = checkfield(md,'fieldname','damage.law','numel',[1],'values',[0,1,2,3])
+ 			md = checkfield(md,'fieldname','damage.spcdamage','forcing',1)
+ 			md = checkfield(md,'fieldname','damage.stabilization','numel',[1],'values',[0,1,2])
+ 			md = checkfield(md,'fieldname','damage.maxiter','>=0',0)
+@@ -139,8 +137,6 @@
+ 			md = checkfield(md,'fieldname','damage.penalty_factor','>=0',0)
+ 			md = checkfield(md,'fieldname','damage.penalty_lock','>=0',0)
+ 			md = checkfield(md,'fieldname','damage.penalty_threshold','>=0',0)
+-
+-		if self.law == 1 or self.law == 2:
+ 			md = checkfield(md,'fieldname','damage.healing','>=',0)
+ 			md = checkfield(md,'fieldname','damage.c1','>=',0)
+ 			md = checkfield(md,'fieldname','damage.c2','>=',0)
+@@ -170,8 +166,6 @@
+ 			WriteData(fid,'object',self,'fieldname','penalty_threshold','format','Integer')
+ 			WriteData(fid,'object',self,'fieldname','penalty_lock','format','Integer')
+ 			WriteData(fid,'object',self,'fieldname','penalty_factor','format','Double')
+-
+-		if self.law==1 or self.law==2:
+ 			WriteData(fid,'object',self,'fieldname','c1','format','Double')
+ 			WriteData(fid,'object',self,'fieldname','c2','format','Double')
+ 			WriteData(fid,'object',self,'fieldname','c3','format','Double')
Index: /issm/oecreview/Archive/17984-18295/ISSM-18278-18279.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18278-18279.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18278-18279.diff	(revision 18296)
@@ -0,0 +1,34 @@
+Index: ../trunk-jpl/src/m/classes/damage.m
+===================================================================
+--- ../trunk-jpl/src/m/classes/damage.m	(revision 18278)
++++ ../trunk-jpl/src/m/classes/damage.m	(revision 18279)
+@@ -157,9 +157,6 @@
+ 				md = checkfield(md,'fieldname','damage.penalty_factor','>=',0);
+ 				md = checkfield(md,'fieldname','damage.penalty_lock','>=',0);
+ 				md = checkfield(md,'fieldname','damage.penalty_threshold','>=',0);
+-			end
+-
+-			if (obj.law==1 | obj.law==2),
+ 				md = checkfield(md,'fieldname','damage.healing','>=',0);
+ 				md = checkfield(md,'fieldname','damage.c1','>=',0);
+ 				md = checkfield(md,'fieldname','damage.c2','>=',0);
+@@ -198,9 +195,6 @@
+ 				fielddisplay(obj,'penalty_lock','stabilize unstable damage constraints that keep zigzagging after n iteration (default is 0, no stabilization)');
+ 				fielddisplay(obj,'penalty_threshold','threshold to declare convergence of damage evolution solution (default is 0)');
+ 				fielddisplay(obj,'penalty_factor','scaling exponent (default is 3)');
+-			end
+-
+-			if (obj.law==1 | obj.law==2),
+ 				fielddisplay(obj,'c1','damage parameter 1');
+ 				fielddisplay(obj,'c2','damage parameter 2');
+ 				fielddisplay(obj,'c3','damage parameter 3');
+@@ -227,9 +221,6 @@
+ 				WriteData(fid,'object',obj,'fieldname','penalty_threshold','format','Integer');
+ 				WriteData(fid,'object',obj,'fieldname','penalty_lock','format','Integer');
+ 				WriteData(fid,'object',obj,'fieldname','penalty_factor','format','Double');
+-			end
+-	
+-			if (obj.law==1 | obj.law==2),
+ 				WriteData(fid,'object',obj,'fieldname','c1','format','Double');
+ 				WriteData(fid,'object',obj,'fieldname','c2','format','Double');
+ 				WriteData(fid,'object',obj,'fieldname','c3','format','Double');
Index: /issm/oecreview/Archive/17984-18295/ISSM-18279-18280.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18279-18280.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18279-18280.diff	(revision 18296)
@@ -0,0 +1,55 @@
+Index: ../trunk-jpl/src/c/shared/FSanalyticals/fsanalyticals.cpp
+===================================================================
+--- ../trunk-jpl/src/c/shared/FSanalyticals/fsanalyticals.cpp	(revision 18279)
++++ ../trunk-jpl/src/c/shared/FSanalyticals/fsanalyticals.cpp	(revision 18280)
+@@ -24,7 +24,7 @@
+ 		case 1:
+ 			z=y;
+ 			return  4*pow(x, 2)*z*pow(x - 1, 2) + 4*pow(x, 2)*z*(z - 1)*(2*z - 1) + 4*pow(x, 2)*pow(x - 1, 2)*(z - 1) + 2*pow(x, 2)*pow(x - 1, 2)*(2*z - 1) + 16*x*z*(x - 1)*(z - 1)*(2*z - 1) - 4*pow(z, 3)*(6*pow(x, 2) - 6*x + 1) + 6*pow(z, 2)*(6*pow(x, 2) - 6*x + 1) + 4*z*pow(x - 1, 2)*(z - 1)*(2*z - 1) - 2*z*(6*pow(x, 2) - 6*x + 1) + z - 1.0L/2.0L;
+-		case 2: case 11:
++		case 2:
+ 			z=y;
+ 			return 10*pow(PI, 2)*pow(p, 2)*pow(sin(PI*p*x), 3)*pow(sin(PI*p*z), 2)*cos(PI*p*z) - 2*pow(PI, 2)*pow(p, 2)*pow(sin(PI*p*x), 3)*pow(cos(PI*p*z), 3) - 6*pow(PI, 2)*pow(p, 2)*sin(PI*p*x)*pow(sin(PI*p*z), 2)*pow(cos(PI*p*x), 2)*cos(PI*p*z) + PI*q*sin(PI*q*z)*cos(PI*q*x);
+ 		case 3: 
+@@ -44,6 +44,9 @@
+ 			return 4*pow(PI, 2)*pow(p, 2)*(cos(PI*p*x) - 1)*sin(PI*p*y)*sin(PI*p*z) + 2*pow(PI, 2)*pow(p, 2)*sin(PI*p*y)*sin(PI*p*z)*cos(PI*p*x) + 2*x*z;
+ 		case 10:
+ 			return 4*pow(PI, 2)*pow(p, 2)*(cos(PI*p*x) - 1)*sin(PI*p*y)*sin(PI*p*z) + 2*pow(PI, 2)*pow(p, 2)*sin(PI*p*y)*sin(PI*p*z)*cos(PI*p*x) + PI*q*pow(z, a)*sin(PI*q*y)*cos(PI*q*x);
++		case 11:
++			z=y;
++			return 32.0/5.0*pow(PI, 2)*sin(8*PI*z) + 8*PI*cos(8*PI*x + 1.0/3.0*PI);
+ 		case 12:
+ 			z=y;
+ 			return 32.0/5.0*pow(PI, 2)*sin(8*PI*z);
+@@ -69,7 +72,7 @@
+ 		case 1:
+ 			z=y;
+ 			return -8*pow(x, 3) + 4*pow(x, 2)*z*(x - 1)*(z - 1) + 2*pow(x, 2)*z*(x - 1)*(2*z - 1) + 2*pow(x, 2)*(x - 1)*(z - 1)*(2*z - 1) + 12*pow(x, 2) + 4*x*z*pow(x - 1, 2)*(z - 1) + 2*x*z*pow(x - 1, 2)*(2*z - 1) + 2*x*pow(x - 1, 2)*(z - 1)*(2*z - 1) - 3*x - 6*pow(z, 4)*(2*x - 1) + 12*pow(z, 3)*(2*x - 1) - 6*pow(z, 2)*(2*x - 1) - 24*pow(z, 2)*(2*pow(x, 3) - 3*pow(x, 2) + x) + 24*z*(2*pow(x, 3) - 3*pow(x, 2) + x) - 1.0L/2.0L;
+-		case 2: case 11:
++		case 2: 
+ 			z=y;
+ 			return -10*pow(PI, 2)*pow(p, 2)*pow(sin(PI*p*x), 2)*pow(sin(PI*p*z), 3)*cos(PI*p*x) + 6*pow(PI, 2)*pow(p, 2)*pow(sin(PI*p*x), 2)*sin(PI*p*z)*cos(PI*p*x)*pow(cos(PI*p*z), 2) + 2*pow(PI, 2)*pow(p, 2)*pow(sin(PI*p*z), 3)*pow(cos(PI*p*x), 3) + PI*q*sin(PI*q*x)*cos(PI*q*z);
+ 		case 3: 
+@@ -89,6 +92,9 @@
+ 			return -2*pow(PI, 2)*pow(p, 2)*(cos(PI*p*y) - 1)*sin(PI*p*x)*sin(PI*p*z) - pow(PI, 2)*pow(p, 2)*sin(PI*p*x)*sin(PI*p*z)*cos(PI*p*y) + 2*y*z;
+ 		case 10:
+ 			return -2*pow(PI, 2)*pow(p, 2)*(cos(PI*p*y) - 1)*sin(PI*p*x)*sin(PI*p*z) - pow(PI, 2)*pow(p, 2)*sin(PI*p*x)*sin(PI*p*z)*cos(PI*p*y) + PI*q*pow(z, a)*sin(PI*q*x)*cos(PI*q*y);
++		case 11:
++			z=y;
++			return 32.0/5.0*pow(PI, 2)*sin(8*PI*x) - 10.;
+ 		case 12:
+ 			z=y;
+ 			return 32.0/5.0*pow(PI, 2)*sin(8*PI*x) - 100;
+@@ -137,11 +143,8 @@
+ 	IssmDouble q = 2.0;   
+ 
+ 	switch(testid){
+-		case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 12: case 21:
++		case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 21:
+ 			return 0.;
+-		case 11:
+-			z=y;
+-			return -10*PI*p*sqrt((9.0L/25.0L)*pow(PI, 2)*pow(p, 2)*pow(cos(2*PI*p*x), 2) + 1)*(9*pow(PI, 2)*pow(p, 2)*pow(sin(PI*p*x), 2)*pow(cos(2*PI*p*x), 2)*pow(cos(PI*p*z), 2) - 9*pow(PI, 2)*pow(p, 2)*pow(sin(PI*p*z), 2)*pow(cos(PI*p*x), 2)*pow(cos(2*PI*p*x), 2) + 90*PI*p*sin(PI*p*x)*sin(PI*p*z)*cos(PI*p*x)*cos(2*PI*p*x)*cos(PI*p*z) - 25*pow(sin(PI*p*x), 2)*pow(cos(PI*p*z), 2) + 25*pow(sin(PI*p*z), 2)*pow(cos(PI*p*x), 2))/((9*pow(PI, 2)*pow(p, 2)*pow(cos(2*PI*p*x), 2) + 25)*(3*PI*p*sin(PI*p*z)*cos(PI*p*x)*cos(2*PI*p*x) - 5*sin(PI*p*x)*cos(PI*p*z))*sin(PI*p*x)*sin(PI*p*z));
+ 		case 18:
+ 			return (120.0L/109.0L)*sqrt(109.)/(10*x - 3*z);
+ 		default:
Index: /issm/oecreview/Archive/17984-18295/ISSM-18280-18281.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18280-18281.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18280-18281.diff	(revision 18296)
@@ -0,0 +1,141 @@
+Index: ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 18280)
++++ ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 18281)
+@@ -30,6 +30,7 @@
+ 	iomodel->FetchDataToInput(elements,VyEnum,0.);
+ 	if(iomodel->domaintype==Domain3DEnum) iomodel->FetchDataToInput(elements,VzEnum,0.);
+ 	iomodel->FetchDataToInput(elements,PressureEnum,0.);
++	iomodel->FetchDataToInput(elements,SigmaNNEnum,0.);
+ }/*}}}*/
+ void UzawaPressureAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+ 
+@@ -170,66 +171,105 @@
+ 	int        dim;
+ 	int        *doflist       = NULL;
+ 	IssmDouble rholambda,un,vx,vy,vz,sigmann;
+-	IssmDouble bed_normal[3];
+ 	IssmDouble *xyz_list_base = NULL;
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+-	int numnodes       = element->GetNumberOfNodes();
+-	//int numnodessigma  = element->NumberofNodes(P2Enum);
+-	int numnodessigma;
++	int numnodes      = element->GetNumberOfNodes();
++	int numnodessigma = element->GetNumberOfNodes(P2Enum);
+ 
+ 	element->FindParam(&dim,DomainDimensionEnum);
+-	if(dim==2) numnodessigma=3;
+-	else numnodessigma=6;
+ 
+ 	/*Fetch dof list and allocate solution vector*/
+ 	element->GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
+-	IssmDouble* values    = xNew<IssmDouble>(numnodes);
+-	IssmDouble* pressure  = xNew<IssmDouble>(numnodes);
+-	Input* vx_input=    element->GetInput(VxEnum);       _assert_(vx_input);
+-	Input* vy_input=    element->GetInput(VyEnum);       _assert_(vy_input);
+-	Input* vz_input     = NULL;
+-	if(dim==3){vz_input =element->GetInput(VzEnum);      _assert_(vz_input);}
+-	Input* sigmann_input=element->GetInput(SigmaNNEnum); _assert_(vy_input);
++	IssmDouble* values        = xNew<IssmDouble>(numnodes);
++	IssmDouble* valueslambda  = xNewZeroInit<IssmDouble>(numnodessigma);
++	IssmDouble* pressure      = xNew<IssmDouble>(numnodes);
++	Input* sigmann_input      = element->GetInput(SigmaNNEnum); _assert_(sigmann_input);
++	Input* vx_input           = element->GetInput(VxEnum);      _assert_(vx_input);
++	Input* vy_input           = element->GetInput(VyEnum);      _assert_(vy_input);
++	Input* vz_input           = NULL;
++	if(dim==3){vz_input       = element->GetInput(VzEnum);      _assert_(vz_input);}
+ 	element->GetInputListOnNodes(&pressure[0],PressureEnum);
+ 
+ 	/*Update pressure enum first*/
+ 	for(int i=0;i<numnodes;i++){
+-		values[i]   = pressure[i] + solution[doflist[i]];
++		values[i]  = pressure[i] + solution[doflist[i]];
+ 	}
+ 	element->AddInput(PressureEnum,values,element->GetElementType());
+ 
+ 	/*Now compute sigmann if on base*/
+ 	if(element->IsOnBase()){ 
++		if(dim==3) _error_("not implemented yet");
+ 
++		int baselist[3];
++		int onbase=0;
++		IssmDouble  Jdet;
++		IssmDouble bed_normal[3];
++		IssmDouble  Jlambda[3][3]  = {0.0};
++		IssmDouble  Cuk[3]         = {0.0};
++		IssmDouble  deltalambda[3] = {0.0};
++		IssmDouble* vertexonbase  = xNew<IssmDouble>(numnodessigma);
++		Input* vertexonbase_input = element->GetInput(MeshVertexonbaseEnum); _assert_(vertexonbase_input);
++		Gauss* gauss = element->NewGauss();
++
++		IssmDouble* basis = xNewZeroInit<IssmDouble>(numnodessigma);
+ 		element->GetVerticesCoordinatesBase(&xyz_list_base);
+ 		element->NormalBase(&bed_normal[0],xyz_list_base);
+ 		element->FindParam(&rholambda,AugmentedLagrangianRholambdaEnum);
+ 
+-		Gauss* gauss = element->NewGauss();
+ 		for(int i=0;i<numnodessigma;i++){
+ 			gauss->GaussNode(P2Enum,i);
++			vertexonbase_input->GetInputValue(&vertexonbase[i], gauss);
++			if(vertexonbase[i]==1){ 
++				baselist[onbase]=i;
++				onbase += 1;
++			}
++		}
++		if(!onbase==3) _error_("basal nodes of element not found");
+ 
+-			sigmann_input->GetInputValue(&sigmann, gauss);
++		delete gauss;
++		gauss = element->NewGaussBase(3);
++		for(int ig=gauss->begin();ig<gauss->end();ig++){
++			gauss->GaussPoint(ig);
++
++			/*Compute Jlambda*/
++			element->NodalFunctionsP2(basis,gauss);
++			element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
++			for(int i=0;i<3;i++){
++				for(int j=0;j<3;j++){
++					Jlambda[i][j] += Jdet*gauss->weight*basis[baselist[i]]*basis[baselist[j]];
++				}
++			}
++
++			/*Compute rho_lambd C u^k*/
+ 			vx_input->GetInputValue(&vx, gauss);
+ 			vy_input->GetInputValue(&vy, gauss);
+ 			un=bed_normal[0]*vx + bed_normal[1]*vy;
+-			if(dim==3){
+-			   vz_input->GetInputValue(&vz, gauss);
+-				un = un + bed_normal[2]*vz;
+-			}
+-			values[i] = sigmann + rholambda*un;
++			for(int i=0;i<3;i++) Cuk[i] += - un*rholambda*Jdet*gauss->weight*basis[baselist[i]];
+ 		}
++
++		/*Now update sigmann*/
++		Matrix3x3Solve(&deltalambda[0],&Jlambda[0][0],&Cuk[0]);
+ 		delete gauss;
++		gauss = element->NewGauss();
++		for(int i=0;i<3;i++){
++			gauss->GaussNode(P2Enum,baselist[i]);
++			sigmann_input->GetInputValue(&sigmann, gauss);
++			valueslambda[baselist[i]] = sigmann + deltalambda[i];
++		}
++
++		delete gauss;
++		xDelete<IssmDouble>(vertexonbase);
+ 		xDelete<IssmDouble>(xyz_list_base);
++		xDelete<IssmDouble>(basis);
+ 	}
+-	element->AddInput(SigmaNNEnum,values,P2Enum);
++	element->AddInput(SigmaNNEnum,valueslambda,P2Enum);
+ 
+ 	/*Free ressources:*/
+ 	xDelete<IssmDouble>(values);
++	xDelete<IssmDouble>(valueslambda);
+ 	xDelete<IssmDouble>(pressure);
+ 	xDelete<int>(doflist);
+-
+ }/*}}}*/
+ void UzawaPressureAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
+ 	/*Default, do nothing*/
Index: /issm/oecreview/Archive/17984-18295/ISSM-18281-18282.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18281-18282.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18281-18282.diff	(revision 18296)
@@ -0,0 +1,68 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18281)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18282)
+@@ -87,16 +87,6 @@
+       damage_input = this->GetInput(DamageDEnum);   _assert_(damage_input);
+       B_input=this->GetInput(MaterialsRheologyBEnum); _assert_(B_input);
+    }
+-	/* Get B and D inputs appropriate for the type of domain */
+-	/*n=this->material->GetN();*/
+-   /*if(domaintype==Domain2DhorizontalEnum){
+-		B=this->material->GetBbar();
+-		D=this->material->GetDbar();
+-   }
+-	else{
+-		B=this->material->GetB();
+-		D=this->material->GetD();
+-	}*/
+ 	
+ 	/* Start looping on the number of nodes: */
+ 	Gauss* gauss=this->NewGauss();
+@@ -120,30 +110,37 @@
+       n_input->GetInputValue(&n,gauss);
+       damage_input->GetInputValue(&D,gauss);
+ 
++		/* Compute threshold strain rate from threshold stress */
++		eps_0=pow(sigma_0/B,n); 
++		_assert_(eps_f>eps_0);
++
+ 		/* Compute kappa (k) from pre-existing level of damage, using Newton-Raphson */
+-		k1=exp(n*eps_0/(eps_f-eps_0)+n*log(1.-D)-log(eps_0)); /* initial guess */
+-		
++		/* provide a reasonable initial guess */
++		if(D==0){
++			k1=eps_0;
++		}
++		else{
++			k1=exp(n*eps_0/(eps_f-eps_0)-n*log(1.-D)+log(eps_0)); /* initial guess */
++		}
++	
++		counter=0;
+ 		while(true){
+       	/*Newton step k2=k1-f(k1)/f'(k1) */
+-      	k2=k1-(1.-D-pow(eps_0/k1,1./n)*exp(-(k1-eps_0)/(eps_f-eps_0)))/(pow(eps_0/k1,1./n)*exp(-(k1-eps_0)/(eps_f-eps_0))*(-1./(eps_f-eps_0)-1./n/k1));
++			k2=k1-(k1+(eps_f-eps_0)/n*log(k1)-eps_0+(eps_f-eps_0)*(log(1.-D)-1./n*log(eps_0)))/(1.+(eps_f-eps_0)/n/k1);
+ 
+       	if( fabs(k2-k1)/(fabs(k2))<threshold ){
+          	break;
+       	}
+       	else{
+-      	   k1=k2;
++				k1=k2;
+       	   counter++;
+       	}
+ 
+       	if(counter>50) break;
+    	}
+ 
+-		/* Compute threshold strain rate from threshold stress */
+-		eps_0=pow(sigma_0/B,n); 
+-		_assert_(eps_f>eps_0);
+-
+ 		if(eps_eff>k2){
+-			newD[i]=1.-pow(eps_0/k2,1./n)*exp(-(k2-eps_0)/(eps_f-eps_0));
++			newD[i]=1.-pow(eps_0/eps_eff,1./n)*exp(-(eps_eff-eps_0)/(eps_f-eps_0));
+ 		}
+ 		else newD[i]=D;
+ 	}
Index: /issm/oecreview/Archive/17984-18295/ISSM-18282-18283.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18282-18283.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18282-18283.diff	(revision 18296)
@@ -0,0 +1,176 @@
+Index: ../trunk-jpl/src/c/classes/Elements/Element.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18282)
++++ ../trunk-jpl/src/c/classes/Elements/Element.h	(revision 18283)
+@@ -171,6 +171,7 @@
+ 		virtual IssmDouble MinEdgeLength(IssmDouble* xyz_list)=0;
+ 		virtual void   NodalFunctions(IssmDouble* basis,Gauss* gauss)=0;
+ 		virtual void   NodalFunctionsP1(IssmDouble* basis,Gauss* gauss)=0;
++		virtual void   NodalFunctionsP2(IssmDouble* basis,Gauss* gauss)=0;
+ 		virtual void   NodalFunctionsVelocity(IssmDouble* basis, Gauss* gauss)=0;
+ 		virtual void   NodalFunctionsPressure(IssmDouble* basis, Gauss* gauss)=0;
+ 		virtual void   NodalFunctionsTensor(IssmDouble* basis, Gauss* gauss)=0;
+@@ -193,6 +194,7 @@
+ 		virtual void   GetSolutionFromInputsOneDof(Vector<IssmDouble>* solution,int solutionenum)=0;
+ 		virtual int    GetNodeIndex(Node* node)=0;
+ 		virtual int    GetNumberOfNodes(void)=0;
++		virtual int    GetNumberOfNodes(int enum_type)=0;
+ 		virtual int    GetNumberOfVertices(void)=0;
+ 
+ 		virtual bool   IsNodeOnShelfFromFlags(IssmDouble* flags)=0; 
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18282)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp	(revision 18283)
+@@ -886,6 +886,10 @@
+ 	else return 0;
+ }
+ /*}}}*/
++int        Tria::GetNumberOfNodes(int enum_type){/*{{{*/
++	return this->NumberofNodes(enum_type);
++}
++/*}}}*/
+ int        Tria::GetNumberOfVertices(void){/*{{{*/
+ 	return NUMVERTICES;
+ }
+@@ -1446,6 +1450,13 @@
+ 
+ }
+ /*}}}*/
++void       Tria::NodalFunctionsP2(IssmDouble* basis, Gauss* gauss){/*{{{*/
++
++	_assert_(gauss->Enum()==GaussTriaEnum);
++	this->GetNodalFunctions(basis,(GaussTria*)gauss,P2Enum);
++
++}
++/*}}}*/
+ void       Tria::NodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+ 
+ 	_assert_(gauss->Enum()==GaussTriaEnum);
+Index: ../trunk-jpl/src/c/classes/Elements/Tria.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18282)
++++ ../trunk-jpl/src/c/classes/Elements/Tria.h	(revision 18283)
+@@ -68,6 +68,7 @@
+ 		IssmDouble  GetGroundedPortion(IssmDouble* xyz_list);
+ 		int         GetNodeIndex(Node* node);
+ 		int         GetNumberOfNodes(void);
++		int         GetNumberOfNodes(int enum_type);
+ 		int         GetNumberOfVertices(void);
+ 		bool        IsOnBase();
+ 		bool        IsOnSurface();
+@@ -164,6 +165,7 @@
+ 		Gauss*         NewGaussTop(int order);
+ 		void           NodalFunctions(IssmDouble* basis,Gauss* gauss);
+ 		void           NodalFunctionsP1(IssmDouble* basis,Gauss* gauss);
++		void           NodalFunctionsP2(IssmDouble* basis,Gauss* gauss);
+ 		void           NodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
+ 		void           NodalFunctionsP1Derivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
+ 		void           NodalFunctionsMINIDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18282)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp	(revision 18283)
+@@ -853,6 +853,10 @@
+ 	return this->NumberofNodes(this->element_type);
+ }
+ /*}}}*/
++int        Penta::GetNumberOfNodes(int enum_type){/*{{{*/
++	return this->NumberofNodes(enum_type);
++}
++/*}}}*/
+ int        Penta::GetNumberOfVertices(void){/*{{{*/
+ 	return NUMVERTICES; 
+ }
+@@ -1627,6 +1631,13 @@
+ 
+ }
+ /*}}}*/
++void       Penta::NodalFunctionsP2(IssmDouble* basis, Gauss* gauss){/*{{{*/
++
++	_assert_(gauss->Enum()==GaussPentaEnum);
++	this->GetNodalFunctions(basis,(GaussPenta*)gauss,P2Enum);
++
++}
++/*}}}*/
+ void       Penta::NodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss){/*{{{*/
+ 
+ 	_assert_(gauss->Enum()==GaussPentaEnum);
+Index: ../trunk-jpl/src/c/classes/Elements/Penta.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 18282)
++++ ../trunk-jpl/src/c/classes/Elements/Penta.h	(revision 18283)
+@@ -73,6 +73,7 @@
+ 		IssmDouble GetGroundedPortion(IssmDouble* xyz_list);
+ 		int    GetNodeIndex(Node* node);
+ 		int    GetNumberOfNodes(void);
++		int    GetNumberOfNodes(int enum_type);
+ 		int    GetNumberOfVertices(void);
+ 		void   GetSolutionFromInputsOneDof(Vector<IssmDouble>* solution,int enum_type);
+ 		void   GetVerticesCoordinatesBase(IssmDouble** pxyz_list);
+@@ -162,6 +163,7 @@
+ 		Gauss*         NewGaussTop(int order);
+ 		void           NodalFunctions(IssmDouble* basis,Gauss* gauss);
+ 		void           NodalFunctionsP1(IssmDouble* basis,Gauss* gauss);
++		void           NodalFunctionsP2(IssmDouble* basis,Gauss* gauss);
+ 		void           NodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
+ 		void           NodalFunctionsP1Derivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
+ 		void           NodalFunctionsMINIDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss);
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.cpp	(revision 18282)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.cpp	(revision 18283)
+@@ -108,6 +108,13 @@
+ 
+ }
+ /*}}}*/
++void       Seg::NodalFunctionsP2(IssmDouble* basis, Gauss* gauss){/*{{{*/
++
++	_assert_(gauss->Enum()==GaussSegEnum);
++	this->GetNodalFunctions(basis,(GaussSeg*)gauss,P2Enum);
++
++}
++/*}}}*/
+ int        Seg::GetNumberOfNodes(void){/*{{{*/
+ 	return this->NumberofNodes(this->element_type);
+ }
+Index: ../trunk-jpl/src/c/classes/Elements/Seg.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 18282)
++++ ../trunk-jpl/src/c/classes/Elements/Seg.h	(revision 18283)
+@@ -67,6 +67,7 @@
+ 		Element*    GetBasalElement(void){_error_("not implemented yet");};
+ 		int         GetNodeIndex(Node* node){_error_("not implemented yet");};
+ 		int         GetNumberOfNodes(void);
++		int         GetNumberOfNodes(int enum_type){_error_("not implemented yet");};
+ 		int         GetNumberOfVertices(void);
+ 		void        GetVerticesCoordinates(IssmDouble** pxyz_list);
+ 		void        GetVerticesCoordinatesBase(IssmDouble** pxyz_list){_error_("not implemented yet");};
+@@ -82,6 +83,7 @@
+ 		IssmDouble  MinEdgeLength(IssmDouble* xyz_list){_error_("not implemented yet");};
+ 		void        NodalFunctions(IssmDouble* basis,Gauss* gauss);
+ 		void        NodalFunctionsP1(IssmDouble* basis,Gauss* gauss);
++		void        NodalFunctionsP2(IssmDouble* basis,Gauss* gauss);
+ 		void        NodalFunctionsVelocity(IssmDouble* basis,Gauss* gauss){_error_("not implemented yet");};
+ 		void        NodalFunctionsPressure(IssmDouble* basis,Gauss* gauss){_error_("not implemented yet");};
+ 		void        NodalFunctionsTensor(IssmDouble* basis,Gauss* gauss){_error_("not implemented yet");};
+Index: ../trunk-jpl/src/c/classes/Elements/Tetra.h
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 18282)
++++ ../trunk-jpl/src/c/classes/Elements/Tetra.h	(revision 18283)
+@@ -70,6 +70,7 @@
+ 		Element*    GetBasalElement(void){_error_("not implemented yet");};
+ 		int         GetNodeIndex(Node* node);
+ 		int         GetNumberOfNodes(void);
++		int         GetNumberOfNodes(int enum_type){_error_("not implemented yet");};
+ 		int         GetNumberOfVertices(void);
+ 		void        GetVerticesCoordinatesBase(IssmDouble** pxyz_list);
+ 		void        GetVerticesCoordinatesTop(IssmDouble** pxyz_list);
+@@ -86,6 +87,7 @@
+ 		IssmDouble  MinEdgeLength(IssmDouble* xyz_list){_error_("not implemented yet");};
+ 		void        NodalFunctions(IssmDouble* basis,Gauss* gauss);
+ 		void        NodalFunctionsP1(IssmDouble* basis,Gauss* gauss){_error_("not implemented yet");};
++		void        NodalFunctionsP2(IssmDouble* basis,Gauss* gauss){_error_("not implemented yet");};
+ 		void        NodalFunctionsVelocity(IssmDouble* basis,Gauss* gauss);
+ 		void        NodalFunctionsPressure(IssmDouble* basis,Gauss* gauss);
+ 		void        NodalFunctionsTensor(IssmDouble* basis,Gauss* gauss);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18283-18284.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18283-18284.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18283-18284.diff	(revision 18296)
@@ -0,0 +1,383 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h	(revision 18283)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.h	(revision 18284)
+@@ -78,6 +78,8 @@
+ 		ElementVector* CreatePVectorFSViscousXTH(Element* element);
+ 		ElementVector* CreatePVectorFSShelf(Element* element);
+ 		ElementVector* CreatePVectorFSFront(Element* element);
++		ElementVector* CreatePVectorFSFriction(Element* element);
++		ElementVector* CreatePVectorFSStress(Element* element);
+ 		void GetBFS(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBFSprime(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+ 		void GetBFSvel(IssmDouble* B,Element* element,int dim,IssmDouble* xyz_list,Gauss* gauss);
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18283)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18284)
+@@ -244,6 +244,7 @@
+ 	iomodel->Constant(&fe_FS,FlowequationFeFSEnum);
+ 	if(fe_FS==LATaylorHoodEnum){
+ 		iomodel->FetchDataToInput(elements,PressureEnum);
++		InputUpdateFromConstantx(elements,0.,SigmaNNEnum);
+ 	}
+ 
+ 	/*Friction law variables*/
+@@ -2895,13 +2896,8 @@
+ 
+ 	/*Fetch number of nodes and dof for this finite element*/
+ 	int vnumnodes = element->NumberofNodesVelocity();
+-	int pnumnodes;
+-	if(dim==2) pnumnodes=3;
+-	else pnumnodes=6;
+-	int lnumnodes;
+-	if(dim==2) lnumnodes=2;
+-	else lnumnodes=3;
+-	//int pnumnodes = element->NumberofNodes(P1Enum);
++	int pnumnodes = element->GetNumberOfNodes(P1Enum);
++	int lnumnodes = element->GetNumberOfNodes(P2Enum);
+ 	int numdof    = vnumnodes*dim;
+ 	int pnumdof   = pnumnodes;
+ 	int lnumdof   = lnumnodes;
+@@ -2919,16 +2915,13 @@
+ 	IssmDouble*    BU       = xNew<IssmDouble>(pnumdof);
+ 	IssmDouble*    BprimeU  = xNew<IssmDouble>(numdof);
+ 	IssmDouble*    D        = xNewZeroInit<IssmDouble>(epssize*epssize);
+-	IssmDouble*    CtCUzawa = xNewZeroInit<IssmDouble>(numdof*pnumdof);
+-	IssmDouble*    C        = xNew<IssmDouble>(lnumdof);
+-	IssmDouble*    Cprime   = xNew<IssmDouble>(numdof);
+ 
+ 	/*Retrieve all inputs and parameters*/
+ 	element->GetVerticesCoordinates(&xyz_list);
+-	Input* vx_input=element->GetInput(VxEnum);     _assert_(vx_input);
+-	Input* vy_input=element->GetInput(VyEnum);     _assert_(vy_input);
+-	Input* vz_input;
+-	if(dim==3){vz_input=element->GetInput(VzEnum); _assert_(vz_input);}
++	Input* vx_input = element->GetInput(VxEnum);     _assert_(vx_input);
++	Input* vy_input = element->GetInput(VyEnum);     _assert_(vy_input);
++	Input* vz_input = NULL;
++	if(dim==3){vz_input = element->GetInput(VzEnum); _assert_(vz_input);}
+ 
+ 	/* Start  looping on the number of gaussian points: */
+ 	Gauss* gauss = element->NewGauss(5);
+@@ -2956,7 +2949,6 @@
+ 					&DU,1,1,0,
+ 					BprimeU,1,numdof,0,
+ 					BtBUzawa,1);
+-
+ 	}
+ 
+ 	if(element->IsOnBase()){ 
+@@ -2964,30 +2956,37 @@
+ 		element->GetVerticesCoordinatesBase(&xyz_list_base);
+ 		element->NormalBase(&normal[0],xyz_list_base);
+ 
+-		int         lsize;
+-		IssmDouble* Dlambda = xNewZeroInit<IssmDouble>(dim*dim);
+-		IssmDouble* C       = xNewZeroInit<IssmDouble>(dim*lnumdof);
+-		IssmDouble* Cprime  = xNewZeroInit<IssmDouble>(dim*numdof);
++		IssmDouble* Dlambda  = xNewZeroInit<IssmDouble>(dim*dim);
++		IssmDouble* C        = xNewZeroInit<IssmDouble>(dim*lnumdof);
++		IssmDouble* Cprime   = xNewZeroInit<IssmDouble>(dim*numdof);
++		IssmDouble* CtCUzawa = xNewZeroInit<IssmDouble>(numdof*lnumdof);
+ 
+ 		delete gauss;
+-		Gauss* gauss=element->NewGaussBase(5);
++		gauss = element->NewGaussBase(5);
+ 		for(int ig=gauss->begin();ig<gauss->end();ig++){
+ 			gauss->GaussPoint(ig);
+ 
+ 			element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
+ 			this->GetCFS(C,element,dim,xyz_list,gauss);
+ 			this->GetCFSprime(Cprime,element,dim,xyz_list,gauss);
+-			for(i=0;i<dim;i++)   Dlambda[i*epssize+i] = gauss->weight*Jdet*sqrt(normal[i]*normal[i])*sqrt(rl);
++			for(i=0;i<dim;i++) Dlambda[i*dim+i] = gauss->weight*Jdet*sqrt(normal[i]*normal[i])*sqrt(rl);
+ 			TripleMultiply(C,dim,lnumdof,1,
+ 						Dlambda,dim,dim,0,
+ 						Cprime,dim,numdof,0,
+ 						CtCUzawa,1);
+ 		}
++
++		/*The sigma naugmentation should not be transformed*/
++		MatrixMultiply(CtCUzawa,lnumdof,numdof,1,
++					CtCUzawa,lnumdof,numdof,0,
++					&Ke->values[0],1);
++
+ 		/*Delete base part*/
+-		xDelete<IssmDouble>(xyz_list_base);
+ 		xDelete<IssmDouble>(Dlambda);
+ 		xDelete<IssmDouble>(C);
+ 		xDelete<IssmDouble>(Cprime);
++		xDelete<IssmDouble>(CtCUzawa);
++		xDelete<IssmDouble>(xyz_list_base);
+ 	}
+ 
+ 	/*Transform Coordinate System*/
+@@ -2998,11 +2997,6 @@
+ 				BtBUzawa,pnumdof,numdof,0,
+ 				&Ke->values[0],1);
+ 
+-	/*The sigma naugmentation should not be transformed*/
+-	MatrixMultiply(CtCUzawa,lnumdof,numdof,1,
+-				CtCUzawa,lnumdof,numdof,0,
+-				&Ke->values[0],1);
+-
+ 	/*Clean up and return*/
+ 	delete gauss;
+ 	xDelete<IssmDouble>(xyz_list);
+@@ -3012,9 +3006,6 @@
+ 	xDelete<IssmDouble>(BprimeU);
+ 	xDelete<IssmDouble>(BU);
+ 	xDelete<IssmDouble>(BtBUzawa);
+-	xDelete<IssmDouble>(Cprime);
+-	xDelete<IssmDouble>(C);
+-	xDelete<IssmDouble>(CtCUzawa);
+ 	xDelete<int>(cs_list);
+ 	return Ke;
+ }/*}}}*/
+@@ -3297,6 +3288,21 @@
+ }/*}}}*/
+ ElementVector* StressbalanceAnalysis::CreatePVectorFS(Element* element){/*{{{*/
+ 
++	ElementVector* pe = NULL;
++
++	ElementVector* pe1=CreatePVectorFSViscous(element);
++	ElementVector* pe2=CreatePVectorFSFriction(element);
++	ElementVector* pe3=CreatePVectorFSStress(element);
++	pe =new ElementVector(pe1,pe2,pe3);
++	delete pe1;
++	delete pe2;
++	delete pe3;
++
++	/*clean-up and return*/
++	return pe;
++}/*}}}*/
++ElementVector* StressbalanceAnalysis::CreatePVectorFSViscous(Element* element){/*{{{*/
++
+ 	int         i,dim,fe_FS;
+ 	IssmDouble  x_coord,y_coord,z_coord;
+ 	IssmDouble  Jdet,forcex,forcey,forcez;
+@@ -3370,6 +3376,116 @@
+ 	}
+ 	return pe;
+ }/*}}}*/
++ElementVector* StressbalanceAnalysis::CreatePVectorFSFriction(Element* element){/*{{{*/
++
++	if(!element->IsOnBase()) return NULL;
++
++	/*Intermediaries*/
++	int         dim;
++	IssmDouble  alpha2,Jdet;
++	IssmDouble  bed_normal[3];
++	IssmDouble *xyz_list_base = NULL;
++	Gauss*      gauss         = NULL;
++
++	/*Get problem dimension*/
++	element->FindParam(&dim,DomainDimensionEnum);
++
++	/*Fetch number of nodes and dof for this finite element*/
++	int vnumnodes = element->NumberofNodesVelocity();
++
++	/*Initialize Element matrix and vectors*/
++	ElementVector* pe = element->NewElementVector(FSvelocityEnum);
++	IssmDouble*    vbasis = xNew<IssmDouble>(vnumnodes);
++
++	/*Retrieve all inputs and parameters*/
++	element->GetVerticesCoordinatesBase(&xyz_list_base);
++	Input*  alpha2_input=element->GetInput(FrictionCoefficientEnum); _assert_(alpha2_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=element->NewGaussBase(3);
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++		gauss->GaussPoint(ig);
++
++		alpha2_input->GetInputValue(&alpha2, gauss);
++		element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
++		element->NodalFunctionsVelocity(vbasis,gauss);
++		element->NormalBase(&bed_normal[0],xyz_list_base);
++
++		for(int i=0;i<vnumnodes;i++){
++			pe->values[i*dim+0] += - alpha2*gauss->weight*Jdet*vbasis[i]*bed_normal[1];
++			pe->values[i*dim+1] += alpha2*gauss->weight*Jdet*vbasis[i]*bed_normal[0];
++			if(dim==3){
++				pe->values[i*dim+2]+= alpha2*gauss->weight*Jdet*vbasis[i];
++			}
++		}
++
++	}
++
++	/*DO NOT Transform Coordinate System: this stiffness matrix is already expressed in tangential coordinates*/
++
++	/*Clean up and return*/
++	delete gauss;
++	xDelete<IssmDouble>(xyz_list_base);
++	xDelete<IssmDouble>(vbasis);
++	return pe;
++}/*}}}*/
++ElementVector* StressbalanceAnalysis::CreatePVectorFSStress(Element* element){/*{{{*/
++
++	if(!element->IsOnBase()) return NULL;
++
++	/*Intermediaries*/
++	int         dim;
++	IssmDouble  sigmann,sigmant,Jdet,bedslope,beta;
++	IssmDouble *xyz_list_base = NULL;
++	Gauss*      gauss         = NULL;
++
++	/*Get problem dimension*/
++	element->FindParam(&dim,DomainDimensionEnum);
++
++	/*Fetch number of nodes and dof for this finite element*/
++	int vnumnodes = element->NumberofNodesVelocity();
++
++	/*Initialize Element matrix and vectors*/
++	ElementVector* pe = element->NewElementVector(FSvelocityEnum);
++	IssmDouble*    vbasis = xNew<IssmDouble>(vnumnodes);
++
++	/*Retrieve all inputs and parameters*/
++	element->GetVerticesCoordinatesBase(&xyz_list_base);
++	Input*  sigmann_input=element->GetInput(VzEnum); _assert_(sigmann_input);
++	Input*  sigmant_input=element->GetInput(TemperatureEnum); _assert_(sigmant_input);
++	Input*  bedslope_input=element->GetInput(BedSlopeXEnum);     _assert_(bedslope_input);
++
++	/* Start  looping on the number of gaussian points: */
++	gauss=element->NewGaussBase(3);
++	for(int ig=gauss->begin();ig<gauss->end();ig++){
++		gauss->GaussPoint(ig);
++
++		sigmann_input->GetInputValue(&sigmann, gauss);
++		sigmant_input->GetInputValue(&sigmant, gauss);
++		bedslope_input->GetInputValue(&bedslope, gauss);
++		element->JacobianDeterminantBase(&Jdet,xyz_list_base,gauss);
++		element->NodalFunctionsVelocity(vbasis,gauss);
++
++		beta=sqrt(1+bedslope*bedslope);
++		for(int i=0;i<vnumnodes;i++){
++			pe->values[i*dim+0] += - (1./beta)*(-bedslope*sigmann + sigmant)*gauss->weight*Jdet*vbasis[i];
++			pe->values[i*dim+1] += - (1./beta)*(sigmann + bedslope*sigmant)*gauss->weight*Jdet*vbasis[i];
++			if(dim==3){
++				//pe->values[i*dim+2]+= alpha2*gauss->weight*Jdet*vbasis[i];
++				_error_("3d not supported yet");
++			}
++		}
++
++	}
++
++	/*DO NOT Transform Coordinate System: this stiffness matrix is already expressed in tangential coordinates*/
++
++	/*Clean up and return*/
++	delete gauss;
++	xDelete<IssmDouble>(xyz_list_base);
++	xDelete<IssmDouble>(vbasis);
++	return pe;
++}/*}}}*/
+ #else
+ ElementMatrix* StressbalanceAnalysis::CreateKMatrixFSFriction(Element* element){/*{{{*/
+ 
+@@ -3501,7 +3617,6 @@
+ 	/*clean-up and return*/
+ 	return pe;
+ }/*}}}*/
+-#endif
+ ElementVector* StressbalanceAnalysis::CreatePVectorFSViscous(Element* element){/*{{{*/
+ 
+ 	int         i,dim;
+@@ -3571,6 +3686,7 @@
+ 	xDelete<IssmDouble>(xyz_list);
+ 	return pe;
+ }/*}}}*/
++#endif
+ ElementVector* StressbalanceAnalysis::CreatePVectorFSViscousXTH(Element* element){/*{{{*/
+ 
+ 	int         i,tausize,dim;
+@@ -3771,7 +3887,7 @@
+ 	element->FindParam(&r,AugmentedLagrangianREnum);
+ 	element->GetVerticesCoordinates(&xyz_list);
+ 
+-	/*Get d and tau*/
++	/*Get pressure and sigmann*/
+ 	Input* pressure_input=element->GetInput(PressureEnum); _assert_(pressure_input);
+ 	Input* sigmann_input =element->GetInput(SigmaNNEnum);  _assert_(sigmann_input);
+ 
+@@ -3786,14 +3902,11 @@
+ 		for(i=0;i<numnodes;i++){
+ 			pe->values[i*dim+0] += pressure*gauss->weight*Jdet*dbasis[0*numnodes+i];
+ 			pe->values[i*dim+1] += pressure*gauss->weight*Jdet*dbasis[1*numnodes+i];
+-			if(dim==3){
+-				pe->values[i*dim+2]+= pressure*gauss->weight*Jdet*dbasis[2*numnodes+i];
+-			}
++			if(dim==3) pe->values[i*dim+2]+= pressure*gauss->weight*Jdet*dbasis[2*numnodes+i];
+ 		}
+ 	}
+ 
+ 	if(element->IsOnBase()){ 
+-
+ 		IssmDouble   sigmann;
+ 		IssmDouble*  vbasis = xNew<IssmDouble>(numnodes);
+ 
+@@ -3801,7 +3914,7 @@
+ 		element->NormalBase(&bed_normal[0],xyz_list_base);
+ 
+ 		delete gauss;
+-		Gauss* gauss=element->NewGaussBase(5);
++		gauss=element->NewGaussBase(5);
+ 		for(int ig=gauss->begin();ig<gauss->end();ig++){
+ 			gauss->GaussPoint(ig);
+ 
+@@ -3810,11 +3923,9 @@
+ 			sigmann_input->GetInputValue(&sigmann, gauss);
+ 
+ 			for(i=0;i<numnodes;i++){
+-				pe->values[i*dim+0] += - sigmann*bed_normal[0]*gauss->weight*Jdet*vbasis[i];
+-				pe->values[i*dim+1] += - sigmann*bed_normal[1]*gauss->weight*Jdet*vbasis[i];
+-				if(dim==3){
+-					pe->values[i*dim+2]+= - sigmann*bed_normal[2]*gauss->weight*Jdet*vbasis[i];
+-				}
++				pe->values[i*dim+0] += + sigmann*bed_normal[0]*gauss->weight*Jdet*vbasis[i];
++				pe->values[i*dim+1] += + sigmann*bed_normal[1]*gauss->weight*Jdet*vbasis[i];
++				if(dim==3) pe->values[i*dim+2] += + sigmann*bed_normal[2]*gauss->weight*Jdet*vbasis[i];
+ 			}
+ 		}
+ 		xDelete<IssmDouble>(xyz_list_base);
+@@ -3822,7 +3933,7 @@
+ 	}
+ 
+ 	/*Transform coordinate system*/
+-	//element->TransformLoadVectorCoord(pe,cs_list); Do not transform pressure augmentation
++	//element->TransformLoadVectorCoord(pe,cs_list); Do not transform augmentation
+ 
+ 	/*Clean up and return*/
+ 	delete gauss;
+@@ -4470,19 +4581,16 @@
+ 	 */
+ 
+ 	/*Fetch number of nodes for this finite element*/
+-	int lnumnodes;
+-	if(dim==2) lnumnodes=3;
+-	else lnumnodes=6;
+-	//int pnumnodes = element->NumberofNodes(P1Enum);
++	int lnumnodes = element->GetNumberOfNodes(P2Enum);
+ 
+ 	/*Get nodal functions derivatives*/
+ 	IssmDouble* basis =xNew<IssmDouble>(lnumnodes);
+-	element->NodalFunctions(basis,gauss);
++	element->NodalFunctionsP2(basis,gauss);
+ 
+ 	/*Build B: */
+ 	for(int i=0;i<lnumnodes;i++){
+-		C[i*lnumnodes+0] = basis[i];
+-		C[i*lnumnodes+1] = basis[i];
++		C[lnumnodes*0+i] = basis[i];
++		C[lnumnodes*1+i] = basis[i];
+ 	}
+ 
+ 	/*Clean up*/
+@@ -4501,7 +4609,7 @@
+ 	 */
+ 
+ 	/*Fetch number of nodes for this finite element*/
+-	int vnumnodes = element->GetNumberOfNodes();
++	int vnumnodes = element->NumberofNodesVelocity();
+ 	int vnumdof   = vnumnodes*dim;
+ 
+ 	IssmDouble* vbasis=xNew<IssmDouble>(vnumnodes);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18284-18285.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18284-18285.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18284-18285.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 18284)
++++ ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 18285)
+@@ -30,7 +30,7 @@
+ 	iomodel->FetchDataToInput(elements,VyEnum,0.);
+ 	if(iomodel->domaintype==Domain3DEnum) iomodel->FetchDataToInput(elements,VzEnum,0.);
+ 	iomodel->FetchDataToInput(elements,PressureEnum,0.);
+-	iomodel->FetchDataToInput(elements,SigmaNNEnum,0.);
++	InputUpdateFromConstantx(elements,0.,SigmaNNEnum);
+ }/*}}}*/
+ void UzawaPressureAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18285-18286.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18285-18286.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18285-18286.diff	(revision 18296)
@@ -0,0 +1,25 @@
+Index: ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18285)
++++ ../trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp	(revision 18286)
+@@ -243,7 +243,7 @@
+ 	/*LATH parameters*/
+ 	iomodel->Constant(&fe_FS,FlowequationFeFSEnum);
+ 	if(fe_FS==LATaylorHoodEnum){
+-		iomodel->FetchDataToInput(elements,PressureEnum);
++		iomodel->FetchDataToInput(elements,PressureEnum,0.);
+ 		InputUpdateFromConstantx(elements,0.,SigmaNNEnum);
+ 	}
+ 
+Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
+===================================================================
+--- ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18285)
++++ ../trunk-jpl/src/c/classes/Elements/Element.cpp	(revision 18286)
+@@ -1026,6 +1026,7 @@
+ 				name==BedEnum ||
+ 				name==BalancethicknessThickeningRateEnum ||
+ 				name==BalancethicknessApparentMassbalanceEnum ||
++				name==SigmaNNEnum ||
+ 				name==SurfaceSlopeXEnum ||
+ 				name==SurfaceSlopeYEnum ||
+ 				name==SurfaceforcingsMassBalanceEnum ||
Index: /issm/oecreview/Archive/17984-18295/ISSM-18286-18287.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18286-18287.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18286-18287.diff	(revision 18296)
@@ -0,0 +1,25 @@
+Index: ../trunk-jpl/test/NightlyRun/test701.m
+===================================================================
+--- ../trunk-jpl/test/NightlyRun/test701.m	(revision 18286)
++++ ../trunk-jpl/test/NightlyRun/test701.m	(revision 18287)
+@@ -38,6 +38,7 @@
+ md=setflowequation(md,'FS','all');
+ md.stressbalance.abstol=NaN;
+ md.stressbalance.FSreconditioning=1;
++md.stressbalance.maxiter=20;
+ md.flowequation.augmented_lagrangian_r=10000;
+ md.miscellaneous.name = 'flowline';
+ md.cluster=generic('np',2);
+@@ -46,7 +47,7 @@
+ field_names={};
+ field_tolerances={};
+ field_values={};
+-for i={'MINI','MINIcondensed','TaylorHood','XTaylorHood','CrouzeixRaviart'}
++for i={'MINI','MINIcondensed','TaylorHood','XTaylorHood','LATaylorHood','CrouzeixRaviart'}
+ 	disp(' ');
+ 	disp(['====== Testing ' i{1} ' Full-Stokes Finite element =====']);
+ 	md.flowequation.fe_FS=i{1};
+Index: ../trunk-jpl/test/Archives/Archive701.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/17984-18295/ISSM-18287-18288.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18287-18288.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18287-18288.diff	(revision 18296)
@@ -0,0 +1,4 @@
+Index: ../trunk-jpl/test/Archives/Archive701.nc
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
Index: /issm/oecreview/Archive/17984-18295/ISSM-18288-18289.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18288-18289.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18288-18289.diff	(revision 18296)
@@ -0,0 +1,27 @@
+Index: ../trunk-jpl/externalpackages/petsc/install-3.5-macosx64.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.5-macosx64.sh	(revision 18288)
++++ ../trunk-jpl/externalpackages/petsc/install-3.5-macosx64.sh	(revision 18289)
+@@ -25,9 +25,7 @@
+ 	--download-metis=1 \
+ 	--download-parmetis=1 \
+ 	--download-mumps=1 \
+-	--download-scalapack=1 \
+-	--download-blas=1 \
+-	--download-fblaslapack=1 
++	--download-scalapack=1
+ 
+ #Compile and intall
+ make
+Index: ../trunk-jpl/externalpackages/petsc/install-3.5-linux64.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.5-linux64.sh	(revision 18288)
++++ ../trunk-jpl/externalpackages/petsc/install-3.5-linux64.sh	(revision 18289)
+@@ -26,7 +26,6 @@
+ 	--download-parmetis=1 \
+ 	--download-mumps=1 \
+ 	--download-scalapack=1 \
+-	--download-blas=1 \
+ 	--download-fblaslapack=1 \
+ 	--with-pic=1
+ 
Index: /issm/oecreview/Archive/17984-18295/ISSM-18289-18290.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18289-18290.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18289-18290.diff	(revision 18296)
@@ -0,0 +1,13 @@
+Index: ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp
+===================================================================
+--- ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 18289)
++++ ../trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp	(revision 18290)
+@@ -225,7 +225,7 @@
+ 				onbase += 1;
+ 			}
+ 		}
+-		if(!onbase==3) _error_("basal nodes of element not found");
++		if(onbase!=3) _error_("basal nodes of element not found");
+ 
+ 		delete gauss;
+ 		gauss = element->NewGaussBase(3);
Index: /issm/oecreview/Archive/17984-18295/ISSM-18290-18291.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18290-18291.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18290-18291.diff	(revision 18296)
@@ -0,0 +1,12 @@
+Index: ../trunk-jpl/externalpackages/petsc/install-3.5-pleiades.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.5-pleiades.sh	(revision 18290)
++++ ../trunk-jpl/externalpackages/petsc/install-3.5-pleiades.sh	(revision 18291)
+@@ -30,7 +30,6 @@
+ 	--download-parmetis=1 \
+ 	--download-mumps=1 \
+ 	--download-scalapack=1 \
+-	--download-blas=1 \
+ 	--download-fblaslapack=1 \
+ 	--COPTFLAGS="-lmpi -O3" \
+ 	--FOPTFLAGS="-lmpi -O3" \
Index: /issm/oecreview/Archive/17984-18295/ISSM-18293-18294.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18293-18294.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18293-18294.diff	(revision 18296)
@@ -0,0 +1,74 @@
+Index: ../trunk-jpl/src/m/parameterization/sethydrostaticmask.m
+===================================================================
+--- ../trunk-jpl/src/m/parameterization/sethydrostaticmask.m	(revision 0)
++++ ../trunk-jpl/src/m/parameterization/sethydrostaticmask.m	(revision 18294)
+@@ -0,0 +1,29 @@
++function md=sethydrostaticmask(md)
++%SETHYDROSTATICMASK - establish groundedice_levelset field
++%
++%   Determines grounded and floating ice position based on 
++%   md.geometry.bed and md.geometry.thickness
++%
++%   Usage:
++%      md=sethydrostaticmask(md)
++%
++%   Examples:
++%      md=sethydrostaticmask(md);
++
++if(length(md.geometry.bed)~=md.mesh.numberofvertices | length(md.geometry.thickness)~=md.mesh.numberofvertices | length(md.geometry.base)~=md.mesh.numberofvertices),
++		error('hydrostaticmask error message: fields in md.geometry do not have the right size.');
++end
++
++%grounded ice level set
++md.mask.groundedice_levelset=md.geometry.thickness+md.geometry.bed*md.materials.rho_water/md.materials.rho_ice;
++
++%Check consistency of geometry
++pos=find(md.mask.groundedice_levelset>0);
++if(any(md.geometry.base(pos)~=md.geometry.bed(pos))),
++	disp('WARNING: md.geometry.bed and md.geometry.base not equal on grounded ice');
++end
++
++pos=find(md.mask.groundedice_levelset<=0);
++if(any(md.geometry.base(pos)<md.geometry.bed(pos))),
++	disp('WARNING: md.geometry.base < md.geometry.bed on floating ice');
++end
+Index: ../trunk-jpl/src/m/parameterization/sethydrostaticmask.py
+===================================================================
+--- ../trunk-jpl/src/m/parameterization/sethydrostaticmask.py	(revision 0)
++++ ../trunk-jpl/src/m/parameterization/sethydrostaticmask.py	(revision 18294)
+@@ -0,0 +1,35 @@
++import numpy
++import os
++from model import model
++from FlagElements import FlagElements
++import pairoptions
++from ContourToMesh import ContourToMesh
++
++def setmask(md)
++	"""
++	SETHYDROSTATICMASK - establish groundedice_levelset field
++
++   Determines grounded and floating ice position based on 
++   md.geometry.bed and md.geometry.thickness
++
++   Usage:
++      md=sethydrostaticmask(md)
++
++   Examples:
++      md=sethydrostaticmask(md);
++   """
++
++	if numpy.size(md.geometry.bed,axis=0)!=md.mesh.numberofvertices or numpy.size(md.geometry.base,axis=0)!=md.mesh.numberofvertices or numpy.size(md.geometry.thickness,axis=0)!=md.mesh.numberofvertices:
++		raise IOError("hydrostaticmask error message: fields in md.geometry do not have the right size.")
++
++   # grounded ice level set
++   md.mask.groundedice_levelset=md.geometry.thickness+md.geometry.bed*md.materials.rho_water/md.materials.rho_ice
++
++   #Check consistency of geometry
++	if any(md.geometry.base[numpy.nonzero(md.mask.groundedice_levelset>0.)]!=md.geometry.bed[numpy.nonzero(md.mask.groundedice_levelset>0.)]):
++	   print "WARNING: md.geometry.bed and md.geometry.base not equal on grounded ice"
++
++	if any(md.geometry.base[numpy.nonzero(md.mask.groundedice_levelset<=0.)]<md.geometry.bed[numpy.nonzero(md.mask.groundedice_levelset<=0.)]):
++		print "WARNING: md.geometry.base < md.geometry.bed on floating ice"
++
++	return md
Index: /issm/oecreview/Archive/17984-18295/ISSM-18294-18295.diff
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-18294-18295.diff	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-18294-18295.diff	(revision 18296)
@@ -0,0 +1,78 @@
+Index: ../trunk-jpl/externalpackages/petsc/install-3.5-macosx64.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.5-macosx64.sh	(revision 18294)
++++ ../trunk-jpl/externalpackages/petsc/install-3.5-macosx64.sh	(revision 18295)
+@@ -2,16 +2,16 @@
+ set -eu
+ 
+ #Some cleanup
+-rm -rf install petsc-3.5.0 src
++rm -rf install petsc-3.5.1 src
+ mkdir install src
+ 
+ #Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.0.tar.gz' 'petsc-3.5.0.tar.gz'
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.1.tar.gz' 'petsc-3.5.1.tar.gz'
+ 
+ #Untar and move petsc to install directory
+-tar -zxvf  petsc-3.5.0.tar.gz
+-mv petsc-3.5.0/* src/
+-rm -rf petsc-3.5.0
++tar -zxvf  petsc-3.5.1.tar.gz
++mv petsc-3.5.1/* src/
++rm -rf petsc-3.5.1
+ 
+ #configure
+ cd src
+Index: ../trunk-jpl/externalpackages/petsc/install-3.5-linux64.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.5-linux64.sh	(revision 18294)
++++ ../trunk-jpl/externalpackages/petsc/install-3.5-linux64.sh	(revision 18295)
+@@ -2,16 +2,16 @@
+ set -eu
+ 
+ #Some cleanup
+-rm -rf install petsc-3.5.0 src
++rm -rf install petsc-3.5.1 src
+ mkdir install src
+ 
+ #Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.0.tar.gz' 'petsc-3.5.0.tar.gz'
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.1.tar.gz' 'petsc-3.5.1.tar.gz'
+ 
+ #Untar and move petsc to install directory
+-tar -zxvf  petsc-3.5.0.tar.gz
+-mv petsc-3.5.0/* src/
+-rm -rf petsc-3.5.0
++tar -zxvf  petsc-3.5.1.tar.gz
++mv petsc-3.5.1/* src/
++rm -rf petsc-3.5.1
+ 
+ #configure
+ cd src
+Index: ../trunk-jpl/externalpackages/petsc/install-3.5-pleiades.sh
+===================================================================
+--- ../trunk-jpl/externalpackages/petsc/install-3.5-pleiades.sh	(revision 18294)
++++ ../trunk-jpl/externalpackages/petsc/install-3.5-pleiades.sh	(revision 18295)
+@@ -2,16 +2,16 @@
+ set -eu
+ 
+ #Some cleanup
+-rm -rf install petsc-3.5.0 src
++rm -rf install petsc-3.5.1 src
+ mkdir install src
+ 
+ #Download from ISSM server
+-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.0.tar.gz' 'petsc-3.5.0.tar.gz'
++$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-lite-3.5.1.tar.gz' 'petsc-3.5.1.tar.gz'
+ 
+ #Untar and move petsc to install directory
+-tar -zxvf  petsc-3.5.0.tar.gz
+-mv petsc-3.5.0/* src/
+-rm -rf petsc-3.5.0
++tar -zxvf  petsc-3.5.1.tar.gz
++mv petsc-3.5.1/* src/
++rm -rf petsc-3.5.1
+ 
+ #configure
+ cd src
Index: /issm/oecreview/Archive/17984-18295/ISSM-DocReview-17984-18295.tex
===================================================================
--- /issm/oecreview/Archive/17984-18295/ISSM-DocReview-17984-18295.tex	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/ISSM-DocReview-17984-18295.tex	(revision 18296)
@@ -0,0 +1,67 @@
+\documentclass[]{report}   % list options between brackets
+\usepackage{graphicx}              % list packages between braces
+
+% type user-defined commands here
+
+\begin{document}
+
+\title{JPL EXPORT ADMINISTRATION \\ DOCUMENT REVIEW RECORD}   % type title between braces
+\author{Tom Scavo}         % type author(s) between braces
+\date{October 27, 1995}    % type date between braces
+%\maketitle
+
+
+\begin{center}
+\begin{tabular}{ |c|c| }
+\hline
+JPL EXPORT ADMINISTRATION \\
+\textit{ DOCUMENT REVIEW RECORD} \\
+\hline
+\end{tabular}
+\end{center}
+
+\hfill Log \#: \underline{\input{LogNumber}}
+
+\vspace{1cm}
+\noindent (Note: This form and process do not replace the procedures described in JPL Policy relating to review and approval of proposals and contractual 
+documents. This process is intended to document the review and coordination of requests to ascertain the export control ramifications relating to specific 
+documents. Export Administration signature does not convey authority to export or release the "Exporter of Record" from any export laws or regulations.)\\
+
+\noindent \textbf{Program:} \underline{ISSM: Ice Sheet System Model} \\ \\
+\noindent \textbf{Person Requesting or Initiating Export}: \underline{Dr. Eric Larour}\\ \\
+\noindent \textbf{Date Received}: \underline{\input{Date}}\\ \\
+\noindent \textbf{Document Title/Description}: ISSM changes from revision \input{r1} to revision \input{r2} \\ \\
+\noindent \textbf{Release to:} \underline{http://issm.ess.uci.edu/svn/issm/issm/trunk on ISSM svn repository}\\ \\
+\noindent \textbf{JPL Intranet:} \underline{murdo.jpl.nasa.gov/proj/ice/larour/issm-uci/trunk-jpl}\\ \\
+
+\noindent \textbf{Disposition: 6 } 
+Does not contain export-controlled information. May be released/disclosed as requested subject to 
+Company guidelines on protection of proprietary information (if applicable). \\
+
+\noindent \textbf{Comments:}  see table of changes below. \\ \\
+\noindent \textbf{Reviewed by ISSM Export Transfer Liaison:} Dr. Eric Larour \hfill \textbf{Date:} \input{Date} \\ 
+\includegraphics[scale=1]{signature}
+
+\noindent JPL Export Administration Form TBS – June 29, 2011
+
+\begin{center}
+\line(1,0){250}
+\end{center}
+
+\noindent \textbf{Disposition:} \\
+1:	  Public Domain Information (Ref ITAR Section 120.11) \\
+2:	  Qualifies for ITAR Exemption				 \\
+3:	  Covered by Department of State License/Agreement Number					  \\
+4:	  Covered by Department of Commerce validated license or exception				 \\
+5:	  New License Required \\
+6:	  Does not contain export-controlled information.  May be released/disclosed as requested subject
+   to Company guidelines on protection of proprietary information (if applicable). \\
+7:	 Other (specify)   
+\begin{center}
+\line(1,0){250}
+\end{center}
+
+
+\input{log}
+
+\end{document}
Index: /issm/oecreview/Archive/17984-18295/LogNumber.tex
===================================================================
--- /issm/oecreview/Archive/17984-18295/LogNumber.tex	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/LogNumber.tex	(revision 18296)
@@ -0,0 +1,1 @@
+17984-18295
Index: /issm/oecreview/Archive/17984-18295/Makefile
===================================================================
--- /issm/oecreview/Archive/17984-18295/Makefile	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/Makefile	(revision 18296)
@@ -0,0 +1,8 @@
+TARGET=ISSM-DocReview-17984-18295
+
+all: 
+	pdflatex -interaction=errorstopmode -file-line-error -halt-on-error $(TARGET).tex
+	rm -rf *.log *.aux 
+
+clean:
+	rm -rf *.log *.aux
Index: /issm/oecreview/Archive/17984-18295/log.tex
===================================================================
--- /issm/oecreview/Archive/17984-18295/log.tex	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/log.tex	(revision 18296)
@@ -0,0 +1,1897 @@
+\noindent \textbf{Change \#1} with diff file ISSM-17984-17985.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: add timestepping enum\\
+\vspace{3em}
+
+\noindent \textbf{Change \#2} with diff file ISSM-17985-17986.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py\\
+Export determination: 6. \\
+Rationale: CHG: add timestepping enum\\
+\vspace{3em}
+
+\noindent \textbf{Change \#3} with diff file ISSM-17987-17988.diff: \\
+Function name: \\
+M /issm/trunk-jpl\\
+Export determination: 6. \\
+Rationale: merged trunk and trunk-jpl\\
+\vspace{3em}
+
+\noindent \textbf{Change \#4} with diff file ISSM-17990-17991.diff: \\
+Function name: \\
+M /issm/trunk-jpl M /issm/trunk-jpl/src M /issm/trunk-jpl/test\\
+Export determination: 6. \\
+Rationale: Block revision 17989 from being merged into trunk-jpl\\
+\vspace{3em}
+
+\noindent \textbf{Change \#5} with diff file ISSM-17991-17992.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model.m M /issm/trunk-jpl/src/m/classes/model.py\\
+Export determination: 6. \\
+Rationale: CHG: add checks for nan\\
+\vspace{3em}
+
+\noindent \textbf{Change \#6} with diff file ISSM-17992-17993.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/enum/TimesteppingInterpForcingsEnum.m\\
+Export determination: 6. \\
+Rationale: CHG: add timestepping enum\\
+\vspace{3em}
+
+\noindent \textbf{Change \#7} with diff file ISSM-17993-17994.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp A /issm/trunk-jpl/src/java A /issm/trunk-jpl/src/java/COPYING A /issm/trunk-jpl/src/java/Changelog\_1.0.0.txt A /issm/trunk-jpl/src/java/License.txt A /issm/trunk-jpl/src/java/MANIFEST.MF A /issm/trunk-jpl/src/java/build A /issm/trunk-jpl/src/java/build/gui\_elements A /issm/trunk-jpl/src/java/build/gui\_elements/AlternativePanel.class A /issm/trunk-jpl/src/java/build/gui\_elements/CheckBoxPanel.class A /issm/trunk-jpl/src/java/build/gui\_elements/ColorCellRenderer.class A /issm/trunk-jpl/src/java/build/gui\_elements/CombinedPanel\$1.class A /issm/trunk-jpl/src/java/build/gui\_elements/CombinedPanel\$Type.class A /issm/trunk-jpl/src/java/build/gui\_elements/CombinedPanel.class A /issm/trunk-jpl/src/java/build/gui\_elements/ControlledPanel.class A /issm/trunk-jpl/src/java/build/gui\_elements/DecimalPanel.class A /issm/trunk-jpl/src/java/build/gui\_elements/DuplicatorPanel.class A /issm/trunk-jpl/src/java/build/gui\_elements/FramePanel.class A /issm/trunk-jpl/src/java/build/gui\_elements/GUIBuildException.class A /issm/trunk-jpl/src/java/build/gui\_elements/IntegerPanel.class A /issm/trunk-jpl/src/java/build/gui\_elements/OptionPanel.class A /issm/trunk-jpl/src/java/build/gui\_elements/PathPanel.class A /issm/trunk-jpl/src/java/build/gui\_elements/SelectorPanel.class A /issm/trunk-jpl/src/java/build/gui\_elements/TextfieldPanel.class A /issm/trunk-jpl/src/java/build/main A /issm/trunk-jpl/src/java/build/main/GUI.class A /issm/trunk-jpl/src/java/build/main/GUIBuilder\$1.class A /issm/trunk-jpl/src/java/build/main/GUIBuilder.class A /issm/trunk-jpl/src/java/build/main/PanelControl.class A /issm/trunk-jpl/src/java/build/main/PanelNode.class A /issm/trunk-jpl/src/java/build/main/XMLHelper.class A /issm/trunk-jpl/src/java/build/resources A /issm/trunk-jpl/src/java/build/resources/config\_schema-0.1.1.xsd A /issm/trunk-jpl/src/java/build/resources/config\_schema.xsd A /issm/trunk-jpl/src/java/build/resources/default\_config.xml A /issm/trunk-jpl/src/java/build/resources/document-export-4.png A /issm/trunk-jpl/src/java/build/resources/document-open-2.png A /issm/trunk-jpl/src/java/build/resources/document-preview.png A /issm/trunk-jpl/src/java/build/resources/icons A /issm/trunk-jpl/src/java/build/resources/icons/advancedsettings.png A /issm/trunk-jpl/src/java/build/resources/icons/file\_ops.xcf A /issm/trunk-jpl/src/java/build/resources/icons/fileopen.png A /issm/trunk-jpl/src/java/build/resources/icons/filesave.png A /issm/trunk-jpl/src/java/build/resources/icons/filesaveas.png A /issm/trunk-jpl/src/java/build/resources/icons/ini\_open.png A /issm/trunk-jpl/src/java/build/resources/icons/kghostview.png A /issm/trunk-jpl/src/java/build/resources/icons/mydocuments.png A /issm/trunk-jpl/src/java/build/resources/icons/opensettings.png A /issm/trunk-jpl/src/java/build/resources/icons/readme.txt A /issm/trunk-jpl/src/java/build/resources/icons/reset.png A /issm/trunk-jpl/src/java/build/resources/icons/viewmag.png A /issm/trunk-jpl/src/java/build/resources/icons/xml\_open.png A /issm/trunk-jpl/src/java/build.xml A /issm/trunk-jpl/src/java/dist A /issm/trunk-jpl/src/java/dist/inishell.jar A /issm/trunk-jpl/src/java/doc A /issm/trunk-jpl/src/java/doc/examples A /issm/trunk-jpl/src/java/doc/examples/io.ini A /issm/trunk-jpl/src/java/doc/examples/issm.xml A /issm/trunk-jpl/src/java/doc/examples/meteoio\_config.xml A /issm/trunk-jpl/src/java/doc/examples/min\_example.xml A /issm/trunk-jpl/src/java/doc/examples/snowpack\_config.xml A /issm/trunk-jpl/src/java/inishell.sh A /issm/trunk-jpl/src/java/lib A /issm/trunk-jpl/src/java/lib/miglayout-4.0.jar A /issm/trunk-jpl/src/java/src A /issm/trunk-jpl/src/java/src/gui\_elements A /issm/trunk-jpl/src/java/src/gui\_elements/AlternativePanel.java A /issm/trunk-jpl/src/java/src/gui\_elements/CheckBoxPanel.java A /issm/trunk-jpl/src/java/src/gui\_elements/CombinedPanel.java A /issm/trunk-jpl/src/java/src/gui\_elements/ControlledPanel.java A /issm/trunk-jpl/src/java/src/gui\_elements/DecimalPanel.java A /issm/trunk-jpl/src/java/src/gui\_elements/DuplicatorPanel.java A /issm/trunk-jpl/src/java/src/gui\_elements/FramePanel.java A /issm/trunk-jpl/src/java/src/gui\_elements/GUIBuildException.java A /issm/trunk-jpl/src/java/src/gui\_elements/IntegerPanel.java A /issm/trunk-jpl/src/java/src/gui\_elements/OptionPanel.java A /issm/trunk-jpl/src/java/src/gui\_elements/PathPanel.java A /issm/trunk-jpl/src/java/src/gui\_elements/SelectorPanel.java A /issm/trunk-jpl/src/java/src/gui\_elements/TextfieldPanel.java A /issm/trunk-jpl/src/java/src/main A /issm/trunk-jpl/src/java/src/main/GUI.java A /issm/trunk-jpl/src/java/src/main/GUIBuilder.java A /issm/trunk-jpl/src/java/src/main/PanelControl.java A /issm/trunk-jpl/src/java/src/main/PanelNode.java A /issm/trunk-jpl/src/java/src/main/XMLHelper.java A /issm/trunk-jpl/src/java/src/resources A /issm/trunk-jpl/src/java/src/resources/config\_schema-0.1.1.xsd A /issm/trunk-jpl/src/java/src/resources/config\_schema.xsd A /issm/trunk-jpl/src/java/src/resources/default\_config.xml A /issm/trunk-jpl/src/java/src/resources/document-export-4.png A /issm/trunk-jpl/src/java/src/resources/document-open-2.png A /issm/trunk-jpl/src/java/src/resources/document-preview.png A /issm/trunk-jpl/src/java/src/resources/icons A /issm/trunk-jpl/src/java/src/resources/icons/advancedsettings.png A /issm/trunk-jpl/src/java/src/resources/icons/file\_ops.xcf A /issm/trunk-jpl/src/java/src/resources/icons/fileopen.png A /issm/trunk-jpl/src/java/src/resources/icons/filesave.png A /issm/trunk-jpl/src/java/src/resources/icons/filesaveas.png A /issm/trunk-jpl/src/java/src/resources/icons/ini\_open.png A /issm/trunk-jpl/src/java/src/resources/icons/kghostview.png A /issm/trunk-jpl/src/java/src/resources/icons/mydocuments.png A /issm/trunk-jpl/src/java/src/resources/icons/opensettings.png A /issm/trunk-jpl/src/java/src/resources/icons/readme.txt A /issm/trunk-jpl/src/java/src/resources/icons/reset.png A /issm/trunk-jpl/src/java/src/resources/icons/viewmag.png A /issm/trunk-jpl/src/java/src/resources/icons/xml\_open.png\\
+Export determination: 6. \\
+Rationale: CHG: back to normal\\
+\vspace{3em}
+
+\noindent \textbf{Change \#8} with diff file ISSM-17994-17995.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model.py\\
+Export determination: 6. \\
+Rationale: BUG: fixed typo\\
+\vspace{3em}
+
+\noindent \textbf{Change \#9} with diff file ISSM-17995-17996.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am D /issm/trunk-jpl/src/c/modules/AverageFilterx D /issm/trunk-jpl/src/c/modules/EdgeDetectionx D /issm/trunk-jpl/src/c/modules/HoleFillerx M /issm/trunk-jpl/src/c/modules/modules.h D /issm/trunk-jpl/src/wrappers/AverageFilter D /issm/trunk-jpl/src/wrappers/EdgeDetection D /issm/trunk-jpl/src/wrappers/HoleFiller D /issm/trunk-jpl/src/wrappers/InternalFront M /issm/trunk-jpl/src/wrappers/matlab/Makefile.am\\
+Export determination: 6. \\
+Rationale: DEL: removing modules that are never used\\
+\vspace{3em}
+
+\noindent \textbf{Change \#10} with diff file ISSM-17999-18000.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive230.nc M /issm/trunk-jpl/test/Archives/Archive231.nc A /issm/trunk-jpl/test/Archives/Archive238.nc A /issm/trunk-jpl/test/Archives/Archive239.nc A /issm/trunk-jpl/test/Archives/Archive336.nc A /issm/trunk-jpl/test/Archives/Archive337.nc A /issm/trunk-jpl/test/Archives/Archive338.nc A /issm/trunk-jpl/test/Archives/Archive339.nc M /issm/trunk-jpl/test/NightlyRun/test230.m M /issm/trunk-jpl/test/NightlyRun/test230.py M /issm/trunk-jpl/test/NightlyRun/test231.m M /issm/trunk-jpl/test/NightlyRun/test231.py\\
+Export determination: 6. \\
+Rationale: CHG: change name of SMB test variable\\
+\vspace{3em}
+
+\noindent \textbf{Change \#11} with diff file ISSM-18000-18001.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/classes/SMBcomponents.m A /issm/trunk-jpl/src/m/classes/SMBcomponents.py A /issm/trunk-jpl/src/m/classes/SMBmeltcomponents.m A /issm/trunk-jpl/src/m/classes/SMBmeltcomponents.py M /issm/trunk-jpl/src/m/classes/timestepping.m M /issm/trunk-jpl/src/m/classes/timestepping.py M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py A /issm/trunk-jpl/src/m/enum/SMBcomponentsEnum.m A /issm/trunk-jpl/src/m/enum/SMBmeltcomponentsEnum.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsAccumulationEnum.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsEvaporationEnum.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsMeltEnum.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsRefreezeEnum.m A /issm/trunk-jpl/src/m/enum/SurfaceforcingsRunoffEnum.m\\
+Export determination: 6. \\
+Rationale: NEW: add SMB components and interpolation option\\
+\vspace{3em}
+
+\noindent \textbf{Change \#12} with diff file ISSM-18001-18002.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp M /issm/trunk-jpl/src/c/classes/Materials/Matpar.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.h M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp\\
+Export determination: 6. \\
+Rationale: NEW: implementation of SMB components and interpolation option\\
+\vspace{3em}
+
+\noindent \textbf{Change \#13} with diff file ISSM-18002-18003.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/IdToName.m A /issm/trunk-jpl/test/NightlyRun/test238.m A /issm/trunk-jpl/test/NightlyRun/test238.py A /issm/trunk-jpl/test/NightlyRun/test239.m A /issm/trunk-jpl/test/NightlyRun/test239.py A /issm/trunk-jpl/test/NightlyRun/test336.m A /issm/trunk-jpl/test/NightlyRun/test336.py A /issm/trunk-jpl/test/NightlyRun/test337.m A /issm/trunk-jpl/test/NightlyRun/test337.py A /issm/trunk-jpl/test/NightlyRun/test338.m A /issm/trunk-jpl/test/NightlyRun/test338.py A /issm/trunk-jpl/test/NightlyRun/test339.m A /issm/trunk-jpl/test/NightlyRun/test339.py\\
+Export determination: 6. \\
+Rationale: NEW: tests for SMB components and interpolation option\\
+\vspace{3em}
+
+\noindent \textbf{Change \#14} with diff file ISSM-18003-18004.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp M /issm/trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/FemModel.h M /issm/trunk-jpl/src/c/cores/control\_core.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp\\
+Export determination: 6. \\
+Rationale: CHG: working on balancethickness2\\
+\vspace{3em}
+
+\noindent \textbf{Change \#15} with diff file ISSM-18005-18006.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/mesh/squaremesh.py\\
+Export determination: 6. \\
+Rationale: BUG: missing mesh2d import\\
+\vspace{3em}
+
+\noindent \textbf{Change \#16} with diff file ISSM-18006-18007.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model.py\\
+Export determination: 6. \\
+Rationale: BUG: import new SMB classes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#17} with diff file ISSM-18007-18008.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/SMBcomponents.py M /issm/trunk-jpl/src/m/classes/SMBmeltcomponents.py\\
+Export determination: 6. \\
+Rationale: BUG: marshalled wrong enum\\
+\vspace{3em}
+
+\noindent \textbf{Change \#18} with diff file ISSM-18008-18009.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/classes/inversionvalidation.m\\
+Export determination: 6. \\
+Rationale: NEW: added inversionvalidation.m to validation inversion gradients\\
+\vspace{3em}
+
+\noindent \textbf{Change \#19} with diff file ISSM-18009-18010.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/cores/WrapperCorePointerFromSolutionEnum.cpp A /issm/trunk-jpl/src/c/cores/controlvalidation\_core.cpp M /issm/trunk-jpl/src/c/cores/cores.h M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp\\
+Export determination: 6. \\
+Rationale: NEW: added adjoint validation test\\
+\vspace{3em}
+
+\noindent \textbf{Change \#20} with diff file ISSM-18010-18011.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controlvalidation\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added output\\
+\vspace{3em}
+
+\noindent \textbf{Change \#21} with diff file ISSM-18011-18012.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/mech/backstressfrominversion.m M /issm/trunk-jpl/src/m/mech/backstressfrominversion.py A /issm/trunk-jpl/src/m/mech/calcbackstress.m A /issm/trunk-jpl/src/m/mech/calcbackstress.py\\
+Export determination: 6. \\
+Rationale: NEW: function to calculate basic analytical backstress (e.g. without an inversion)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#22} with diff file ISSM-18012-18013.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/applyoptions.py M /issm/trunk-jpl/src/m/plot/checkplotoptions.py\\
+Export determination: 6. \\
+Rationale: BUG: a couple minor pythong plotting bugs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#23} with diff file ISSM-18024-18025.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test239.m M /issm/trunk-jpl/test/NightlyRun/test239.py M /issm/trunk-jpl/test/NightlyRun/test337.m M /issm/trunk-jpl/test/NightlyRun/test337.py M /issm/trunk-jpl/test/NightlyRun/test339.m M /issm/trunk-jpl/test/NightlyRun/test339.py\\
+Export determination: 6. \\
+Rationale: CHG: relaxing tolerances of python tests\\
+\vspace{3em}
+
+\noindent \textbf{Change \#24} with diff file ISSM-18025-18026.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/FemModel.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added support for Balancethickness2MisfitEnum\\
+\vspace{3em}
+
+\noindent \textbf{Change \#25} with diff file ISSM-18026-18027.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test415.m M /issm/trunk-jpl/test/NightlyRun/test415.py M /issm/trunk-jpl/test/NightlyRun/test435.m\\
+Export determination: 6. \\
+Rationale: CHG: relaxing tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#26} with diff file ISSM-18027-18028.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controlvalidation\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed AD compile\\
+\vspace{3em}
+
+\noindent \textbf{Change \#27} with diff file ISSM-18028-18029.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controlvalidation\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed AD compile\\
+\vspace{3em}
+
+\noindent \textbf{Change \#28} with diff file ISSM-18029-18030.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controlvalidation\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed AD compile\\
+\vspace{3em}
+
+\noindent \textbf{Change \#29} with diff file ISSM-18030-18031.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controlvalidation\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed AD compile\\
+\vspace{3em}
+
+\noindent \textbf{Change \#30} with diff file ISSM-18031-18032.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/damage.m M /issm/trunk-jpl/src/m/classes/damage.py\\
+Export determination: 6. \\
+Rationale: BUG: fixed marshalling of elementinterp as an enum\\
+\vspace{3em}
+
+\noindent \textbf{Change \#31} with diff file ISSM-18032-18033.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/damage.m\\
+Export determination: 6. \\
+Rationale: BUG: fixing python copy/paste\\
+\vspace{3em}
+
+\noindent \textbf{Change \#32} with diff file ISSM-18033-18034.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: working on P2 implementation for DamageEvolution\\
+\vspace{3em}
+
+\noindent \textbf{Change \#33} with diff file ISSM-18034-18035.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: numvertices should be numnodes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#34} with diff file ISSM-18035-18036.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/FemModel.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixing cost function\\
+\vspace{3em}
+
+\noindent \textbf{Change \#35} with diff file ISSM-18036-18037.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing memory leak\\
+\vspace{3em}
+
+\noindent \textbf{Change \#36} with diff file ISSM-18037-18038.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing Adjoint RHS\\
+\vspace{3em}
+
+\noindent \textbf{Change \#37} with diff file ISSM-18039-18040.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Inputs/PentaInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/TetraInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/TriaInput.cpp M /issm/trunk-jpl/src/c/classes/gauss/GaussTria.cpp\\
+Export determination: 6. \\
+Rationale: NEW: added support for P0Interpolation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#38} with diff file ISSM-18041-18042.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: damagelaw is now an integer to facilitate switching between different laws\\
+\vspace{3em}
+
+\noindent \textbf{Change \#39} with diff file ISSM-18042-18043.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test271.m M /issm/trunk-jpl/test/NightlyRun/test271.py M /issm/trunk-jpl/test/NightlyRun/test275.m M /issm/trunk-jpl/test/NightlyRun/test275.py\\
+Export determination: 6. \\
+Rationale: CHG: updated NR for new damage law format\\
+\vspace{3em}
+
+\noindent \textbf{Change \#40} with diff file ISSM-18043-18044.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/damage.m M /issm/trunk-jpl/src/m/classes/damage.py\\
+Export determination: 6. \\
+Rationale: CHG: updated damage class for new law format\\
+\vspace{3em}
+
+\noindent \textbf{Change \#41} with diff file ISSM-18044-18045.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/damage.m\\
+Export determination: 6. \\
+Rationale: CHG: initialize as NaN only for arrays\\
+\vspace{3em}
+
+\noindent \textbf{Change \#42} with diff file ISSM-18045-18046.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/damage.m\\
+Export determination: 6. \\
+Rationale: BUG: fixed consistency check\\
+\vspace{3em}
+
+\noindent \textbf{Change \#43} with diff file ISSM-18049-18050.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/dakota/install-5.2-discover.sh\\
+Export determination: 6. \\
+Rationale: CHG: Install 5.2 for discover\\
+\vspace{3em}
+
+\noindent \textbf{Change \#44} with diff file ISSM-18050-18051.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/petsc/install-3.2-discover-intel13.sh\\
+Export determination: 6. \\
+Rationale: NEW: add compile eith new intel\\
+\vspace{3em}
+
+\noindent \textbf{Change \#45} with diff file ISSM-18052-18053.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/ad/todo D /issm/trunk-jpl/src/ad/wrappers.txt\\
+Export determination: 6. \\
+Rationale: DEL: removing some outdated files\\
+\vspace{3em}
+
+\noindent \textbf{Change \#46} with diff file ISSM-18053-18054.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/dox/issm.dox D /issm/trunk-jpl/src/perl\\
+Export determination: 6. \\
+Rationale: DEL: not needed anymore\\
+\vspace{3em}
+
+\noindent \textbf{Change \#47} with diff file ISSM-18054-18055.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: simplifying adjoint\\
+\vspace{3em}
+
+\noindent \textbf{Change \#48} with diff file ISSM-18055-18056.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp M /issm/trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.h M /issm/trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.h M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.h M /issm/trunk-jpl/src/c/analyses/Analysis.h M /issm/trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp M /issm/trunk-jpl/src/c/analyses/Balancethickness2Analysis.h M /issm/trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/BalancethicknessAnalysis.h M /issm/trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.h M /issm/trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/BalancevelocityAnalysis.h M /issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h M /issm/trunk-jpl/src/c/analyses/DepthAverageAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/DepthAverageAnalysis.h M /issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.h M /issm/trunk-jpl/src/c/analyses/EnumToAnalysis.h M /issm/trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/ExtrapolationAnalysis.h M /issm/trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.h M /issm/trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.h M /issm/trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.h M /issm/trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.h M /issm/trunk-jpl/src/c/analyses/GiaAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/GiaAnalysis.h M /issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.h M /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h M /issm/trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.h M /issm/trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.h M /issm/trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.h M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.h M /issm/trunk-jpl/src/c/analyses/LsfReinitializationAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/LsfReinitializationAnalysis.h M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.h M /issm/trunk-jpl/src/c/analyses/MeltingAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/MeltingAnalysis.h M /issm/trunk-jpl/src/c/analyses/MeshdeformationAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/MeshdeformationAnalysis.h M /issm/trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.h M /issm/trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.h M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.h M /issm/trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.h M /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.h M /issm/trunk-jpl/src/c/analyses/ThermalAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/ThermalAnalysis.h\\
+Export determination: 6. \\
+Rationale: NEW: added new method for gradient calculation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#49} with diff file ISSM-18056-18057.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/FemModel.cpp\\
+Export determination: 6. \\
+Rationale: CHG: changing cost function for bal H 2\\
+\vspace{3em}
+
+\noindent \textbf{Change \#50} with diff file ISSM-18057-18058.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp M /issm/trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.h M /issm/trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.h M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.h M /issm/trunk-jpl/src/c/analyses/Analysis.h M /issm/trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp M /issm/trunk-jpl/src/c/analyses/Balancethickness2Analysis.h M /issm/trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/BalancethicknessAnalysis.h M /issm/trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.h M /issm/trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/BalancevelocityAnalysis.h M /issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h M /issm/trunk-jpl/src/c/analyses/DepthAverageAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/DepthAverageAnalysis.h M /issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.h M /issm/trunk-jpl/src/c/analyses/EnumToAnalysis.h M /issm/trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/ExtrapolationAnalysis.h M /issm/trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.h M /issm/trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.h M /issm/trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.h M /issm/trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.h M /issm/trunk-jpl/src/c/analyses/GiaAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/GiaAnalysis.h M /issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.h M /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h M /issm/trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.h M /issm/trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.h M /issm/trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.h M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.h M /issm/trunk-jpl/src/c/analyses/LsfReinitializationAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/LsfReinitializationAnalysis.h M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.h M /issm/trunk-jpl/src/c/analyses/MeltingAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/MeltingAnalysis.h M /issm/trunk-jpl/src/c/analyses/MeshdeformationAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/MeshdeformationAnalysis.h M /issm/trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeXAnalysis.h M /issm/trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.h M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.h M /issm/trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.h M /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.h M /issm/trunk-jpl/src/c/analyses/ThermalAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/ThermalAnalysis.h\\
+Export determination: 6. \\
+Rationale: CHG: working on migrating gradients to adjoints\\
+\vspace{3em}
+
+\noindent \textbf{Change \#51} with diff file ISSM-18058-18059.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.cpp M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h\\
+Export determination: 6. \\
+Rationale: CHG: working on moving gradient to adjoint\\
+\vspace{3em}
+
+\noindent \textbf{Change \#52} with diff file ISSM-18059-18060.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Materials/Material.h M /issm/trunk-jpl/src/c/classes/Materials/Matice.cpp M /issm/trunk-jpl/src/c/classes/Materials/Matice.h M /issm/trunk-jpl/src/c/classes/Materials/Matpar.h\\
+Export determination: 6. \\
+Rationale: CHG: still working on moving gradient to analysis\\
+\vspace{3em}
+
+\noindent \textbf{Change \#53} with diff file ISSM-18060-18061.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.h M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/Elements/TriaRef.cpp M /issm/trunk-jpl/src/c/classes/Materials/Material.h M /issm/trunk-jpl/src/c/classes/Materials/Matice.cpp M /issm/trunk-jpl/src/c/classes/Materials/Matice.h M /issm/trunk-jpl/src/c/classes/Materials/Matpar.h M /issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp M /issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.h\\
+Export determination: 6. \\
+Rationale: CHG: moving gradients from element to adjoint analyses\\
+\vspace{3em}
+
+\noindent \textbf{Change \#54} with diff file ISSM-18061-18062.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp M /issm/trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.h M /issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: NEW: readded adjoint for Balancethickness2\\
+\vspace{3em}
+
+\noindent \textbf{Change \#55} with diff file ISSM-18062-18063.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.cpp M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h\\
+Export determination: 6. \\
+Rationale: DEL: removed all gradients of elements, now done by adjoint\\
+\vspace{3em}
+
+\noindent \textbf{Change \#56} with diff file ISSM-18063-18064.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Nodes.cpp M /issm/trunk-jpl/src/c/classes/Profiler.cpp M /issm/trunk-jpl/src/c/classes/Segment.h M /issm/trunk-jpl/src/c/classes/Vertex.cpp M /issm/trunk-jpl/src/c/classes/Vertices.cpp M /issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp M /issm/trunk-jpl/src/c/datastructures/DataSet.cpp M /issm/trunk-jpl/src/c/kml/KMLFileReadUtils.cpp M /issm/trunk-jpl/src/c/kml/KML\_Attribute.cpp M /issm/trunk-jpl/src/c/kml/KML\_ColorStyle.cpp M /issm/trunk-jpl/src/c/kml/KML\_Comment.cpp M /issm/trunk-jpl/src/c/kml/KML\_Container.cpp M /issm/trunk-jpl/src/c/kml/KML\_Document.cpp M /issm/trunk-jpl/src/c/kml/KML\_Feature.cpp M /issm/trunk-jpl/src/c/kml/KML\_File.cpp M /issm/trunk-jpl/src/c/kml/KML\_Folder.cpp M /issm/trunk-jpl/src/c/kml/KML\_Geometry.cpp M /issm/trunk-jpl/src/c/kml/KML\_GroundOverlay.cpp M /issm/trunk-jpl/src/c/kml/KML\_Icon.cpp M /issm/trunk-jpl/src/c/kml/KML\_LatLonBox.cpp M /issm/trunk-jpl/src/c/kml/KML\_LineString.cpp M /issm/trunk-jpl/src/c/kml/KML\_LineStyle.cpp M /issm/trunk-jpl/src/c/kml/KML\_LinearRing.cpp M /issm/trunk-jpl/src/c/kml/KML\_MultiGeometry.cpp M /issm/trunk-jpl/src/c/kml/KML\_Object.cpp M /issm/trunk-jpl/src/c/kml/KML\_Overlay.cpp M /issm/trunk-jpl/src/c/kml/KML\_Placemark.cpp M /issm/trunk-jpl/src/c/kml/KML\_Point.cpp M /issm/trunk-jpl/src/c/kml/KML\_PolyStyle.cpp M /issm/trunk-jpl/src/c/kml/KML\_Polygon.cpp M /issm/trunk-jpl/src/c/kml/KML\_Style.cpp M /issm/trunk-jpl/src/c/kml/KML\_StyleSelector.cpp M /issm/trunk-jpl/src/c/kml/KML\_SubStyle.cpp M /issm/trunk-jpl/src/c/kml/KML\_Unknown.cpp M /issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp M /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp M /issm/trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp M /issm/trunk-jpl/src/c/shared/Elements/DrainageFunctionWaterfraction.cpp M /issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp M /issm/trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp M /issm/trunk-jpl/src/c/shared/Numerics/Synchronize.sh M /issm/trunk-jpl/src/c/shared/Numerics/Verbosity.cpp M /issm/trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp M /issm/trunk-jpl/src/c/toolkits/issm/IssmMpiDenseMat.h M /issm/trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h M /issm/trunk-jpl/src/c/toolkits/issm/IssmMpiVec.h M /issm/trunk-jpl/src/c/toolkits/issm/IssmSeqVec.h M /issm/trunk-jpl/src/c/toolkits/objects/Matrix.h M /issm/trunk-jpl/src/c/toolkits/objects/Vector.h M /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp M /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp\\
+Export determination: 6. \\
+Rationale: CHG: removed some FUNCTION folds, moved to function declaration\\
+\vspace{3em}
+
+\noindent \textbf{Change \#57} with diff file ISSM-18064-18065.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/bamg/AdjacentTriangle.cpp M /issm/trunk-jpl/src/c/bamg/BamgGeom.cpp M /issm/trunk-jpl/src/c/bamg/BamgMesh.cpp M /issm/trunk-jpl/src/c/bamg/BamgOpts.cpp M /issm/trunk-jpl/src/c/bamg/BamgQuadtree.cpp M /issm/trunk-jpl/src/c/bamg/BamgVertex.cpp M /issm/trunk-jpl/src/c/bamg/CrackedEdge.cpp M /issm/trunk-jpl/src/c/bamg/Curve.cpp M /issm/trunk-jpl/src/c/bamg/Direction.cpp M /issm/trunk-jpl/src/c/bamg/Edge.cpp M /issm/trunk-jpl/src/c/bamg/EigenMetric.cpp M /issm/trunk-jpl/src/c/bamg/GeomEdge.cpp M /issm/trunk-jpl/src/c/bamg/GeomSubDomain.cpp M /issm/trunk-jpl/src/c/bamg/GeomVertex.cpp M /issm/trunk-jpl/src/c/bamg/Geometry.cpp M /issm/trunk-jpl/src/c/bamg/ListofIntersectionTriangles.cpp M /issm/trunk-jpl/src/c/bamg/Mesh.cpp M /issm/trunk-jpl/src/c/bamg/Metric.cpp M /issm/trunk-jpl/src/c/bamg/SetOfE4.cpp M /issm/trunk-jpl/src/c/bamg/SubDomain.cpp M /issm/trunk-jpl/src/c/bamg/Triangle.cpp M /issm/trunk-jpl/src/c/bamg/VertexOnEdge.cpp M /issm/trunk-jpl/src/c/bamg/VertexOnGeom.cpp M /issm/trunk-jpl/src/c/bamg/VertexOnVertex.cpp M /issm/trunk-jpl/src/c/classes/Constraints/Constraints.cpp M /issm/trunk-jpl/src/c/classes/Constraints/Constraints.h M /issm/trunk-jpl/src/c/classes/Constraints/SpcDynamic.cpp M /issm/trunk-jpl/src/c/classes/Constraints/SpcStatic.cpp M /issm/trunk-jpl/src/c/classes/Constraints/SpcTransient.cpp M /issm/trunk-jpl/src/c/classes/Contour.h M /issm/trunk-jpl/src/c/classes/Contours.cpp M /issm/trunk-jpl/src/c/classes/DependentObject.cpp M /issm/trunk-jpl/src/c/classes/DofIndexing.cpp M /issm/trunk-jpl/src/c/classes/ExternalResults/Results.cpp M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/Hook.cpp M /issm/trunk-jpl/src/c/classes/IndependentObject.cpp M /issm/trunk-jpl/src/c/classes/Inputs/BoolInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/ControlInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/DoubleInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/Inputs.cpp M /issm/trunk-jpl/src/c/classes/Inputs/IntInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/PentaInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/SegInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/TetraInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/TriaInput.cpp M /issm/trunk-jpl/src/c/classes/IoModel.cpp M /issm/trunk-jpl/src/c/classes/Loads/Friction.cpp M /issm/trunk-jpl/src/c/classes/Loads/Loads.cpp M /issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp M /issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp M /issm/trunk-jpl/src/c/classes/Loads/Penpair.cpp M /issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp M /issm/trunk-jpl/src/c/classes/Massfluxatgate.h M /issm/trunk-jpl/src/c/classes/Materials/Materials.cpp M /issm/trunk-jpl/src/c/classes/Materials/Matice.cpp M /issm/trunk-jpl/src/c/classes/Materials/Matpar.cpp M /issm/trunk-jpl/src/c/classes/Misfit.h M /issm/trunk-jpl/src/c/classes/Node.cpp M /issm/trunk-jpl/src/c/classes/Options/OptionUtilities.cpp M /issm/trunk-jpl/src/c/classes/Options/Options.cpp M /issm/trunk-jpl/src/c/classes/Params/BoolParam.cpp M /issm/trunk-jpl/src/c/classes/Params/DataSetParam.cpp M /issm/trunk-jpl/src/c/classes/Params/DoubleMatArrayParam.cpp M /issm/trunk-jpl/src/c/classes/Params/DoubleMatParam.cpp M /issm/trunk-jpl/src/c/classes/Params/DoubleParam.cpp M /issm/trunk-jpl/src/c/classes/Params/DoubleTransientMatParam.cpp M /issm/trunk-jpl/src/c/classes/Params/DoubleVecParam.cpp M /issm/trunk-jpl/src/c/classes/Params/FileParam.cpp M /issm/trunk-jpl/src/c/classes/Params/IntMatParam.cpp M /issm/trunk-jpl/src/c/classes/Params/IntParam.cpp M /issm/trunk-jpl/src/c/classes/Params/IntVecParam.cpp M /issm/trunk-jpl/src/c/classes/Params/MatrixParam.cpp M /issm/trunk-jpl/src/c/classes/Params/Parameters.cpp M /issm/trunk-jpl/src/c/classes/Params/StringArrayParam.cpp M /issm/trunk-jpl/src/c/classes/Params/StringParam.cpp M /issm/trunk-jpl/src/c/classes/Params/TransientParam.cpp M /issm/trunk-jpl/src/c/classes/Params/VectorParam.cpp M /issm/trunk-jpl/src/c/classes/gauss/GaussPenta.cpp M /issm/trunk-jpl/src/c/classes/gauss/GaussSeg.cpp M /issm/trunk-jpl/src/c/classes/gauss/GaussTetra.cpp M /issm/trunk-jpl/src/c/classes/gauss/GaussTria.cpp M /issm/trunk-jpl/src/c/classes/kriging/ExponentialVariogram.cpp M /issm/trunk-jpl/src/c/classes/kriging/GaussianVariogram.cpp M /issm/trunk-jpl/src/c/classes/kriging/Observation.cpp M /issm/trunk-jpl/src/c/classes/kriging/Observations.cpp M /issm/trunk-jpl/src/c/classes/kriging/PowerVariogram.cpp M /issm/trunk-jpl/src/c/classes/kriging/Quadtree.cpp M /issm/trunk-jpl/src/c/classes/kriging/SphericalVariogram.cpp M /issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp\\
+Export determination: 6. \\
+Rationale: DEL: removed all FUNCTIONs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#58} with diff file ISSM-18065-18066.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/android/android-ndk/android\_aux.sh A /issm/trunk-jpl/externalpackages/android/android-ndk/installNDK-linux-x86.sh A /issm/trunk-jpl/externalpackages/android/android-sdk/installSDK-linux-x86.sh\\
+Export determination: 6. \\
+Rationale: CHG: new scripts for ubuntu.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#59} with diff file ISSM-18067-18068.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/miscellaneous/prctile\_issm.m\\
+Export determination: 6. \\
+Rationale: CHG: remove transp\\
+\vspace{3em}
+
+\noindent \textbf{Change \#60} with diff file ISSM-18068-18069.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/MeltingAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/ThermalAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/cores/thermal\_core.cpp M /issm/trunk-jpl/src/c/cores/transient\_core.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/basalforcings.m M /issm/trunk-jpl/src/m/classes/basalforcings.py M /issm/trunk-jpl/src/m/classes/groundingline.m M /issm/trunk-jpl/src/m/classes/groundingline.py M /issm/trunk-jpl/src/m/classes/mask.m M /issm/trunk-jpl/src/m/classes/mask.py M /issm/trunk-jpl/src/m/classes/model.m M /issm/trunk-jpl/src/m/classes/model.py M /issm/trunk-jpl/src/m/classes/thermal.m M /issm/trunk-jpl/src/m/classes/thermal.py M /issm/trunk-jpl/src/m/contrib/hack/tres.m A /issm/trunk-jpl/src/m/enum/BasalforcingsFloatingiceMeltingRateEnum.m A /issm/trunk-jpl/src/m/enum/BasalforcingsGroundediceMeltingRateEnum.m M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py M /issm/trunk-jpl/src/m/mech/steadystateiceshelftemp.m M /issm/trunk-jpl/src/m/mech/steadystateiceshelftemp.py M /issm/trunk-jpl/test/NightlyRun/test108.m M /issm/trunk-jpl/test/NightlyRun/test108.py M /issm/trunk-jpl/test/NightlyRun/test109.m M /issm/trunk-jpl/test/NightlyRun/test109.py M /issm/trunk-jpl/test/NightlyRun/test111.m M /issm/trunk-jpl/test/NightlyRun/test111.py M /issm/trunk-jpl/test/NightlyRun/test1208.m M /issm/trunk-jpl/test/NightlyRun/test1208.py M /issm/trunk-jpl/test/NightlyRun/test1301.m M /issm/trunk-jpl/test/NightlyRun/test1301.py M /issm/trunk-jpl/test/NightlyRun/test206.m M /issm/trunk-jpl/test/NightlyRun/test206.py M /issm/trunk-jpl/test/NightlyRun/test207.m M /issm/trunk-jpl/test/NightlyRun/test207.py M /issm/trunk-jpl/test/NightlyRun/test209.m M /issm/trunk-jpl/test/NightlyRun/test209.py M /issm/trunk-jpl/test/NightlyRun/test210.m M /issm/trunk-jpl/test/NightlyRun/test210.py M /issm/trunk-jpl/test/NightlyRun/test211.m M /issm/trunk-jpl/test/NightlyRun/test211.py M /issm/trunk-jpl/test/NightlyRun/test224.m M /issm/trunk-jpl/test/NightlyRun/test224.py M /issm/trunk-jpl/test/NightlyRun/test225.m M /issm/trunk-jpl/test/NightlyRun/test225.py M /issm/trunk-jpl/test/NightlyRun/test227.m M /issm/trunk-jpl/test/NightlyRun/test227.py M /issm/trunk-jpl/test/NightlyRun/test232.m M /issm/trunk-jpl/test/NightlyRun/test232.py M /issm/trunk-jpl/test/NightlyRun/test233.m M /issm/trunk-jpl/test/NightlyRun/test233.py M /issm/trunk-jpl/test/NightlyRun/test237.m M /issm/trunk-jpl/test/NightlyRun/test237.py M /issm/trunk-jpl/test/NightlyRun/test3008.m M /issm/trunk-jpl/test/NightlyRun/test3008.py M /issm/trunk-jpl/test/NightlyRun/test3009.m M /issm/trunk-jpl/test/NightlyRun/test3009.py M /issm/trunk-jpl/test/NightlyRun/test3108.m M /issm/trunk-jpl/test/NightlyRun/test3108.py M /issm/trunk-jpl/test/NightlyRun/test3109.m M /issm/trunk-jpl/test/NightlyRun/test3109.py M /issm/trunk-jpl/test/NightlyRun/test312.m M /issm/trunk-jpl/test/NightlyRun/test312.py M /issm/trunk-jpl/test/NightlyRun/test313.m M /issm/trunk-jpl/test/NightlyRun/test313.py M /issm/trunk-jpl/test/NightlyRun/test315.m M /issm/trunk-jpl/test/NightlyRun/test315.py M /issm/trunk-jpl/test/NightlyRun/test317.m M /issm/trunk-jpl/test/NightlyRun/test317.py M /issm/trunk-jpl/test/NightlyRun/test318.m M /issm/trunk-jpl/test/NightlyRun/test318.py M /issm/trunk-jpl/test/NightlyRun/test324.m M /issm/trunk-jpl/test/NightlyRun/test324.py M /issm/trunk-jpl/test/NightlyRun/test332.m M /issm/trunk-jpl/test/NightlyRun/test333.m M /issm/trunk-jpl/test/NightlyRun/test334.m M /issm/trunk-jpl/test/NightlyRun/test335.m M /issm/trunk-jpl/test/NightlyRun/test406.m M /issm/trunk-jpl/test/NightlyRun/test406.py M /issm/trunk-jpl/test/NightlyRun/test407.m M /issm/trunk-jpl/test/NightlyRun/test407.py M /issm/trunk-jpl/test/NightlyRun/test409.m M /issm/trunk-jpl/test/NightlyRun/test409.py M /issm/trunk-jpl/test/NightlyRun/test410.m M /issm/trunk-jpl/test/NightlyRun/test410.py M /issm/trunk-jpl/test/NightlyRun/test411.m M /issm/trunk-jpl/test/NightlyRun/test411.py M /issm/trunk-jpl/test/NightlyRun/test415.m M /issm/trunk-jpl/test/NightlyRun/test415.py M /issm/trunk-jpl/test/NightlyRun/test416.m M /issm/trunk-jpl/test/NightlyRun/test416.py M /issm/trunk-jpl/test/NightlyRun/test435.m M /issm/trunk-jpl/test/NightlyRun/test505.m M /issm/trunk-jpl/test/NightlyRun/test505.py M /issm/trunk-jpl/test/NightlyRun/test506.m M /issm/trunk-jpl/test/NightlyRun/test506.py M /issm/trunk-jpl/test/NightlyRun/test507.m M /issm/trunk-jpl/test/NightlyRun/test507.py M /issm/trunk-jpl/test/NightlyRun/test508.m M /issm/trunk-jpl/test/NightlyRun/test508.py M /issm/trunk-jpl/test/NightlyRun/test509.m M /issm/trunk-jpl/test/NightlyRun/test509.py M /issm/trunk-jpl/test/NightlyRun/test510.m M /issm/trunk-jpl/test/NightlyRun/test510.py M /issm/trunk-jpl/test/NightlyRun/test513.m M /issm/trunk-jpl/test/NightlyRun/test513.py M /issm/trunk-jpl/test/NightlyRun/test515.m M /issm/trunk-jpl/test/NightlyRun/test515.py M /issm/trunk-jpl/test/NightlyRun/test516.m M /issm/trunk-jpl/test/NightlyRun/test516.py M /issm/trunk-jpl/test/NightlyRun/test703.m M /issm/trunk-jpl/test/Par/79North.par M /issm/trunk-jpl/test/Par/79North.py M /issm/trunk-jpl/test/Par/RoundSheetShelf.par M /issm/trunk-jpl/test/Par/RoundSheetShelf.py M /issm/trunk-jpl/test/Par/SquareEISMINT.par M /issm/trunk-jpl/test/Par/SquareEISMINT.py M /issm/trunk-jpl/test/Par/SquareSheetShelf.par M /issm/trunk-jpl/test/Par/SquareSheetShelf.py M /issm/trunk-jpl/test/Par/SquareShelfConstrained.par M /issm/trunk-jpl/test/Par/SquareShelfConstrained.py M /issm/trunk-jpl/test/Par/SquareThermal.par M /issm/trunk-jpl/test/Par/ValleyGlacierShelf.par\\
+Export determination: 6. \\
+Rationale: NEW: reorganizing basal melting\\
+\vspace{3em}
+
+\noindent \textbf{Change \#61} with diff file ISSM-18069-18070.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Par/RoundSheetShelf.py\\
+Export determination: 6. \\
+Rationale: BUG: minor typo\\
+\vspace{3em}
+
+\noindent \textbf{Change \#62} with diff file ISSM-18070-18071.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: temporary change to check nightly runs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#63} with diff file ISSM-18071-18072.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive424.nc M /issm/trunk-jpl/test/Archives/Archive425.nc\\
+Export determination: 6. \\
+Rationale: CHG: archives grounding line with no code (no more grounding\_line melting)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#64} with diff file ISSM-18072-18073.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive803.nc M /issm/trunk-jpl/test/Archives/Archive805.nc\\
+Export determination: 6. \\
+Rationale: CHG: minor archives\\
+\vspace{3em}
+
+\noindent \textbf{Change \#65} with diff file ISSM-18073-18074.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.m\\
+Export determination: 6. \\
+Rationale: BUG: forgot to update unit conversion for new basal melting fields\\
+\vspace{3em}
+
+\noindent \textbf{Change \#66} with diff file ISSM-18074-18075.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: separaring grounded and floating melting rates where appropriate\\
+\vspace{3em}
+
+\noindent \textbf{Change \#67} with diff file ISSM-18075-18076.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp M /issm/trunk-jpl/src/c/classes/Elements/PentaRef.h\\
+Export determination: 6. \\
+Rationale: CHG: minor cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#68} with diff file ISSM-18076-18077.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/flowequation.m M /issm/trunk-jpl/src/m/classes/flowequation.py M /issm/trunk-jpl/src/m/classes/inversionvalidation.m M /issm/trunk-jpl/src/m/classes/m1qn3inversion.m M /issm/trunk-jpl/src/m/parameterization/setflowequation.m M /issm/trunk-jpl/src/m/parameterization/setflowequation.py M /issm/trunk-jpl/src/m/plot/plot\_elementstype.m\\
+Export determination: 6. \\
+Rationale: CHG: renumbering L1L2\\
+\vspace{3em}
+
+\noindent \textbf{Change \#69} with diff file ISSM-18077-18078.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/mesh3dprisms.m M /issm/trunk-jpl/src/m/classes/mesh3dprisms.py M /issm/trunk-jpl/src/m/classes/model.m M /issm/trunk-jpl/src/m/classes/model.py M /issm/trunk-jpl/src/m/consistency/checkfield.m M /issm/trunk-jpl/src/m/consistency/checkfield.py M /issm/trunk-jpl/src/m/contrib/bamg/yams.m\\
+Export determination: 6. \\
+Rationale: CHG: removed elementonbase/surface\\
+\vspace{3em}
+
+\noindent \textbf{Change \#70} with diff file ISSM-18078-18079.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp M /issm/trunk-jpl/src/c/classes/Elements/PentaRef.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.cpp M /issm/trunk-jpl/src/c/classes/Elements/SegRef.cpp M /issm/trunk-jpl/src/c/classes/Elements/SegRef.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp M /issm/trunk-jpl/src/c/classes/Elements/TetraRef.cpp M /issm/trunk-jpl/src/c/classes/Elements/TetraRef.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/TriaRef.cpp M /issm/trunk-jpl/src/c/classes/Elements/TriaRef.h M /issm/trunk-jpl/src/c/classes/Inputs/PentaInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/PentaInput.h M /issm/trunk-jpl/src/c/classes/Inputs/SegInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/SegInput.h M /issm/trunk-jpl/src/c/classes/Inputs/TetraInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/TetraInput.h M /issm/trunk-jpl/src/c/classes/Inputs/TriaInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/TriaInput.h M /issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp\\
+Export determination: 6. \\
+Rationale: CHG: moved element\_type to element rather than reference element\\
+\vspace{3em}
+
+\noindent \textbf{Change \#71} with diff file ISSM-18079-18080.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp\\
+Export determination: 6. \\
+Rationale: CHG: cosmetics\\
+\vspace{3em}
+
+\noindent \textbf{Change \#72} with diff file ISSM-18082-18083.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive111.nc M /issm/trunk-jpl/test/Archives/Archive124.nc M /issm/trunk-jpl/test/Archives/Archive209.nc M /issm/trunk-jpl/test/Archives/Archive210.nc M /issm/trunk-jpl/test/Archives/Archive211.nc M /issm/trunk-jpl/test/Archives/Archive224.nc M /issm/trunk-jpl/test/Archives/Archive225.nc M /issm/trunk-jpl/test/Archives/Archive227.nc M /issm/trunk-jpl/test/Archives/Archive233.nc M /issm/trunk-jpl/test/Archives/Archive409.nc M /issm/trunk-jpl/test/Archives/Archive410.nc M /issm/trunk-jpl/test/Archives/Archive411.nc M /issm/trunk-jpl/test/Archives/Archive415.nc M /issm/trunk-jpl/test/Archives/Archive416.nc M /issm/trunk-jpl/test/Archives/Archive426.nc M /issm/trunk-jpl/test/Archives/Archive427.nc M /issm/trunk-jpl/test/Archives/Archive505.nc M /issm/trunk-jpl/test/Archives/Archive506.nc M /issm/trunk-jpl/test/Archives/Archive507.nc M /issm/trunk-jpl/test/Archives/Archive509.nc M /issm/trunk-jpl/test/Archives/Archive513.nc M /issm/trunk-jpl/test/Archives/Archive802.nc M /issm/trunk-jpl/test/Archives/Archive803.nc\\
+Export determination: 6. \\
+Rationale: CHG: new archives for basal melting\\
+\vspace{3em}
+
+\noindent \textbf{Change \#73} with diff file ISSM-18083-18084.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive508.nc M /issm/trunk-jpl/test/NightlyRun/test508.m M /issm/trunk-jpl/test/NightlyRun/test508.py\\
+Export determination: 6. \\
+Rationale: CHG: fixed nightly run that was failing\\
+\vspace{3em}
+
+\noindent \textbf{Change \#74} with diff file ISSM-18084-18085.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/windows\\
+Export determination: 6. \\
+Rationale: CHG: removed development option from windows\\
+\vspace{3em}
+
+\noindent \textbf{Change \#75} with diff file ISSM-18085-18086.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive303.nc M /issm/trunk-jpl/test/Archives/Archive306.nc M /issm/trunk-jpl/test/NightlyRun/test513.m M /issm/trunk-jpl/test/NightlyRun/test513.py\\
+Export determination: 6. \\
+Rationale: CHG: forgot to update to archives\\
+\vspace{3em}
+
+\noindent \textbf{Change \#76} with diff file ISSM-18087-18088.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/solve/parseresultsfromdisk.py\\
+Export determination: 6. \\
+Rationale: BUG: forgot to change unit conversion of results in python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#77} with diff file ISSM-18089-18090.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/clusters/generic.m\\
+Export determination: 6. \\
+Rationale: CHG: fixed issue for users of csh and tcsh shell. Needed to add n at end of line. Also created a new field 'shell' in the generic cluster, which defaults to '/bin/sh'. This field can be changed to '/bin/csh'.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#78} with diff file ISSM-18090-18091.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test513.py\\
+Export determination: 6. \\
+Rationale: CHG: minor python tolerance\\
+\vspace{3em}
+
+\noindent \textbf{Change \#79} with diff file ISSM-18091-18092.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/IdToName.m M /issm/trunk-jpl/test/NightlyRun/IdToName.py D /issm/trunk-jpl/test/NightlyRun/temp291.m D /issm/trunk-jpl/test/NightlyRun/temp291.py A /issm/trunk-jpl/test/NightlyRun/test291.m A /issm/trunk-jpl/test/NightlyRun/test291.py\\
+Export determination: 6. \\
+Rationale: NEW: commited P4z test\\
+\vspace{3em}
+
+\noindent \textbf{Change \#80} with diff file ISSM-18092-18093.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive291.nc M /issm/trunk-jpl/test/NightlyRun/test291.m M /issm/trunk-jpl/test/NightlyRun/test291.py\\
+Export determination: 6. \\
+Rationale: NEW: added archive for P4z test\\
+\vspace{3em}
+
+\noindent \textbf{Change \#81} with diff file ISSM-18093-18094.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h A /issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatex A /issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatex/.deps A /issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatex/.deps/.dirstamp A /issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatex/.deps/FloatingiceMeltingRatex.Plo A /issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatex/.deps/libISSMCore\_a-FloatingiceMeltingRatex.Po A /issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatex/.deps/libISSMRose\_a-FloatingiceMeltingRatex.r2cpp.Po A /issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatex/.dirstamp A /issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp A /issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.h M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp M /issm/trunk-jpl/src/c/modules/modules.h M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/basalforcings.m M /issm/trunk-jpl/src/m/classes/basalforcings.py A /issm/trunk-jpl/src/m/classes/linearbasalforcings.m A /issm/trunk-jpl/src/m/enum/BasalforcingsDeepwaterElevationEnum.m A /issm/trunk-jpl/src/m/enum/BasalforcingsDeepwaterMeltingRateEnum.m A /issm/trunk-jpl/src/m/enum/BasalforcingsEnum.m A /issm/trunk-jpl/src/m/enum/BasalforcingsUpperwaterElevationEnum.m M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py A /issm/trunk-jpl/src/m/enum/FloatingMeltRateEnum.m A /issm/trunk-jpl/src/m/enum/LinearFloatingMeltRateEnum.m\\
+Export determination: 6. \\
+Rationale: BEW: adding new class for floating ice melt rate\\
+\vspace{3em}
+
+\noindent \textbf{Change \#82} with diff file ISSM-18094-18095.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/transient\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG: forgot to add Floating melt rate module\\
+\vspace{3em}
+
+\noindent \textbf{Change \#83} with diff file ISSM-18095-18096.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/IdToName.m A /issm/trunk-jpl/test/NightlyRun/test292.m\\
+Export determination: 6. \\
+Rationale: NEW: added NR for floating melt rate parameteriation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#84} with diff file ISSM-18096-18097.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/linearbasalforcings.m\\
+Export determination: 6. \\
+Rationale: BUG: forgot class changes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#85} with diff file ISSM-18097-18098.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/Archives/Archive292.nc\\
+Export determination: 6. \\
+Rationale: NEW: archive for test 292\\
+\vspace{3em}
+
+\noindent \textbf{Change \#86} with diff file ISSM-18099-18100.diff: \\
+Function name: \\
+D /issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatex/.deps\\
+Export determination: 6. \\
+Rationale: CHG: should not be under svn\\
+\vspace{3em}
+
+\noindent \textbf{Change \#87} with diff file ISSM-18100-18101.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: removed duplicate DamageEvolution\\
+\vspace{3em}
+
+\noindent \textbf{Change \#88} with diff file ISSM-18101-18102.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/solve/solve.m M /issm/trunk-jpl/src/m/solve/solve.py\\
+Export determination: 6. \\
+Rationale: CHG: introduced option to bypass on consistency check.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#89} with diff file ISSM-18102-18103.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/wrappers/matlab/Makefile.am M /issm/trunk-jpl/src/wrappers/python/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: prevent automake from complaining about subdir options\\
+\vspace{3em}
+
+\noindent \textbf{Change \#90} with diff file ISSM-18103-18104.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/solve/solve.m M /issm/trunk-jpl/src/m/solve/solve.py\\
+Export determination: 6. \\
+Rationale: CHG: always check,reversing bug introduced in previous attempt to unhook consistency checks when not necessary.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#91} with diff file ISSM-18104-18105.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/FemModel.cpp\\
+Export determination: 6. \\
+Rationale: CHG: moved vx vy vz max,min,abs to module\\
+\vspace{3em}
+
+\noindent \textbf{Change \#92} with diff file ISSM-18105-18106.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/wrappers/IssmConfig\\
+Export determination: 6. \\
+Rationale: CHG: ignoring some files\\
+\vspace{3em}
+
+\noindent \textbf{Change \#93} with diff file ISSM-18106-18107.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive292.nc\\
+Export determination: 6. \\
+Rationale: CHG: better archive\\
+\vspace{3em}
+
+\noindent \textbf{Change \#94} with diff file ISSM-18107-18108.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/wrappers/python/Makefile.am\\
+Export determination: 6. \\
+Rationale: BUG: cannot use subdir options for python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#95} with diff file ISSM-18108-18109.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/IdToName.py\\
+Export determination: 6. \\
+Rationale: NEW: adding last NR in python test list\\
+\vspace{3em}
+
+\noindent \textbf{Change \#96} with diff file ISSM-18109-18110.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/interp/interp.py\\
+Export determination: 6. \\
+Rationale: BUG: wrong array size for nearest neighbors\\
+\vspace{3em}
+
+\noindent \textbf{Change \#97} with diff file ISSM-18110-18111.diff: \\
+Function name: \\
+A /issm/trunk-jpl/test/NightlyRun/test292.py\\
+Export determination: 6. \\
+Rationale: CHG: added test292 for python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#98} with diff file ISSM-18111-18112.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/classes/linearbasalforcings.py\\
+Export determination: 6. \\
+Rationale: BUG: forgot to add linearbasalforcings class in python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#99} with diff file ISSM-18112-18113.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive801.nc\\
+Export determination: 6. \\
+Rationale: CHG: minor trying to debug NR 801\\
+\vspace{3em}
+
+\noindent \textbf{Change \#100} with diff file ISSM-18113-18114.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Par/ValleyGlacierShelf.py\\
+Export determination: 6. \\
+Rationale: BUG: forgot to update ValleyGlacier par file in python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#101} with diff file ISSM-18114-18115.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive801.nc\\
+Export determination: 6. \\
+Rationale: BUG: reverting back old archive\\
+\vspace{3em}
+
+\noindent \textbf{Change \#102} with diff file ISSM-18115-18116.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/linearbasalforcings.py M /issm/trunk-jpl/test/NightlyRun/test292.py\\
+Export determination: 6. \\
+Rationale: BUG: test 292.py now running\\
+\vspace{3em}
+
+\noindent \textbf{Change \#103} with diff file ISSM-18116-18117.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/linearbasalforcings.py\\
+Export determination: 6. \\
+Rationale: BUG: similar values in default parameters for matlab and python\\
+\vspace{3em}
+
+\noindent \textbf{Change \#104} with diff file ISSM-18117-18118.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/SquareIceShelf/Front.exp\\
+Export determination: 6. \\
+Rationale: CHG: make front closer to boundary to avoid MUMPS crash\\
+\vspace{3em}
+
+\noindent \textbf{Change \#105} with diff file ISSM-18118-18119.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Inputs/ControlInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/ControlInput.h\\
+Export determination: 6. \\
+Rationale: NEW: added Min function\\
+\vspace{3em}
+
+\noindent \textbf{Change \#106} with diff file ISSM-18119-18120.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: NEW: added support for matlab 2014+ mex\\
+\vspace{3em}
+
+\noindent \textbf{Change \#107} with diff file ISSM-18120-18121.diff: \\
+Function name: \\
+M /issm/trunk-jpl/jenkins/windows\\
+Export determination: 6. \\
+Rationale: CHG: excluding development and FS runs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#108} with diff file ISSM-18121-18122.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Par/RoundSheetShelf.par\\
+Export determination: 6. \\
+Rationale: BUG: typo\\
+\vspace{3em}
+
+\noindent \textbf{Change \#109} with diff file ISSM-18122-18123.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.h M /issm/trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: renaming process2 for shared library\\
+\vspace{3em}
+
+\noindent \textbf{Change \#110} with diff file ISSM-18123-18124.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatex\\
+Export determination: 6. \\
+Rationale: CHG: gatting svn to ignore some files\\
+\vspace{3em}
+
+\noindent \textbf{Change \#111} with diff file ISSM-18124-18125.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am D /issm/trunk-jpl/src/c/shared/MemOps/MemOps.cpp M /issm/trunk-jpl/src/c/shared/MemOps/MemOps.h D /issm/trunk-jpl/src/c/shared/Numerics/isnan.cpp M /issm/trunk-jpl/src/c/shared/Numerics/isnan.h\\
+Export determination: 6. \\
+Rationale: CHG: moved some code from CPP to H so that ranlib does not complain about no symbol found\\
+\vspace{3em}
+
+\noindent \textbf{Change \#112} with diff file ISSM-18125-18126.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am A /issm/trunk-jpl/src/c/shared/MemOps/MemOps.cpp M /issm/trunk-jpl/src/c/shared/MemOps/MemOps.h A /issm/trunk-jpl/src/c/shared/Numerics/isnan.cpp M /issm/trunk-jpl/src/c/shared/Numerics/isnan.h\\
+Export determination: 6. \\
+Rationale: CHG: reverting back, AD does not compile like that (multiple definitions)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#113} with diff file ISSM-18126-18127.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added Enum to IsEnum\\
+\vspace{3em}
+
+\noindent \textbf{Change \#114} with diff file ISSM-18127-18128.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/parameterization/setflowequation.m M /issm/trunk-jpl/src/m/parameterization/setflowequation.py\\
+Export determination: 6. \\
+Rationale: CHG: minor typo name of routine\\
+\vspace{3em}
+
+\noindent \textbf{Change \#115} with diff file ISSM-18128-18129.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/cores/control\_core.cpp M /issm/trunk-jpl/src/c/cores/controlm1qn3\_core.cpp M /issm/trunk-jpl/src/c/cores/controltao\_core.cpp M /issm/trunk-jpl/src/c/cores/controlvalidation\_core.cpp M /issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp M /issm/trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp M /issm/trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h M /issm/trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp M /issm/trunk-jpl/src/c/shared/Numerics/OptPars.h M /issm/trunk-jpl/src/c/shared/Numerics/numerics.h M /issm/trunk-jpl/src/m/classes/inversion.m\\
+Export determination: 6. \\
+Rationale: NEW: working on BrentSearch interface to make it tao like\\
+\vspace{3em}
+
+\noindent \textbf{Change \#116} with diff file ISSM-18129-18130.diff: \\
+Function name: \\
+M /issm/trunk-jpl/AUTHORS\\
+Export determination: 6. \\
+Rationale: CHG: changed mathieu's email address\\
+\vspace{3em}
+
+\noindent \textbf{Change \#117} with diff file ISSM-18130-18131.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h\\
+Export determination: 6. \\
+Rationale: BUG: fixing AD compile\\
+\vspace{3em}
+
+\noindent \textbf{Change \#118} with diff file ISSM-18131-18132.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/control\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing steadystate runs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#119} with diff file ISSM-18132-18133.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/control\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: no need to get FS\\
+\vspace{3em}
+
+\noindent \textbf{Change \#120} with diff file ISSM-18133-18134.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive322.nc\\
+Export determination: 6. \\
+Rationale: CHG: no more orthogonalization\\
+\vspace{3em}
+
+\noindent \textbf{Change \#121} with diff file ISSM-18134-18135.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/cores/control\_core.cpp M /issm/trunk-jpl/src/c/cores/cores.h D /issm/trunk-jpl/src/c/cores/gradient\_core.cpp M /issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp D /issm/trunk-jpl/src/c/modules/Orthx M /issm/trunk-jpl/src/c/modules/modules.h\\
+Export determination: 6. \\
+Rationale: DEL: removed some modules not needed anymore\\
+\vspace{3em}
+
+\noindent \textbf{Change \#122} with diff file ISSM-18135-18136.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h D /issm/trunk-jpl/src/c/modules/ControlInputGetGradientx D /issm/trunk-jpl/src/c/modules/ControlInputScaleGradientx M /issm/trunk-jpl/src/c/modules/modules.h\\
+Export determination: 6. \\
+Rationale: DEL: removed some modules not needed anymore\\
+\vspace{3em}
+
+\noindent \textbf{Change \#123} with diff file ISSM-18136-18137.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h\\
+Export determination: 6. \\
+Rationale: CHG: working on a new damage evolution source term\\
+\vspace{3em}
+
+\noindent \textbf{Change \#124} with diff file ISSM-18137-18138.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/control\_core.cpp M /issm/trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp\\
+Export determination: 6. \\
+Rationale: CHG: better display of Brent search inversion\\
+\vspace{3em}
+
+\noindent \textbf{Change \#125} with diff file ISSM-18138-18139.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/control\_core.cpp M /issm/trunk-jpl/test/Archives/Archive212.nc M /issm/trunk-jpl/test/Archives/Archive213.nc M /issm/trunk-jpl/test/Archives/Archive214.nc M /issm/trunk-jpl/test/Archives/Archive215.nc M /issm/trunk-jpl/test/Archives/Archive272.nc M /issm/trunk-jpl/test/Archives/Archive319.nc M /issm/trunk-jpl/test/Archives/Archive320.nc M /issm/trunk-jpl/test/Archives/Archive321.nc M /issm/trunk-jpl/test/Archives/Archive322.nc M /issm/trunk-jpl/test/Archives/Archive415.nc M /issm/trunk-jpl/test/Archives/Archive416.nc M /issm/trunk-jpl/test/Archives/Archive511.nc M /issm/trunk-jpl/test/Archives/Archive512.nc M /issm/trunk-jpl/test/Archives/Archive513.nc\\
+Export determination: 6. \\
+Rationale: CHG: do not need to call another time forward run after gradient\\
+\vspace{3em}
+
+\noindent \textbf{Change \#126} with diff file ISSM-18139-18140.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/TetraRef.cpp M /issm/trunk-jpl/src/c/classes/Elements/TetraRef.h\\
+Export determination: 6. \\
+Rationale: CHG: added some capabilities\\
+\vspace{3em}
+
+\noindent \textbf{Change \#127} with diff file ISSM-18140-18141.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateFaces.cpp\\
+Export determination: 6. \\
+Rationale: CHG: forgot last marker\\
+\vspace{3em}
+
+\noindent \textbf{Change \#128} with diff file ISSM-18141-18142.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/mech/basalstress.m M /issm/trunk-jpl/src/m/plot/plotdoc.m\\
+Export determination: 6. \\
+Rationale: CHG: minor better documentation for basalstress function and plot\\
+\vspace{3em}
+
+\noindent \textbf{Change \#129} with diff file ISSM-18142-18143.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model.m\\
+Export determination: 6. \\
+Rationale: BUG: fixed split from prisms to tets\\
+\vspace{3em}
+
+\noindent \textbf{Change \#130} with diff file ISSM-18143-18144.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp M /issm/trunk-jpl/src/c/classes/Elements/TetraRef.cpp\\
+Export determination: 6. \\
+Rationale: NEW: some functionalities required for Nathan's algorithm in 3d\\
+\vspace{3em}
+
+\noindent \textbf{Change \#131} with diff file ISSM-18147-18148.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/FemModel.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed case when elements->Size()==0\\
+\vspace{3em}
+
+\noindent \textbf{Change \#132} with diff file ISSM-18148-18149.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp M /issm/trunk-jpl/src/c/shared/Matrix/matrix.h\\
+Export determination: 6. \\
+Rationale: NEW: implemeted matrix inversion\\
+\vspace{3em}
+
+\noindent \textbf{Change \#133} with diff file ISSM-18149-18150.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed AD compilation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#134} with diff file ISSM-18150-18151.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: reverting back analytical test\\
+\vspace{3em}
+
+\noindent \textbf{Change \#135} with diff file ISSM-18151-18152.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed allocation required in 3d for four-field FS\\
+\vspace{3em}
+
+\noindent \textbf{Change \#136} with diff file ISSM-18152-18153.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed memory leak\\
+\vspace{3em}
+
+\noindent \textbf{Change \#137} with diff file ISSM-18153-18154.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/contrib/bamg/gmsh3d.m\\
+Export determination: 6. \\
+Rationale: NEW: added gmsh3d.m\\
+\vspace{3em}
+
+\noindent \textbf{Change \#138} with diff file ISSM-18157-18158.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/plot\_BC.m\\
+Export determination: 6. \\
+Rationale: CHG: handle 2d meshes.\\
+\vspace{3em}
+
+\noindent \textbf{Change \#139} with diff file ISSM-18158-18159.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64\_mavericks.sh\\
+Export determination: 6. \\
+Rationale: CHG: add new install for mavericks\\
+\vspace{3em}
+
+\noindent \textbf{Change \#140} with diff file ISSM-18159-18160.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/boost/configs A /issm/trunk-jpl/externalpackages/boost/configs/1.55 A /issm/trunk-jpl/externalpackages/boost/configs/1.55/cas128strong.hpp.patch A /issm/trunk-jpl/externalpackages/boost/configs/1.55/gcc-atomic.hpp.patch A /issm/trunk-jpl/externalpackages/boost/install-1.49-linux.sh (from /issm/trunk-jpl/externalpackages/boost/install.sh:18012) A /issm/trunk-jpl/externalpackages/boost/install-1.55-macosx-mavericks.sh R /issm/trunk-jpl/externalpackages/boost/install.sh\\
+Export determination: 6. \\
+Rationale: CHG: add new install for mavericks\\
+\vspace{3em}
+
+\noindent \textbf{Change \#141} with diff file ISSM-18160-18161.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: NEW: add dakota 3.1 for mac\\
+\vspace{3em}
+
+\noindent \textbf{Change \#142} with diff file ISSM-18161-18162.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp\\
+Export determination: 6. \\
+Rationale: CHG: comment out check of determinant\\
+\vspace{3em}
+
+\noindent \textbf{Change \#143} with diff file ISSM-18162-18163.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/plot\_unit.m\\
+Export determination: 6. \\
+Rationale: CHG: tetras in plot elements\\
+\vspace{3em}
+
+\noindent \textbf{Change \#144} with diff file ISSM-18163-18164.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp\\
+Export determination: 6. \\
+Rationale: BUG: change coordinate system for floating ice as well\\
+\vspace{3em}
+
+\noindent \textbf{Change \#145} with diff file ISSM-18164-18165.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: CHG: add path for dynlib DAKOTA\\
+\vspace{3em}
+
+\noindent \textbf{Change \#146} with diff file ISSM-18165-18166.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test513.m M /issm/trunk-jpl/test/NightlyRun/test513.py\\
+Export determination: 6. \\
+Rationale: CHG: relaxed tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#147} with diff file ISSM-18166-18167.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/model.m\\
+Export determination: 6. \\
+Rationale: BUG: wrong filed collapsed\\
+\vspace{3em}
+
+\noindent \textbf{Change \#148} with diff file ISSM-18167-18168.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test322.m M /issm/trunk-jpl/test/NightlyRun/test322.py\\
+Export determination: 6. \\
+Rationale: CHG: relaxed tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#149} with diff file ISSM-18168-18169.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test337.m M /issm/trunk-jpl/test/NightlyRun/test337.py\\
+Export determination: 6. \\
+Rationale: CHG: relaxed tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#150} with diff file ISSM-18169-18170.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/balancethickness2.m M /issm/trunk-jpl/src/m/classes/inversion.m M /issm/trunk-jpl/src/m/classes/taoinversion.m\\
+Export determination: 6. \\
+Rationale: CHG: working on new bed topography algorithm\\
+\vspace{3em}
+
+\noindent \textbf{Change \#151} with diff file ISSM-18170-18171.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/TriaRef.cpp M /issm/trunk-jpl/src/c/classes/gauss/GaussTria.cpp M /issm/trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateNodes.cpp M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/flowequation.m M /issm/trunk-jpl/src/m/classes/flowequation.py D /issm/trunk-jpl/src/m/enum/BasalforcingsMeltingRateCorrectionEnum.m D /issm/trunk-jpl/src/m/enum/BasalforcingsMeltingRateEnum.m M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py D /issm/trunk-jpl/src/m/enum/GroundinglineMeltingRateEnum.m A /issm/trunk-jpl/src/m/enum/P2bubbleEnum.m A /issm/trunk-jpl/src/m/enum/P2bubblecondensedEnum.m\\
+Export determination: 6. \\
+Rationale: NEW: added P2bubble element, to be debugged\\
+\vspace{3em}
+
+\noindent \textbf{Change \#152} with diff file ISSM-18171-18172.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp M /issm/trunk-jpl/src/c/classes/gauss/GaussPenta.cpp M /issm/trunk-jpl/src/m/classes/flowequation.m M /issm/trunk-jpl/src/m/classes/flowequation.py\\
+Export determination: 6. \\
+Rationale: NEW: P2bubble in 3d\\
+\vspace{3em}
+
+\noindent \textbf{Change \#153} with diff file ISSM-18172-18173.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/vim/addons/vim/syntax/c.vim\\
+Export determination: 6. \\
+Rationale: CHG: syncing Enums\\
+\vspace{3em}
+
+\noindent \textbf{Change \#154} with diff file ISSM-18173-18174.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/TriaRef.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateNodes.cpp M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/flowequation.m M /issm/trunk-jpl/src/m/classes/flowequation.py\\
+Export determination: 6. \\
+Rationale: NEW: added CrouzeixRaviart elements in FS\\
+\vspace{3em}
+
+\noindent \textbf{Change \#155} with diff file ISSM-18174-18175.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/wrappers/InterpFromGridToMesh/InterpFromGridToMesh.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added bilinear interpolation to help display:\\
+\vspace{3em}
+
+\noindent \textbf{Change \#156} with diff file ISSM-18175-18176.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed divergence that was only integrating on base (+ added 2d case)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#157} with diff file ISSM-18176-18177.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Exp/SquareFront.exp\\
+Export determination: 6. \\
+Rationale: BUG: more restrictive on front to avoid crash\\
+\vspace{3em}
+
+\noindent \textbf{Change \#158} with diff file ISSM-18177-18178.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive701.nc M /issm/trunk-jpl/test/NightlyRun/test701.m\\
+Export determination: 6. \\
+Rationale: CHG: testing more 2d FS elements\\
+\vspace{3em}
+
+\noindent \textbf{Change \#159} with diff file ISSM-18179-18180.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/Makefile.am M /issm/trunk-jpl/src/c/analyses/EnumToAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.h A /issm/trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp A /issm/trunk-jpl/src/c/analyses/UzawaPressureAnalysis.h M /issm/trunk-jpl/src/c/analyses/analyses.h M /issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp M /issm/trunk-jpl/src/c/classes/Elements/TetraRef.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/TriaRef.cpp M /issm/trunk-jpl/src/c/cores/AnalysisConfiguration.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateNodes.cpp M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp A /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_la.cpp M /issm/trunk-jpl/src/c/solutionsequences/solutionsequences.h M /issm/trunk-jpl/src/m/classes/flowequation.m M /issm/trunk-jpl/src/m/classes/flowequation.py M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py A /issm/trunk-jpl/src/m/enum/LATaylorHoodEnum.m A /issm/trunk-jpl/src/m/enum/UzawaPressureAnalysisEnum.m\\
+Export determination: 6. \\
+Rationale: NEW: starting to implement pressure augmentation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#160} with diff file ISSM-18180-18181.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/enum/CrouzeixRaviartEnum.m\\
+Export determination: 6. \\
+Rationale: CHG: forgot to add Enum\\
+\vspace{3em}
+
+\noindent \textbf{Change \#161} with diff file ISSM-18181-18182.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/analyses.m4\\
+Export determination: 6. \\
+Rationale: BUG: commited analysis.m4 with UsawaPressure\\
+\vspace{3em}
+
+\noindent \textbf{Change \#162} with diff file ISSM-18182-18183.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/TriaRef.cpp\\
+Export determination: 6. \\
+Rationale: BUG: starting to debug LATaylorHood\\
+\vspace{3em}
+
+\noindent \textbf{Change \#163} with diff file ISSM-18183-18184.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: correction to epl gradient and modif in transfer scheme\\
+\vspace{3em}
+
+\noindent \textbf{Change \#164} with diff file ISSM-18184-18185.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.h\\
+Export determination: 6. \\
+Rationale: BUG: debugging LATaylorHood\\
+\vspace{3em}
+
+\noindent \textbf{Change \#165} with diff file ISSM-18185-18186.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/flowequation.m\\
+Export determination: 6. \\
+Rationale: BUG: minor wrong name of element\\
+\vspace{3em}
+
+\noindent \textbf{Change \#166} with diff file ISSM-18186-18187.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_la.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed leaks in LATaylorHood\\
+\vspace{3em}
+
+\noindent \textbf{Change \#167} with diff file ISSM-18187-18188.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing LATaylorHood\\
+\vspace{3em}
+
+\noindent \textbf{Change \#168} with diff file ISSM-18188-18189.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: forgot r in r B$^T$ B\\
+\vspace{3em}
+
+\noindent \textbf{Change \#169} with diff file ISSM-18189-18190.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive701.nc M /issm/trunk-jpl/test/NightlyRun/test701.m\\
+Export determination: 6. \\
+Rationale: BUG: the archive was wrong (probably for analytical test)\\
+\vspace{3em}
+
+\noindent \textbf{Change \#170} with diff file ISSM-18190-18191.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Seg.cpp M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/cores/control\_core.cpp\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#171} with diff file ISSM-18191-18192.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: should not transform coordinates for augmented pressure\\
+\vspace{3em}
+
+\noindent \textbf{Change \#172} with diff file ISSM-18192-18193.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h\\
+Export determination: 6. \\
+Rationale: CHG: moved StrainRate to element\\
+\vspace{3em}
+
+\noindent \textbf{Change \#173} with diff file ISSM-18193-18194.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/cores/adjointbalancethickness2\_core.cpp M /issm/trunk-jpl/src/c/cores/controlvalidation\_core.cpp\\
+Export determination: 6. \\
+Rationale: BUG: BalancethicknessAparentMassbalance was not in Isiinput\\
+\vspace{3em}
+
+\noindent \textbf{Change \#174} with diff file ISSM-18194-18195.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py A /issm/trunk-jpl/src/m/enum/NewDamageEnum.m M /issm/trunk-jpl/src/m/plot/plotmodel.py\\
+Export determination: 6. \\
+Rationale: NEW: working on damage calculation from stress balance solution\\
+\vspace{3em}
+
+\noindent \textbf{Change \#175} with diff file ISSM-18195-18196.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: debugging LATH\\
+\vspace{3em}
+
+\noindent \textbf{Change \#176} with diff file ISSM-18196-18197.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: NEW: improving lagrange pressure\\
+\vspace{3em}
+
+\noindent \textbf{Change \#177} with diff file ISSM-18197-18198.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/flowequation.m M /issm/trunk-jpl/src/m/classes/flowequation.py\\
+Export determination: 6. \\
+Rationale: NEW: names in augmented lagrangian\\
+\vspace{3em}
+
+\noindent \textbf{Change \#178} with diff file ISSM-18198-18199.diff: \\
+Function name: \\
+A /issm/trunk-jpl/examples/Data A /issm/trunk-jpl/examples/Data/Download.sh A /issm/trunk-jpl/examples/Greenland A /issm/trunk-jpl/examples/Greenland/DomainOutline.exp A /issm/trunk-jpl/examples/Greenland/Greenland.par A /issm/trunk-jpl/examples/Greenland/Jak\_grounded.exp A /issm/trunk-jpl/examples/Greenland/Jak\_outline.exp A /issm/trunk-jpl/examples/Greenland/Models A /issm/trunk-jpl/examples/Greenland/runme.m A /issm/trunk-jpl/examples/ISMIP A /issm/trunk-jpl/examples/ISMIP/CheatyIsmipA.par A /issm/trunk-jpl/examples/ISMIP/CheatyIsmipF.par A /issm/trunk-jpl/examples/ISMIP/CheatyRunme.m A /issm/trunk-jpl/examples/ISMIP/IsmipA.par A /issm/trunk-jpl/examples/ISMIP/IsmipF.par A /issm/trunk-jpl/examples/ISMIP/Models A /issm/trunk-jpl/examples/ISMIP/runme.m A /issm/trunk-jpl/examples/IceflowModels A /issm/trunk-jpl/examples/IceflowModels/Contour.exp A /issm/trunk-jpl/examples/IceflowModels/EISMINT.par A /issm/trunk-jpl/examples/IceflowModels/RoundFront.exp A /issm/trunk-jpl/examples/IceflowModels/Square.exp A /issm/trunk-jpl/examples/IceflowModels/SquareFront.exp A /issm/trunk-jpl/examples/IceflowModels/SquareShelf.par A /issm/trunk-jpl/examples/IceflowModels/eismint.m A /issm/trunk-jpl/examples/IceflowModels/runme.m A /issm/trunk-jpl/examples/Inversion A /issm/trunk-jpl/examples/Inversion/DomainOutline.exp A /issm/trunk-jpl/examples/Inversion/Front.exp A /issm/trunk-jpl/examples/Inversion/Square.par A /issm/trunk-jpl/examples/Inversion/runme.m A /issm/trunk-jpl/examples/Pig A /issm/trunk-jpl/examples/Pig/06PIG\_Application.pdf A /issm/trunk-jpl/examples/Pig/CheatSheet.m A /issm/trunk-jpl/examples/Pig/DomainOutline.bkp A /issm/trunk-jpl/examples/Pig/DomainOutline.exp A /issm/trunk-jpl/examples/Pig/Models A /issm/trunk-jpl/examples/Pig/Pig.par A /issm/trunk-jpl/examples/Pig/PigRegion.m A /issm/trunk-jpl/examples/Pig/runme.m A /issm/trunk-jpl/examples/UncertaintyQuantification A /issm/trunk-jpl/examples/UncertaintyQuantification/ErrorContour.exp A /issm/trunk-jpl/examples/UncertaintyQuantification/MassFluxes A /issm/trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux1.exp A /issm/trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux10.exp A /issm/trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux11.exp A /issm/trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux12.exp A /issm/trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux13.exp A /issm/trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux14.exp A /issm/trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux15.exp A /issm/trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux2.exp A /issm/trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux3.exp A /issm/trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux4.exp A /issm/trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux5.exp A /issm/trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux6.exp A /issm/trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux7.exp A /issm/trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux8.exp A /issm/trunk-jpl/examples/UncertaintyQuantification/MassFluxes/MassFlux9.exp A /issm/trunk-jpl/examples/UncertaintyQuantification/Models A /issm/trunk-jpl/examples/UncertaintyQuantification/runme.m\\
+Export determination: 6. \\
+Rationale: Done with tutorials\\
+\vspace{3em}
+
+\noindent \textbf{Change \#179} with diff file ISSM-18199-18200.diff: \\
+Function name: \\
+D /issm/trunk-jpl/examples/Pig/06PIG\_Application.pdf\\
+Export determination: 6. \\
+Rationale: DEL: not needed\\
+\vspace{3em}
+
+\noindent \textbf{Change \#180} with diff file ISSM-18200-18201.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test701.m\\
+Export determination: 6. \\
+Rationale: BUG: changed name of augmented lagrangian parameter in matlab\\
+\vspace{3em}
+
+\noindent \textbf{Change \#181} with diff file ISSM-18201-18202.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/Jakobshavn/Jks.par M /issm/trunk-jpl/examples/Jakobshavn/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: update Jks for new Data directory\\
+\vspace{3em}
+
+\noindent \textbf{Change \#182} with diff file ISSM-18202-18203.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/Pig/CheatSheet.m M /issm/trunk-jpl/examples/Pig/Pig.par M /issm/trunk-jpl/examples/Pig/PigRegion.m M /issm/trunk-jpl/examples/Pig/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: update runmes for tutorials\\
+\vspace{3em}
+
+\noindent \textbf{Change \#183} with diff file ISSM-18203-18204.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/ISMIP/CheatyIsmipA.par M /issm/trunk-jpl/examples/ISMIP/CheatyIsmipF.par M /issm/trunk-jpl/examples/ISMIP/CheatyRunme.m M /issm/trunk-jpl/examples/ISMIP/runme.m M /issm/trunk-jpl/examples/Inversion/runme.m M /issm/trunk-jpl/examples/UncertaintyQuantification/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: update runmes for tutorials\\
+\vspace{3em}
+
+\noindent \textbf{Change \#184} with diff file ISSM-18204-18205.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/UncertaintyQuantification/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: update UQ runme\\
+\vspace{3em}
+
+\noindent \textbf{Change \#185} with diff file ISSM-18205-18206.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/Greenland/Greenland.par M /issm/trunk-jpl/examples/Greenland/runme.m M /issm/trunk-jpl/examples/Jakobshavn/Jks.par M /issm/trunk-jpl/examples/Pig/Pig.par\\
+Export determination: 6. \\
+Rationale: CHG: Greenland and melting rates\\
+\vspace{3em}
+
+\noindent \textbf{Change \#186} with diff file ISSM-18206-18207.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/autotools/install.sh\\
+Export determination: 6. \\
+Rationale: CHG: upgradint to newest version\\
+\vspace{3em}
+
+\noindent \textbf{Change \#187} with diff file ISSM-18207-18208.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_la.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixing Uzawa pressure\\
+\vspace{3em}
+
+\noindent \textbf{Change \#188} with diff file ISSM-18208-18209.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/c/solutionsequences/solutionsequence\_la.cpp M /issm/trunk-jpl/src/m/classes/flowequation.m M /issm/trunk-jpl/src/m/classes/flowequation.py A /issm/trunk-jpl/src/m/enum/AugmentedLagrangianRhopEnum.m M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py\\
+Export determination: 6. \\
+Rationale: NEW: added AugmentedLagrangianRhopEnum\\
+\vspace{3em}
+
+\noindent \textbf{Change \#189} with diff file ISSM-18209-18210.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: forgot to add correction term in analytical FS\\
+\vspace{3em}
+
+\noindent \textbf{Change \#190} with diff file ISSM-18210-18211.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: minor should not commit FSanalytical\\
+\vspace{3em}
+
+\noindent \textbf{Change \#191} with diff file ISSM-18211-18212.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/exp/exp2shp.m\\
+Export determination: 6. \\
+Rationale: NEW: exp2shp routine\\
+\vspace{3em}
+
+\noindent \textbf{Change \#192} with diff file ISSM-18212-18213.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/PentaRef.cpp\\
+Export determination: 6. \\
+Rationale: NEW: changes for augmented lagrangian pressure in 3d\\
+\vspace{3em}
+
+\noindent \textbf{Change \#193} with diff file ISSM-18213-18214.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/exp/exp2shp.m\\
+Export determination: 6. \\
+Rationale: CHG: add geometry settings\\
+\vspace{3em}
+
+\noindent \textbf{Change \#194} with diff file ISSM-18214-18215.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/Greenland/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: update Greenland runme\\
+\vspace{3em}
+
+\noindent \textbf{Change \#195} with diff file ISSM-18216-18217.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/inversion.m M /issm/trunk-jpl/src/m/classes/model.m M /issm/trunk-jpl/src/m/classes/model.py M /issm/trunk-jpl/src/m/extrusion/project2d.m M /issm/trunk-jpl/src/m/extrusion/project2d.py\\
+Export determination: 6. \\
+Rationale: CHG: improved help\\
+\vspace{3em}
+
+\noindent \textbf{Change \#196} with diff file ISSM-18217-18218.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64.sh (from /issm/trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64\_mavericks.sh:18198) D /issm/trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64\_mavericks.sh\\
+Export determination: 6. \\
+Rationale: CHG: move install for all macosx\\
+\vspace{3em}
+
+\noindent \textbf{Change \#197} with diff file ISSM-18218-18219.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: minor problem in FS analytical\\
+\vspace{3em}
+
+\noindent \textbf{Change \#198} with diff file ISSM-18219-18220.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/petsc/install-3.5-macosx64.sh\\
+Export determination: 6. \\
+Rationale: NEW: petsc 3.5 mac installation script\\
+\vspace{3em}
+
+\noindent \textbf{Change \#199} with diff file ISSM-18220-18221.diff: \\
+Function name: \\
+M /issm/trunk-jpl/etc/environment.sh\\
+Export determination: 6. \\
+Rationale: CHG; preappend boost\\
+\vspace{3em}
+
+\noindent \textbf{Change \#200} with diff file ISSM-18221-18222.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/dakota/install-5.3.1-macosx64.sh\\
+Export determination: 6. \\
+Rationale: CHG: add fortran\\
+\vspace{3em}
+
+\noindent \textbf{Change \#201} with diff file ISSM-18222-18223.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/FemModel.cpp\\
+Export determination: 6. \\
+Rationale: CHG: working on other cost functions\\
+\vspace{3em}
+
+\noindent \textbf{Change \#202} with diff file ISSM-18223-18224.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscSolver.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added support for petsc 3.5\\
+\vspace{3em}
+
+\noindent \textbf{Change \#203} with diff file ISSM-18224-18225.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: working on other cost functions\\
+\vspace{3em}
+
+\noindent \textbf{Change \#204} with diff file ISSM-18225-18226.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/cores/controltao\_core.cpp\\
+Export determination: 6. \\
+Rationale: NEW: TAO is now provided by petsc 3.5\\
+\vspace{3em}
+
+\noindent \textbf{Change \#205} with diff file ISSM-18226-18227.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: NEW: TAO is now provided by petsc 3.5\\
+\vspace{3em}
+
+\noindent \textbf{Change \#206} with diff file ISSM-18227-18228.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.h M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp M /issm/trunk-jpl/src/m/classes/flowequation.m M /issm/trunk-jpl/src/m/classes/flowequation.py A /issm/trunk-jpl/src/m/enum/AugmentedLagrangianRholambdaEnum.m A /issm/trunk-jpl/src/m/enum/AugmentedLagrangianRlambdaEnum.m M /issm/trunk-jpl/src/m/enum/EnumDefinitions.py\\
+Export determination: 6. \\
+Rationale: NEW: working on Augmented lagrangien sigma nn\\
+\vspace{3em}
+
+\noindent \textbf{Change \#207} with diff file ISSM-18228-18229.diff: \\
+Function name: \\
+A /issm/trunk-jpl/configs/config-ios-armv7.sh A /issm/trunk-jpl/configs/config-ios-armv7s.sh A /issm/trunk-jpl/configs/config-ios-simulator.sh A /issm/trunk-jpl/externalpackages/gsl/finite.patch A /issm/trunk-jpl/externalpackages/triangle/configs/ios A /issm/trunk-jpl/externalpackages/triangle/configs/ios/configure.make A /issm/trunk-jpl/externalpackages/triangle/install-iosarmv7.sh A /issm/trunk-jpl/externalpackages/triangle/install-iosarmv7s.sh A /issm/trunk-jpl/externalpackages/triangle/install-iosi386.sh\\
+Export determination: 6. \\
+Rationale: Added iOS cross compiling scripts armv7, armv7s, i386\\
+\vspace{3em}
+
+\noindent \textbf{Change \#208} with diff file ISSM-18229-18230.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test701.m\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#209} with diff file ISSM-18230-18231.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/petsc/install-3.5-linux64.sh M /issm/trunk-jpl/jenkins/imac-012301-gil M /issm/trunk-jpl/jenkins/linux64\_larsen M /issm/trunk-jpl/jenkins/linux64\_murdo\\
+Export determination: 6. \\
+Rationale: CHG: use petsc 3.5 now\\
+\vspace{3em}
+
+\noindent \textbf{Change \#210} with diff file ISSM-18232-18233.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/wrappers/Makefile.am M /issm/trunk-jpl/src/wrappers/matlab/Makefile.am M /issm/trunk-jpl/src/wrappers/python/Makefile.am\\
+Export determination: 6. \\
+Rationale: CHG: duplicating 18231\\
+\vspace{3em}
+
+\noindent \textbf{Change \#211} with diff file ISSM-18233-18234.diff: \\
+Function name: \\
+A /issm/trunk-jpl/externalpackages/petsc/install-3.5-pleiades.sh\\
+Export determination: 6. \\
+Rationale: NEW: added petsc 3.5 installation script on pleiades\\
+\vspace{3em}
+
+\noindent \textbf{Change \#212} with diff file ISSM-18234-18235.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test701.m\\
+Export determination: 6. \\
+Rationale: CHG: relaxed tolerances\\
+\vspace{3em}
+
+\noindent \textbf{Change \#213} with diff file ISSM-18235-18236.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: NEW: trying to implement augmentation lambda\\
+\vspace{3em}
+
+\noindent \textbf{Change \#214} with diff file ISSM-18236-18237.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: forgot to fix to compilation problems in lagrangian lambda\\
+\vspace{3em}
+
+\noindent \textbf{Change \#215} with diff file ISSM-18237-18238.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/ThermalAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Constraints/SpcDynamic.cpp M /issm/trunk-jpl/src/c/classes/Constraints/SpcStatic.cpp M /issm/trunk-jpl/src/c/classes/Contour.h M /issm/trunk-jpl/src/c/classes/DofIndexing.cpp M /issm/trunk-jpl/src/c/classes/DofIndexing.h M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp M /issm/trunk-jpl/src/c/classes/Elements/Elements.cpp M /issm/trunk-jpl/src/c/classes/Elements/Elements.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h M /issm/trunk-jpl/src/c/classes/FemModel.cpp M /issm/trunk-jpl/src/c/classes/FemModel.h M /issm/trunk-jpl/src/c/classes/Hook.cpp M /issm/trunk-jpl/src/c/classes/Hook.h M /issm/trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/PentaInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/TetraInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp M /issm/trunk-jpl/src/c/classes/Inputs/TriaInput.cpp M /issm/trunk-jpl/src/c/classes/Loads/Load.h M /issm/trunk-jpl/src/c/classes/Loads/Loads.cpp M /issm/trunk-jpl/src/c/classes/Loads/Loads.h M /issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp M /issm/trunk-jpl/src/c/classes/Loads/Numericalflux.h M /issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp M /issm/trunk-jpl/src/c/classes/Loads/Pengrid.h M /issm/trunk-jpl/src/c/classes/Loads/Penpair.cpp M /issm/trunk-jpl/src/c/classes/Loads/Penpair.h M /issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp M /issm/trunk-jpl/src/c/classes/Loads/Riftfront.h M /issm/trunk-jpl/src/c/classes/Materials/Material.h M /issm/trunk-jpl/src/c/classes/Materials/Materials.cpp M /issm/trunk-jpl/src/c/classes/Materials/Materials.h M /issm/trunk-jpl/src/c/classes/Materials/Matice.cpp M /issm/trunk-jpl/src/c/classes/Materials/Matice.h M /issm/trunk-jpl/src/c/classes/Materials/Matpar.cpp M /issm/trunk-jpl/src/c/classes/Materials/Matpar.h M /issm/trunk-jpl/src/c/classes/Misfit.h M /issm/trunk-jpl/src/c/classes/Node.cpp M /issm/trunk-jpl/src/c/classes/Node.h M /issm/trunk-jpl/src/c/classes/Params/DoubleParam.cpp M /issm/trunk-jpl/src/c/classes/Params/Parameters.cpp M /issm/trunk-jpl/src/c/classes/Profiler.cpp M /issm/trunk-jpl/src/c/classes/Profiler.h M /issm/trunk-jpl/src/c/classes/kriging/ExponentialVariogram.cpp M /issm/trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h M /issm/trunk-jpl/src/c/classes/kriging/GaussianVariogram.cpp M /issm/trunk-jpl/src/c/classes/kriging/GaussianVariogram.h M /issm/trunk-jpl/src/c/classes/kriging/Observation.cpp M /issm/trunk-jpl/src/c/classes/kriging/Observation.h M /issm/trunk-jpl/src/c/classes/kriging/PowerVariogram.cpp M /issm/trunk-jpl/src/c/classes/kriging/PowerVariogram.h M /issm/trunk-jpl/src/c/classes/kriging/Quadtree.cpp M /issm/trunk-jpl/src/c/classes/kriging/Quadtree.h M /issm/trunk-jpl/src/c/classes/kriging/SphericalVariogram.cpp M /issm/trunk-jpl/src/c/classes/kriging/SphericalVariogram.h M /issm/trunk-jpl/src/c/cores/DakotaSpawnCore.cpp M /issm/trunk-jpl/src/c/cores/damage\_core.cpp M /issm/trunk-jpl/src/c/cores/masstransport\_core.cpp M /issm/trunk-jpl/src/c/cores/stressbalance\_core.cpp M /issm/trunk-jpl/src/c/cores/thermal\_core.cpp M /issm/trunk-jpl/src/c/cores/transient\_core.cpp M /issm/trunk-jpl/src/c/datastructures/DataSet.cpp M /issm/trunk-jpl/src/c/datastructures/DataSet.h M /issm/trunk-jpl/src/c/main/issm.cpp M /issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp M /issm/trunk-jpl/src/c/toolkits/issm/Bucket.h\\
+Export determination: 6. \\
+Rationale: CHG: create femmodel copy for dakota runs\\
+\vspace{3em}
+
+\noindent \textbf{Change \#216} with diff file ISSM-18238-18239.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: add qmu benchmark to runme\\
+\vspace{3em}
+
+\noindent \textbf{Change \#217} with diff file ISSM-18239-18240.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp\\
+Export determination: 6. \\
+Rationale: BUG: element\_type\_list is a int array, should be initialized with 0, not NULL\\
+\vspace{3em}
+
+\noindent \textbf{Change \#218} with diff file ISSM-18240-18241.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/FSanalyticals/fsanalyticals.cpp\\
+Export determination: 6. \\
+Rationale: NEW: analytical solution for Stokes test\\
+\vspace{3em}
+
+\noindent \textbf{Change \#219} with diff file ISSM-18241-18242.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: NEW: preparing friction for LA\\
+\vspace{3em}
+
+\noindent \textbf{Change \#220} with diff file ISSM-18242-18243.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed FS 3d\\
+\vspace{3em}
+
+\noindent \textbf{Change \#221} with diff file ISSM-18243-18244.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed memory leak\\
+\vspace{3em}
+
+\noindent \textbf{Change \#222} with diff file ISSM-18244-18245.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/FemModel.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed memory leaks\\
+\vspace{3em}
+
+\noindent \textbf{Change \#223} with diff file ISSM-18245-18246.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: CHG: fixed FS 3d\\
+\vspace{3em}
+
+\noindent \textbf{Change \#224} with diff file ISSM-18246-18247.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp M /issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h M /issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp M /issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: removing useless Dakota Enums, now that we have FemModel::Copy\\
+\vspace{3em}
+
+\noindent \textbf{Change \#225} with diff file ISSM-18247-18248.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/NightlyRun/test417.m\\
+Export determination: 6. \\
+Rationale: CHG: set params to direct\\
+\vspace{3em}
+
+\noindent \textbf{Change \#226} with diff file ISSM-18248-18249.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/UncertaintyQuantification/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: need direct set for mac\\
+\vspace{3em}
+
+\noindent \textbf{Change \#227} with diff file ISSM-18249-18250.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/Pig/CheatSheet.m\\
+Export determination: 6. \\
+Rationale: BUG: remove org from cheatsheet\\
+\vspace{3em}
+
+\noindent \textbf{Change \#228} with diff file ISSM-18250-18251.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/plot\_scatter.m\\
+Export determination: 6. \\
+Rationale: CHG: added caxis command\\
+\vspace{3em}
+
+\noindent \textbf{Change \#229} with diff file ISSM-18251-18252.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/plot\_elementstype.m\\
+Export determination: 6. \\
+Rationale: CHG: minor\\
+\vspace{3em}
+
+\noindent \textbf{Change \#230} with diff file ISSM-18252-18253.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/processdata.m\\
+Export determination: 6. \\
+Rationale: NEW: enable to display structure\\
+\vspace{3em}
+
+\noindent \textbf{Change \#231} with diff file ISSM-18253-18254.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/processdata.m\\
+Export determination: 6. \\
+Rationale: NEW: enable to display structure\\
+\vspace{3em}
+
+\noindent \textbf{Change \#232} with diff file ISSM-18254-18255.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added check on allocation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#233} with diff file ISSM-18255-18256.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/plot\_transient\_movie.m\\
+Export determination: 6. \\
+Rationale: CHG: can just call plotmodel(md,'data','transient\_movie') now\\
+\vspace{3em}
+
+\noindent \textbf{Change \#234} with diff file ISSM-18256-18257.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/plot/plot\_transient\_movie.m\\
+Export determination: 6. \\
+Rationale: CHG: added caxis calculation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#235} with diff file ISSM-18257-18258.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.cpp\\
+Export determination: 6. \\
+Rationale: NEW: added message\\
+\vspace{3em}
+
+\noindent \textbf{Change \#236} with diff file ISSM-18258-18259.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp\\
+Export determination: 6. \\
+Rationale: CHG: added message\\
+\vspace{3em}
+
+\noindent \textbf{Change \#237} with diff file ISSM-18259-18260.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/FemModel.cpp\\
+Export determination: 6. \\
+Rationale: BUG: looking for wrong enum\\
+\vspace{3em}
+
+\noindent \textbf{Change \#238} with diff file ISSM-18260-18261.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/Pig/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: use mdHO to plot in step 7\\
+\vspace{3em}
+
+\noindent \textbf{Change \#239} with diff file ISSM-18261-18262.diff: \\
+Function name: \\
+M /issm/trunk-jpl/m4/issm\_options.m4\\
+Export determination: 6. \\
+Rationale: CHG: removed --with-gia option, conflicting with --with-Gia\\
+\vspace{3em}
+
+\noindent \textbf{Change \#240} with diff file ISSM-18262-18263.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: dim was not initialized\\
+\vspace{3em}
+
+\noindent \textbf{Change \#241} with diff file ISSM-18263-18264.diff: \\
+Function name: \\
+A /issm/trunk-jpl/examples/Greenland/CheatSheet.m M /issm/trunk-jpl/examples/Greenland/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: update runme\\
+\vspace{3em}
+
+\noindent \textbf{Change \#242} with diff file ISSM-18264-18265.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/Greenland/CheatSheet.m M /issm/trunk-jpl/examples/Greenland/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: add plot execise\\
+\vspace{3em}
+
+\noindent \textbf{Change \#243} with diff file ISSM-18265-18266.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/SMBgradients.m\\
+Export determination: 6. \\
+Rationale: CHG: add units\\
+\vspace{3em}
+
+\noindent \textbf{Change \#244} with diff file ISSM-18266-18267.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp\\
+Export determination: 6. \\
+Rationale: CHG: cleanup gradients\\
+\vspace{3em}
+
+\noindent \textbf{Change \#245} with diff file ISSM-18267-18268.diff: \\
+Function name: \\
+A /issm/trunk-jpl/examples/IceBridge A /issm/trunk-jpl/examples/IceBridge/DomainOutline.exp A /issm/trunk-jpl/examples/IceBridge/Greenland.par A /issm/trunk-jpl/examples/IceBridge/Greenland\_cheatsheet.par A /issm/trunk-jpl/examples/IceBridge/Greenland\_noOIB.par A /issm/trunk-jpl/examples/IceBridge/Jak\_grounded.exp A /issm/trunk-jpl/examples/IceBridge/Jak\_outline.exp A /issm/trunk-jpl/examples/IceBridge/Models A /issm/trunk-jpl/examples/IceBridge/data\_gaps.exp A /issm/trunk-jpl/examples/IceBridge/runme.m M /issm/trunk-jpl/examples/Pig/runme.m M /issm/trunk-jpl/examples/UncertaintyQuantification/runme.m\\
+Export determination: 6. \\
+Rationale: NEW: add icebridge tutorial\\
+\vspace{3em}
+
+\noindent \textbf{Change \#246} with diff file ISSM-18268-18269.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/Greenland/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: runme move lat lon conversion to step 7\\
+\vspace{3em}
+
+\noindent \textbf{Change \#247} with diff file ISSM-18269-18270.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/Pig/runme.m M /issm/trunk-jpl/examples/UncertaintyQuantification/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: revert runmes back\\
+\vspace{3em}
+
+\noindent \textbf{Change \#248} with diff file ISSM-18270-18271.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/Greenland/CheatSheet.m M /issm/trunk-jpl/examples/Greenland/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: minor typo\\
+\vspace{3em}
+
+\noindent \textbf{Change \#249} with diff file ISSM-18271-18272.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/Inversion/runme.m A /issm/trunk-jpl/examples/Inversion/runme2.m\\
+Export determination: 6. \\
+Rationale: CHG: add runme2\\
+\vspace{3em}
+
+\noindent \textbf{Change \#250} with diff file ISSM-18272-18273.diff: \\
+Function name: \\
+A /issm/trunk-jpl/examples/Inversion/CheatSheet.m (from /issm/trunk-jpl/examples/Inversion/runme2.m:18271) M /issm/trunk-jpl/examples/Inversion/runme.m D /issm/trunk-jpl/examples/Inversion/runme2.m\\
+Export determination: 6. \\
+Rationale: CHG: update cheatsheet\\
+\vspace{3em}
+
+\noindent \textbf{Change \#251} with diff file ISSM-18273-18274.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/Inversion/CheatSheet.m M /issm/trunk-jpl/examples/Inversion/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: add plot\\
+\vspace{3em}
+
+\noindent \textbf{Change \#252} with diff file ISSM-18274-18275.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/Inversion/CheatSheet.m M /issm/trunk-jpl/examples/Inversion/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: add plots\\
+\vspace{3em}
+
+\noindent \textbf{Change \#253} with diff file ISSM-18275-18276.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/Inversion/CheatSheet.m M /issm/trunk-jpl/examples/Inversion/runme.m\\
+Export determination: 6. \\
+Rationale: CHG: remove caxis\\
+\vspace{3em}
+
+\noindent \textbf{Change \#254} with diff file ISSM-18276-18277.diff: \\
+Function name: \\
+M /issm/trunk-jpl/examples/Inversion/CheatSheet.m\\
+Export determination: 6. \\
+Rationale: CHG: geometry after param\\
+\vspace{3em}
+
+\noindent \textbf{Change \#255} with diff file ISSM-18277-18278.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp\\
+Export determination: 6. \\
+Rationale: CHG: working on new damage calculation as a requested output of a Stressbalance solution\\
+\vspace{3em}
+
+\noindent \textbf{Change \#256} with diff file ISSM-18278-18279.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/damage.py\\
+Export determination: 6. \\
+Rationale: CHG: display and marshall all damage params if isdamage=1, since now damage can be calculated from a Stressbalance\\
+\vspace{3em}
+
+\noindent \textbf{Change \#257} with diff file ISSM-18279-18280.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/m/classes/damage.m\\
+Export determination: 6. \\
+Rationale: CHG: forgot to also include matlab damage class\\
+\vspace{3em}
+
+\noindent \textbf{Change \#258} with diff file ISSM-18280-18281.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/shared/FSanalyticals/fsanalyticals.cpp\\
+Export determination: 6. \\
+Rationale: CHG: some analytcal tests for stokes\\
+\vspace{3em}
+
+\noindent \textbf{Change \#259} with diff file ISSM-18281-18282.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: NEW: added second augmentation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#260} with diff file ISSM-18282-18283.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp\\
+Export determination: 6. \\
+Rationale: NEW: updated damage solution can now be called as a Requested Output of a Stressbalance solution. Requires that the matdamageice class be used with two extra parameters specified (stress\_threshold and c1, a ductility parameter).\\
+\vspace{3em}
+
+\noindent \textbf{Change \#261} with diff file ISSM-18283-18284.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.cpp M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.cpp M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h\\
+Export determination: 6. \\
+Rationale: NEW: some functions for P2 elements\\
+\vspace{3em}
+
+\noindent \textbf{Change \#262} with diff file ISSM-18284-18285.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.h\\
+Export determination: 6. \\
+Rationale: NEW: finished augmentation\\
+\vspace{3em}
+
+\noindent \textbf{Change \#263} with diff file ISSM-18285-18286.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed way to call SigmaNN\\
+\vspace{3em}
+
+\noindent \textbf{Change \#264} with diff file ISSM-18286-18287.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/classes/Elements/Element.cpp\\
+Export determination: 6. \\
+Rationale: BUG: fixed minor problems\\
+\vspace{3em}
+
+\noindent \textbf{Change \#265} with diff file ISSM-18287-18288.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive701.nc M /issm/trunk-jpl/test/NightlyRun/test701.m\\
+Export determination: 6. \\
+Rationale: NEW: added test for new stokes solver\\
+\vspace{3em}
+
+\noindent \textbf{Change \#266} with diff file ISSM-18288-18289.diff: \\
+Function name: \\
+M /issm/trunk-jpl/test/Archives/Archive701.nc\\
+Export determination: 6. \\
+Rationale: CHG: archive saved on thwaites\\
+\vspace{3em}
+
+\noindent \textbf{Change \#267} with diff file ISSM-18289-18290.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/petsc/install-3.5-linux64.sh M /issm/trunk-jpl/externalpackages/petsc/install-3.5-macosx64.sh\\
+Export determination: 6. \\
+Rationale: CHG: new installation scripts based on Satish's comments\\
+\vspace{3em}
+
+\noindent \textbf{Change \#268} with diff file ISSM-18290-18291.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp\\
+Export determination: 6. \\
+Rationale: BUG: wrong test\\
+\vspace{3em}
+
+\noindent \textbf{Change \#269} with diff file ISSM-18291-18292.diff: \\
+Function name: \\
+M /issm/trunk-jpl/externalpackages/petsc/install-3.5-pleiades.sh\\
+Export determination: 6. \\
+Rationale: CHG: no need to install blas\\
+\vspace{3em}
+
+\noindent \textbf{Change \#270} with diff file ISSM-18293-18294.diff: \\
+Function name: \\
+M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp M /issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.h M /issm/trunk-jpl/src/c/classes/Elements/Element.h M /issm/trunk-jpl/src/c/classes/Elements/Penta.h M /issm/trunk-jpl/src/c/classes/Elements/Seg.h M /issm/trunk-jpl/src/c/classes/Elements/Tetra.h M /issm/trunk-jpl/src/c/classes/Elements/Tria.cpp M /issm/trunk-jpl/src/c/classes/Elements/Tria.h\\
+Export determination: 6. \\
+Rationale: CHG: added lateral friction for Erkut SSA\\
+\vspace{3em}
+
+\noindent \textbf{Change \#271} with diff file ISSM-18294-18295.diff: \\
+Function name: \\
+A /issm/trunk-jpl/src/m/parameterization/sethydrostaticmask.m A /issm/trunk-jpl/src/m/parameterization/sethydrostaticmask.py\\
+Export determination: 6. \\
+Rationale: NEW: function to determine hydrostatic grounding line position\\
+\vspace{3em}
+
Index: /issm/oecreview/Archive/17984-18295/r1.tex
===================================================================
--- /issm/oecreview/Archive/17984-18295/r1.tex	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/r1.tex	(revision 18296)
@@ -0,0 +1,1 @@
+17984
Index: /issm/oecreview/Archive/17984-18295/r2.tex
===================================================================
--- /issm/oecreview/Archive/17984-18295/r2.tex	(revision 18296)
+++ /issm/oecreview/Archive/17984-18295/r2.tex	(revision 18296)
@@ -0,0 +1,1 @@
+18295
